selinux-refpolicy/policy/modules/services/corosync.te

154 lines
4.3 KiB
Plaintext
Raw Normal View History

policy_module(corosync, 1.6.2)
########################################
#
# Declarations
#
type corosync_t;
type corosync_exec_t;
init_daemon_domain(corosync_t, corosync_exec_t)
domain_obj_id_change_exemption(corosync_t)
type corosync_initrc_exec_t;
init_script_file(corosync_initrc_exec_t)
Updates for corosync to work in enforcing Allow corosync to map its own shared memory Sep 26 18:45:02 localhost audispd: node=virtual type=AVC msg=audit(1601145902.400:2972): avc: denied { map } for pid=6903 comm="corosync" path="/dev/shm/qb-6903-7028-31-FGGoGv/qb-request-cmap-header" dev="tmpfs" ino=40759 scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:corosync_tmpfs_t:s0 tclass=file permissive=1 Setup corosync lock file type Sep 27 17:20:07 localhost audispd: node=virtual type=PATH msg=audit(1601227207.522:3421): item=1 name="/var/lock/subsys/corosync" inode=35029 dev=00:14 mode=0100640 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:var_lock_t:s0 objtype=DELETE cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0 Sep 27 17:34:49 localhost audispd: node=virtual type=AVC msg=audit(1601228085.093:2862): avc: denied { read } for pid=6748 comm="corosync" name="lock" dev="dm-0" ino=13082 scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=lnk_file permissive=1 Sep 27 17:34:49 localhost audispd: node=virtual type=AVC msg=audit(1601228085.093:2862): avc: denied { search } for pid=6748 comm="corosync" name="lock" dev="tmpfs" ino=10248 scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=dir permissive=1 Sep 27 17:34:49 localhost audispd: node=virtual type=AVC msg=audit(1601228085.797:2882): avc: denied { add_name } for pid=7066 comm="touch" name="corosync" scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=dir permissive=1 Sep 27 17:34:49 localhost audispd: node=virtual type=AVC msg=audit(1601228085.797:2882): avc: denied { create } for pid=7066 comm="touch" name="corosync" scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=file permissive=1 Sep 27 17:34:49 localhost audispd: node=virtual type=AVC msg=audit(1601228085.797:2882): avc: denied { write open } for pid=7066 comm="touch" path="/run/lock/subsys/corosync" dev="tmpfs" ino=35048 scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=file permissive=1 On RHEL7 systemd executes '/usr/share/corosync/corosync start' to start, label these files. Signed-off-by: Dave Sugar <dsugar@tresys.com>
2020-09-26 18:55:35 +00:00
type corosync_lock_t;
files_lock_file(corosync_lock_t)
type corosync_runtime_t alias corosync_var_run_t;
files_runtime_file(corosync_runtime_t)
type corosync_tmp_t;
files_tmp_file(corosync_tmp_t)
type corosync_tmpfs_t;
files_tmpfs_file(corosync_tmpfs_t)
type corosync_var_lib_t;
files_type(corosync_var_lib_t)
type corosync_var_log_t;
logging_log_file(corosync_var_log_t)
########################################
#
# Local policy
#
allow corosync_t self:capability { dac_override fowner ipc_lock setgid setuid sys_admin sys_nice sys_resource };
# for hearbeat
allow corosync_t self:capability { chown net_raw };
allow corosync_t self:process { setpgid setrlimit setsched signal signull };
allow corosync_t self:fifo_file rw_fifo_file_perms;
allow corosync_t self:sem create_sem_perms;
allow corosync_t self:shm create_shm_perms;
allow corosync_t self:unix_dgram_socket sendto;
allow corosync_t self:unix_stream_socket { accept connectto listen };
Updates for corosync to work in enforcing Allow corosync to map its own shared memory Sep 26 18:45:02 localhost audispd: node=virtual type=AVC msg=audit(1601145902.400:2972): avc: denied { map } for pid=6903 comm="corosync" path="/dev/shm/qb-6903-7028-31-FGGoGv/qb-request-cmap-header" dev="tmpfs" ino=40759 scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:corosync_tmpfs_t:s0 tclass=file permissive=1 Setup corosync lock file type Sep 27 17:20:07 localhost audispd: node=virtual type=PATH msg=audit(1601227207.522:3421): item=1 name="/var/lock/subsys/corosync" inode=35029 dev=00:14 mode=0100640 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:var_lock_t:s0 objtype=DELETE cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0 Sep 27 17:34:49 localhost audispd: node=virtual type=AVC msg=audit(1601228085.093:2862): avc: denied { read } for pid=6748 comm="corosync" name="lock" dev="dm-0" ino=13082 scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=lnk_file permissive=1 Sep 27 17:34:49 localhost audispd: node=virtual type=AVC msg=audit(1601228085.093:2862): avc: denied { search } for pid=6748 comm="corosync" name="lock" dev="tmpfs" ino=10248 scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=dir permissive=1 Sep 27 17:34:49 localhost audispd: node=virtual type=AVC msg=audit(1601228085.797:2882): avc: denied { add_name } for pid=7066 comm="touch" name="corosync" scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=dir permissive=1 Sep 27 17:34:49 localhost audispd: node=virtual type=AVC msg=audit(1601228085.797:2882): avc: denied { create } for pid=7066 comm="touch" name="corosync" scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=file permissive=1 Sep 27 17:34:49 localhost audispd: node=virtual type=AVC msg=audit(1601228085.797:2882): avc: denied { write open } for pid=7066 comm="touch" path="/run/lock/subsys/corosync" dev="tmpfs" ino=35048 scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=file permissive=1 On RHEL7 systemd executes '/usr/share/corosync/corosync start' to start, label these files. Signed-off-by: Dave Sugar <dsugar@tresys.com>
2020-09-26 18:55:35 +00:00
manage_files_pattern(corosync_t, corosync_lock_t, corosync_lock_t)
files_lock_filetrans(corosync_t, corosync_lock_t, file)
manage_dirs_pattern(corosync_t, corosync_tmp_t, corosync_tmp_t)
manage_files_pattern(corosync_t, corosync_tmp_t, corosync_tmp_t)
relabel_files_pattern(corosync_t, corosync_tmp_t, corosync_tmp_t)
files_tmp_filetrans(corosync_t, corosync_tmp_t, { dir file })
manage_dirs_pattern(corosync_t, corosync_tmpfs_t, corosync_tmpfs_t)
manage_files_pattern(corosync_t, corosync_tmpfs_t, corosync_tmpfs_t)
Updates for corosync to work in enforcing Allow corosync to map its own shared memory Sep 26 18:45:02 localhost audispd: node=virtual type=AVC msg=audit(1601145902.400:2972): avc: denied { map } for pid=6903 comm="corosync" path="/dev/shm/qb-6903-7028-31-FGGoGv/qb-request-cmap-header" dev="tmpfs" ino=40759 scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:corosync_tmpfs_t:s0 tclass=file permissive=1 Setup corosync lock file type Sep 27 17:20:07 localhost audispd: node=virtual type=PATH msg=audit(1601227207.522:3421): item=1 name="/var/lock/subsys/corosync" inode=35029 dev=00:14 mode=0100640 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:var_lock_t:s0 objtype=DELETE cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0 Sep 27 17:34:49 localhost audispd: node=virtual type=AVC msg=audit(1601228085.093:2862): avc: denied { read } for pid=6748 comm="corosync" name="lock" dev="dm-0" ino=13082 scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=lnk_file permissive=1 Sep 27 17:34:49 localhost audispd: node=virtual type=AVC msg=audit(1601228085.093:2862): avc: denied { search } for pid=6748 comm="corosync" name="lock" dev="tmpfs" ino=10248 scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=dir permissive=1 Sep 27 17:34:49 localhost audispd: node=virtual type=AVC msg=audit(1601228085.797:2882): avc: denied { add_name } for pid=7066 comm="touch" name="corosync" scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=dir permissive=1 Sep 27 17:34:49 localhost audispd: node=virtual type=AVC msg=audit(1601228085.797:2882): avc: denied { create } for pid=7066 comm="touch" name="corosync" scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=file permissive=1 Sep 27 17:34:49 localhost audispd: node=virtual type=AVC msg=audit(1601228085.797:2882): avc: denied { write open } for pid=7066 comm="touch" path="/run/lock/subsys/corosync" dev="tmpfs" ino=35048 scontext=system_u:system_r:corosync_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=file permissive=1 On RHEL7 systemd executes '/usr/share/corosync/corosync start' to start, label these files. Signed-off-by: Dave Sugar <dsugar@tresys.com>
2020-09-26 18:55:35 +00:00
mmap_read_files_pattern(corosync_t, corosync_tmpfs_t, corosync_tmpfs_t)
fs_tmpfs_filetrans(corosync_t, corosync_tmpfs_t, { dir file })
manage_files_pattern(corosync_t, corosync_var_lib_t, corosync_var_lib_t)
manage_dirs_pattern(corosync_t, corosync_var_lib_t, corosync_var_lib_t)
manage_sock_files_pattern(corosync_t, corosync_var_lib_t, corosync_var_lib_t)
manage_fifo_files_pattern(corosync_t, corosync_var_lib_t,corosync_var_lib_t)
files_var_lib_filetrans(corosync_t,corosync_var_lib_t, { dir fifo_file file sock_file })
create_files_pattern(corosync_t, corosync_var_log_t, corosync_var_log_t)
append_files_pattern(corosync_t, corosync_var_log_t, corosync_var_log_t)
setattr_files_pattern(corosync_t, corosync_var_log_t, corosync_var_log_t)
logging_log_filetrans(corosync_t, corosync_var_log_t, file)
manage_files_pattern(corosync_t, corosync_runtime_t, corosync_runtime_t)
manage_sock_files_pattern(corosync_t, corosync_runtime_t, corosync_runtime_t)
manage_dirs_pattern(corosync_t, corosync_runtime_t,corosync_runtime_t)
files_runtime_filetrans(corosync_t, corosync_runtime_t, { file sock_file dir })
can_exec(corosync_t, corosync_exec_t)
kernel_read_all_sysctls(corosync_t)
kernel_read_network_state(corosync_t)
kernel_read_system_state(corosync_t)
corecmd_exec_bin(corosync_t)
corecmd_exec_shell(corosync_t)
corenet_all_recvfrom_netlabel(corosync_t)
corenet_udp_sendrecv_generic_if(corosync_t)
corenet_udp_sendrecv_generic_node(corosync_t)
corenet_udp_bind_generic_node(corosync_t)
corenet_sendrecv_netsupport_server_packets(corosync_t)
corenet_udp_bind_netsupport_port(corosync_t)
dev_read_sysfs(corosync_t)
dev_read_urand(corosync_t)
domain_read_all_domains_state(corosync_t)
files_manage_mounttab(corosync_t)
files_read_usr_files(corosync_t)
auth_use_nsswitch(corosync_t)
init_domtrans_script(corosync_t)
init_read_script_state(corosync_t)
init_rw_script_tmp_files(corosync_t)
logging_send_syslog_msg(corosync_t)
miscfiles_read_localization(corosync_t)
userdom_read_user_tmp_files(corosync_t)
userdom_manage_user_tmpfs_files(corosync_t)
optional_policy(`
ccs_read_config(corosync_t)
')
optional_policy(`
cmirrord_rw_shm(corosync_t)
')
optional_policy(`
consoletype_exec(corosync_t)
')
optional_policy(`
dbus_system_bus_client(corosync_t)
')
optional_policy(`
drbd_domtrans(corosync_t)
')
optional_policy(`
qpidd_rw_shm(corosync_t)
')
optional_policy(`
rhcs_getattr_fenced_exec_files(corosync_t)
rhcs_rw_cluster_shm(corosync_t)
rhcs_rw_cluster_semaphores(corosync_t)
rhcs_stream_connect_cluster(corosync_t)
')
optional_policy(`
rgmanager_manage_tmpfs_files(corosync_t)
')
optional_policy(`
rpc_search_nfs_state_data(corosync_t)
')