2005-06-27 20:59:28 +00:00
|
|
|
|
2007-08-22 20:02:41 +00:00
|
|
|
policy_module(fstools,1.7.1)
|
2005-06-27 20:59:28 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
2005-06-30 18:54:08 +00:00
|
|
|
|
2005-09-26 20:26:32 +00:00
|
|
|
type fsadm_t;
|
2005-06-27 20:59:28 +00:00
|
|
|
type fsadm_exec_t;
|
|
|
|
init_system_domain(fsadm_t,fsadm_exec_t)
|
|
|
|
role system_r types fsadm_t;
|
|
|
|
|
2006-09-04 18:22:12 +00:00
|
|
|
type fsadm_log_t;
|
|
|
|
logging_log_file(fsadm_log_t)
|
|
|
|
|
2005-06-27 20:59:28 +00:00
|
|
|
type fsadm_tmp_t;
|
|
|
|
files_tmp_file(fsadm_tmp_t)
|
|
|
|
|
2006-02-20 16:31:54 +00:00
|
|
|
type swapfile_t; # customizable
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type(swapfile_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
|
|
|
|
########################################
|
2005-06-30 18:54:08 +00:00
|
|
|
#
|
|
|
|
# local policy
|
|
|
|
#
|
2005-06-27 20:59:28 +00:00
|
|
|
|
|
|
|
# ipc_lock is for losetup
|
2007-02-16 23:01:42 +00:00
|
|
|
allow fsadm_t self:capability { ipc_lock sys_rawio sys_admin sys_resource sys_tty_config dac_override dac_read_search };
|
2005-09-01 20:13:42 +00:00
|
|
|
allow fsadm_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execmem execheap };
|
2005-06-27 20:59:28 +00:00
|
|
|
allow fsadm_t self:fd use;
|
|
|
|
allow fsadm_t self:fifo_file rw_file_perms;
|
2005-11-08 22:00:30 +00:00
|
|
|
allow fsadm_t self:sock_file r_file_perms;
|
2005-06-27 20:59:28 +00:00
|
|
|
allow fsadm_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow fsadm_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
allow fsadm_t self:unix_dgram_socket sendto;
|
|
|
|
allow fsadm_t self:unix_stream_socket connectto;
|
|
|
|
allow fsadm_t self:shm create_shm_perms;
|
|
|
|
allow fsadm_t self:sem create_sem_perms;
|
|
|
|
allow fsadm_t self:msgq create_msgq_perms;
|
|
|
|
allow fsadm_t self:msg { send receive };
|
|
|
|
|
|
|
|
can_exec(fsadm_t, fsadm_exec_t)
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow fsadm_t fsadm_tmp_t:dir manage_dir_perms;
|
|
|
|
allow fsadm_t fsadm_tmp_t:file manage_file_perms;
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(fsadm_t, fsadm_tmp_t, { file dir })
|
2005-06-27 20:59:28 +00:00
|
|
|
|
2006-09-04 18:22:12 +00:00
|
|
|
# log files
|
2006-12-12 20:08:08 +00:00
|
|
|
allow fsadm_t fsadm_log_t:dir setattr;
|
|
|
|
manage_files_pattern(fsadm_t,fsadm_log_t,fsadm_log_t)
|
2006-09-04 18:22:12 +00:00
|
|
|
logging_log_filetrans(fsadm_t,fsadm_log_t,file)
|
|
|
|
|
2005-06-27 20:59:28 +00:00
|
|
|
# Enable swapping to files
|
2007-02-16 23:01:42 +00:00
|
|
|
allow fsadm_t swapfile_t:file { rw_file_perms swapon };
|
2005-06-27 20:59:28 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(fsadm_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(fsadm_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
# Allow console log change (updfstab)
|
|
|
|
kernel_change_ring_buffer_level(fsadm_t)
|
2005-07-08 20:44:57 +00:00
|
|
|
# mkreiserfs needs this
|
|
|
|
kernel_getattr_proc(fsadm_t)
|
2006-03-23 19:19:38 +00:00
|
|
|
kernel_getattr_core_if(fsadm_t)
|
2005-07-08 20:44:57 +00:00
|
|
|
# Access to /initrd devices
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_rw_unlabeled_dirs(fsadm_t)
|
|
|
|
kernel_rw_unlabeled_blk_files(fsadm_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
files_getattr_boot_dirs(fsadm_t)
|
2006-02-13 22:05:08 +00:00
|
|
|
|
2005-09-19 21:17:45 +00:00
|
|
|
dev_getattr_all_chr_files(fsadm_t)
|
2006-03-23 19:19:38 +00:00
|
|
|
dev_dontaudit_getattr_all_blk_files(fsadm_t)
|
2007-08-22 20:02:41 +00:00
|
|
|
dev_dontaudit_getattr_generic_files(fsadm_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
# mkreiserfs and other programs need this for UUID
|
|
|
|
dev_read_rand(fsadm_t)
|
|
|
|
dev_read_urand(fsadm_t)
|
|
|
|
# Recreate /dev/cdrom.
|
|
|
|
dev_manage_generic_symlinks(fsadm_t)
|
2006-03-30 15:59:39 +00:00
|
|
|
# fdisk needs this for early boot
|
|
|
|
dev_manage_generic_blk_files(fsadm_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
# Access to /initrd devices
|
|
|
|
dev_search_usbfs(fsadm_t)
|
2005-06-28 17:32:57 +00:00
|
|
|
# for swapon
|
2005-09-16 13:36:26 +00:00
|
|
|
dev_read_sysfs(fsadm_t)
|
2005-07-08 20:44:57 +00:00
|
|
|
# Access to /initrd devices
|
2006-01-31 16:08:56 +00:00
|
|
|
dev_getattr_usbfs_dirs(fsadm_t)
|
2006-01-11 15:28:14 +00:00
|
|
|
# Access to /dev/mapper/control
|
|
|
|
dev_rw_lvm_control(fsadm_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
|
|
|
|
fs_search_auto_mountpoints(fsadm_t)
|
|
|
|
fs_getattr_xattr_fs(fsadm_t)
|
2006-01-31 20:29:27 +00:00
|
|
|
fs_rw_ramfs_pipes(fsadm_t)
|
|
|
|
fs_rw_tmpfs_files(fsadm_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
# remount file system to apply changes
|
|
|
|
fs_remount_xattr_fs(fsadm_t)
|
2005-07-08 20:44:57 +00:00
|
|
|
# for /dev/shm
|
|
|
|
fs_search_tmpfs(fsadm_t)
|
2006-01-31 20:29:27 +00:00
|
|
|
fs_getattr_tmpfs_dirs(fsadm_t)
|
2006-01-25 15:53:35 +00:00
|
|
|
fs_read_tmpfs_symlinks(fsadm_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
|
2007-08-20 18:26:08 +00:00
|
|
|
mls_file_read_all_levels(fsadm_t)
|
|
|
|
mls_file_write_all_levels(fsadm_t)
|
2005-11-07 20:09:28 +00:00
|
|
|
|
2005-06-27 20:59:28 +00:00
|
|
|
storage_raw_read_fixed_disk(fsadm_t)
|
|
|
|
storage_raw_write_fixed_disk(fsadm_t)
|
|
|
|
storage_raw_read_removable_device(fsadm_t)
|
|
|
|
storage_raw_write_removable_device(fsadm_t)
|
|
|
|
storage_read_scsi_generic(fsadm_t)
|
2005-06-28 17:32:57 +00:00
|
|
|
storage_swapon_fixed_disk(fsadm_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
|
2005-09-16 13:36:26 +00:00
|
|
|
term_use_console(fsadm_t)
|
|
|
|
|
2005-07-11 19:02:50 +00:00
|
|
|
corecmd_list_bin(fsadm_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
corecmd_read_bin_symlinks(fsadm_t)
|
2006-09-22 17:14:35 +00:00
|
|
|
#RedHat bug #201164
|
|
|
|
corecmd_exec_shell(fsadm_t)
|
|
|
|
|
2005-07-11 19:02:50 +00:00
|
|
|
# cjp: these are probably not needed:
|
2006-02-02 21:08:12 +00:00
|
|
|
corecmd_read_bin_files(fsadm_t)
|
|
|
|
corecmd_read_bin_pipes(fsadm_t)
|
|
|
|
corecmd_read_bin_sockets(fsadm_t)
|
2005-07-11 19:02:50 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(fsadm_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
|
|
|
|
files_list_home(fsadm_t)
|
|
|
|
files_read_usr_files(fsadm_t)
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(fsadm_t)
|
2005-06-28 17:48:59 +00:00
|
|
|
files_manage_lost_found(fsadm_t)
|
2006-01-31 19:21:01 +00:00
|
|
|
files_manage_isid_type_dirs(fsadm_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
# Write to /etc/mtab.
|
|
|
|
files_manage_etc_runtime_files(fsadm_t)
|
2006-05-02 18:34:35 +00:00
|
|
|
files_etc_filetrans_etc_runtime(fsadm_t,file)
|
2005-06-27 20:59:28 +00:00
|
|
|
# Access to /initrd devices
|
2006-01-31 19:21:01 +00:00
|
|
|
files_rw_isid_type_dirs(fsadm_t)
|
|
|
|
files_rw_isid_type_blk_files(fsadm_t)
|
2005-07-08 20:44:57 +00:00
|
|
|
# Recreate /mnt/cdrom.
|
|
|
|
files_manage_mnt_dirs(fsadm_t)
|
2005-10-14 17:55:40 +00:00
|
|
|
# for tune2fs
|
|
|
|
files_search_all(fsadm_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
init_use_fds(fsadm_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
init_use_script_ptys(fsadm_t)
|
2006-03-23 19:19:38 +00:00
|
|
|
init_dontaudit_getattr_initctl(fsadm_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
|
|
|
|
libs_use_ld_so(fsadm_t)
|
|
|
|
libs_use_shared_libs(fsadm_t)
|
|
|
|
|
|
|
|
logging_send_syslog_msg(fsadm_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(fsadm_t)
|
|
|
|
|
2006-02-02 21:08:12 +00:00
|
|
|
modutils_read_module_config(fsadm_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
|
|
|
|
seutil_read_config(fsadm_t)
|
|
|
|
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_use_unpriv_users_fds(fsadm_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
|
2005-11-08 22:00:30 +00:00
|
|
|
ifdef(`targeted_policy',`
|
2006-02-02 21:08:12 +00:00
|
|
|
term_use_unallocated_ttys(fsadm_t)
|
|
|
|
term_use_generic_ptys(fsadm_t)
|
2005-11-08 22:00:30 +00:00
|
|
|
')
|
|
|
|
|
2005-07-08 20:44:57 +00:00
|
|
|
tunable_policy(`read_default_t',`
|
|
|
|
files_list_default(fsadm_t)
|
|
|
|
files_read_default_files(fsadm_t)
|
|
|
|
files_read_default_symlinks(fsadm_t)
|
|
|
|
files_read_default_sockets(fsadm_t)
|
|
|
|
files_read_default_pipes(fsadm_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-02-20 16:31:54 +00:00
|
|
|
amanda_rw_dumpdates_files(fsadm_t)
|
|
|
|
amanda_append_log_files(fsadm_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-28 17:32:57 +00:00
|
|
|
# for smartctl cron jobs
|
|
|
|
cron_system_entry(fsadm_t,fsadm_exec_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-27 20:59:28 +00:00
|
|
|
nis_use_ypbind(fsadm_t)
|
|
|
|
')
|
2006-03-09 19:02:29 +00:00
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-03-09 19:02:29 +00:00
|
|
|
fs_dontaudit_write_ramfs_pipes(fsadm_t)
|
|
|
|
rhgb_stub(fsadm_t)
|
|
|
|
')
|
2007-08-22 20:02:41 +00:00
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
xen_append_log(fsadm_t)
|
|
|
|
')
|