Chris PeBenito 17de1b
Chris PeBenito 8d2c34
policy_module(fstools,1.7.1)
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 17de1b
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 17de1b
allow fsadm_t self:fifo_file rw_file_perms;
Chris PeBenito 17de1b
allow fsadm_t self:sock_file r_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 c0868a
manage_files_pattern(fsadm_t,fsadm_log_t,fsadm_log_t)
Chris PeBenito 13d7ce
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)
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 17de1b
files_getattr_boot_dirs(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 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)
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
corecmd_list_bin(fsadm_t)
Chris PeBenito 17de1b
corecmd_read_bin_symlinks(fsadm_t)
Chris PeBenito 8708d9
#RedHat bug #201164
Chris PeBenito 8708d9
corecmd_exec_shell(fsadm_t)
Chris PeBenito 8708d9
Chris PeBenito 17de1b
# cjp: these are probably not needed:
Chris PeBenito 17de1b
corecmd_read_bin_files(fsadm_t)
Chris PeBenito 17de1b
corecmd_read_bin_pipes(fsadm_t)
Chris PeBenito 17de1b
corecmd_read_bin_sockets(fsadm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(fsadm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_list_home(fsadm_t)
Chris PeBenito 17de1b
files_read_usr_files(fsadm_t)
Chris PeBenito 17de1b
files_read_etc_files(fsadm_t)
Chris PeBenito 17de1b
files_manage_lost_found(fsadm_t)
Chris PeBenito 17de1b
files_manage_isid_type_dirs(fsadm_t)
Chris PeBenito 17de1b
# Write to /etc/mtab.
Chris PeBenito 17de1b
files_manage_etc_runtime_files(fsadm_t)
Chris PeBenito 17de1b
files_etc_filetrans_etc_runtime(fsadm_t,file)
Chris PeBenito 17de1b
# Access to /initrd devices
Chris PeBenito 17de1b
files_rw_isid_type_dirs(fsadm_t)
Chris PeBenito 17de1b
files_rw_isid_type_blk_files(fsadm_t)
Chris PeBenito 17de1b
# Recreate /mnt/cdrom.
Chris PeBenito 17de1b
files_manage_mnt_dirs(fsadm_t)
Chris PeBenito 17de1b
# for tune2fs
Chris PeBenito 17de1b
files_search_all(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
libs_use_ld_so(fsadm_t)
Chris PeBenito 17de1b
libs_use_shared_libs(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 17de1b
Chris PeBenito 17de1b
seutil_read_config(fsadm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_use_unpriv_users_fds(fsadm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`targeted_policy',`
Chris PeBenito 17de1b
	term_use_unallocated_ttys(fsadm_t)
Chris PeBenito 17de1b
	term_use_generic_ptys(fsadm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
tunable_policy(`read_default_t',`
Chris PeBenito 17de1b
	files_list_default(fsadm_t)
Chris PeBenito 17de1b
	files_read_default_files(fsadm_t)
Chris PeBenito 17de1b
	files_read_default_symlinks(fsadm_t)
Chris PeBenito 17de1b
	files_read_default_sockets(fsadm_t)
Chris PeBenito 17de1b
	files_read_default_pipes(fsadm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
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 17de1b
	cron_system_entry(fsadm_t,fsadm_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
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(`
Chris PeBenito 8d2c34
	xen_append_log(fsadm_t)
Chris PeBenito 8d2c34
')