selinux-policy/strict/domains/program/mount.te

92 lines
2.6 KiB
Plaintext
Raw Normal View History

2005-04-29 17:45:15 +00:00
#DESC Mount - Filesystem mount utilities
#
# Macros for mount
#
# Author: Brian May <bam@snoopy.apana.org.au>
# X-Debian-Packages: mount
#
# based on the work of:
# Mark Westerman mark.westerman@csoconline.com
#
type mount_exec_t, file_type, sysadmfile, exec_type;
2005-09-15 21:03:45 +00:00
mount_domain(sysadm, mount, `, fs_domain, nscd_client_domain, mlsfileread, mlsfilewrite')
2005-04-29 17:45:15 +00:00
mount_loopback_privs(sysadm, mount)
role sysadm_r types mount_t;
role system_r types mount_t;
can_access_pty(mount_t, initrc)
allow mount_t console_device_t:chr_file { read write };
2005-04-29 17:45:15 +00:00
domain_auto_trans(initrc_t, mount_exec_t, mount_t)
allow mount_t init_t:fd use;
allow mount_t privfd:fd use;
allow mount_t self:capability { dac_override ipc_lock sys_tty_config };
2005-04-29 17:45:15 +00:00
allow mount_t self:process { fork signal_perms };
allow mount_t file_type:dir search;
# Access disk devices.
allow mount_t fixed_disk_device_t:devfile_class_set rw_file_perms;
allow mount_t removable_device_t:devfile_class_set rw_file_perms;
allow mount_t device_t:lnk_file read;
# for when /etc/mtab loses its type
allow mount_t file_t:file { getattr read unlink };
# Mount, remount and unmount file systems.
allow mount_t fs_type:filesystem mount_fs_perms;
allow mount_t mount_point:dir mounton;
2005-04-29 17:45:15 +00:00
allow mount_t nfs_t:dir search;
2005-09-15 21:03:45 +00:00
allow mount_t sysctl_t:dir search;
2005-04-29 17:45:15 +00:00
allow mount_t root_t:filesystem unmount;
2005-09-15 21:03:45 +00:00
can_portmap(mount_t)
2005-04-29 17:45:15 +00:00
ifdef(`portmap.te', `
# for nfs
can_network(mount_t)
2005-09-15 21:03:45 +00:00
allow mount_t port_type:tcp_socket name_connect;
2005-04-29 17:45:15 +00:00
can_ypbind(mount_t)
allow mount_t port_t:{ tcp_socket udp_socket } name_bind;
allow mount_t reserved_port_t:{ tcp_socket udp_socket } name_bind;
can_udp_send(mount_t, portmap_t)
can_udp_send(portmap_t, mount_t)
allow mount_t rpc_pipefs_t:dir search;
')
dontaudit mount_t reserved_port_type:{tcp_socket udp_socket} name_bind;
#
# required for mount.smbfs
#
allow mount_t sbin_t:lnk_file { getattr read };
rhgb_domain(mount_t)
# for localization
allow mount_t lib_t:file { getattr read };
allow mount_t autofs_t:dir read;
2005-09-16 21:20:37 +00:00
allow mount_t fs_type:filesystem relabelfrom;
2005-04-29 17:45:15 +00:00
#
# This rule needs to be generalized. Only admin, initrc should have it.
#
allow mount_t file_type:filesystem { unmount mount relabelto };
allow mount_t mnt_t:dir getattr;
dontaudit mount_t kernel_t:fd use;
allow mount_t userdomain:fd use;
can_exec(mount_t, { sbin_t bin_t })
allow mount_t device_t:dir r_dir_perms;
allow mount_t tmpfs_t:chr_file { read write };
# tries to read /init
dontaudit mount_t root_t:file { getattr read };
allow kernel_t mount_t:tcp_socket { read write };
allow mount_t self:capability { setgid setuid };
allow user_t mount_t:tcp_socket write;
allow mount_t proc_t:lnk_file read;