Jeremy Solt 538cf9
policy_module(rhcs, 1.1.0)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
########################################
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
# Declarations
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
Jeremy Solt 538cf9
## <desc>
Dominick Grift 1e2abe
##	

Dominick Grift 1e2abe
##	Allow fenced domain to connect to the network using TCP.
Dominick Grift 1e2abe
##	

Jeremy Solt 538cf9
## </desc>
Jeremy Solt 538cf9
gen_tunable(fenced_can_network_connect, false)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
attribute cluster_domain;
Dan Walsh 3eaa99
attribute cluster_tmpfs;
Dan Walsh 3eaa99
attribute cluster_pid;
Jeremy Solt 538cf9
Jeremy Solt 538cf9
rhcs_domain_template(dlm_controld)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
rhcs_domain_template(fenced)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
type fenced_lock_t;
Jeremy Solt 538cf9
files_lock_file(fenced_lock_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
type fenced_tmp_t;
Jeremy Solt 538cf9
files_tmp_file(fenced_tmp_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
rhcs_domain_template(gfs_controld)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
rhcs_domain_template(groupd)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
rhcs_domain_template(qdiskd)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
type qdiskd_var_lib_t;
Jeremy Solt 538cf9
files_type(qdiskd_var_lib_t)
Jeremy Solt 538cf9
Miroslav Grepl be5142
# type for cluster lib files
Miroslav Grepl be5142
type cluster_var_lib_t;
Miroslav Grepl be5142
files_type(cluster_var_lib_t)
Miroslav Grepl be5142
Jeremy Solt 538cf9
#####################################
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
# dlm_controld local policy
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
Jeremy Solt 538cf9
allow dlm_controld_t self:capability { net_admin sys_admin sys_resource };
Jeremy Solt 538cf9
Jeremy Solt 538cf9
allow dlm_controld_t self:netlink_kobject_uevent_socket create_socket_perms;
Jeremy Solt 538cf9
Jeremy Solt 538cf9
stream_connect_pattern(dlm_controld_t, fenced_var_run_t, fenced_var_run_t, fenced_t)
Jeremy Solt 538cf9
stream_connect_pattern(dlm_controld_t, groupd_var_run_t, groupd_var_run_t, groupd_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
kernel_read_system_state(dlm_controld_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
dev_rw_dlm_control(dlm_controld_t)
Jeremy Solt 538cf9
dev_rw_sysfs(dlm_controld_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
fs_manage_configfs_files(dlm_controld_t)
Jeremy Solt 538cf9
fs_manage_configfs_dirs(dlm_controld_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
init_rw_script_tmp_files(dlm_controld_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
#######################################
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
# fenced local policy
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
Jeremy Solt 538cf9
allow fenced_t self:capability { sys_rawio sys_resource };
Dan Walsh 3eaa99
allow fenced_t self:process { getsched signal_perms };
Jeremy Solt 538cf9
Jeremy Solt 538cf9
allow fenced_t self:tcp_socket create_stream_socket_perms;
Jeremy Solt 538cf9
allow fenced_t self:udp_socket create_socket_perms;
Jeremy Solt 538cf9
Jeremy Solt 538cf9
can_exec(fenced_t, fenced_exec_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
manage_files_pattern(fenced_t, fenced_lock_t, fenced_lock_t)
Jeremy Solt 538cf9
files_lock_filetrans(fenced_t, fenced_lock_t, file)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
manage_dirs_pattern(fenced_t, fenced_tmp_t, fenced_tmp_t)
Jeremy Solt 538cf9
manage_files_pattern(fenced_t, fenced_tmp_t, fenced_tmp_t)
Jeremy Solt 538cf9
manage_fifo_files_pattern(fenced_t, fenced_tmp_t, fenced_tmp_t)
Jeremy Solt 538cf9
files_tmp_filetrans(fenced_t, fenced_tmp_t, { file fifo_file dir })
Jeremy Solt 538cf9
Jeremy Solt 538cf9
stream_connect_pattern(fenced_t, groupd_var_run_t, groupd_var_run_t, groupd_t)
Jeremy Solt 538cf9
Dan Walsh 3eaa99
kernel_read_system_state(fenced_t)
Dan Walsh 3eaa99
Jeremy Solt 538cf9
corecmd_exec_bin(fenced_t)
Dan Walsh 3eaa99
corecmd_exec_shell(fenced_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
corenet_tcp_connect_http_port(fenced_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
dev_read_sysfs(fenced_t)
Jeremy Solt 538cf9
dev_read_urand(fenced_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
files_read_usr_symlinks(fenced_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
storage_raw_read_fixed_disk(fenced_t)
Jeremy Solt 538cf9
storage_raw_write_fixed_disk(fenced_t)
Jeremy Solt 538cf9
storage_raw_read_removable_device(fenced_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
term_getattr_pty_fs(fenced_t)
Jeremy Solt 538cf9
term_use_ptmx(fenced_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
auth_use_nsswitch(fenced_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
tunable_policy(`fenced_can_network_connect',`
Jeremy Solt 538cf9
	corenet_tcp_connect_all_ports(fenced_t)
Jeremy Solt 538cf9
')
Jeremy Solt 538cf9
Miroslav Grepl be5142
# needed by fence_scsi
Miroslav Grepl be5142
optional_policy(`
Dominick Grift 1e2abe
	corosync_exec(fenced_t)
Miroslav Grepl be5142
')
Miroslav Grepl be5142
Jeremy Solt 538cf9
optional_policy(`
Jeremy Solt 538cf9
	ccs_read_config(fenced_t)
Jeremy Solt 538cf9
')
Jeremy Solt 538cf9
Jeremy Solt 538cf9
optional_policy(`
Jeremy Solt 538cf9
	lvm_domtrans(fenced_t)
Jeremy Solt 538cf9
	lvm_read_config(fenced_t)
Jeremy Solt 538cf9
')
Jeremy Solt 538cf9
Jeremy Solt 538cf9
######################################
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
# gfs_controld local policy
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
Jeremy Solt 538cf9
allow gfs_controld_t self:capability { net_admin sys_resource };
Jeremy Solt 538cf9
allow gfs_controld_t self:shm create_shm_perms;
Jeremy Solt 538cf9
allow gfs_controld_t self:netlink_kobject_uevent_socket create_socket_perms;
Jeremy Solt 538cf9
Jeremy Solt 538cf9
stream_connect_pattern(gfs_controld_t, dlm_controld_var_run_t, dlm_controld_var_run_t, dlm_controld_t)
Jeremy Solt 538cf9
stream_connect_pattern(gfs_controld_t, fenced_var_run_t, fenced_var_run_t, fenced_t)
Jeremy Solt 538cf9
stream_connect_pattern(gfs_controld_t, groupd_var_run_t, groupd_var_run_t, groupd_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
kernel_read_system_state(gfs_controld_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
dev_rw_dlm_control(gfs_controld_t)
Jeremy Solt 538cf9
dev_setattr_dlm_control(gfs_controld_t)
Jeremy Solt 538cf9
dev_rw_sysfs(gfs_controld_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
storage_getattr_removable_dev(gfs_controld_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
init_rw_script_tmp_files(gfs_controld_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
optional_policy(`
Jeremy Solt 538cf9
	lvm_exec(gfs_controld_t)
Jeremy Solt 538cf9
	dev_rw_lvm_control(gfs_controld_t)
Jeremy Solt 538cf9
')
Jeremy Solt 538cf9
Jeremy Solt 538cf9
#######################################
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
# groupd local policy
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
Jeremy Solt 538cf9
allow groupd_t self:capability { sys_nice sys_resource };
Jeremy Solt 538cf9
allow groupd_t self:process setsched;
Jeremy Solt 538cf9
allow groupd_t self:shm create_shm_perms;
Jeremy Solt 538cf9
Jeremy Solt 538cf9
dev_list_sysfs(groupd_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
files_read_etc_files(groupd_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
init_rw_script_tmp_files(groupd_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
######################################
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
# qdiskd local policy
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
Dan Walsh 3eaa99
allow qdiskd_t self:capability { ipc_lock sys_boot };
Jeremy Solt 538cf9
allow qdiskd_t self:tcp_socket create_stream_socket_perms;
Jeremy Solt 538cf9
allow qdiskd_t self:udp_socket create_socket_perms;
Jeremy Solt 538cf9
Jeremy Solt 538cf9
manage_files_pattern(qdiskd_t, qdiskd_var_lib_t, qdiskd_var_lib_t)
Jeremy Solt 538cf9
manage_dirs_pattern(qdiskd_t, qdiskd_var_lib_t, qdiskd_var_lib_t)
Jeremy Solt 538cf9
manage_sock_files_pattern(qdiskd_t, qdiskd_var_lib_t, qdiskd_var_lib_t)
Jeremy Solt 538cf9
files_var_lib_filetrans(qdiskd_t, qdiskd_var_lib_t, { file dir sock_file })
Jeremy Solt 538cf9
Jeremy Solt 538cf9
kernel_read_system_state(qdiskd_t)
Jeremy Solt 538cf9
kernel_read_software_raid_state(qdiskd_t)
Jeremy Solt 538cf9
kernel_getattr_core_if(qdiskd_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
corecmd_getattr_bin_files(qdiskd_t)
Jeremy Solt 538cf9
corecmd_exec_shell(qdiskd_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
dev_read_sysfs(qdiskd_t)
Jeremy Solt 538cf9
dev_list_all_dev_nodes(qdiskd_t)
Jeremy Solt 538cf9
dev_getattr_all_blk_files(qdiskd_t)
Jeremy Solt 538cf9
dev_getattr_all_chr_files(qdiskd_t)
Jeremy Solt 538cf9
dev_manage_generic_blk_files(qdiskd_t)
Jeremy Solt 538cf9
dev_manage_generic_chr_files(qdiskd_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
domain_dontaudit_getattr_all_pipes(qdiskd_t)
Jeremy Solt 538cf9
domain_dontaudit_getattr_all_sockets(qdiskd_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
files_dontaudit_getattr_all_sockets(qdiskd_t)
Jeremy Solt 538cf9
files_dontaudit_getattr_all_pipes(qdiskd_t)
Jeremy Solt 538cf9
files_read_etc_files(qdiskd_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
storage_raw_read_removable_device(qdiskd_t)
Jeremy Solt 538cf9
storage_raw_write_removable_device(qdiskd_t)
Jeremy Solt 538cf9
storage_raw_read_fixed_disk(qdiskd_t)
Jeremy Solt 538cf9
storage_raw_write_fixed_disk(qdiskd_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
auth_use_nsswitch(qdiskd_t)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
optional_policy(`
Jeremy Solt 538cf9
	netutils_domtrans_ping(qdiskd_t)
Jeremy Solt 538cf9
')
Jeremy Solt 538cf9
Jeremy Solt 538cf9
optional_policy(`
Jeremy Solt 538cf9
	udev_read_db(qdiskd_t)
Jeremy Solt 538cf9
')
Jeremy Solt 538cf9
Jeremy Solt 538cf9
#####################################
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
# rhcs domains common policy
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
Dominick Grift a25335
allow cluster_domain self:capability sys_nice;
Jeremy Solt 538cf9
allow cluster_domain self:process setsched;
Jeremy Solt 538cf9
allow cluster_domain self:sem create_sem_perms;
Jeremy Solt 538cf9
allow cluster_domain self:fifo_file rw_fifo_file_perms;
Jeremy Solt 538cf9
allow cluster_domain self:unix_stream_socket create_stream_socket_perms;
Jeremy Solt 538cf9
allow cluster_domain self:unix_dgram_socket create_socket_perms;
Jeremy Solt 538cf9
Miroslav Grepl be5142
manage_files_pattern(cluster_domain, cluster_var_lib_t, cluster_var_lib_t)
Miroslav Grepl be5142
manage_dirs_pattern(cluster_domain, cluster_var_lib_t, cluster_var_lib_t)
Miroslav Grepl be5142
Jeremy Solt 538cf9
logging_send_syslog_msg(cluster_domain)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
miscfiles_read_localization(cluster_domain)
Jeremy Solt 538cf9
Jeremy Solt 538cf9
optional_policy(`
Dan Walsh 3eaa99
	ccs_stream_connect(cluster_domain)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Jeremy Solt 538cf9
	corosync_stream_connect(cluster_domain)
Jeremy Solt 538cf9
')