Chris PeBenito 3016a9
# Copyright (C) 2005 Tresys Technology, LLC
Chris PeBenito 3016a9
Chris PeBenito 3016a9
type mount_t;
Chris PeBenito 3016a9
type mount_exec_t;
Chris PeBenito ff3138
init_make_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 38e24a
files_make_temporary_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 3016a9
allow mount_t self:capability { ipc_lock sys_rawio sys_admin dac_override chown };
Chris PeBenito 3016a9
Chris PeBenito 3016a9
allow mount_t mount_tmp_t:file { getattr create read setattr write setattr unlink };
Chris PeBenito 3016a9
allow mount_t mount_tmp_t:dir { getattr search create read setattr write setattr unlink rmdir };
Chris PeBenito 3016a9
Chris PeBenito 3016a9
kernel_read_system_state(mount_t)
Chris PeBenito a2d824
kernel_ignore_use_file_descriptors(mount_t)
Chris PeBenito 3016a9
Chris PeBenito 3016a9
devices_get_all_block_device_attributes(mount_t)
Chris PeBenito 3016a9
devices_list_device_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 3016a9
filesystem_get_persistent_filesystem_attributes(mount_t)
Chris PeBenito 3016a9
filesystem_mount_all_filesystems(mount_t)
Chris PeBenito 3016a9
filesystem_unmount_all_filesystems(mount_t)
Chris PeBenito 3016a9
filesystem_remount_all_filesystems(mount_t)
Chris PeBenito a2d824
files_unmount_root_filesystem(mount_t)
Chris PeBenito 3016a9
Chris PeBenito 3016a9
terminal_use_console(mount_t)
Chris PeBenito 3016a9
Chris PeBenito a2d824
corenetwork_ignore_bind_tcp_on_all_reserved_ports(mount_t)
Chris PeBenito a2d824
corenetwork_ignore_bind_udp_on_all_reserved_ports(mount_t)
Chris PeBenito a2d824
Chris PeBenito a2d824
init_use_file_descriptors(mount_t)
Chris PeBenito a2d824
init_script_use_pseudoterminal(mount_t)
Chris PeBenito a2d824
Chris PeBenito a2d824
domain_use_widely_inheritable_file_descriptors(mount_t)
Chris PeBenito a2d824
Chris PeBenito 3016a9
files_search_all_directories(mount_t)
Chris PeBenito 3016a9
files_create_private_tmp_data(mount_t,mount_tmp_t,{ file dir })
Chris PeBenito 3016a9
files_read_general_system_config(mount_t)
Chris PeBenito 3016a9
files_create_runtime_system_config(mount_t)
Chris PeBenito a2d824
files_mount_on_all_mountpoints(mount_t)
Chris PeBenito 3016a9
Chris PeBenito 3016a9
libraries_use_dynamic_loader(mount_t)
Chris PeBenito 3016a9
libraries_read_shared_libraries(mount_t)
Chris PeBenito 3016a9
Chris PeBenito 3016a9
# required for mount.smbfs
Chris PeBenito 3016a9
corecommands_execute_system_programs(mount_t)
Chris PeBenito 3016a9
corecommands_execute_general_programs(mount_t)
Chris PeBenito 3016a9
Chris PeBenito 3016a9
logging_send_system_log_message(mount_t)
Chris PeBenito 3016a9
Chris PeBenito 3016a9
miscfiles_read_localization(mount_t)
Chris PeBenito 3016a9
Chris PeBenito 3016a9
ifdef(`TODO',`
Chris PeBenito 3016a9
# Mount, remount and unmount file systems.
Chris PeBenito 3016a9
# nfsv4 has a filesystem to mount for its userspace daemons
Chris PeBenito 3016a9
allow mount_t var_lib_nfs_t:dir mounton;
Chris PeBenito 3016a9
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
# TODO: Probably need a macro for reading/unlinking files
Chris PeBenito 3016a9
# for when /etc/mtab loses its type
Chris PeBenito 3016a9
allow mount_t file_t:file { getattr read unlink };
Chris PeBenito 3016a9
Chris PeBenito 3016a9
# TODO: Need macro for granting relabelto, relabelfrom
Chris PeBenito 3016a9
allow mount_t fs_t:filesystem relabelfrom;
Chris PeBenito 3016a9
Chris PeBenito 3016a9
# This rule needs to be generalized.  Only admin, initrc should have it.
Chris PeBenito 3016a9
allow mount_t file_type:filesystem { unmount mount relabelto };
Chris PeBenito 3016a9
Chris PeBenito 3016a9
allow mount_t userdomain:fd use;
Chris PeBenito 3016a9
Chris PeBenito 3016a9
domain_auto_trans(sysadm_t, mount_exec_t, mount_t)
Chris PeBenito 3016a9
role sysadm_r types mount_t;
Chris PeBenito 3016a9
allow mount_t sysadm_tty_device_t:chr_file { getattr read write ioctl };
Chris PeBenito 3016a9
allow mount_t sysadm_devpts_t:chr_file { getattr read write };
Chris PeBenito 3016a9
ifdef(`gnome-pty-helper.te', `
Chris PeBenito 3016a9
allow mount_t sysadm_gph_t:fd use;
Chris PeBenito 3016a9
')
Chris PeBenito 3016a9
Chris PeBenito 25baab
tunable_policy(`distro_redhat',`
Chris PeBenito 25baab
optional_policy(`authlogin.te',`
Chris PeBenito 3016a9
r_dir_file($2_t,pam_var_console_t)
Chris PeBenito 3016a9
# mount config by default sets fscontext=removable_t
Chris PeBenito 3016a9
allow $2_t dosfs_t:filesystem relabelfrom;
Chris PeBenito 25baab
') dnl end authlogin
Chris PeBenito 3016a9
') dnl end distro_redhat
Chris PeBenito 3016a9
Chris PeBenito 25baab
optional_policy(`rhgb.te', `
Chris PeBenito 3016a9
allow mount_t rhgb_t:process sigchld;
Chris PeBenito 3016a9
allow mount_t rhgb_t:fd use;
Chris PeBenito 3016a9
allow mount_t rhgb_t:fifo_file { read write };
Chris PeBenito 3016a9
')
Chris PeBenito 3016a9
Chris PeBenito 25baab
tunable_policy(`distro_redhat', `
Chris PeBenito 3016a9
allow mount_t tmpfs_t:chr_file { read write };
Chris PeBenito 3016a9
allow mount_t tmpfs_t:dir mounton;
Chris PeBenito 3016a9
')
Chris PeBenito 3016a9
Chris PeBenito 25baab
optional_policy(`automount.te', `
Chris PeBenito 3016a9
allow mount_t autofs_t:dir read;
Chris PeBenito 3016a9
')
Chris PeBenito 3016a9
Chris PeBenito 25baab
optional_policy(`portmap.te', `
Chris PeBenito 3016a9
# for nfs
Chris PeBenito 3016a9
can_ypbind(mount_t)
Chris PeBenito 1e5c2a
can_udp_send(mount_t, portmap_t)
Chris PeBenito 1e5c2a
can_udp_send(portmap_t, mount_t)
Chris PeBenito 1e5c2a
allow mount_t rpc_pipefs_t:dir search;
Chris PeBenito 1e5c2a
corenetwork_network_tcp_on_all_interfaces(mount_t)
Chris PeBenito 1e5c2a
corenetwork_network_raw_on_all_interfaces(mount_t)
Chris PeBenito 1e5c2a
corenetwork_network_udp_on_all_interfaces(mount_t)
Chris PeBenito 1e5c2a
corenetwork_network_tcp_on_all_nodes(mount_t)
Chris PeBenito 1e5c2a
corenetwork_network_raw_on_all_nodes(mount_t)
Chris PeBenito 1e5c2a
corenetwork_network_udp_on_all_nodes(mount_t)
Chris PeBenito 1e5c2a
corenetwork_network_tcp_on_all_ports(mount_t)
Chris PeBenito 1e5c2a
corenetwork_network_udp_on_all_ports(mount_t)
Chris PeBenito 1e5c2a
corenetwork_bind_tcp_on_all_nodes(mount_t)
Chris PeBenito 1e5c2a
corenetwork_bind_udp_on_all_nodes(mount_t)
Chris PeBenito 3016a9
corenetwork_bind_tcp_on_general_port(mount_t)
Chris PeBenito 3016a9
corenetwork_bind_udp_on_general_port(mount_t)
Chris PeBenito 3016a9
corenetwork_bind_tcp_on_reserved_port(mount_t)
Chris PeBenito 3016a9
corenetwork_bind_udp_on_reserved_port(mount_t)
Chris PeBenito 3016a9
')
Chris PeBenito 3016a9
Chris PeBenito 3016a9
') dnl endif TODO