Chris PeBenito 58c3da
Chris PeBenito 58c3da
policy_module(fstools,1.0)
Chris PeBenito 58c3da
Chris PeBenito 58c3da
########################################
Chris PeBenito 58c3da
#
Chris PeBenito 58c3da
# Declarations
Chris PeBenito 58c3da
#
Chris PeBenito fd89e1
Chris PeBenito a08248
type fsadm_t; #, mlsfileread;
Chris PeBenito 58c3da
type fsadm_exec_t;
Chris PeBenito 58c3da
init_system_domain(fsadm_t,fsadm_exec_t)
Chris PeBenito 58c3da
role system_r types fsadm_t;
Chris PeBenito 58c3da
Chris PeBenito 58c3da
type fsadm_tmp_t;
Chris PeBenito 58c3da
files_tmp_file(fsadm_tmp_t)
Chris PeBenito 58c3da
Chris PeBenito 58c3da
type swapfile_t;
Chris PeBenito 8fd367
files_type(swapfile_t)
Chris PeBenito 58c3da
Chris PeBenito 58c3da
########################################
Chris PeBenito fd89e1
#
Chris PeBenito fd89e1
# local policy
Chris PeBenito fd89e1
#
Chris PeBenito 58c3da
Chris PeBenito 58c3da
# ipc_lock is for losetup
Chris PeBenito a08248
allow fsadm_t self:capability { ipc_lock sys_rawio sys_admin sys_tty_config dac_override dac_read_search };
Chris PeBenito 9d3bdc
allow fsadm_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execmem execheap };
Chris PeBenito 58c3da
allow fsadm_t self:fd use;
Chris PeBenito 58c3da
allow fsadm_t self:fifo_file rw_file_perms;
Chris PeBenito 58c3da
allow fsadm_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 58c3da
allow fsadm_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 58c3da
allow fsadm_t self:unix_dgram_socket sendto;
Chris PeBenito 58c3da
allow fsadm_t self:unix_stream_socket connectto;
Chris PeBenito 58c3da
allow fsadm_t self:shm create_shm_perms;
Chris PeBenito 58c3da
allow fsadm_t self:sem create_sem_perms;
Chris PeBenito 58c3da
allow fsadm_t self:msgq create_msgq_perms;
Chris PeBenito 58c3da
allow fsadm_t self:msg { send receive };
Chris PeBenito 58c3da
Chris PeBenito 58c3da
can_exec(fsadm_t, fsadm_exec_t)
Chris PeBenito 58c3da
Chris PeBenito 58c3da
allow fsadm_t fsadm_tmp_t:dir create_dir_perms;
Chris PeBenito 58c3da
allow fsadm_t fsadm_tmp_t:file create_file_perms;
Chris PeBenito 58c3da
files_create_tmp_files(fsadm_t, fsadm_tmp_t, { file dir })
Chris PeBenito 58c3da
Chris PeBenito 58c3da
# Enable swapping to files
Chris PeBenito 58c3da
allow fsadm_t swapfile_t:file { getattr swapon };
Chris PeBenito 58c3da
Chris PeBenito 58c3da
kernel_read_system_state(fsadm_t)
Chris PeBenito 58c3da
kernel_read_kernel_sysctl(fsadm_t)
Chris PeBenito 58c3da
# Allow console log change (updfstab)
Chris PeBenito 58c3da
kernel_change_ring_buffer_level(fsadm_t)
Chris PeBenito a42ca7
# mkreiserfs needs this
Chris PeBenito a42ca7
kernel_getattr_proc(fsadm_t)
Chris PeBenito a42ca7
# Access to /initrd devices
Chris PeBenito a42ca7
kernel_rw_unlabeled_dir(fsadm_t)
Chris PeBenito a42ca7
kernel_use_unlabeled_blk_dev(fsadm_t)
Chris PeBenito 58c3da
Chris PeBenito a1fcff
dev_getattr_all_chr_files(fsadm_t)
Chris PeBenito 58c3da
# mkreiserfs and other programs need this for UUID
Chris PeBenito 58c3da
dev_read_rand(fsadm_t)
Chris PeBenito 58c3da
dev_read_urand(fsadm_t)
Chris PeBenito 58c3da
# Recreate /dev/cdrom.
Chris PeBenito 58c3da
dev_manage_generic_symlinks(fsadm_t)
Chris PeBenito 58c3da
# Access to /initrd devices
Chris PeBenito 58c3da
dev_search_usbfs(fsadm_t)
Chris PeBenito 783b38
# for swapon
Chris PeBenito a08248
dev_read_sysfs(fsadm_t)
Chris PeBenito a42ca7
# Access to /initrd devices
Chris PeBenito a42ca7
dev_getattr_usbfs_dir(fsadm_t)
Chris PeBenito 58c3da
Chris PeBenito 58c3da
fs_search_auto_mountpoints(fsadm_t)
Chris PeBenito 58c3da
fs_getattr_xattr_fs(fsadm_t)
Chris PeBenito 58c3da
# remount file system to apply changes
Chris PeBenito 58c3da
fs_remount_xattr_fs(fsadm_t)
Chris PeBenito a42ca7
# for /dev/shm
Chris PeBenito a42ca7
fs_search_tmpfs(fsadm_t)
Chris PeBenito a42ca7
fs_getattr_tmpfs_dir(fsadm_t)
Chris PeBenito 58c3da
Chris PeBenito 58c3da
storage_raw_read_fixed_disk(fsadm_t)
Chris PeBenito 58c3da
storage_raw_write_fixed_disk(fsadm_t)
Chris PeBenito 58c3da
storage_raw_read_removable_device(fsadm_t)
Chris PeBenito 58c3da
storage_raw_write_removable_device(fsadm_t)
Chris PeBenito 58c3da
storage_read_scsi_generic(fsadm_t)
Chris PeBenito 783b38
storage_swapon_fixed_disk(fsadm_t)
Chris PeBenito 58c3da
Chris PeBenito a08248
term_use_console(fsadm_t)
Chris PeBenito a08248
Chris PeBenito ae9e27
corecmd_list_bin(fsadm_t)
Chris PeBenito ae9e27
corecmd_list_sbin(fsadm_t)
Chris PeBenito ae9e27
corecmd_read_bin_symlink(fsadm_t)
Chris PeBenito ae9e27
corecmd_read_sbin_symlink(fsadm_t)
Chris PeBenito ae9e27
# cjp: these are probably not needed:
Chris PeBenito ae9e27
corecmd_read_bin_file(fsadm_t)
Chris PeBenito ae9e27
corecmd_read_bin_pipe(fsadm_t)
Chris PeBenito ae9e27
corecmd_read_bin_socket(fsadm_t)
Chris PeBenito ae9e27
corecmd_read_sbin_file(fsadm_t)
Chris PeBenito ae9e27
corecmd_read_sbin_pipe(fsadm_t)
Chris PeBenito ae9e27
corecmd_read_sbin_socket(fsadm_t)
Chris PeBenito ae9e27
Chris PeBenito 58c3da
domain_use_wide_inherit_fd(fsadm_t)
Chris PeBenito 58c3da
Chris PeBenito 58c3da
files_list_home(fsadm_t)
Chris PeBenito 58c3da
files_read_usr_files(fsadm_t)
Chris PeBenito 8fd367
files_read_etc_files(fsadm_t)
Chris PeBenito cbca03
files_manage_lost_found(fsadm_t)
Chris PeBenito a42ca7
files_manage_isid_type_dir(fsadm_t)
Chris PeBenito 58c3da
# Write to /etc/mtab.
Chris PeBenito 58c3da
files_manage_etc_runtime_files(fsadm_t)
Chris PeBenito 58c3da
# Access to /initrd devices
Chris PeBenito 58c3da
files_rw_isid_type_dir(fsadm_t)
Chris PeBenito 58c3da
files_rw_isid_type_blk_node(fsadm_t)
Chris PeBenito a42ca7
# Recreate /mnt/cdrom.
Chris PeBenito a42ca7
files_manage_mnt_dirs(fsadm_t)
Chris PeBenito 58c3da
Chris PeBenito 58c3da
init_use_fd(fsadm_t)
Chris PeBenito 58c3da
init_use_script_pty(fsadm_t)
Chris PeBenito 58c3da
Chris PeBenito 58c3da
libs_use_ld_so(fsadm_t)
Chris PeBenito 58c3da
libs_use_shared_libs(fsadm_t)
Chris PeBenito 58c3da
Chris PeBenito 58c3da
logging_send_syslog_msg(fsadm_t)
Chris PeBenito 58c3da
Chris PeBenito 58c3da
miscfiles_read_localization(fsadm_t)
Chris PeBenito 58c3da
Chris PeBenito 58c3da
modutils_read_module_conf(fsadm_t)
Chris PeBenito 58c3da
Chris PeBenito 58c3da
seutil_read_config(fsadm_t)
Chris PeBenito 58c3da
Chris PeBenito 58c3da
userdom_use_unpriv_users_fd(fsadm_t)
Chris PeBenito 58c3da
Chris PeBenito a42ca7
tunable_policy(`read_default_t',`
Chris PeBenito a42ca7
	files_list_default(fsadm_t)
Chris PeBenito a42ca7
	files_read_default_files(fsadm_t)
Chris PeBenito a42ca7
	files_read_default_symlinks(fsadm_t)
Chris PeBenito a42ca7
	files_read_default_sockets(fsadm_t)
Chris PeBenito a42ca7
	files_read_default_pipes(fsadm_t)
Chris PeBenito a42ca7
')
Chris PeBenito a42ca7
Chris PeBenito 783b38
optional_policy(`cron.te',`
Chris PeBenito 783b38
	# for smartctl cron jobs
Chris PeBenito 783b38
	cron_system_entry(fsadm_t,fsadm_exec_t)
Chris PeBenito 783b38
')
Chris PeBenito 783b38
Chris PeBenito 58c3da
optional_policy(`nis.te',`
Chris PeBenito 58c3da
	nis_use_ypbind(fsadm_t)
Chris PeBenito 58c3da
')
Chris PeBenito 58c3da
Chris PeBenito 58c3da
ifdef(`TODO',`
Chris PeBenito a1fcff
allow fsadm_t tmpfs_t:file { read write };
Chris PeBenito a1fcff
allow fsadm_t ramfs_t:fifo_file rw_file_perms;
Chris PeBenito 58c3da
ifdef(`gnome-pty-helper.te', `allow fsadm_t sysadm_gph_t:fd use;')
Chris PeBenito 58c3da
') dnl end TODO