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 daa0e0
corenetwork_ignore_bind_tcp_on_all_reserved_ports(mount_t)
Chris PeBenito daa0e0
corenetwork_ignore_bind_udp_on_all_reserved_ports(mount_t)
Chris PeBenito daa0e0
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 dc771f
filesystem_relabelfrom_persistent_filesystem(mount_t)
Chris PeBenito 3016a9
Chris PeBenito 3016a9
terminal_use_console(mount_t)
Chris PeBenito 3016a9
Chris PeBenito daa0e0
# required for mount.smbfs
Chris PeBenito daa0e0
corecommands_execute_system_programs(mount_t)
Chris PeBenito daa0e0
corecommands_execute_general_programs(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 dc771f
files_unmount_root_filesystem(mount_t)
Chris PeBenito dc771f
# These rules need to be generalized.  Only admin, initrc should have it:
Chris PeBenito dc771f
files_relabelto_all_file_type_filesystems(mount_t)
Chris PeBenito dc771f
files_mount_all_file_type_filesystems(mount_t)
Chris PeBenito dc771f
files_mount_all_file_type_filesystems(mount_t)
Chris PeBenito 3016a9
Chris PeBenito daa0e0
init_use_file_descriptors(mount_t)
Chris PeBenito daa0e0
init_script_use_pseudoterminal(mount_t)
Chris PeBenito daa0e0
Chris PeBenito 3016a9
libraries_use_dynamic_loader(mount_t)
Chris PeBenito dd14d0
libraries_use_shared_libraries(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 daa0e0
userdomain_use_all_users_file_descriptors(mount_t)
Chris PeBenito daa0e0
Chris PeBenito daa0e0
tunable_policy(`distro_redhat',`
Chris PeBenito daa0e0
filesystem_use_tmpfs_character_devices(mount_t)
Chris PeBenito daa0e0
allow mount_t tmpfs_t:dir mounton;
Chris PeBenito daa0e0
Chris PeBenito daa0e0
optional_policy(`authlogin.te',`
Chris PeBenito daa0e0
authlogin_pam_console_read_runtime_data(mount_t)
Chris PeBenito daa0e0
# mount config by default sets fscontext=removable_t
Chris PeBenito dc771f
filesystem_relabelfrom_dos_filesystem(mount_t)
Chris PeBenito daa0e0
') dnl end authlogin
Chris PeBenito daa0e0
Chris PeBenito daa0e0
') dnl end distro_redhat
Chris PeBenito daa0e0
Chris PeBenito daa0e0
optional_policy(`portmap.te', `
Chris PeBenito daa0e0
# for nfs
Chris PeBenito daa0e0
#can_ypbind(mount_t)
Chris PeBenito daa0e0
#allow portmap_t mount_t:udp_socket { sendto recvfrom };
Chris PeBenito daa0e0
#allow mount_t portmap_t:udp_socket { sendto recvfrom };
Chris PeBenito daa0e0
#allow mount_t rpc_pipefs_t:dir search;
Chris PeBenito daa0e0
corenetwork_network_tcp_on_all_interfaces(mount_t)
Chris PeBenito daa0e0
corenetwork_network_raw_on_all_interfaces(mount_t)
Chris PeBenito daa0e0
corenetwork_network_udp_on_all_interfaces(mount_t)
Chris PeBenito daa0e0
corenetwork_network_tcp_on_all_nodes(mount_t)
Chris PeBenito daa0e0
corenetwork_network_raw_on_all_nodes(mount_t)
Chris PeBenito daa0e0
corenetwork_network_udp_on_all_nodes(mount_t)
Chris PeBenito daa0e0
corenetwork_network_tcp_on_all_ports(mount_t)
Chris PeBenito daa0e0
corenetwork_network_udp_on_all_ports(mount_t)
Chris PeBenito daa0e0
corenetwork_bind_tcp_on_all_nodes(mount_t)
Chris PeBenito daa0e0
corenetwork_bind_udp_on_all_nodes(mount_t)
Chris PeBenito daa0e0
corenetwork_bind_tcp_on_general_port(mount_t)
Chris PeBenito daa0e0
corenetwork_bind_udp_on_general_port(mount_t)
Chris PeBenito daa0e0
corenetwork_bind_tcp_on_reserved_port(mount_t)
Chris PeBenito daa0e0
corenetwork_bind_udp_on_reserved_port(mount_t)
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito 3016a9
ifdef(`TODO',`
Chris PeBenito daa0e0
# this goes to the nfs/rpc module
Chris PeBenito daa0e0
files_make_mountpoint(var_lib_nfs_t)
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
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
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
optional_policy(`automount.te', `
Chris PeBenito 3016a9
allow mount_t autofs_t:dir read;
Chris PeBenito 3016a9
')
Chris PeBenito 3016a9
Chris PeBenito 3016a9
') dnl endif TODO