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 1c1ac6
files_pid_filetrans(mdadm_t,mdadm_var_run_t,file)
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 15722e
domain_use_interactive_fds(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 1c1ac6
init_use_fds(mdadm_t)
Chris PeBenito 1815ba
init_use_script_ptys(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 15722e
userdom_dontaudit_use_unpriv_user_fds(mdadm_t)
Chris PeBenito 1815ba
userdom_dontaudit_use_sysadm_ttys(mdadm_t)
Chris PeBenito 50aca6
Chris PeBenito 3774e4
mta_send_mail(mdadm_t)
Chris PeBenito 3774e4
Chris PeBenito 50aca6
ifdef(`targeted_policy',`
Chris PeBenito 1815ba
	term_dontaudit_use_unallocated_ttys(mdadm_t)
Chris PeBenito 1815ba
	term_dontaudit_use_generic_ptys(mdadm_t)
Chris PeBenito 9e04f5
	files_dontaudit_read_root_files(mdadm_t)
Chris PeBenito 50aca6
')
Chris PeBenito 50aca6
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito 50aca6
	seutil_sigchld_newrole(mdadm_t)
Chris PeBenito 50aca6
')
Chris PeBenito 50aca6
Chris PeBenito bb7170
optional_policy(`
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
') dnl TODO