2005-05-13 14:36:35 +00:00
|
|
|
|
|
|
|
policy_module(lvm,1.0)
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
type lvm_t;
|
|
|
|
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
|
2005-06-14 19:56:46 +00:00
|
|
|
domain_obj_id_change_exempt(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
|
|
|
|
|
|
|
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
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
# DAC overrides and mknod for modifying /dev entries (vgmknodes)
|
|
|
|
allow lvm_t self:capability { dac_override ipc_lock sys_admin sys_nice mknod };
|
|
|
|
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-06-09 14:26:05 +00:00
|
|
|
allow lvm_t self:file r_file_perms;
|
|
|
|
allow lvm_t self:fifo_file rw_file_perms;
|
|
|
|
allow lvm_t self:unix_dgram_socket create_socket_perms;
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2005-06-09 14:26:05 +00:00
|
|
|
allow lvm_t lvm_tmp_t:dir create_dir_perms;
|
|
|
|
allow lvm_t lvm_tmp_t:file create_file_perms;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_create_tmp_files(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)
|
|
|
|
allow lvm_t lvm_exec_t:dir search;
|
2005-06-09 14:26:05 +00:00
|
|
|
allow lvm_t lvm_exec_t:{ file lnk_file } r_file_perms;
|
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
|
2005-06-10 01:01:13 +00:00
|
|
|
allow lvm_t lvm_lock_t:dir rw_dir_perms;
|
2005-06-09 14:26:05 +00:00
|
|
|
allow lvm_t lvm_lock_t:file create_file_perms;
|
2005-06-29 14:26:41 +00:00
|
|
|
files_create_lock(lvm_t,lvm_lock_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2005-06-09 14:26:05 +00:00
|
|
|
allow lvm_t lvm_etc_t:file r_file_perms;
|
|
|
|
allow lvm_t lvm_etc_t:lnk_file r_file_perms;
|
2005-05-13 14:36:35 +00:00
|
|
|
# Write to /etc/lvm, /etc/lvmtab, /etc/lvmtab.d
|
2005-06-09 14:26:05 +00:00
|
|
|
allow lvm_t lvm_etc_t:dir rw_dir_perms;
|
|
|
|
allow lvm_t lvm_metadata_t:file create_file_perms;
|
|
|
|
allow lvm_t lvm_metadata_t:dir rw_dir_perms;
|
2005-05-13 14:36:35 +00:00
|
|
|
type_transition lvm_t lvm_etc_t:file lvm_metadata_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_create_etc_config(lvm_t,lvm_metadata_t,file)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(lvm_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
kernel_read_kernel_sysctl(lvm_t)
|
|
|
|
# Read system variables in /proc/sys
|
|
|
|
kernel_read_kernel_sysctl(lvm_t)
|
|
|
|
# it has no reason to need this
|
|
|
|
kernel_dontaudit_getattr_core(lvm_t)
|
|
|
|
|
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
|
|
|
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_create_generic_chr_file(lvm_t)
|
|
|
|
dev_read_rand(lvm_t)
|
|
|
|
dev_read_urand(lvm_t)
|
|
|
|
dev_rw_lvm_control(lvm_t)
|
|
|
|
dev_manage_generic_symlinks(lvm_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
dev_relabel_dev_dirs(lvm_t)
|
|
|
|
dev_manage_generic_blk_file(lvm_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
dev_read_sysfs(lvm_t)
|
|
|
|
# Read /sys/block. Device mapper metadata is kept there.
|
|
|
|
dev_read_sysfs(sysfs_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-06-13 16:22:32 +00:00
|
|
|
dev_dontaudit_getattr_all_chr_files(lvm_t)
|
|
|
|
dev_dontaudit_getattr_all_blk_files(lvm_t)
|
|
|
|
dev_dontaudit_getattr_generic_chr_file(lvm_t)
|
|
|
|
dev_dontaudit_getattr_generic_blk_file(lvm_t)
|
|
|
|
dev_dontaudit_getattr_generic_pipe(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)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2005-06-28 17:32:57 +00:00
|
|
|
storage_relabel_fixed_disk(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>
|
2005-06-29 14:26:41 +00:00
|
|
|
storage_create_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)
|
|
|
|
|
2005-06-28 17:32:57 +00:00
|
|
|
term_dontaudit_getattr_all_user_ttys(lvm_t)
|
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
corecmd_search_sbin(lvm_t)
|
|
|
|
corecmd_dontaudit_getattr_sbin_file(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_use_wide_inherit_fd(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
files_search_var(lvm_t)
|
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-07-08 20:44:57 +00:00
|
|
|
files_dontaudit_getattr_pid_dir(lvm_t)
|
2005-05-31 21:25:45 +00:00
|
|
|
# for when /usr is not mounted:
|
2005-06-13 17:35:46 +00:00
|
|
|
files_dontaudit_search_isid_type_dir(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
init_use_fd(lvm_t)
|
|
|
|
init_dontaudit_getattr_initctl(lvm_t)
|
|
|
|
init_use_script_pty(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
libs_use_ld_so(lvm_t)
|
|
|
|
libs_use_shared_libs(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
|
|
|
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`distro_redhat',`
|
2005-06-01 13:51:54 +00:00
|
|
|
# this is from the initrd:
|
2005-06-13 17:35:46 +00:00
|
|
|
files_rw_isid_type_dir(lvm_t)
|
2005-06-01 13:51:54 +00:00
|
|
|
')
|
|
|
|
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`targeted_policy', `
|
2005-06-10 01:01:13 +00:00
|
|
|
term_dontaudit_use_unallocated_tty(lvm_t)
|
2005-06-13 20:27:32 +00:00
|
|
|
term_dontaudit_use_generic_pty(lvm_t)
|
2005-05-31 23:02:11 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
files_dontaudit_read_root_file(lvm_t)
|
2005-05-31 23:02:11 +00:00
|
|
|
')
|
2005-05-13 14:36:35 +00:00
|
|
|
|
|
|
|
optional_policy(`bootloader.te',`
|
2005-06-10 01:01:13 +00:00
|
|
|
bootloader_rw_tmp_file(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
')
|
|
|
|
|
2005-08-17 21:28:31 +00:00
|
|
|
optional_policy(`gpm.te',`
|
|
|
|
gpm_dontaudit_getattr_gpmctl(lvm_t)
|
|
|
|
')
|
|
|
|
|
2005-05-13 14:36:35 +00:00
|
|
|
optional_policy(`udev.te', `
|
2005-06-13 17:35:46 +00:00
|
|
|
udev_read_db(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
ifdef(`TODO',`
|
|
|
|
|
|
|
|
optional_policy(`gnome-pty-helper.te', `
|
2005-06-03 12:25:14 +00:00
|
|
|
allow lvm_t sysadm_gph_t:fd use;
|
2005-05-13 14:36:35 +00:00
|
|
|
')
|
|
|
|
|
2005-06-28 17:32:57 +00:00
|
|
|
optional_policy(`rhgb.te',`
|
|
|
|
rhgb_domain(lvm_t)
|
2005-05-13 14:36:35 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
') dnl end TODO
|