|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
bb4372 |
policy_module(mount,1.1.2)
|
|
Chris PeBenito |
7a2f20 |
|
|
Chris PeBenito |
7a2f20 |
########################################
|
|
Chris PeBenito |
7a2f20 |
#
|
|
Chris PeBenito |
7a2f20 |
# Declarations
|
|
Chris PeBenito |
7a2f20 |
#
|
|
Chris PeBenito |
7a2f20 |
|
|
Chris PeBenito |
f0574f |
type mount_t;
|
|
Chris PeBenito |
3016a9 |
type mount_exec_t;
|
|
Chris PeBenito |
c9428d |
init_system_domain(mount_t,mount_exec_t)
|
|
Chris PeBenito |
bbd6a6 |
role system_r types mount_t;
|
|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
3016a9 |
type mount_tmp_t;
|
|
Chris PeBenito |
c9428d |
files_tmp_file(mount_tmp_t)
|
|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
3016a9 |
########################################
|
|
Chris PeBenito |
3016a9 |
#
|
|
Chris PeBenito |
3016a9 |
# mount local policy
|
|
Chris PeBenito |
3016a9 |
#
|
|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
77f6e2 |
allow mount_t self:capability { ipc_lock sys_rawio sys_admin dac_override chown sys_tty_config };
|
|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
cc41a9 |
allow mount_t mount_tmp_t:file create_file_perms;
|
|
Chris PeBenito |
cc41a9 |
allow mount_t mount_tmp_t:dir create_dir_perms;
|
|
Chris PeBenito |
c9428d |
files_create_tmp_files(mount_t,mount_tmp_t,{ file dir })
|
|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
3016a9 |
kernel_read_system_state(mount_t)
|
|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
0fd9dc |
corenet_dontaudit_tcp_bind_all_reserved_ports(mount_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_dontaudit_udp_bind_all_reserved_ports(mount_t)
|
|
Chris PeBenito |
daa0e0 |
|
|
Karl MacMillan |
f0c985 |
dev_getattr_all_blk_files(mount_t)
|
|
Karl MacMillan |
f0c985 |
dev_list_all_dev_nodes(mount_t)
|
|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
3016a9 |
storage_raw_read_fixed_disk(mount_t)
|
|
Chris PeBenito |
3016a9 |
storage_raw_write_fixed_disk(mount_t)
|
|
Chris PeBenito |
3016a9 |
storage_raw_read_removable_device(mount_t)
|
|
Chris PeBenito |
3016a9 |
storage_raw_write_removable_device(mount_t)
|
|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
0fd9dc |
fs_getattr_xattr_fs(mount_t)
|
|
Chris PeBenito |
763c44 |
fs_mount_all_fs(mount_t)
|
|
Chris PeBenito |
763c44 |
fs_unmount_all_fs(mount_t)
|
|
Chris PeBenito |
763c44 |
fs_remount_all_fs(mount_t)
|
|
Chris PeBenito |
cf6a7d |
fs_relabelfrom_all_fs(mount_t)
|
|
Chris PeBenito |
ab940a |
fs_search_auto_mountpoints(mount_t)
|
|
Chris PeBenito |
98a8ea |
fs_use_tmpfs_chr_dev(mount_t)
|
|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
0fd9dc |
term_use_console(mount_t)
|
|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
daa0e0 |
# required for mount.smbfs
|
|
Chris PeBenito |
c9428d |
corecmd_exec_sbin(mount_t)
|
|
Chris PeBenito |
c9428d |
corecmd_exec_bin(mount_t)
|
|
Chris PeBenito |
a2d824 |
|
|
Chris PeBenito |
c9428d |
domain_use_wide_inherit_fd(mount_t)
|
|
Chris PeBenito |
a2d824 |
|
|
Chris PeBenito |
c9428d |
files_search_all_dirs(mount_t)
|
|
Chris PeBenito |
8fd367 |
files_read_etc_files(mount_t)
|
|
Chris PeBenito |
c9428d |
files_manage_etc_runtime_files(mount_t)
|
|
Chris PeBenito |
c9428d |
files_mounton_all_mountpoints(mount_t)
|
|
Chris PeBenito |
c9428d |
files_unmount_rootfs(mount_t)
|
|
Chris PeBenito |
dc771f |
# These rules need to be generalized. Only admin, initrc should have it:
|
|
Chris PeBenito |
763c44 |
files_relabelto_all_file_type_fs(mount_t)
|
|
Chris PeBenito |
763c44 |
files_mount_all_file_type_fs(mount_t)
|
|
Chris PeBenito |
ce1b44 |
files_unmount_all_file_type_fs(mount_t)
|
|
Chris PeBenito |
ae9e27 |
# for when /etc/mtab loses its type
|
|
Chris PeBenito |
ae9e27 |
# cjp: this seems wrong, the type should probably be etc
|
|
Chris PeBenito |
ae9e27 |
files_read_isid_type_file(mount_t)
|
|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
c9428d |
init_use_fd(mount_t)
|
|
Chris PeBenito |
c9428d |
init_use_script_pty(mount_t)
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
c9428d |
libs_use_ld_so(mount_t)
|
|
Chris PeBenito |
c9428d |
libs_use_shared_libs(mount_t)
|
|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
c9428d |
logging_send_syslog_msg(mount_t)
|
|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
3016a9 |
miscfiles_read_localization(mount_t)
|
|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
f0574f |
mls_file_read_up(mount_t)
|
|
Chris PeBenito |
f0574f |
mls_file_write_down(mount_t)
|
|
Chris PeBenito |
f0574f |
|
|
Chris PeBenito |
98a8ea |
sysnet_use_portmap(mount_t)
|
|
Chris PeBenito |
98a8ea |
|
|
Chris PeBenito |
c9428d |
userdom_use_all_user_fd(mount_t)
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
254bbc |
ifdef(`distro_redhat',`
|
|
Chris PeBenito |
132880 |
optional_policy(`authlogin',`
|
|
Chris PeBenito |
c9428d |
auth_read_pam_console_data(mount_t)
|
|
Chris PeBenito |
0c73cd |
# mount config by default sets fscontext=removable_t
|
|
Chris PeBenito |
763c44 |
fs_relabelfrom_dos_fs(mount_t)
|
|
Chris PeBenito |
0c73cd |
')
|
|
Chris PeBenito |
0c73cd |
')
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
132880 |
optional_policy(`portmap',`
|
|
Chris PeBenito |
0c73cd |
# for nfs
|
|
Chris PeBenito |
bb4372 |
corenet_non_ipsec_sendrecv(mount_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_tcp_sendrecv_all_if(mount_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_raw_sendrecv_all_if(mount_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_udp_sendrecv_all_if(mount_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_tcp_sendrecv_all_nodes(mount_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_raw_sendrecv_all_nodes(mount_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_udp_sendrecv_all_nodes(mount_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_tcp_sendrecv_all_ports(mount_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_udp_sendrecv_all_ports(mount_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_tcp_bind_all_nodes(mount_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_udp_bind_all_nodes(mount_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_tcp_bind_generic_port(mount_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_udp_bind_generic_port(mount_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_tcp_bind_reserved_port(mount_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_udp_bind_reserved_port(mount_t)
|
|
Chris PeBenito |
98a8ea |
corenet_tcp_connect_all_ports(mount_t)
|
|
Chris PeBenito |
ab940a |
|
|
Chris PeBenito |
bb4372 |
fs_search_rpc_dirs(mount_t)
|
|
Chris PeBenito |
bb4372 |
|
|
Chris PeBenito |
bb4372 |
portmap_udp_sendrecv(mount_t)
|
|
Chris PeBenito |
bb4372 |
|
|
Chris PeBenito |
132880 |
optional_policy(`nis',`
|
|
Chris PeBenito |
ab940a |
nis_use_ypbind(mount_t)
|
|
Chris PeBenito |
ab940a |
')
|
|
Chris PeBenito |
daa0e0 |
')
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
132880 |
optional_policy(`apm',`
|
|
Chris PeBenito |
4483ee |
apm_use_fd(mount_t)
|
|
Chris PeBenito |
4483ee |
')
|
|
Chris PeBenito |
4483ee |
|
|
Chris PeBenito |
b24f35 |
# for kernel package installation
|
|
Chris PeBenito |
132880 |
optional_policy(`rpm',`
|
|
Chris PeBenito |
b24f35 |
rpm_rw_pipe(mount_t)
|
|
Chris PeBenito |
b24f35 |
')
|
|
Chris PeBenito |
b24f35 |
|
|
Chris PeBenito |
132880 |
optional_policy(`samba',`
|
|
Chris PeBenito |
84c922 |
samba_domtrans_smbmount(mount_t)
|
|
Chris PeBenito |
84c922 |
')
|
|
Chris PeBenito |
84c922 |
|
|
Chris PeBenito |
3016a9 |
ifdef(`TODO',`
|
|
Chris PeBenito |
3016a9 |
# TODO: Need to examine this further. Not sure how to handle this
|
|
Chris PeBenito |
f66a1a |
#type sysadm_mount_source_t, file_type, sysadmfile, $1_file_type;
|
|
Chris PeBenito |
f66a1a |
#allow sysadm_t sysadm_mount_source_t:file create_file_perms;
|
|
Chris PeBenito |
f66a1a |
#allow sysadm_t sysadm_mount_source_t:file { relabelto relabelfrom };
|
|
Chris PeBenito |
f66a1a |
#allow mount_t sysadm_mount_source_t:file rw_file_perms;
|
|
Chris PeBenito |
3016a9 |
|
|
Chris PeBenito |
3016a9 |
# for when /etc/mtab loses its type
|
|
Chris PeBenito |
ae9e27 |
allow mount_t file_t:file unlink;
|
|
Chris PeBenito |
3016a9 |
') dnl endif TODO
|