|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
a52492 |
policy_module(lvm,1.2.1)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
1bde83 |
########################################
|
|
Chris PeBenito |
1bde83 |
#
|
|
Chris PeBenito |
1bde83 |
# Declarations
|
|
Chris PeBenito |
1bde83 |
#
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
cff75c |
type clvmd_t;
|
|
Chris PeBenito |
cff75c |
type clvmd_exec_t;
|
|
Chris PeBenito |
cff75c |
init_daemon_domain(clvmd_t,clvmd_exec_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
type clvmd_var_run_t;
|
|
Chris PeBenito |
cff75c |
files_pid_file(clvmd_var_run_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
1bde83 |
type lvm_t;
|
|
Chris PeBenito |
1bde83 |
type lvm_exec_t;
|
|
Chris PeBenito |
c9428d |
init_system_domain(lvm_t,lvm_exec_t)
|
|
Chris PeBenito |
1bde83 |
# needs privowner because it assigns the identity system_u to device nodes
|
|
Chris PeBenito |
1bde83 |
# but runs as the identity of the sysadmin
|
|
Chris PeBenito |
1815ba |
domain_obj_id_change_exemption(lvm_t)
|
|
Chris PeBenito |
1bde83 |
role system_r types lvm_t;
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
1bde83 |
type lvm_etc_t;
|
|
Chris PeBenito |
8fd367 |
files_type(lvm_etc_t)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
1bde83 |
type lvm_lock_t;
|
|
Chris PeBenito |
c9428d |
files_lock_file(lvm_lock_t)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
daa0e0 |
type lvm_metadata_t;
|
|
Chris PeBenito |
8fd367 |
files_type(lvm_metadata_t)
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
a1fcff |
type lvm_var_run_t;
|
|
Chris PeBenito |
a1fcff |
files_pid_file(lvm_var_run_t)
|
|
Chris PeBenito |
a1fcff |
|
|
Chris PeBenito |
daa0e0 |
type lvm_tmp_t;
|
|
Chris PeBenito |
c9428d |
files_tmp_file(lvm_tmp_t)
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
1bde83 |
########################################
|
|
Chris PeBenito |
1bde83 |
#
|
|
Chris PeBenito |
cff75c |
# Cluster LVM daemon local policy
|
|
Chris PeBenito |
cff75c |
#
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
dontaudit clvmd_t self:capability sys_tty_config;
|
|
Chris PeBenito |
681c9a |
allow clvmd_t self:process signal_perms;
|
|
Chris PeBenito |
cff75c |
allow clvmd_t self:socket create_socket_perms;
|
|
Chris PeBenito |
cff75c |
allow clvmd_t self:fifo_file { read write };
|
|
Chris PeBenito |
cff75c |
allow clvmd_t self:unix_stream_socket { connectto create_stream_socket_perms };
|
|
Chris PeBenito |
cff75c |
allow clvmd_t self:tcp_socket create_stream_socket_perms;
|
|
Chris PeBenito |
cff75c |
allow clvmd_t self:udp_socket create_socket_perms;
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
allow clvmd_t clvmd_var_run_t:file create_file_perms;
|
|
Chris PeBenito |
cff75c |
allow clvmd_t clvmd_var_run_t:dir rw_dir_perms;
|
|
Chris PeBenito |
9d5949 |
files_filetrans_pid(clvmd_t,clvmd_var_run_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
445522 |
kernel_read_kernel_sysctls(clvmd_t)
|
|
Chris PeBenito |
cff75c |
kernel_list_proc(clvmd_t)
|
|
Chris PeBenito |
cff75c |
kernel_read_proc_symlinks(clvmd_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
corenet_tcp_sendrecv_all_if(clvmd_t)
|
|
Chris PeBenito |
cff75c |
corenet_udp_sendrecv_all_if(clvmd_t)
|
|
Chris PeBenito |
cff75c |
corenet_raw_sendrecv_all_if(clvmd_t)
|
|
Chris PeBenito |
cff75c |
corenet_tcp_sendrecv_all_nodes(clvmd_t)
|
|
Chris PeBenito |
cff75c |
corenet_udp_sendrecv_all_nodes(clvmd_t)
|
|
Chris PeBenito |
cff75c |
corenet_raw_sendrecv_all_nodes(clvmd_t)
|
|
Chris PeBenito |
cff75c |
corenet_tcp_sendrecv_all_ports(clvmd_t)
|
|
Chris PeBenito |
cff75c |
corenet_udp_sendrecv_all_ports(clvmd_t)
|
|
Chris PeBenito |
bd7037 |
corenet_non_ipsec_sendrecv(clvmd_t)
|
|
Chris PeBenito |
cff75c |
corenet_tcp_bind_all_nodes(clvmd_t)
|
|
Chris PeBenito |
cff75c |
corenet_udp_bind_all_nodes(clvmd_t)
|
|
Chris PeBenito |
cff75c |
corenet_tcp_bind_reserved_port(clvmd_t)
|
|
Chris PeBenito |
cff75c |
corenet_dontaudit_tcp_bind_all_reserved_ports(clvmd_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
dev_read_sysfs(clvmd_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
fs_getattr_all_fs(clvmd_t)
|
|
Chris PeBenito |
cff75c |
fs_search_auto_mountpoints(clvmd_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
term_dontaudit_use_console(clvmd_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
domain_use_wide_inherit_fd(clvmd_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
681c9a |
files_list_usr(clvmd_t)
|
|
Chris PeBenito |
681c9a |
|
|
Chris PeBenito |
cff75c |
init_use_fd(clvmd_t)
|
|
Chris PeBenito |
1815ba |
init_use_script_ptys(clvmd_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
libs_use_ld_so(clvmd_t)
|
|
Chris PeBenito |
cff75c |
libs_use_shared_libs(clvmd_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
logging_send_syslog_msg(clvmd_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
miscfiles_read_localization(clvmd_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
seutil_dontaudit_search_config(clvmd_t)
|
|
Chris PeBenito |
cff75c |
seutil_sigchld_newrole(clvmd_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
sysnet_read_config(clvmd_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
userdom_dontaudit_use_unpriv_user_fd(clvmd_t)
|
|
Chris PeBenito |
cff75c |
userdom_dontaudit_search_sysadm_home_dir(clvmd_t)
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
ifdef(`targeted_policy', `
|
|
Chris PeBenito |
1815ba |
term_dontaudit_use_unallocated_ttys(clvmd_t)
|
|
Chris PeBenito |
1815ba |
term_dontaudit_use_generic_ptys(clvmd_t)
|
|
Chris PeBenito |
9e04f5 |
files_dontaudit_read_root_files(clvmd_t)
|
|
Chris PeBenito |
cff75c |
')
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
132880 |
optional_policy(`mount',`
|
|
Chris PeBenito |
cff75c |
mount_send_nfs_client_request(clvmd_t)
|
|
Chris PeBenito |
cff75c |
')
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
132880 |
optional_policy(`nis',`
|
|
Chris PeBenito |
cff75c |
nis_use_ypbind(clvmd_t)
|
|
Chris PeBenito |
cff75c |
')
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
132880 |
optional_policy(`udev',`
|
|
Chris PeBenito |
cff75c |
udev_read_db(clvmd_t)
|
|
Chris PeBenito |
cff75c |
')
|
|
Chris PeBenito |
cff75c |
|
|
Chris PeBenito |
cff75c |
########################################
|
|
Chris PeBenito |
cff75c |
#
|
|
Chris PeBenito |
cff75c |
# LVM Local policy
|
|
Chris PeBenito |
1bde83 |
#
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
1bde83 |
# DAC overrides and mknod for modifying /dev entries (vgmknodes)
|
|
Chris PeBenito |
0907bd |
allow lvm_t self:capability { dac_override ipc_lock sys_admin sys_nice mknod chown sys_resource };
|
|
Chris PeBenito |
1bde83 |
dontaudit lvm_t self:capability sys_tty_config;
|
|
Chris PeBenito |
1bde83 |
allow lvm_t self:process { sigchld sigkill sigstop signull signal };
|
|
Chris PeBenito |
1bde83 |
# LVM will complain a lot if it cannot set its priority.
|
|
Chris PeBenito |
1bde83 |
allow lvm_t self:process setsched;
|
|
Chris PeBenito |
0907bd |
allow lvm_t self:file rw_file_perms;
|
|
Chris PeBenito |
80048c |
allow lvm_t self:fifo_file rw_file_perms;
|
|
Chris PeBenito |
80048c |
allow lvm_t self:unix_dgram_socket create_socket_perms;
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
80048c |
allow lvm_t lvm_tmp_t:dir create_dir_perms;
|
|
Chris PeBenito |
80048c |
allow lvm_t lvm_tmp_t:file create_file_perms;
|
|
Chris PeBenito |
9d5949 |
files_filetrans_tmp(lvm_t, lvm_tmp_t, { file dir })
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
1bde83 |
# /lib/lvm-<version> holds the actual LVM binaries (and symlinks)
|
|
Chris PeBenito |
1bde83 |
allow lvm_t lvm_exec_t:dir search;
|
|
Chris PeBenito |
80048c |
allow lvm_t lvm_exec_t:{ file lnk_file } r_file_perms;
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
1bde83 |
# LVM is split into many individual binaries
|
|
Chris PeBenito |
80048c |
can_exec(lvm_t, lvm_exec_t)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
1bde83 |
# Creating lock files
|
|
Chris PeBenito |
0fd9dc |
allow lvm_t lvm_lock_t:dir rw_dir_perms;
|
|
Chris PeBenito |
80048c |
allow lvm_t lvm_lock_t:file create_file_perms;
|
|
Chris PeBenito |
9d5949 |
files_filetrans_lock(lvm_t,lvm_lock_t)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
a1fcff |
allow lvm_t lvm_var_run_t:file create_file_perms;
|
|
Chris PeBenito |
a1fcff |
allow lvm_t lvm_var_run_t:dir create_dir_perms;
|
|
Chris PeBenito |
9d5949 |
files_filetrans_pid(lvm_t,lvm_var_run_t)
|
|
Chris PeBenito |
a1fcff |
|
|
Chris PeBenito |
80048c |
allow lvm_t lvm_etc_t:file r_file_perms;
|
|
Chris PeBenito |
80048c |
allow lvm_t lvm_etc_t:lnk_file r_file_perms;
|
|
Chris PeBenito |
1bde83 |
# Write to /etc/lvm, /etc/lvmtab, /etc/lvmtab.d
|
|
Chris PeBenito |
80048c |
allow lvm_t lvm_etc_t:dir rw_dir_perms;
|
|
Chris PeBenito |
80048c |
allow lvm_t lvm_metadata_t:file create_file_perms;
|
|
Chris PeBenito |
80048c |
allow lvm_t lvm_metadata_t:dir rw_dir_perms;
|
|
Chris PeBenito |
1bde83 |
type_transition lvm_t lvm_etc_t:file lvm_metadata_t;
|
|
Chris PeBenito |
9d5949 |
files_filetrans_etc(lvm_t,lvm_metadata_t,file)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
1bde83 |
kernel_read_system_state(lvm_t)
|
|
Chris PeBenito |
445522 |
kernel_read_kernel_sysctls(lvm_t)
|
|
Chris PeBenito |
d35c62 |
# Read system variables in /proc/sys
|
|
Chris PeBenito |
445522 |
kernel_read_kernel_sysctls(lvm_t)
|
|
Chris PeBenito |
d35c62 |
# it has no reason to need this
|
|
Chris PeBenito |
445522 |
kernel_dontaudit_getattr_core_if(lvm_t)
|
|
Chris PeBenito |
d35c62 |
|
|
Chris PeBenito |
5e0da6 |
selinux_get_fs_mount(lvm_t)
|
|
Chris PeBenito |
5e0da6 |
selinux_validate_context(lvm_t)
|
|
Chris PeBenito |
5e0da6 |
selinux_compute_access_vector(lvm_t)
|
|
Chris PeBenito |
5e0da6 |
selinux_compute_create_context(lvm_t)
|
|
Chris PeBenito |
5e0da6 |
selinux_compute_relabel_context(lvm_t)
|
|
Chris PeBenito |
5e0da6 |
selinux_compute_user_contexts(lvm_t)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
207c47 |
dev_create_generic_chr_files(lvm_t)
|
|
Karl MacMillan |
f0c985 |
dev_read_rand(lvm_t)
|
|
Karl MacMillan |
f0c985 |
dev_read_urand(lvm_t)
|
|
Karl MacMillan |
f0c985 |
dev_rw_lvm_control(lvm_t)
|
|
Karl MacMillan |
f0c985 |
dev_manage_generic_symlinks(lvm_t)
|
|
Chris PeBenito |
207c47 |
dev_relabel_generic_dev_dirs(lvm_t)
|
|
Chris PeBenito |
207c47 |
dev_manage_generic_blk_files(lvm_t)
|
|
Chris PeBenito |
d35c62 |
# Read /sys/block. Device mapper metadata is kept there.
|
|
Chris PeBenito |
c3a05c |
dev_read_sysfs(lvm_t)
|
|
Chris PeBenito |
783b38 |
# cjp: this has no effect since LVM does not
|
|
Chris PeBenito |
783b38 |
# have lnk_file relabelto for anything else.
|
|
Chris PeBenito |
783b38 |
# perhaps this should be blk_files?
|
|
Chris PeBenito |
783b38 |
dev_relabel_generic_symlinks(lvm_t)
|
|
Chris PeBenito |
1bde83 |
# LVM (vgscan) scans for devices by stating every file in /dev and applying a regex...
|
|
Chris PeBenito |
cf6a7d |
dev_dontaudit_read_all_chr_files(lvm_t)
|
|
Chris PeBenito |
cf6a7d |
dev_dontaudit_read_all_blk_files(lvm_t)
|
|
Chris PeBenito |
207c47 |
dev_dontaudit_getattr_generic_chr_files(lvm_t)
|
|
Chris PeBenito |
207c47 |
dev_dontaudit_getattr_generic_blk_files(lvm_t)
|
|
Chris PeBenito |
207c47 |
dev_dontaudit_getattr_generic_pipes(lvm_t)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
0fd9dc |
fs_getattr_xattr_fs(lvm_t)
|
|
Chris PeBenito |
ab940a |
fs_search_auto_mountpoints(lvm_t)
|
|
Chris PeBenito |
a52492 |
fs_read_tmpfs_symlinks(lvm_t)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
783b38 |
storage_relabel_fixed_disk(lvm_t)
|
|
Chris PeBenito |
f5c42b |
# LVM creates block devices in /dev/mapper or /dev/<vg>
|
|
Chris PeBenito |
f5c42b |
# depending on its version
|
|
Chris PeBenito |
f5c42b |
# LVM(2) needs to create directores (/dev/mapper, /dev/<vg>)
|
|
Chris PeBenito |
f5c42b |
# and links from /dev/<vg> to /dev/mapper/<vg>-<lv>
|
|
Chris PeBenito |
8fd367 |
storage_create_fixed_disk(lvm_t)
|
|
Chris PeBenito |
f5c42b |
# Access raw devices and old /dev/lvm (c 109,0). Is this needed?
|
|
Chris PeBenito |
f5c42b |
storage_manage_fixed_disk(lvm_t)
|
|
Chris PeBenito |
f5c42b |
|
|
Chris PeBenito |
783b38 |
term_dontaudit_getattr_all_user_ttys(lvm_t)
|
|
Chris PeBenito |
1815ba |
term_dontaudit_getattr_pty_dirs(lvm_t)
|
|
Chris PeBenito |
783b38 |
|
|
Chris PeBenito |
c9428d |
corecmd_search_sbin(lvm_t)
|
|
Chris PeBenito |
1815ba |
corecmd_dontaudit_getattr_sbin_files(lvm_t)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
c9428d |
domain_use_wide_inherit_fd(lvm_t)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
8fd367 |
files_read_etc_files(lvm_t)
|
|
Chris PeBenito |
c9428d |
files_read_etc_runtime_files(lvm_t)
|
|
Chris PeBenito |
3b857e |
# for when /usr is not mounted:
|
|
Chris PeBenito |
9e04f5 |
files_dontaudit_search_isid_type_dirs(lvm_t)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
c9428d |
init_use_fd(lvm_t)
|
|
Chris PeBenito |
c9428d |
init_dontaudit_getattr_initctl(lvm_t)
|
|
Chris PeBenito |
1815ba |
init_use_script_ptys(lvm_t)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
c9428d |
libs_use_ld_so(lvm_t)
|
|
Chris PeBenito |
c9428d |
libs_use_shared_libs(lvm_t)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
c9428d |
logging_send_syslog_msg(lvm_t)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
1bde83 |
miscfiles_read_localization(lvm_t)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
5e0da6 |
seutil_read_config(lvm_t)
|
|
Chris PeBenito |
5e0da6 |
seutil_read_file_contexts(lvm_t)
|
|
Chris PeBenito |
ebdc3b |
seutil_search_default_contexts(lvm_t)
|
|
Chris PeBenito |
8fd367 |
seutil_sigchld_newrole(lvm_t)
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
254bbc |
ifdef(`distro_redhat',`
|
|
Chris PeBenito |
129318 |
# this is from the initrd:
|
|
Chris PeBenito |
9e04f5 |
files_rw_isid_type_dirs(lvm_t)
|
|
Chris PeBenito |
129318 |
')
|
|
Chris PeBenito |
129318 |
|
|
Chris PeBenito |
254bbc |
ifdef(`targeted_policy', `
|
|
Chris PeBenito |
1815ba |
term_dontaudit_use_unallocated_ttys(lvm_t)
|
|
Chris PeBenito |
1815ba |
term_dontaudit_use_generic_ptys(lvm_t)
|
|
Chris PeBenito |
d115b2 |
|
|
Chris PeBenito |
9e04f5 |
files_dontaudit_read_root_files(lvm_t)
|
|
Chris PeBenito |
d115b2 |
')
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
132880 |
optional_policy(`bootloader',`
|
|
Chris PeBenito |
1815ba |
bootloader_rw_tmp_files(lvm_t)
|
|
Chris PeBenito |
1bde83 |
')
|
|
Chris PeBenito |
1bde83 |
|
|
Chris PeBenito |
132880 |
optional_policy(`gpm',`
|
|
Chris PeBenito |
f862c3 |
gpm_dontaudit_getattr_gpmctl(lvm_t)
|
|
Chris PeBenito |
f862c3 |
')
|
|
Chris PeBenito |
f862c3 |
|
|
Chris PeBenito |
132880 |
optional_policy(`udev',`
|
|
Chris PeBenito |
c9428d |
udev_read_db(lvm_t)
|
|
Chris PeBenito |
1bde83 |
')
|