|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
123a99 |
policy_module(automount,1.2.7)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
########################################
|
|
Chris PeBenito |
7576fa |
#
|
|
Chris PeBenito |
7576fa |
# Declarations
|
|
Chris PeBenito |
7576fa |
#
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
type automount_t;
|
|
Chris PeBenito |
7576fa |
type automount_exec_t;
|
|
Chris PeBenito |
7576fa |
init_daemon_domain(automount_t,automount_exec_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
type automount_var_run_t;
|
|
Chris PeBenito |
7576fa |
files_pid_file(automount_var_run_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
type automount_etc_t;
|
|
Chris PeBenito |
7576fa |
files_config_file(automount_etc_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
type automount_lock_t;
|
|
Chris PeBenito |
7576fa |
files_lock_file(automount_lock_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
type automount_tmp_t;
|
|
Chris PeBenito |
7576fa |
files_tmp_file(automount_tmp_t)
|
|
Chris PeBenito |
7576fa |
files_mountpoint(automount_tmp_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
########################################
|
|
Chris PeBenito |
7576fa |
#
|
|
Chris PeBenito |
7576fa |
# Local policy
|
|
Chris PeBenito |
7576fa |
#
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
123a99 |
allow automount_t self:capability { net_bind_service sys_nice sys_resource dac_override sys_admin };
|
|
Chris PeBenito |
7576fa |
dontaudit automount_t self:capability sys_tty_config;
|
|
Chris PeBenito |
2dbd38 |
allow automount_t self:process { signal_perms getpgid setpgid setsched setrlimit };
|
|
Chris PeBenito |
7576fa |
allow automount_t self:fifo_file rw_file_perms;
|
|
Chris PeBenito |
7576fa |
allow automount_t self:unix_stream_socket create_socket_perms;
|
|
Chris PeBenito |
7576fa |
allow automount_t self:unix_dgram_socket create_socket_perms;
|
|
Chris PeBenito |
7576fa |
allow automount_t self:tcp_socket create_stream_socket_perms;
|
|
Chris PeBenito |
7576fa |
allow automount_t self:udp_socket create_socket_perms;
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
allow automount_t automount_etc_t:file { getattr read };
|
|
Chris PeBenito |
7576fa |
# because config files can be shell scripts
|
|
Chris PeBenito |
7576fa |
can_exec(automount_t, automount_etc_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
allow automount_t automount_lock_t:file create_file_perms;
|
|
Chris PeBenito |
1c1ac6 |
files_lock_filetrans(automount_t,automount_lock_t,file)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
allow automount_t automount_tmp_t:dir create_dir_perms;
|
|
Chris PeBenito |
7576fa |
allow automount_t automount_tmp_t:file create_file_perms;
|
|
Chris PeBenito |
103fe2 |
files_tmp_filetrans(automount_t, automount_tmp_t, { file dir })
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
# Allow automount to create and delete directories in / and /home
|
|
Chris PeBenito |
7576fa |
allow automount_t automount_tmp_t:dir create_dir_perms;
|
|
Chris PeBenito |
1c1ac6 |
files_home_filetrans(automount_t,automount_tmp_t,dir)
|
|
Chris PeBenito |
103fe2 |
files_root_filetrans(automount_t,automount_tmp_t,dir)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
allow automount_t automount_var_run_t:file create_file_perms;
|
|
Chris PeBenito |
7576fa |
allow automount_t automount_var_run_t:dir rw_dir_perms;
|
|
Chris PeBenito |
1c1ac6 |
files_pid_filetrans(automount_t,automount_var_run_t,file)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
445522 |
kernel_read_kernel_sysctls(automount_t)
|
|
Chris PeBenito |
2dbd38 |
kernel_read_irq_sysctls(automount_t)
|
|
Chris PeBenito |
445522 |
kernel_read_fs_sysctls(automount_t)
|
|
Chris PeBenito |
7576fa |
kernel_read_proc_symlinks(automount_t)
|
|
Chris PeBenito |
7576fa |
kernel_read_system_state(automount_t)
|
|
Chris PeBenito |
2dbd38 |
kernel_read_network_state(automount_t)
|
|
Chris PeBenito |
7576fa |
kernel_list_proc(automount_t)
|
|
Chris PeBenito |
123a99 |
kernel_dontaudit_search_xen_state(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
1c1ac6 |
files_search_boot(automount_t)
|
|
Chris PeBenito |
123a99 |
# Automount is slowly adding all mount functionality internally
|
|
Chris PeBenito |
123a99 |
files_search_all(automount_t)
|
|
Chris PeBenito |
123a99 |
files_mounton_all_mountpoints(automount_t)
|
|
Chris PeBenito |
123a99 |
files_mount_all_file_type_fs(automount_t)
|
|
Chris PeBenito |
123a99 |
files_unmount_all_file_type_fs(automount_t)
|
|
Chris PeBenito |
123a99 |
|
|
Chris PeBenito |
123a99 |
fs_mount_all_fs(automount_t)
|
|
Chris PeBenito |
123a99 |
fs_unmount_all_fs(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
bf080a |
corecmd_exec_sbin(automount_t)
|
|
Chris PeBenito |
7576fa |
corecmd_exec_bin(automount_t)
|
|
Chris PeBenito |
7576fa |
corecmd_exec_shell(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
corenet_non_ipsec_sendrecv(automount_t)
|
|
Chris PeBenito |
7576fa |
corenet_tcp_sendrecv_generic_if(automount_t)
|
|
Chris PeBenito |
7576fa |
corenet_udp_sendrecv_generic_if(automount_t)
|
|
Chris PeBenito |
7576fa |
corenet_tcp_sendrecv_all_nodes(automount_t)
|
|
Chris PeBenito |
7576fa |
corenet_udp_sendrecv_all_nodes(automount_t)
|
|
Chris PeBenito |
7576fa |
corenet_tcp_sendrecv_all_ports(automount_t)
|
|
Chris PeBenito |
7576fa |
corenet_udp_sendrecv_all_ports(automount_t)
|
|
Chris PeBenito |
7576fa |
corenet_tcp_bind_all_nodes(automount_t)
|
|
Chris PeBenito |
7576fa |
corenet_udp_bind_all_nodes(automount_t)
|
|
Chris PeBenito |
bf080a |
corenet_tcp_connect_portmap_port(automount_t)
|
|
Chris PeBenito |
a77e65 |
corenet_tcp_connect_all_ports(automount_t)
|
|
Chris PeBenito |
bf080a |
corenet_dontaudit_tcp_connect_all_reserved_ports(automount_t)
|
|
Chris PeBenito |
3d03a4 |
corenet_sendrecv_all_client_packets(automount_t)
|
|
Chris PeBenito |
0f27d9 |
# Automount execs showmount when you browse /net. This is required until
|
|
Chris PeBenito |
0f27d9 |
# Someone writes a showmount policy
|
|
Chris PeBenito |
0f27d9 |
corenet_tcp_bind_reserved_port(automount_t)
|
|
Chris PeBenito |
e99359 |
corenet_tcp_bind_all_rpc_ports(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
dev_read_sysfs(automount_t)
|
|
Chris PeBenito |
7576fa |
# for SSP
|
|
Chris PeBenito |
7576fa |
dev_read_urand(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
15722e |
domain_use_interactive_fds(automount_t)
|
|
Chris PeBenito |
2dbd38 |
domain_dontaudit_read_all_domains_state(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
9e04f5 |
files_dontaudit_write_var_dirs(automount_t)
|
|
Chris PeBenito |
0f27d9 |
files_getattr_all_dirs(automount_t)
|
|
Chris PeBenito |
46c69c |
files_list_mnt(automount_t)
|
|
Chris PeBenito |
7576fa |
files_getattr_home_dir(automount_t)
|
|
Chris PeBenito |
7576fa |
files_read_etc_files(automount_t)
|
|
Chris PeBenito |
7576fa |
files_read_etc_runtime_files(automount_t)
|
|
Chris PeBenito |
7576fa |
# for if the mount point is not labelled
|
|
Chris PeBenito |
9e04f5 |
files_getattr_isid_type_dirs(automount_t)
|
|
Chris PeBenito |
9e04f5 |
files_getattr_default_dirs(automount_t)
|
|
Chris PeBenito |
7576fa |
# because config files can be shell scripts
|
|
Chris PeBenito |
7576fa |
files_exec_etc_files(automount_t)
|
|
Chris PeBenito |
2dbd38 |
files_mounton_mnt(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
fs_getattr_all_fs(automount_t)
|
|
Chris PeBenito |
cbe327 |
fs_getattr_all_dirs(automount_t)
|
|
Chris PeBenito |
7576fa |
fs_search_auto_mountpoints(automount_t)
|
|
Chris PeBenito |
7576fa |
fs_manage_auto_mountpoints(automount_t)
|
|
Chris PeBenito |
2dbd38 |
fs_unmount_autofs(automount_t)
|
|
Chris PeBenito |
2dbd38 |
fs_mount_autofs(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
term_dontaudit_use_console(automount_t)
|
|
Chris PeBenito |
1815ba |
term_dontaudit_getattr_pty_dirs(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
1c1ac6 |
init_use_fds(automount_t)
|
|
Chris PeBenito |
1815ba |
init_use_script_ptys(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
libs_use_ld_so(automount_t)
|
|
Chris PeBenito |
7576fa |
libs_use_shared_libs(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
logging_send_syslog_msg(automount_t)
|
|
Chris PeBenito |
bf080a |
logging_search_logs(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
miscfiles_read_localization(automount_t)
|
|
Chris PeBenito |
8cfa5a |
miscfiles_read_certs(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
# Run mount in the mount_t domain.
|
|
Chris PeBenito |
7576fa |
mount_domtrans(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
sysnet_dns_name_resolve(automount_t)
|
|
Chris PeBenito |
7576fa |
sysnet_use_ldap(automount_t)
|
|
Chris PeBenito |
7576fa |
sysnet_read_config(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
15722e |
userdom_dontaudit_use_unpriv_user_fds(automount_t)
|
|
Chris PeBenito |
103fe2 |
userdom_dontaudit_search_sysadm_home_dirs(automount_t)
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
7576fa |
ifdef(`targeted_policy', `
|
|
Chris PeBenito |
9e04f5 |
files_dontaudit_read_root_files(automount_t)
|
|
Chris PeBenito |
1815ba |
term_dontaudit_use_unallocated_ttys(automount_t)
|
|
Chris PeBenito |
1815ba |
term_dontaudit_use_generic_ptys(automount_t)
|
|
Chris PeBenito |
7576fa |
')
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
bb7170 |
optional_policy(`
|
|
Chris PeBenito |
7576fa |
corecmd_exec_bin(automount_t)
|
|
Chris PeBenito |
7576fa |
')
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
bb7170 |
optional_policy(`
|
|
Chris PeBenito |
a77e65 |
bind_search_cache(automount_t)
|
|
Chris PeBenito |
a77e65 |
')
|
|
Chris PeBenito |
a77e65 |
|
|
Chris PeBenito |
bb7170 |
optional_policy(`
|
|
Chris PeBenito |
7576fa |
fstools_domtrans(automount_t)
|
|
Chris PeBenito |
7576fa |
')
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
bb7170 |
optional_policy(`
|
|
Chris PeBenito |
7576fa |
nis_use_ypbind(automount_t)
|
|
Chris PeBenito |
7576fa |
')
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
bb7170 |
optional_policy(`
|
|
Chris PeBenito |
7576fa |
rpc_search_nfs_state_data(automount_t)
|
|
Chris PeBenito |
7576fa |
')
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
bb7170 |
optional_policy(`
|
|
Chris PeBenito |
7576fa |
seutil_sigchld_newrole(automount_t)
|
|
Chris PeBenito |
7576fa |
')
|
|
Chris PeBenito |
7576fa |
|
|
Chris PeBenito |
bb7170 |
optional_policy(`
|
|
Chris PeBenito |
7576fa |
udev_read_db(automount_t)
|
|
Chris PeBenito |
7576fa |
')
|