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 763c44
fs_get_persistent_fs_attributes(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 763c44
fs_relabelfrom_persistent_fs(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 d490eb
files_manage_runtime_system_config(mount_t)
Chris PeBenito a2d824
files_mount_on_all_mountpoints(mount_t)
Chris PeBenito 763c44
files_unmount_root_fs(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 763c44
files_mount_all_file_type_fs(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 254bbc
ifdef(`distro_redhat',`
Chris PeBenito 763c44
	fs_use_tmpfs_character_devices(mount_t)
Chris PeBenito 0c73cd
	allow mount_t tmpfs_t:dir mounton;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	optional_policy(`authlogin.te',`
Chris PeBenito 0c73cd
		authlogin_pam_console_read_runtime_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 daa0e0
optional_policy(`portmap.te', `
Chris PeBenito 0c73cd
	# for nfs
Chris PeBenito 0c73cd
	#can_ypbind(mount_t)
Chris PeBenito 0c73cd
	#allow portmap_t mount_t:udp_socket { sendto recvfrom };
Chris PeBenito 0c73cd
	#allow mount_t portmap_t:udp_socket { sendto recvfrom };
Chris PeBenito 0c73cd
	#allow mount_t rpc_pipefs_t:dir search;
Chris PeBenito 0c73cd
	corenetwork_sendrecv_tcp_on_all_interfaces(mount_t)
Chris PeBenito 0c73cd
	corenetwork_sendrecv_raw_on_all_interfaces(mount_t)
Chris PeBenito 0c73cd
	corenetwork_sendrecv_udp_on_all_interfaces(mount_t)
Chris PeBenito 0c73cd
	corenetwork_sendrecv_tcp_on_all_nodes(mount_t)
Chris PeBenito 0c73cd
	corenetwork_sendrecv_raw_on_all_nodes(mount_t)
Chris PeBenito 0c73cd
	corenetwork_sendrecv_udp_on_all_nodes(mount_t)
Chris PeBenito 0c73cd
	corenetwork_sendrecv_tcp_on_all_ports(mount_t)
Chris PeBenito 0c73cd
	corenetwork_sendrecv_udp_on_all_ports(mount_t)
Chris PeBenito 0c73cd
	corenetwork_bind_tcp_on_all_nodes(mount_t)
Chris PeBenito 0c73cd
	corenetwork_bind_udp_on_all_nodes(mount_t)
Chris PeBenito 0c73cd
	corenetwork_bind_tcp_on_general_port(mount_t)
Chris PeBenito 0c73cd
	corenetwork_bind_udp_on_general_port(mount_t)
Chris PeBenito 0c73cd
	corenetwork_bind_tcp_on_reserved_port(mount_t)
Chris PeBenito 0c73cd
	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