Chris PeBenito a5f339
Chris PeBenito 5ea24b
policy_module(raid,1.0.0)
Chris PeBenito a5f339
Chris PeBenito a5f339
########################################
Chris PeBenito 50aca6
#
Chris PeBenito a5f339
# Declarations
Chris PeBenito 50aca6
#
Chris PeBenito 50aca6
Chris PeBenito 3774e4
type mdadm_t;
Chris PeBenito 50aca6
type mdadm_exec_t;
Chris PeBenito 50aca6
init_daemon_domain(mdadm_t,mdadm_exec_t)
Chris PeBenito 50aca6
role system_r types mdadm_t;
Chris PeBenito 50aca6
Chris PeBenito 50aca6
type mdadm_var_run_t;
Chris PeBenito 50aca6
files_pid_file(mdadm_var_run_t)
Chris PeBenito 50aca6
Chris PeBenito a5f339
########################################
Chris PeBenito a5f339
#
Chris PeBenito a5f339
# Local policy
Chris PeBenito a5f339
#
Chris PeBenito a5f339
Chris PeBenito 50aca6
allow mdadm_t self:capability { dac_override sys_admin ipc_lock };
Chris PeBenito 50aca6
dontaudit mdadm_t self:capability sys_tty_config;
Chris PeBenito 50aca6
allow mdadm_t self:process { sigchld sigkill sigstop signull signal };
Chris PeBenito 50aca6
Chris PeBenito 50aca6
allow mdadm_t mdadm_var_run_t:file create_file_perms;
Chris PeBenito 9d5949
files_filetrans_pid(mdadm_t,mdadm_var_run_t)
Chris PeBenito 50aca6
Chris PeBenito 50aca6
kernel_read_system_state(mdadm_t)
Chris PeBenito 445522
kernel_read_kernel_sysctls(mdadm_t)
Chris PeBenito 50aca6
kernel_rw_software_raid_state(mdadm_t)
Chris PeBenito 50aca6
Chris PeBenito 50aca6
dev_read_sysfs(mdadm_t)
Chris PeBenito 50aca6
# Ignore attempts to read every device file
Chris PeBenito 50aca6
dev_dontaudit_getattr_all_blk_files(mdadm_t)
Chris PeBenito 50aca6
dev_dontaudit_getattr_all_chr_files(mdadm_t)
Chris PeBenito 50aca6
Chris PeBenito 50aca6
fs_search_auto_mountpoints(mdadm_t)
Chris PeBenito a5f339
fs_dontaudit_list_tmpfs(mdadm_t)
Chris PeBenito 50aca6
Chris PeBenito 50aca6
# RAID block device access
Chris PeBenito 50aca6
storage_manage_fixed_disk(mdadm_t)
Chris PeBenito 50aca6
Chris PeBenito 50aca6
term_dontaudit_use_console(mdadm_t)
Chris PeBenito 50aca6
term_dontaudit_list_ptys(mdadm_t)
Chris PeBenito 50aca6
Chris PeBenito 50aca6
# Helper program access
Chris PeBenito 50aca6
corecmd_exec_bin(mdadm_t)
Chris PeBenito 50aca6
corecmd_exec_sbin(mdadm_t)
Chris PeBenito 50aca6
Chris PeBenito 50aca6
domain_use_wide_inherit_fd(mdadm_t)
Chris PeBenito 50aca6
Chris PeBenito 50aca6
files_read_etc_files(mdadm_t)
Chris PeBenito 50aca6
files_read_etc_runtime_files(mdadm_t)
Chris PeBenito 50aca6
Chris PeBenito 50aca6
init_use_fd(mdadm_t)
Chris PeBenito 50aca6
init_use_script_pty(mdadm_t)
Chris PeBenito 50aca6
init_dontaudit_getattr_initctl(mdadm_t)
Chris PeBenito 50aca6
Chris PeBenito 50aca6
libs_use_ld_so(mdadm_t)
Chris PeBenito 50aca6
libs_use_shared_libs(mdadm_t)
Chris PeBenito 50aca6
Chris PeBenito 50aca6
logging_send_syslog_msg(mdadm_t)
Chris PeBenito 50aca6
Chris PeBenito 50aca6
miscfiles_read_localization(mdadm_t)
Chris PeBenito 50aca6
Chris PeBenito 50aca6
userdom_dontaudit_use_unpriv_user_fd(mdadm_t)
Chris PeBenito 50aca6
userdom_dontaudit_use_sysadm_tty(mdadm_t)
Chris PeBenito 50aca6
Chris PeBenito 3774e4
mta_send_mail(mdadm_t)
Chris PeBenito 3774e4
Chris PeBenito 50aca6
ifdef(`targeted_policy',`
Chris PeBenito 50aca6
	term_dontaudit_use_unallocated_tty(mdadm_t)
Chris PeBenito 50aca6
	term_dontaudit_use_generic_pty(mdadm_t)
Chris PeBenito 9e04f5
	files_dontaudit_read_root_files(mdadm_t)
Chris PeBenito 50aca6
')
Chris PeBenito 50aca6
Chris PeBenito 132880
optional_policy(`selinux',`
Chris PeBenito 50aca6
	seutil_sigchld_newrole(mdadm_t)
Chris PeBenito 50aca6
')
Chris PeBenito 50aca6
Chris PeBenito 132880
optional_policy(`udev',`
Chris PeBenito 50aca6
	udev_read_db(mdadm_t)
Chris PeBenito 50aca6
')
Chris PeBenito 50aca6
Chris PeBenito 50aca6
ifdef(`TODO',`
Chris PeBenito 50aca6
# Ignore attempts to read every device file
Chris PeBenito a5f339
dontaudit mdadm_t device_t:{ fifo_file file chr_file blk_file } { read getattr };
Chris PeBenito 50aca6
Chris PeBenito 50aca6
allow mdadm_t var_t:dir getattr;
Chris PeBenito 50aca6
') dnl TODO