|
Chris PeBenito |
ab58ad |
#DESC updfstab - Red Hat utility to change /etc/fstab
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
# Author: Russell Coker <russell@coker.com.au>
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
daemon_base_domain(updfstab, `, fs_domain, etc_writer')
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
rw_dir_create_file(updfstab_t, etc_t)
|
|
Chris PeBenito |
ab58ad |
create_dir_file(updfstab_t, mnt_t)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Read /dev directories and modify sym-links
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t device_t:dir rw_dir_perms;
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t device_t:lnk_file create_file_perms;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Access disk devices.
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t fixed_disk_device_t:blk_file rw_file_perms;
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t removable_device_t:blk_file rw_file_perms;
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t scsi_generic_device_t:chr_file rw_file_perms;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# for /proc/partitions
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t proc_t:file { getattr read };
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# for /proc/self/mounts
|
|
Chris PeBenito |
ab58ad |
r_dir_file(updfstab_t, self)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# for /etc/mtab
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t etc_runtime_t:file { getattr read };
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
read_locale(updfstab_t)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
ifdef(`dbusd.te', `
|
|
Chris PeBenito |
ab58ad |
dbusd_client(system, updfstab)
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t system_dbusd_t:dbus { send_msg };
|
|
Chris PeBenito |
ab58ad |
allow initrc_t updfstab_t:dbus send_msg;
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t initrc_t:dbus send_msg;
|
|
Chris PeBenito |
ab58ad |
')
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# not sure what the sysctl_kernel_t file is, or why it wants to write it, so
|
|
Chris PeBenito |
ab58ad |
# I will not allow it
|
|
Chris PeBenito |
ab58ad |
read_sysctl(updfstab_t)
|
|
Chris PeBenito |
ab58ad |
dontaudit updfstab_t sysctl_kernel_t:file write;
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t modules_conf_t:file { getattr read };
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t sbin_t:dir search;
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t sbin_t:lnk_file read;
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t { var_t var_log_t }:dir search;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t kernel_t:fd use;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t self:unix_stream_socket create_stream_socket_perms;
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t self:unix_dgram_socket create_socket_perms;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
ifdef(`modutil.te', `
|
|
Chris PeBenito |
ab58ad |
dnl domain_auto_trans(updfstab_t, insmod_exec_t, insmod_t)
|
|
Chris PeBenito |
ab58ad |
can_exec(updfstab_t, insmod_exec_t)
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t modules_object_t:dir search;
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t modules_dep_t:file { getattr read };
|
|
Chris PeBenito |
ab58ad |
')
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
ifdef(`pamconsole.te', `
|
|
Chris PeBenito |
ab58ad |
domain_auto_trans(updfstab_t, pam_console_exec_t, pam_console_t)
|
|
Chris PeBenito |
ab58ad |
')
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t kernel_t:system syslog_console;
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t sysadm_tty_device_t:chr_file { read write };
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t self:capability dac_override;
|
|
Chris PeBenito |
ab58ad |
dontaudit updfstab_t self:capability sys_admin;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
r_dir_file(updfstab_t, { selinux_config_t file_context_t default_context_t } )
|
|
Chris PeBenito |
ab58ad |
can_getsecurity(updfstab_t)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t { sbin_t bin_t }:dir { search getattr };
|
|
Chris PeBenito |
ab58ad |
dontaudit updfstab_t devtty_t:chr_file { read write };
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t self:fifo_file { getattr read write ioctl };
|
|
Chris PeBenito |
ab58ad |
can_exec(updfstab_t, { sbin_t bin_t ls_exec_t } )
|
|
Chris PeBenito |
ab58ad |
dontaudit updfstab_t home_root_t:dir { getattr search };
|
|
Chris PeBenito |
ab58ad |
dontaudit updfstab_t { home_dir_type home_type }:dir search;
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t fs_t:filesystem { getattr };
|
|
Chris PeBenito |
ab58ad |
allow updfstab_t tmpfs_t:dir getattr;
|
|
Chris PeBenito |
ab58ad |
ifdef(`hald.te', `
|
|
Chris PeBenito |
ab58ad |
can_unix_connect(updfstab_t, hald_t)
|
|
Chris PeBenito |
ab58ad |
')
|
|
Chris PeBenito |
ab58ad |
|