Blob Blame History Raw
policy_module(callweaver,1.0.0)

########################################
#
# Declarations
#

type callweaver_t;
type callweaver_exec_t;
init_daemon_domain(callweaver_t, callweaver_exec_t)

type callweaver_initrc_exec_t;
init_script_file(callweaver_initrc_exec_t)

type callweaver_log_t;
logging_log_file(callweaver_log_t)

type callweaver_var_lib_t;
files_type(callweaver_var_lib_t)

type callweaver_var_run_t;
files_pid_file(callweaver_var_run_t)

type callweaver_spool_t;
files_spool_file(callweaver_spool_t)

########################################
#
# callweaver local policy
#

allow callweaver_t self:capability { setuid sys_nice setgid };
allow callweaver_t self:process { setsched signal };
allow callweaver_t self:fifo_file rw_fifo_file_perms;
allow callweaver_t self:unix_stream_socket create_stream_socket_perms;

manage_dirs_pattern(callweaver_t, callweaver_log_t, callweaver_log_t)
manage_files_pattern(callweaver_t, callweaver_log_t, callweaver_log_t)
logging_log_filetrans(callweaver_t, callweaver_log_t, { dir file } )

manage_dirs_pattern(callweaver_t, callweaver_var_lib_t, callweaver_var_lib_t)
manage_files_pattern(callweaver_t, callweaver_var_lib_t, callweaver_var_lib_t)
files_var_lib_filetrans(callweaver_t, callweaver_var_lib_t, { dir file } )

manage_dirs_pattern(callweaver_t, callweaver_var_run_t, callweaver_var_run_t)
manage_files_pattern(callweaver_t, callweaver_var_run_t, callweaver_var_run_t)
manage_sock_files_pattern(callweaver_t, callweaver_var_run_t, callweaver_var_run_t)
files_pid_filetrans(callweaver_t, callweaver_var_run_t, { dir file sock_file })

manage_dirs_pattern(callweaver_t, callweaver_spool_t, callweaver_spool_t)
manage_files_pattern(callweaver_t, callweaver_spool_t, callweaver_spool_t)
manage_lnk_files_pattern(callweaver_t, callweaver_spool_t, callweaver_spool_t)
files_spool_filetrans(callweaver_t, callweaver_spool_t, { dir file })

allow callweaver_t self:tcp_socket create_stream_socket_perms;
allow callweaver_t self:udp_socket create_socket_perms;

kernel_read_sysctl(callweaver_t)
kernel_read_kernel_sysctls(callweaver_t)

corenet_udp_bind_asterisk_port(callweaver_t)
corenet_udp_bind_generic_port(callweaver_t)
corenet_udp_bind_sip_port(callweaver_t)

dev_manage_generic_symlinks(callweaver_t)

domain_use_interactive_fds(callweaver_t)


term_getattr_pty_fs(callweaver_t)
term_use_generic_ptys(callweaver_t)
term_use_ptmx(callweaver_t)

auth_use_nsswitch(callweaver_t)

miscfiles_read_localization(callweaver_t)