2005-04-26 21:12:52 +00:00
|
|
|
|
2005-12-12 21:47:43 +00:00
|
|
|
policy_module(mount,1.1.2)
|
2005-06-20 17:41:29 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2005-09-26 20:26:32 +00:00
|
|
|
type mount_t;
|
2005-04-26 21:12:52 +00:00
|
|
|
type mount_exec_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
init_system_domain(mount_t,mount_exec_t)
|
2005-05-05 18:30:00 +00:00
|
|
|
role system_r types mount_t;
|
2005-04-26 21:12:52 +00:00
|
|
|
|
|
|
|
type mount_tmp_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_tmp_file(mount_tmp_t)
|
2005-04-26 21:12:52 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# mount local policy
|
|
|
|
#
|
|
|
|
|
2005-10-13 20:59:36 +00:00
|
|
|
allow mount_t self:capability { ipc_lock sys_rawio sys_admin dac_override chown sys_tty_config };
|
2005-04-26 21:12:52 +00:00
|
|
|
|
2005-06-09 18:08:26 +00:00
|
|
|
allow mount_t mount_tmp_t:file create_file_perms;
|
|
|
|
allow mount_t mount_tmp_t:dir create_dir_perms;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_create_tmp_files(mount_t,mount_tmp_t,{ file dir })
|
2005-04-26 21:12:52 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(mount_t)
|
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
corenet_dontaudit_tcp_bind_all_reserved_ports(mount_t)
|
|
|
|
corenet_dontaudit_udp_bind_all_reserved_ports(mount_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_getattr_all_blk_files(mount_t)
|
|
|
|
dev_list_all_dev_nodes(mount_t)
|
2005-04-26 21:12:52 +00:00
|
|
|
|
|
|
|
storage_raw_read_fixed_disk(mount_t)
|
|
|
|
storage_raw_write_fixed_disk(mount_t)
|
|
|
|
storage_raw_read_removable_device(mount_t)
|
|
|
|
storage_raw_write_removable_device(mount_t)
|
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_getattr_xattr_fs(mount_t)
|
2005-06-08 13:12:00 +00:00
|
|
|
fs_mount_all_fs(mount_t)
|
|
|
|
fs_unmount_all_fs(mount_t)
|
|
|
|
fs_remount_all_fs(mount_t)
|
2005-09-16 21:20:37 +00:00
|
|
|
fs_relabelfrom_all_fs(mount_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
fs_search_auto_mountpoints(mount_t)
|
2005-09-15 21:03:29 +00:00
|
|
|
fs_use_tmpfs_chr_dev(mount_t)
|
2005-04-26 21:12:52 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
term_use_console(mount_t)
|
2005-04-26 21:12:52 +00:00
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
# required for mount.smbfs
|
2005-06-13 17:35:46 +00:00
|
|
|
corecmd_exec_sbin(mount_t)
|
|
|
|
corecmd_exec_bin(mount_t)
|
2005-04-28 21:41:09 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_use_wide_inherit_fd(mount_t)
|
2005-04-28 21:41:09 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
files_search_all_dirs(mount_t)
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(mount_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_manage_etc_runtime_files(mount_t)
|
|
|
|
files_mounton_all_mountpoints(mount_t)
|
|
|
|
files_unmount_rootfs(mount_t)
|
2005-05-24 15:55:57 +00:00
|
|
|
# These rules need to be generalized. Only admin, initrc should have it:
|
2005-06-08 13:12:00 +00:00
|
|
|
files_relabelto_all_file_type_fs(mount_t)
|
|
|
|
files_mount_all_file_type_fs(mount_t)
|
2005-09-02 20:55:17 +00:00
|
|
|
files_unmount_all_file_type_fs(mount_t)
|
2005-07-11 19:02:50 +00:00
|
|
|
# for when /etc/mtab loses its type
|
|
|
|
# cjp: this seems wrong, the type should probably be etc
|
|
|
|
files_read_isid_type_file(mount_t)
|
2005-04-26 21:12:52 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
init_use_fd(mount_t)
|
|
|
|
init_use_script_pty(mount_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
libs_use_ld_so(mount_t)
|
|
|
|
libs_use_shared_libs(mount_t)
|
2005-04-26 21:12:52 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(mount_t)
|
2005-04-26 21:12:52 +00:00
|
|
|
|
|
|
|
miscfiles_read_localization(mount_t)
|
|
|
|
|
2005-09-26 20:26:32 +00:00
|
|
|
mls_file_read_up(mount_t)
|
|
|
|
mls_file_write_down(mount_t)
|
|
|
|
|
2005-09-15 21:03:29 +00:00
|
|
|
sysnet_use_portmap(mount_t)
|
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
userdom_use_all_user_fd(mount_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`distro_redhat',`
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`authlogin',`
|
2005-06-13 17:35:46 +00:00
|
|
|
auth_read_pam_console_data(mount_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
# mount config by default sets fscontext=removable_t
|
2005-06-08 13:12:00 +00:00
|
|
|
fs_relabelfrom_dos_fs(mount_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
')
|
|
|
|
')
|
2005-05-19 21:06:06 +00:00
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`portmap',`
|
2005-06-03 12:25:14 +00:00
|
|
|
# for nfs
|
2005-12-12 21:47:43 +00:00
|
|
|
corenet_non_ipsec_sendrecv(mount_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
corenet_tcp_sendrecv_all_if(mount_t)
|
|
|
|
corenet_raw_sendrecv_all_if(mount_t)
|
|
|
|
corenet_udp_sendrecv_all_if(mount_t)
|
|
|
|
corenet_tcp_sendrecv_all_nodes(mount_t)
|
|
|
|
corenet_raw_sendrecv_all_nodes(mount_t)
|
|
|
|
corenet_udp_sendrecv_all_nodes(mount_t)
|
|
|
|
corenet_tcp_sendrecv_all_ports(mount_t)
|
|
|
|
corenet_udp_sendrecv_all_ports(mount_t)
|
|
|
|
corenet_tcp_bind_all_nodes(mount_t)
|
|
|
|
corenet_udp_bind_all_nodes(mount_t)
|
|
|
|
corenet_tcp_bind_generic_port(mount_t)
|
|
|
|
corenet_udp_bind_generic_port(mount_t)
|
|
|
|
corenet_tcp_bind_reserved_port(mount_t)
|
|
|
|
corenet_udp_bind_reserved_port(mount_t)
|
2005-09-15 21:03:29 +00:00
|
|
|
corenet_tcp_connect_all_ports(mount_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
|
2005-12-12 21:47:43 +00:00
|
|
|
fs_search_rpc_dirs(mount_t)
|
|
|
|
|
|
|
|
portmap_udp_sendrecv(mount_t)
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nis',`
|
2005-06-27 16:30:55 +00:00
|
|
|
nis_use_ypbind(mount_t)
|
|
|
|
')
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`apm',`
|
2005-10-10 18:11:46 +00:00
|
|
|
apm_use_fd(mount_t)
|
|
|
|
')
|
|
|
|
|
2005-07-12 20:34:24 +00:00
|
|
|
# for kernel package installation
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`rpm',`
|
2005-07-12 20:34:24 +00:00
|
|
|
rpm_rw_pipe(mount_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`samba',`
|
2005-09-14 18:33:53 +00:00
|
|
|
samba_domtrans_smbmount(mount_t)
|
|
|
|
')
|
|
|
|
|
2005-04-26 21:12:52 +00:00
|
|
|
ifdef(`TODO',`
|
|
|
|
# TODO: Need to examine this further. Not sure how to handle this
|
2005-05-05 14:08:26 +00:00
|
|
|
#type sysadm_mount_source_t, file_type, sysadmfile, $1_file_type;
|
|
|
|
#allow sysadm_t sysadm_mount_source_t:file create_file_perms;
|
|
|
|
#allow sysadm_t sysadm_mount_source_t:file { relabelto relabelfrom };
|
|
|
|
#allow mount_t sysadm_mount_source_t:file rw_file_perms;
|
2005-04-26 21:12:52 +00:00
|
|
|
|
|
|
|
# for when /etc/mtab loses its type
|
2005-07-11 19:02:50 +00:00
|
|
|
allow mount_t file_t:file unlink;
|
2005-04-26 21:12:52 +00:00
|
|
|
') dnl endif TODO
|