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