2005-05-13 14:36:35 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
policy_module(lvm, 1.9.1)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2005-09-16 19:36:10 +00:00
|
|
|
type clvmd_t;
|
|
|
|
type clvmd_exec_t;
|
|
|
|
init_daemon_domain(clvmd_t,clvmd_exec_t)
|
|
|
|
|
|
|
|
type clvmd_var_run_t;
|
|
|
|
files_pid_file(clvmd_var_run_t)
|
|
|
|
|
2005-05-13 14:36:35 +00:00
|
|
|
type lvm_t;
|
2006-10-04 17:25:34 +00:00
|
|
|
type lvm_exec_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
init_system_domain(lvm_t,lvm_exec_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
# needs privowner because it assigns the identity system_u to device nodes
|
|
|
|
# but runs as the identity of the sysadmin
|
2006-02-02 21:08:12 +00:00
|
|
|
domain_obj_id_change_exemption(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
role system_r types lvm_t;
|
|
|
|
|
|
|
|
type lvm_etc_t;
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type(lvm_etc_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
|
|
|
type lvm_lock_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_lock_file(lvm_lock_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
type lvm_metadata_t;
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type(lvm_metadata_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
|
2006-12-04 20:10:56 +00:00
|
|
|
type lvm_var_lib_t;
|
|
|
|
files_type(lvm_var_lib_t)
|
|
|
|
|
2005-09-19 21:17:45 +00:00
|
|
|
type lvm_var_run_t;
|
|
|
|
files_pid_file(lvm_var_run_t)
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
type lvm_tmp_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_tmp_file(lvm_tmp_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
|
2005-05-13 14:36:35 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-09-16 19:36:10 +00:00
|
|
|
# Cluster LVM daemon local policy
|
|
|
|
#
|
|
|
|
|
2007-02-16 23:01:42 +00:00
|
|
|
allow clvmd_t self:capability { sys_admin mknod };
|
2005-09-16 19:36:10 +00:00
|
|
|
dontaudit clvmd_t self:capability sys_tty_config;
|
2005-09-22 21:59:50 +00:00
|
|
|
allow clvmd_t self:process signal_perms;
|
2007-03-22 14:01:55 +00:00
|
|
|
dontaudit clvmd_t self:process ptrace;
|
2005-09-16 19:36:10 +00:00
|
|
|
allow clvmd_t self:socket create_socket_perms;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow clvmd_t self:fifo_file rw_fifo_file_perms;
|
2005-09-16 19:36:10 +00:00
|
|
|
allow clvmd_t self:unix_stream_socket { connectto create_stream_socket_perms };
|
|
|
|
allow clvmd_t self:tcp_socket create_stream_socket_perms;
|
|
|
|
allow clvmd_t self:udp_socket create_socket_perms;
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
manage_files_pattern(clvmd_t,clvmd_var_run_t,clvmd_var_run_t)
|
2006-03-02 23:41:11 +00:00
|
|
|
files_pid_filetrans(clvmd_t,clvmd_var_run_t,file)
|
2005-09-16 19:36:10 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
read_files_pattern(clvmd_t,lvm_metadata_t,lvm_metadata_t)
|
2006-12-04 20:10:56 +00:00
|
|
|
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(clvmd_t)
|
2006-12-04 20:10:56 +00:00
|
|
|
kernel_read_system_state(clvmd_t)
|
2005-09-16 19:36:10 +00:00
|
|
|
kernel_list_proc(clvmd_t)
|
|
|
|
kernel_read_proc_symlinks(clvmd_t)
|
2006-12-04 20:10:56 +00:00
|
|
|
kernel_search_debugfs(clvmd_t)
|
2007-02-16 23:01:42 +00:00
|
|
|
kernel_dontaudit_getattr_core_if(clvmd_t)
|
2006-12-04 20:10:56 +00:00
|
|
|
|
|
|
|
corecmd_exec_shell(clvmd_t)
|
2007-03-23 23:24:59 +00:00
|
|
|
corecmd_getattr_bin_files(clvmd_t)
|
2005-09-16 19:36:10 +00:00
|
|
|
|
2007-06-27 15:23:21 +00:00
|
|
|
corenet_all_recvfrom_unlabeled(clvmd_t)
|
|
|
|
corenet_all_recvfrom_netlabel(clvmd_t)
|
2005-09-16 19:36:10 +00:00
|
|
|
corenet_tcp_sendrecv_all_if(clvmd_t)
|
|
|
|
corenet_udp_sendrecv_all_if(clvmd_t)
|
|
|
|
corenet_raw_sendrecv_all_if(clvmd_t)
|
|
|
|
corenet_tcp_sendrecv_all_nodes(clvmd_t)
|
|
|
|
corenet_udp_sendrecv_all_nodes(clvmd_t)
|
|
|
|
corenet_raw_sendrecv_all_nodes(clvmd_t)
|
|
|
|
corenet_tcp_sendrecv_all_ports(clvmd_t)
|
|
|
|
corenet_udp_sendrecv_all_ports(clvmd_t)
|
|
|
|
corenet_tcp_bind_all_nodes(clvmd_t)
|
|
|
|
corenet_tcp_bind_reserved_port(clvmd_t)
|
|
|
|
corenet_dontaudit_tcp_bind_all_reserved_ports(clvmd_t)
|
2006-05-29 15:04:49 +00:00
|
|
|
corenet_sendrecv_generic_server_packets(clvmd_t)
|
2005-09-16 19:36:10 +00:00
|
|
|
|
|
|
|
dev_read_sysfs(clvmd_t)
|
2006-12-04 20:10:56 +00:00
|
|
|
dev_manage_generic_chr_files(clvmd_t)
|
2007-02-16 23:01:42 +00:00
|
|
|
dev_rw_lvm_control(clvmd_t)
|
|
|
|
dev_dontaudit_getattr_all_blk_files(clvmd_t)
|
|
|
|
dev_dontaudit_getattr_all_chr_files(clvmd_t)
|
2006-12-04 20:10:56 +00:00
|
|
|
|
|
|
|
files_read_etc_files(clvmd_t)
|
|
|
|
files_list_usr(clvmd_t)
|
2005-09-16 19:36:10 +00:00
|
|
|
|
|
|
|
fs_getattr_all_fs(clvmd_t)
|
|
|
|
fs_search_auto_mountpoints(clvmd_t)
|
2007-02-16 23:01:42 +00:00
|
|
|
fs_dontaudit_list_tmpfs(clvmd_t)
|
2007-03-06 15:35:02 +00:00
|
|
|
fs_dontaudit_read_removable_files(clvmd_t)
|
2007-02-16 23:01:42 +00:00
|
|
|
|
|
|
|
storage_dontaudit_getattr_removable_dev(clvmd_t)
|
2005-09-16 19:36:10 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(clvmd_t)
|
2005-09-16 19:36:10 +00:00
|
|
|
|
2006-12-04 20:10:56 +00:00
|
|
|
storage_raw_read_fixed_disk(clvmd_t)
|
2005-09-22 21:59:50 +00:00
|
|
|
|
2007-12-04 15:05:55 +00:00
|
|
|
auth_use_nsswitch(clvmd_t)
|
|
|
|
|
2005-09-16 19:36:10 +00:00
|
|
|
logging_send_syslog_msg(clvmd_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(clvmd_t)
|
|
|
|
|
|
|
|
seutil_dontaudit_search_config(clvmd_t)
|
|
|
|
seutil_sigchld_newrole(clvmd_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_dontaudit_use_unpriv_user_fds(clvmd_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_dontaudit_search_user_home_dirs(clvmd_t)
|
2005-09-16 19:36:10 +00:00
|
|
|
|
2006-12-04 20:10:56 +00:00
|
|
|
lvm_domtrans(clvmd_t)
|
|
|
|
lvm_read_config(clvmd_t)
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
ccs_stream_connect(clvmd_t)
|
|
|
|
')
|
|
|
|
|
2007-02-16 23:01:42 +00:00
|
|
|
optional_policy(`
|
|
|
|
gpm_dontaudit_getattr_gpmctl(clvmd_t)
|
|
|
|
')
|
|
|
|
|
2006-12-04 20:10:56 +00:00
|
|
|
optional_policy(`
|
|
|
|
ricci_dontaudit_rw_modcluster_pipes(clvmd_t)
|
|
|
|
ricci_dontaudit_use_modcluster_fds(clvmd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-09-16 19:36:10 +00:00
|
|
|
udev_read_db(clvmd_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# LVM Local policy
|
2005-05-13 14:36:35 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# DAC overrides and mknod for modifying /dev entries (vgmknodes)
|
2006-03-23 19:19:38 +00:00
|
|
|
# rawio needed for dmraid
|
2006-07-28 15:13:58 +00:00
|
|
|
allow lvm_t self:capability { dac_override fowner ipc_lock sys_admin sys_nice mknod chown sys_resource sys_rawio };
|
2005-05-13 14:36:35 +00:00
|
|
|
dontaudit lvm_t self:capability sys_tty_config;
|
|
|
|
allow lvm_t self:process { sigchld sigkill sigstop signull signal };
|
|
|
|
# LVM will complain a lot if it cannot set its priority.
|
|
|
|
allow lvm_t self:process setsched;
|
2005-09-13 13:06:07 +00:00
|
|
|
allow lvm_t self:file rw_file_perms;
|
2005-06-09 14:26:05 +00:00
|
|
|
allow lvm_t self:fifo_file rw_file_perms;
|
|
|
|
allow lvm_t self:unix_dgram_socket create_socket_perms;
|
2006-08-29 02:41:00 +00:00
|
|
|
allow lvm_t self:netlink_kobject_uevent_socket create_socket_perms;
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2007-02-16 23:01:42 +00:00
|
|
|
allow lvm_t clvmd_t:unix_stream_socket connectto;
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
manage_dirs_pattern(lvm_t,lvm_tmp_t,lvm_tmp_t)
|
|
|
|
manage_files_pattern(lvm_t,lvm_tmp_t,lvm_tmp_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(lvm_t, lvm_tmp_t, { file dir })
|
2005-05-13 14:36:35 +00:00
|
|
|
|
|
|
|
# /lib/lvm-<version> holds the actual LVM binaries (and symlinks)
|
2006-12-12 20:08:08 +00:00
|
|
|
read_files_pattern(lvm_t,lvm_exec_t,lvm_exec_t)
|
|
|
|
read_lnk_files_pattern(lvm_t,lvm_exec_t,lvm_exec_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
|
|
|
# LVM is split into many individual binaries
|
2005-06-09 14:26:05 +00:00
|
|
|
can_exec(lvm_t, lvm_exec_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
|
|
|
# Creating lock files
|
2006-12-12 20:08:08 +00:00
|
|
|
manage_files_pattern(lvm_t,lvm_lock_t,lvm_lock_t)
|
2006-03-02 23:41:11 +00:00
|
|
|
files_lock_filetrans(lvm_t,lvm_lock_t,file)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
manage_dirs_pattern(lvm_t,lvm_var_lib_t,lvm_var_lib_t)
|
|
|
|
manage_files_pattern(lvm_t,lvm_var_lib_t,lvm_var_lib_t)
|
2006-12-04 20:10:56 +00:00
|
|
|
files_var_lib_filetrans(lvm_t,lvm_var_lib_t,{ dir file })
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
manage_dirs_pattern(lvm_t,lvm_var_run_t,lvm_var_run_t)
|
|
|
|
manage_files_pattern(lvm_t,lvm_var_run_t,lvm_var_run_t)
|
|
|
|
manage_sock_files_pattern(lvm_t,lvm_var_run_t,lvm_var_run_t)
|
2006-08-29 02:41:00 +00:00
|
|
|
files_pid_filetrans(lvm_t,lvm_var_run_t,{ file sock_file })
|
2005-09-19 21:17:45 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
read_files_pattern(lvm_t,lvm_etc_t,lvm_etc_t)
|
|
|
|
read_lnk_files_pattern(lvm_t,lvm_etc_t,lvm_etc_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
# Write to /etc/lvm, /etc/lvmtab, /etc/lvmtab.d
|
2006-12-12 20:08:08 +00:00
|
|
|
manage_files_pattern(lvm_t,lvm_metadata_t,lvm_metadata_t)
|
|
|
|
filetrans_pattern(lvm_t,lvm_etc_t,lvm_metadata_t,file)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_etc_filetrans(lvm_t,lvm_metadata_t,file)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(lvm_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(lvm_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
# Read system variables in /proc/sys
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(lvm_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
# it has no reason to need this
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_dontaudit_getattr_core_if(lvm_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
|
2005-06-14 20:48:34 +00:00
|
|
|
selinux_get_fs_mount(lvm_t)
|
|
|
|
selinux_validate_context(lvm_t)
|
|
|
|
selinux_compute_access_vector(lvm_t)
|
|
|
|
selinux_compute_create_context(lvm_t)
|
|
|
|
selinux_compute_relabel_context(lvm_t)
|
|
|
|
selinux_compute_user_contexts(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2006-01-31 16:08:56 +00:00
|
|
|
dev_create_generic_chr_files(lvm_t)
|
2007-03-06 15:35:02 +00:00
|
|
|
dev_delete_generic_dirs(lvm_t)
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_read_rand(lvm_t)
|
|
|
|
dev_read_urand(lvm_t)
|
|
|
|
dev_rw_lvm_control(lvm_t)
|
|
|
|
dev_manage_generic_symlinks(lvm_t)
|
2006-01-31 16:08:56 +00:00
|
|
|
dev_relabel_generic_dev_dirs(lvm_t)
|
|
|
|
dev_manage_generic_blk_files(lvm_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
# Read /sys/block. Device mapper metadata is kept there.
|
2005-10-17 20:00:20 +00:00
|
|
|
dev_read_sysfs(lvm_t)
|
2005-06-28 17:32:57 +00:00
|
|
|
# cjp: this has no effect since LVM does not
|
|
|
|
# have lnk_file relabelto for anything else.
|
|
|
|
# perhaps this should be blk_files?
|
|
|
|
dev_relabel_generic_symlinks(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
# LVM (vgscan) scans for devices by stating every file in /dev and applying a regex...
|
2005-09-16 21:20:37 +00:00
|
|
|
dev_dontaudit_read_all_chr_files(lvm_t)
|
|
|
|
dev_dontaudit_read_all_blk_files(lvm_t)
|
2006-01-31 16:08:56 +00:00
|
|
|
dev_dontaudit_getattr_generic_chr_files(lvm_t)
|
|
|
|
dev_dontaudit_getattr_generic_blk_files(lvm_t)
|
|
|
|
dev_dontaudit_getattr_generic_pipes(lvm_t)
|
2006-03-23 19:19:38 +00:00
|
|
|
dev_create_generic_dirs(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_getattr_xattr_fs(lvm_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
fs_search_auto_mountpoints(lvm_t)
|
2006-07-28 15:13:58 +00:00
|
|
|
fs_list_tmpfs(lvm_t)
|
2006-01-25 15:53:35 +00:00
|
|
|
fs_read_tmpfs_symlinks(lvm_t)
|
2006-05-03 19:58:01 +00:00
|
|
|
fs_dontaudit_read_removable_files(lvm_t)
|
2007-02-16 23:01:42 +00:00
|
|
|
fs_dontaudit_getattr_tmpfs_files(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2005-06-28 17:32:57 +00:00
|
|
|
storage_relabel_fixed_disk(lvm_t)
|
2006-05-03 19:58:01 +00:00
|
|
|
storage_dontaudit_read_removable_device(lvm_t)
|
2005-05-30 21:17:20 +00:00
|
|
|
# LVM creates block devices in /dev/mapper or /dev/<vg>
|
|
|
|
# depending on its version
|
|
|
|
# LVM(2) needs to create directores (/dev/mapper, /dev/<vg>)
|
|
|
|
# and links from /dev/<vg> to /dev/mapper/<vg>-<lv>
|
2006-03-02 23:41:11 +00:00
|
|
|
# cjp: need create interface here for fixed disk create
|
|
|
|
storage_dev_filetrans_fixed_disk(lvm_t)
|
2005-05-30 21:17:20 +00:00
|
|
|
# Access raw devices and old /dev/lvm (c 109,0). Is this needed?
|
|
|
|
storage_manage_fixed_disk(lvm_t)
|
|
|
|
|
2007-03-23 23:24:59 +00:00
|
|
|
corecmd_exec_bin(lvm_t)
|
2008-04-18 15:32:03 +00:00
|
|
|
corecmd_exec_shell(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(lvm_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_read_etc_runtime_files(lvm_t)
|
2005-05-31 21:25:45 +00:00
|
|
|
# for when /usr is not mounted:
|
2006-01-31 19:21:01 +00:00
|
|
|
files_dontaudit_search_isid_type_dirs(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
init_use_fds(lvm_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
init_dontaudit_getattr_initctl(lvm_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
init_use_script_ptys(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
|
|
|
miscfiles_read_localization(lvm_t)
|
|
|
|
|
2005-06-14 20:48:34 +00:00
|
|
|
seutil_read_config(lvm_t)
|
|
|
|
seutil_read_file_contexts(lvm_t)
|
2005-06-29 20:53:53 +00:00
|
|
|
seutil_search_default_contexts(lvm_t)
|
2005-06-29 14:26:41 +00:00
|
|
|
seutil_sigchld_newrole(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_use_user_terminals(lvm_t)
|
|
|
|
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`distro_redhat',`
|
2005-06-01 13:51:54 +00:00
|
|
|
# this is from the initrd:
|
2006-01-31 19:21:01 +00:00
|
|
|
files_rw_isid_type_dirs(lvm_t)
|
2005-06-01 13:51:54 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-02-02 21:08:12 +00:00
|
|
|
bootloader_rw_tmp_files(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
')
|
|
|
|
|
2006-12-04 20:10:56 +00:00
|
|
|
optional_policy(`
|
|
|
|
ccs_stream_connect(lvm_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-08-17 21:28:31 +00:00
|
|
|
gpm_dontaudit_getattr_gpmctl(lvm_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-13 17:35:46 +00:00
|
|
|
udev_read_db(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
')
|