policy_module(automount,1.1.0) ######################################## # # Declarations # type automount_t; type automount_exec_t; init_daemon_domain(automount_t,automount_exec_t) type automount_var_run_t; files_pid_file(automount_var_run_t) type automount_etc_t; files_config_file(automount_etc_t) type automount_lock_t; files_lock_file(automount_lock_t) type automount_tmp_t; files_tmp_file(automount_tmp_t) files_mountpoint(automount_tmp_t) ######################################## # # Local policy # allow automount_t self:capability { net_bind_service sys_nice dac_override }; dontaudit automount_t self:capability sys_tty_config; allow automount_t self:process { signal_perms getpgid setpgid setsched }; allow automount_t self:fifo_file rw_file_perms; allow automount_t self:unix_stream_socket create_socket_perms; allow automount_t self:unix_dgram_socket create_socket_perms; allow automount_t self:tcp_socket create_stream_socket_perms; allow automount_t self:udp_socket create_socket_perms; allow automount_t automount_etc_t:file { getattr read }; # because config files can be shell scripts can_exec(automount_t, automount_etc_t) allow automount_t automount_lock_t:file create_file_perms; files_filetrans_lock(automount_t,automount_lock_t) allow automount_t automount_tmp_t:dir create_dir_perms; allow automount_t automount_tmp_t:file create_file_perms; files_filetrans_tmp(automount_t, automount_tmp_t, { file dir }) # Allow automount to create and delete directories in / and /home allow automount_t automount_tmp_t:dir create_dir_perms; files_filetrans_home(automount_t,automount_tmp_t) files_filetrans_root(automount_t,automount_tmp_t,dir) allow automount_t automount_var_run_t:file create_file_perms; allow automount_t automount_var_run_t:dir rw_dir_perms; files_filetrans_pid(automount_t,automount_var_run_t) kernel_read_kernel_sysctls(automount_t) kernel_read_fs_sysctls(automount_t) kernel_read_proc_symlinks(automount_t) kernel_read_system_state(automount_t) kernel_list_proc(automount_t) bootloader_getattr_boot_dirs(automount_t) corecmd_exec_sbin(automount_t) corecmd_exec_bin(automount_t) corecmd_exec_shell(automount_t) corenet_non_ipsec_sendrecv(automount_t) corenet_tcp_sendrecv_generic_if(automount_t) corenet_udp_sendrecv_generic_if(automount_t) corenet_raw_sendrecv_generic_if(automount_t) corenet_tcp_sendrecv_all_nodes(automount_t) corenet_udp_sendrecv_all_nodes(automount_t) corenet_raw_sendrecv_all_nodes(automount_t) corenet_tcp_sendrecv_all_ports(automount_t) corenet_udp_sendrecv_all_ports(automount_t) corenet_tcp_bind_all_nodes(automount_t) corenet_udp_bind_all_nodes(automount_t) corenet_tcp_connect_portmap_port(automount_t) corenet_tcp_connect_all_ports(automount_t) corenet_dontaudit_tcp_connect_all_reserved_ports(automount_t) dev_read_sysfs(automount_t) # for SSP dev_read_urand(automount_t) domain_use_wide_inherit_fd(automount_t) files_dontaudit_write_var_dirs(automount_t) files_search_var_lib(automount_t) files_search_mnt(automount_t) files_getattr_home_dir(automount_t) files_read_etc_files(automount_t) files_read_etc_runtime_files(automount_t) # for if the mount point is not labelled files_getattr_isid_type_dirs(automount_t) files_getattr_default_dirs(automount_t) # because config files can be shell scripts files_exec_etc_files(automount_t) fs_getattr_all_fs(automount_t) fs_getattr_all_dirs(automount_t) fs_search_auto_mountpoints(automount_t) fs_manage_auto_mountpoints(automount_t) term_dontaudit_use_console(automount_t) term_dontaudit_getattr_pty_dirs(automount_t) init_use_fd(automount_t) init_use_script_ptys(automount_t) libs_use_ld_so(automount_t) libs_use_shared_libs(automount_t) logging_send_syslog_msg(automount_t) logging_search_logs(automount_t) miscfiles_read_localization(automount_t) # Run mount in the mount_t domain. mount_domtrans(automount_t) sysnet_dns_name_resolve(automount_t) sysnet_use_ldap(automount_t) sysnet_read_config(automount_t) userdom_dontaudit_use_unpriv_user_fd(automount_t) userdom_dontaudit_search_sysadm_home_dir(automount_t) ifdef(`targeted_policy', ` files_dontaudit_read_root_files(automount_t) term_dontaudit_use_unallocated_ttys(automount_t) term_dontaudit_use_generic_ptys(automount_t) ') optional_policy(`apm',` corecmd_exec_bin(automount_t) ') optional_policy(`bind',` bind_search_cache(automount_t) ') optional_policy(`fstools',` fstools_domtrans(automount_t) ') optional_policy(`nis',` nis_use_ypbind(automount_t) ') optional_policy(`rpc',` rpc_search_nfs_state_data(automount_t) ') optional_policy(`selinuxutil',` seutil_sigchld_newrole(automount_t) ') optional_policy(`udev',` udev_read_db(automount_t) ')