Chris PeBenito 31b7c0
#DESC Automount - Automount daemon
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Authors:  Stephen Smalley <sds@epoch.ncsc.mil>
Chris PeBenito 31b7c0
# Modified by Russell Coker <russell@coker.com.au>
Chris PeBenito 31b7c0
# X-Debian-Packages: amd am-utils autofs
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
#################################
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Rules for the automount_t domain.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
daemon_domain(automount)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
etc_domain(automount)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# for SSP
Chris PeBenito 31b7c0
allow automount_t urandom_device_t:chr_file read;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# for if the mount point is not labelled
Chris PeBenito 31b7c0
allow automount_t file_t:dir getattr;
Chris PeBenito 31b7c0
allow automount_t default_t:dir getattr;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow automount_t autofs_t:dir { create_dir_perms ioctl };
Chris PeBenito 31b7c0
allow automount_t fs_type:dir getattr;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow automount_t { etc_t etc_runtime_t }:file { getattr read };
Chris PeBenito 31b7c0
allow automount_t proc_t:file { getattr read };
Chris PeBenito 31b7c0
allow automount_t self:process { getpgid setpgid setsched };
Chris PeBenito 31b7c0
allow automount_t self:capability { sys_nice dac_override };
Chris PeBenito 31b7c0
allow automount_t self:unix_stream_socket create_socket_perms;
Chris PeBenito 31b7c0
allow automount_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# because config files can be shell scripts
Chris PeBenito 31b7c0
can_exec(automount_t, { etc_t automount_etc_t })
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
can_network_server(automount_t)
Chris PeBenito 31b7c0
can_resolve(automount_t)
Chris PeBenito 31b7c0
can_ypbind(automount_t)
Chris PeBenito 31b7c0
can_ldap(automount_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
ifdef(`fsadm.te', `
Chris PeBenito 31b7c0
domain_auto_trans(automount_t, fsadm_exec_t, fsadm_t)
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
lock_domain(automount)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
tmp_domain(automount)
Chris PeBenito 31b7c0
allow automount_t self:fifo_file rw_file_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Run mount in the mount_t domain.
Chris PeBenito 31b7c0
domain_auto_trans(automount_t, mount_exec_t, mount_t)
Chris PeBenito 31b7c0
allow mount_t autofs_t:dir { search mounton read };
Chris PeBenito 31b7c0
allow mount_t automount_tmp_t:dir mounton;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
ifdef(`apmd.te',
Chris PeBenito 31b7c0
`domain_auto_trans(apmd_t, automount_exec_t, automount_t)
Chris PeBenito 31b7c0
can_exec(automount_t, bin_t)')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow automount_t { bin_t sbin_t }:dir search;
Chris PeBenito 31b7c0
can_exec(automount_t, mount_exec_t)
Chris PeBenito 31b7c0
can_exec(automount_t, shell_exec_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow mount_t autofs_t:dir getattr;
Chris PeBenito 31b7c0
dontaudit automount_t var_t:dir write;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow userdomain autofs_t:dir r_dir_perms;
Chris PeBenito 31b7c0
allow kernel_t autofs_t:dir { getattr ioctl read search };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow automount_t { boot_t home_root_t }:dir getattr;
Chris PeBenito 31b7c0
allow automount_t mnt_t:dir { getattr search };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
can_exec(initrc_t, automount_etc_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Allow automount to create and delete directories in / and /home
Chris PeBenito 31b7c0
file_type_auto_trans(automount_t, { root_t home_root_t }, automount_tmp_t, dir)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow automount_t var_lib_t:dir search;
Chris PeBenito 31b7c0
allow automount_t var_lib_nfs_t:dir search;
Chris PeBenito 31b7c0