Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
policy_module(daemontools,1.0.0)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
########################################
Chris PeBenito 44d5d9
#
Chris PeBenito 44d5d9
# Declarations
Chris PeBenito 44d5d9
#
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
type svc_conf_t;
Chris PeBenito 44d5d9
files_type(svc_conf_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
type svc_log_t;
Chris PeBenito 44d5d9
files_type(svc_log_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
type svc_multilog_t;
Chris PeBenito 44d5d9
type svc_multilog_exec_t;
Chris PeBenito 44d5d9
domain_type(svc_multilog_t)
Chris PeBenito 44d5d9
domain_entry_file(svc_multilog_t,svc_multilog_exec_t)
Chris PeBenito 44d5d9
role system_r types svc_multilog_t;
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
type svc_run_t;
Chris PeBenito 44d5d9
type svc_run_exec_t;
Chris PeBenito 44d5d9
domain_type(svc_run_t)
Chris PeBenito 44d5d9
domain_entry_file(svc_run_t,svc_run_exec_t)
Chris PeBenito 44d5d9
role system_r types svc_run_t;
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
type svc_start_t;
Chris PeBenito 44d5d9
type svc_start_exec_t;
Chris PeBenito 44d5d9
init_domain(svc_start_t,svc_start_exec_t)
Chris PeBenito 44d5d9
init_system_domain(svc_start_t,svc_start_exec_t)
Chris PeBenito 44d5d9
role system_r types svc_start_t;
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
type svc_svc_t;
Chris PeBenito 44d5d9
files_type(svc_svc_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
########################################
Chris PeBenito 44d5d9
#
Chris PeBenito 44d5d9
# multilog local policy
Chris PeBenito 44d5d9
#
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
# multilog creates /service/*/log/status
Chris PeBenito 44d5d9
allow svc_multilog_t svc_svc_t:dir rw_dir_perms;
Chris PeBenito 44d5d9
allow svc_multilog_t svc_svc_t:file create_file_perms;
Chris PeBenito 44d5d9
Chris PeBenito 1c1ac6
init_use_fds(svc_multilog_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
libs_use_ld_so(svc_multilog_t)
Chris PeBenito 44d5d9
libs_use_shared_libs(svc_multilog_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
# writes to /var/log/*/*
Chris PeBenito 44d5d9
logging_manage_generic_logs(svc_multilog_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
daemontools_ipc_domain(svc_multilog_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
########################################
Chris PeBenito 44d5d9
#
Chris PeBenito 44d5d9
# local policy for binaries that impose 
Chris PeBenito 44d5d9
# a given environment to supervised daemons
Chris PeBenito 44d5d9
# ie. softlimit, setuidgid, envuidgid, envdir, fghack ..
Chris PeBenito 44d5d9
#
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
allow svc_run_t self:capability { setgid setuid chown fsetid };
Chris PeBenito 44d5d9
allow svc_run_t self:process setrlimit;
Chris PeBenito 44d5d9
allow svc_run_t self:fifo_file rw_file_perms;
Chris PeBenito 44d5d9
allow svc_run_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
allow svc_run_t svc_conf_t:dir r_dir_perms;
Chris PeBenito 44d5d9
allow svc_run_t svc_conf_t:file r_file_perms;
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
can_exec(svc_run_t svc_run_exec_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
kernel_read_system_state(svc_run_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
corecmd_exec_bin(svc_run_t)
Chris PeBenito 44d5d9
corecmd_exec_sbin(svc_run_t)
Chris PeBenito 44d5d9
corecmd_exec_shell(svc_run_t)
Chris PeBenito 44d5d9
corecmd_exec_ls(svc_run_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
files_read_etc_files(svc_run_t)
Chris PeBenito 44d5d9
files_read_etc_runtime_files(svc_run_t)
Chris PeBenito 44d5d9
files_search_pids(svc_run_t)
Chris PeBenito 44d5d9
files_search_var_lib(svc_run_t)
Chris PeBenito 44d5d9
Chris PeBenito 15722e
init_use_script_fds(svc_run_t)
Chris PeBenito 1c1ac6
init_use_fds(svc_run_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
libs_use_ld_so(svc_run_t)
Chris PeBenito 44d5d9
libs_use_shared_libs(svc_run_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
daemontools_domtrans_multilog(svc_run_t)
Chris PeBenito 44d5d9
daemontools_read_svc(svc_run_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
########################################
Chris PeBenito 44d5d9
#
Chris PeBenito 44d5d9
# local policy for service monitoring programs
Chris PeBenito 44d5d9
# ie svc, svscan, supervise ...
Chris PeBenito 44d5d9
#
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
allow svc_start_t svc_run_t:process signal;
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
allow svc_start_t self:fifo_file rw_file_perms;
Chris PeBenito 44d5d9
allow svc_start_t self:capability kill;
Chris PeBenito 44d5d9
allow svc_start_t self:unix_stream_socket create_socket_perms;
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
can_exec(svc_start_t svc_start_exec_t)
Chris PeBenito 44d5d9
Chris PeBenito 1815ba
corecmd_read_sbin_symlinks(svc_start_t)
Chris PeBenito 44d5d9
corecmd_exec_bin(svc_start_t)
Chris PeBenito 44d5d9
corecmd_exec_shell(svc_start_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
files_read_etc_files(svc_start_t)
Chris PeBenito 44d5d9
files_read_etc_runtime_files(svc_start_t)
Chris PeBenito 44d5d9
files_search_var(svc_start_t)
Chris PeBenito 44d5d9
files_search_pids(svc_start_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
libs_use_ld_so(svc_start_t)
Chris PeBenito 44d5d9
libs_use_shared_libs(svc_start_t)
Chris PeBenito 44d5d9
Chris PeBenito 44d5d9
daemontools_domtrans_run(svc_start_t)
Chris PeBenito 44d5d9
daemontools_manage_svc(svc_start_t)