2020-02-29 21:54:39 +00:00
|
|
|
policy_module(setrans, 1.16.0)
|
2009-02-09 13:58:22 +00:00
|
|
|
|
|
|
|
gen_require(`
|
|
|
|
class context contains;
|
|
|
|
')
|
2006-05-17 14:50:31 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
type setrans_t;
|
2006-10-04 17:25:34 +00:00
|
|
|
type setrans_exec_t;
|
2006-05-17 14:50:31 +00:00
|
|
|
init_daemon_domain(setrans_t, setrans_exec_t)
|
|
|
|
|
2008-09-18 18:20:31 +00:00
|
|
|
type setrans_initrc_exec_t;
|
|
|
|
init_script_file(setrans_initrc_exec_t)
|
|
|
|
|
2019-09-08 20:55:02 +00:00
|
|
|
type setrans_runtime_t alias setrans_var_run_t;
|
|
|
|
files_pid_file(setrans_runtime_t)
|
|
|
|
mls_trusted_object(setrans_runtime_t)
|
2006-05-17 14:50:31 +00:00
|
|
|
|
2019-09-11 00:05:46 +00:00
|
|
|
type setrans_unit_t;
|
|
|
|
init_unit_file(setrans_unit_t)
|
|
|
|
|
2013-11-09 09:45:13 +00:00
|
|
|
ifdef(`distro_debian',`
|
2019-09-08 20:55:02 +00:00
|
|
|
init_daemon_pid_file(setrans_runtime_t, dir, "setrans")
|
2013-11-09 09:45:13 +00:00
|
|
|
')
|
|
|
|
|
2006-10-04 17:25:34 +00:00
|
|
|
ifdef(`enable_mcs',`
|
2009-06-26 14:40:13 +00:00
|
|
|
init_ranged_daemon_domain(setrans_t, setrans_exec_t, s0 - mcs_systemhigh)
|
2006-10-04 17:25:34 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
ifdef(`enable_mls',`
|
2009-06-26 14:40:13 +00:00
|
|
|
init_ranged_daemon_domain(setrans_t, setrans_exec_t, mls_systemhigh)
|
2006-10-04 17:25:34 +00:00
|
|
|
')
|
|
|
|
|
2006-05-17 14:50:31 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# setrans local policy
|
|
|
|
#
|
|
|
|
|
2006-05-19 14:02:24 +00:00
|
|
|
allow setrans_t self:capability sys_resource;
|
2008-09-11 14:54:40 +00:00
|
|
|
allow setrans_t self:process { setrlimit getcap setcap signal_perms };
|
2006-05-17 14:50:31 +00:00
|
|
|
allow setrans_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
allow setrans_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow setrans_t self:netlink_selinux_socket create_socket_perms;
|
2009-02-09 13:58:22 +00:00
|
|
|
allow setrans_t self:context contains;
|
2006-05-17 14:50:31 +00:00
|
|
|
|
|
|
|
can_exec(setrans_t, setrans_exec_t)
|
2007-03-23 23:24:59 +00:00
|
|
|
corecmd_search_bin(setrans_t)
|
2006-05-17 14:50:31 +00:00
|
|
|
|
|
|
|
# create unix domain socket in /var
|
2019-09-08 20:55:02 +00:00
|
|
|
manage_dirs_pattern(setrans_t, setrans_runtime_t, setrans_runtime_t)
|
|
|
|
manage_files_pattern(setrans_t, setrans_runtime_t, setrans_runtime_t)
|
|
|
|
manage_sock_files_pattern(setrans_t, setrans_runtime_t, setrans_runtime_t)
|
|
|
|
files_pid_filetrans(setrans_t, setrans_runtime_t, { file dir })
|
2006-05-17 14:50:31 +00:00
|
|
|
|
|
|
|
kernel_read_kernel_sysctls(setrans_t)
|
2013-11-09 09:44:47 +00:00
|
|
|
kernel_read_system_state(setrans_t)
|
2006-05-17 14:50:31 +00:00
|
|
|
|
|
|
|
# allow performing getpidcon() on all processes
|
|
|
|
domain_read_all_domains_state(setrans_t)
|
2006-09-22 17:14:35 +00:00
|
|
|
domain_dontaudit_search_all_domains_state(setrans_t)
|
2006-05-17 14:50:31 +00:00
|
|
|
domain_getattr_all_domains(setrans_t)
|
|
|
|
domain_getsession_all_domains(setrans_t)
|
|
|
|
|
|
|
|
files_read_etc_runtime_files(setrans_t)
|
|
|
|
|
2007-08-20 18:26:08 +00:00
|
|
|
mls_file_read_all_levels(setrans_t)
|
|
|
|
mls_file_write_all_levels(setrans_t)
|
2006-05-17 14:50:31 +00:00
|
|
|
mls_net_receive_all_levels(setrans_t)
|
2006-10-20 14:44:23 +00:00
|
|
|
mls_socket_write_all_levels(setrans_t)
|
2014-05-23 18:18:10 +00:00
|
|
|
mls_process_read_all_levels(setrans_t)
|
2006-10-31 21:01:48 +00:00
|
|
|
mls_socket_read_all_levels(setrans_t)
|
2006-05-17 14:50:31 +00:00
|
|
|
|
|
|
|
selinux_compute_access_vector(setrans_t)
|
|
|
|
|
|
|
|
term_dontaudit_use_generic_ptys(setrans_t)
|
2006-09-01 15:52:05 +00:00
|
|
|
term_dontaudit_use_unallocated_ttys(setrans_t)
|
2006-05-17 14:50:31 +00:00
|
|
|
|
2006-05-19 14:02:24 +00:00
|
|
|
init_dontaudit_use_script_ptys(setrans_t)
|
2006-05-17 14:50:31 +00:00
|
|
|
|
2006-09-01 15:52:05 +00:00
|
|
|
locallogin_dontaudit_use_fds(setrans_t)
|
|
|
|
|
2006-05-17 14:50:31 +00:00
|
|
|
logging_send_syslog_msg(setrans_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(setrans_t)
|
|
|
|
|
2013-12-03 14:52:21 +00:00
|
|
|
seutil_libselinux_linked(setrans_t)
|
2006-07-28 15:13:58 +00:00
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
rpm_use_script_fds(setrans_t)
|
|
|
|
')
|