|
Chris PeBenito |
29af4c |
policy_module(fstools, 1.14.0)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Declarations
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type fsadm_t;
|
|
Chris PeBenito |
17de1b |
type fsadm_exec_t;
|
|
Chris PeBenito |
3f67f7 |
init_system_domain(fsadm_t, fsadm_exec_t)
|
|
Chris PeBenito |
17de1b |
role system_r types fsadm_t;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
13d7ce |
type fsadm_log_t;
|
|
Chris PeBenito |
13d7ce |
logging_log_file(fsadm_log_t)
|
|
Chris PeBenito |
13d7ce |
|
|
Chris PeBenito |
17de1b |
type fsadm_tmp_t;
|
|
Chris PeBenito |
17de1b |
files_tmp_file(fsadm_tmp_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type swapfile_t; # customizable
|
|
Chris PeBenito |
17de1b |
files_type(swapfile_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# ipc_lock is for losetup
|
|
Chris PeBenito |
6b19be |
allow fsadm_t self:capability { ipc_lock sys_rawio sys_admin sys_resource sys_tty_config dac_override dac_read_search };
|
|
Chris PeBenito |
17de1b |
allow fsadm_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execmem execheap };
|
|
Chris PeBenito |
17de1b |
allow fsadm_t self:fd use;
|
|
Chris PeBenito |
ef659a |
allow fsadm_t self:fifo_file rw_fifo_file_perms;
|
|
Chris PeBenito |
ef659a |
allow fsadm_t self:sock_file read_sock_file_perms;
|
|
Chris PeBenito |
17de1b |
allow fsadm_t self:unix_dgram_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow fsadm_t self:unix_stream_socket create_stream_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow fsadm_t self:unix_dgram_socket sendto;
|
|
Chris PeBenito |
17de1b |
allow fsadm_t self:unix_stream_socket connectto;
|
|
Chris PeBenito |
17de1b |
allow fsadm_t self:shm create_shm_perms;
|
|
Chris PeBenito |
17de1b |
allow fsadm_t self:sem create_sem_perms;
|
|
Chris PeBenito |
17de1b |
allow fsadm_t self:msgq create_msgq_perms;
|
|
Chris PeBenito |
17de1b |
allow fsadm_t self:msg { send receive };
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
can_exec(fsadm_t, fsadm_exec_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
allow fsadm_t fsadm_tmp_t:dir manage_dir_perms;
|
|
Chris PeBenito |
c0868a |
allow fsadm_t fsadm_tmp_t:file manage_file_perms;
|
|
Chris PeBenito |
17de1b |
files_tmp_filetrans(fsadm_t, fsadm_tmp_t, { file dir })
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
13d7ce |
# log files
|
|
Chris PeBenito |
c0868a |
allow fsadm_t fsadm_log_t:dir setattr;
|
|
Chris PeBenito |
3f67f7 |
manage_files_pattern(fsadm_t, fsadm_log_t, fsadm_log_t)
|
|
Chris PeBenito |
3f67f7 |
logging_log_filetrans(fsadm_t, fsadm_log_t, file)
|
|
Chris PeBenito |
13d7ce |
|
|
Chris PeBenito |
17de1b |
# Enable swapping to files
|
|
Chris PeBenito |
6b19be |
allow fsadm_t swapfile_t:file { rw_file_perms swapon };
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state(fsadm_t)
|
|
Chris PeBenito |
17de1b |
kernel_read_kernel_sysctls(fsadm_t)
|
|
Dan Walsh |
3eaa99 |
kernel_request_load_module(fsadm_t)
|
|
Chris PeBenito |
17de1b |
# Allow console log change (updfstab)
|
|
Chris PeBenito |
17de1b |
kernel_change_ring_buffer_level(fsadm_t)
|
|
Chris PeBenito |
17de1b |
# mkreiserfs needs this
|
|
Chris PeBenito |
17de1b |
kernel_getattr_proc(fsadm_t)
|
|
Chris PeBenito |
17de1b |
kernel_getattr_core_if(fsadm_t)
|
|
Chris PeBenito |
17de1b |
# Access to /initrd devices
|
|
Chris PeBenito |
17de1b |
kernel_rw_unlabeled_dirs(fsadm_t)
|
|
Chris PeBenito |
17de1b |
kernel_rw_unlabeled_blk_files(fsadm_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
79ca72 |
corecmd_exec_bin(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
#RedHat bug #201164
|
|
Chris PeBenito |
79ca72 |
corecmd_exec_shell(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
# cjp: these are probably not needed:
|
|
Chris PeBenito |
79ca72 |
corecmd_read_bin_files(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
corecmd_read_bin_pipes(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
corecmd_read_bin_sockets(fsadm_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dev_getattr_all_chr_files(fsadm_t)
|
|
Chris PeBenito |
17de1b |
dev_dontaudit_getattr_all_blk_files(fsadm_t)
|
|
Chris PeBenito |
8d2c34 |
dev_dontaudit_getattr_generic_files(fsadm_t)
|
|
Chris PeBenito |
17de1b |
# mkreiserfs and other programs need this for UUID
|
|
Chris PeBenito |
17de1b |
dev_read_rand(fsadm_t)
|
|
Chris PeBenito |
17de1b |
dev_read_urand(fsadm_t)
|
|
Chris PeBenito |
17de1b |
# Recreate /dev/cdrom.
|
|
Chris PeBenito |
17de1b |
dev_manage_generic_symlinks(fsadm_t)
|
|
Chris PeBenito |
17de1b |
# fdisk needs this for early boot
|
|
Chris PeBenito |
17de1b |
dev_manage_generic_blk_files(fsadm_t)
|
|
Chris PeBenito |
17de1b |
# Access to /initrd devices
|
|
Chris PeBenito |
17de1b |
dev_search_usbfs(fsadm_t)
|
|
Chris PeBenito |
17de1b |
# for swapon
|
|
Chris PeBenito |
17de1b |
dev_read_sysfs(fsadm_t)
|
|
Chris PeBenito |
17de1b |
# Access to /initrd devices
|
|
Chris PeBenito |
17de1b |
dev_getattr_usbfs_dirs(fsadm_t)
|
|
Chris PeBenito |
17de1b |
# Access to /dev/mapper/control
|
|
Chris PeBenito |
17de1b |
dev_rw_lvm_control(fsadm_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
79ca72 |
domain_use_interactive_fds(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
|
|
Chris PeBenito |
79ca72 |
files_getattr_boot_dirs(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
files_list_home(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
files_read_usr_files(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
files_read_etc_files(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
files_manage_lost_found(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
files_manage_isid_type_dirs(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
# Write to /etc/mtab.
|
|
Chris PeBenito |
79ca72 |
files_manage_etc_runtime_files(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
files_etc_filetrans_etc_runtime(fsadm_t, file)
|
|
Chris PeBenito |
79ca72 |
# Access to /initrd devices
|
|
Chris PeBenito |
79ca72 |
files_rw_isid_type_dirs(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
files_rw_isid_type_blk_files(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
files_read_isid_type_files(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
|
|
Chris PeBenito |
17de1b |
fs_search_auto_mountpoints(fsadm_t)
|
|
Chris PeBenito |
17de1b |
fs_getattr_xattr_fs(fsadm_t)
|
|
Chris PeBenito |
17de1b |
fs_rw_ramfs_pipes(fsadm_t)
|
|
Chris PeBenito |
17de1b |
fs_rw_tmpfs_files(fsadm_t)
|
|
Chris PeBenito |
17de1b |
# remount file system to apply changes
|
|
Chris PeBenito |
17de1b |
fs_remount_xattr_fs(fsadm_t)
|
|
Chris PeBenito |
17de1b |
# for /dev/shm
|
|
Chris PeBenito |
17de1b |
fs_search_tmpfs(fsadm_t)
|
|
Chris PeBenito |
17de1b |
fs_getattr_tmpfs_dirs(fsadm_t)
|
|
Chris PeBenito |
17de1b |
fs_read_tmpfs_symlinks(fsadm_t)
|
|
Dan Walsh |
3eaa99 |
fs_manage_nfs_files(fsadm_t)
|
|
Dan Walsh |
3eaa99 |
fs_manage_cifs_files(fsadm_t)
|
|
Dan Walsh |
035275 |
fs_rw_hugetlbfs_files(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
# Recreate /mnt/cdrom.
|
|
Chris PeBenito |
79ca72 |
files_manage_mnt_dirs(fsadm_t)
|
|
Chris PeBenito |
79ca72 |
# for tune2fs
|
|
Chris PeBenito |
79ca72 |
files_search_all(fsadm_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
f8233a |
mls_file_read_all_levels(fsadm_t)
|
|
Chris PeBenito |
f8233a |
mls_file_write_all_levels(fsadm_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
storage_raw_read_fixed_disk(fsadm_t)
|
|
Chris PeBenito |
17de1b |
storage_raw_write_fixed_disk(fsadm_t)
|
|
Chris PeBenito |
17de1b |
storage_raw_read_removable_device(fsadm_t)
|
|
Chris PeBenito |
17de1b |
storage_raw_write_removable_device(fsadm_t)
|
|
Chris PeBenito |
17de1b |
storage_read_scsi_generic(fsadm_t)
|
|
Chris PeBenito |
17de1b |
storage_swapon_fixed_disk(fsadm_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
term_use_console(fsadm_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
init_use_fds(fsadm_t)
|
|
Chris PeBenito |
17de1b |
init_use_script_ptys(fsadm_t)
|
|
Chris PeBenito |
17de1b |
init_dontaudit_getattr_initctl(fsadm_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(fsadm_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(fsadm_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
modutils_read_module_config(fsadm_t)
|
|
Chris PeBenito |
77c71b |
modutils_read_module_deps(fsadm_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
seutil_read_config(fsadm_t)
|
|
Chris PeBenito |
17de1b |
|
|
Dan Walsh |
3eaa99 |
term_use_all_terms(fsadm_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
d6605b |
ifdef(`distro_redhat',`
|
|
Chris PeBenito |
d6605b |
optional_policy(`
|
|
Chris PeBenito |
d6605b |
unconfined_domain(fsadm_t)
|
|
Chris PeBenito |
d6605b |
')
|
|
Chris PeBenito |
d6605b |
')
|
|
Chris PeBenito |
d6605b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
amanda_rw_dumpdates_files(fsadm_t)
|
|
Chris PeBenito |
17de1b |
amanda_append_log_files(fsadm_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
# for smartctl cron jobs
|
|
Chris PeBenito |
3f67f7 |
cron_system_entry(fsadm_t, fsadm_exec_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
hal_dontaudit_write_log(fsadm_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
livecd_rw_tmp_files(fsadm_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
nis_use_ypbind(fsadm_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
fs_dontaudit_write_ramfs_pipes(fsadm_t)
|
|
Chris PeBenito |
17de1b |
rhgb_stub(fsadm_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
8d2c34 |
|
|
Chris PeBenito |
8d2c34 |
optional_policy(`
|
|
Dan Walsh |
4765a5 |
virt_read_blk_images(fsadm_t)
|
|
Dan Walsh |
4765a5 |
')
|
|
Dan Walsh |
4765a5 |
|
|
Dan Walsh |
4765a5 |
optional_policy(`
|
|
Chris PeBenito |
8d2c34 |
xen_append_log(fsadm_t)
|
|
Chris PeBenito |
77c71b |
xen_rw_image_files(fsadm_t)
|
|
Chris PeBenito |
8d2c34 |
')
|