2013-01-03 15:53:34 +00:00
|
|
|
policy_module(bootloader, 1.13.2)
|
2005-04-26 17:00:25 +00:00
|
|
|
|
2005-04-28 21:41:09 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2011-08-12 14:37:56 +00:00
|
|
|
attribute_role bootloader_roles;
|
|
|
|
roleattribute system_r bootloader_roles;
|
|
|
|
|
2005-04-25 21:32:09 +00:00
|
|
|
#
|
|
|
|
# boot_runtime_t is the type for /boot/kernel.h,
|
|
|
|
# which is automatically generated at boot time.
|
|
|
|
# only for Red Hat
|
|
|
|
#
|
2005-04-16 17:18:34 +00:00
|
|
|
type boot_runtime_t;
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type(boot_runtime_t)
|
2005-04-16 17:18:34 +00:00
|
|
|
|
2005-04-25 21:32:09 +00:00
|
|
|
type bootloader_t;
|
|
|
|
type bootloader_exec_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
application_domain(bootloader_t, bootloader_exec_t)
|
2011-08-12 14:37:56 +00:00
|
|
|
role bootloader_roles types bootloader_t;
|
2005-04-25 21:32:09 +00:00
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
# bootloader_etc_t is the configuration file,
|
|
|
|
# grub.conf, lilo.conf, etc.
|
|
|
|
#
|
|
|
|
type bootloader_etc_t alias etc_bootloader_t;
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type(bootloader_etc_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# The temp file is used for initrd creation;
|
|
|
|
# it consists of files and device nodes
|
|
|
|
#
|
|
|
|
type bootloader_tmp_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_tmp_file(bootloader_tmp_t)
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_node(bootloader_tmp_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-04-22 19:31:32 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# bootloader local policy
|
|
|
|
#
|
|
|
|
|
2006-07-28 15:13:58 +00:00
|
|
|
allow bootloader_t self:capability { dac_override dac_read_search fsetid sys_rawio sys_admin mknod chown };
|
2010-10-04 18:23:17 +00:00
|
|
|
allow bootloader_t self:process { signal_perms execmem };
|
2006-12-12 20:08:08 +00:00
|
|
|
allow bootloader_t self:fifo_file rw_fifo_file_perms;
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow bootloader_t bootloader_etc_t:file read_file_perms;
|
2005-05-13 14:37:13 +00:00
|
|
|
# uncomment the following lines if you use "lilo -p"
|
2006-03-02 23:41:11 +00:00
|
|
|
#allow bootloader_t bootloader_etc_t:file manage_file_perms;
|
|
|
|
#files_etc_filetrans(bootloader_t,bootloader_etc_t,file)
|
2005-05-13 14:37:13 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_dirs_pattern(bootloader_t, bootloader_tmp_t, bootloader_tmp_t)
|
|
|
|
manage_files_pattern(bootloader_t, bootloader_tmp_t, bootloader_tmp_t)
|
|
|
|
manage_lnk_files_pattern(bootloader_t, bootloader_tmp_t, bootloader_tmp_t)
|
|
|
|
manage_blk_files_pattern(bootloader_t, bootloader_tmp_t, bootloader_tmp_t)
|
|
|
|
manage_chr_files_pattern(bootloader_t, bootloader_tmp_t, bootloader_tmp_t)
|
|
|
|
files_tmp_filetrans(bootloader_t, bootloader_tmp_t, { dir file lnk_file chr_file blk_file })
|
2005-05-13 14:37:13 +00:00
|
|
|
# for tune2fs (cjp: ?)
|
2008-07-23 21:38:39 +00:00
|
|
|
files_root_filetrans(bootloader_t, bootloader_tmp_t, file)
|
2005-05-13 14:37:13 +00:00
|
|
|
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_getattr_core_if(bootloader_t)
|
2006-07-28 15:13:58 +00:00
|
|
|
kernel_read_network_state(bootloader_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
kernel_read_system_state(bootloader_t)
|
|
|
|
kernel_read_software_raid_state(bootloader_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(bootloader_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
|
|
|
storage_raw_read_fixed_disk(bootloader_t)
|
|
|
|
storage_raw_write_fixed_disk(bootloader_t)
|
|
|
|
storage_raw_read_removable_device(bootloader_t)
|
|
|
|
storage_raw_write_removable_device(bootloader_t)
|
|
|
|
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_getattr_all_chr_files(bootloader_t)
|
2005-09-01 20:13:42 +00:00
|
|
|
dev_getattr_all_blk_files(bootloader_t)
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_dontaudit_rw_generic_dev_nodes(bootloader_t)
|
|
|
|
dev_read_rand(bootloader_t)
|
|
|
|
dev_read_urand(bootloader_t)
|
2006-02-13 22:05:08 +00:00
|
|
|
dev_read_sysfs(bootloader_t)
|
2006-08-29 02:41:00 +00:00
|
|
|
# needed on some hardware
|
|
|
|
dev_rw_nvram(bootloader_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_getattr_xattr_fs(bootloader_t)
|
2006-07-28 15:13:58 +00:00
|
|
|
fs_getattr_tmpfs(bootloader_t)
|
2006-01-25 15:53:35 +00:00
|
|
|
fs_read_tmpfs_symlinks(bootloader_t)
|
2006-07-28 15:13:58 +00:00
|
|
|
#Needed for ia64
|
|
|
|
fs_manage_dos_files(bootloader_t)
|
2005-05-13 14:37:13 +00:00
|
|
|
|
2007-08-20 18:26:08 +00:00
|
|
|
mls_file_read_all_levels(bootloader_t)
|
|
|
|
mls_file_write_all_levels(bootloader_t)
|
2007-02-16 23:01:42 +00:00
|
|
|
|
2010-02-11 19:20:10 +00:00
|
|
|
term_getattr_all_ttys(bootloader_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
term_dontaudit_manage_pty_dirs(bootloader_t)
|
2005-05-13 14:37:13 +00:00
|
|
|
|
2006-04-19 21:43:02 +00:00
|
|
|
corecmd_exec_all_executables(bootloader_t)
|
2005-04-28 21:41:09 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(bootloader_t)
|
2005-04-28 21:41:09 +00:00
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
files_create_boot_dirs(bootloader_t)
|
|
|
|
files_manage_boot_files(bootloader_t)
|
|
|
|
files_manage_boot_symlinks(bootloader_t)
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(bootloader_t)
|
2005-09-22 21:59:50 +00:00
|
|
|
files_exec_etc_files(bootloader_t)
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_usr_src_files(bootloader_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_read_usr_files(bootloader_t)
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_var_files(bootloader_t)
|
2006-03-02 23:41:11 +00:00
|
|
|
files_read_kernel_modules(bootloader_t)
|
2005-05-13 14:37:13 +00:00
|
|
|
# for nscd
|
2005-06-13 17:35:46 +00:00
|
|
|
files_dontaudit_search_pids(bootloader_t)
|
2006-03-23 19:19:38 +00:00
|
|
|
# for blkid.tab
|
|
|
|
files_manage_etc_runtime_files(bootloader_t)
|
2008-07-23 21:38:39 +00:00
|
|
|
files_etc_filetrans_etc_runtime(bootloader_t, file)
|
2006-06-21 18:25:06 +00:00
|
|
|
files_dontaudit_search_home(bootloader_t)
|
2005-04-28 21:41:09 +00:00
|
|
|
|
2005-07-07 15:20:24 +00:00
|
|
|
init_getattr_initctl(bootloader_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
init_use_script_ptys(bootloader_t)
|
2006-02-20 21:33:25 +00:00
|
|
|
init_use_script_fds(bootloader_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
init_rw_script_pipes(bootloader_t)
|
2005-07-07 15:20:24 +00:00
|
|
|
|
2006-02-02 21:08:12 +00:00
|
|
|
libs_read_lib_files(bootloader_t)
|
2005-09-22 21:59:50 +00:00
|
|
|
libs_exec_lib_files(bootloader_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(bootloader_t)
|
|
|
|
logging_rw_generic_logs(bootloader_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-05-13 14:37:13 +00:00
|
|
|
miscfiles_read_localization(bootloader_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2011-09-13 18:45:14 +00:00
|
|
|
modutils_domtrans_insmod(bootloader_t)
|
2006-06-21 18:25:06 +00:00
|
|
|
|
2006-02-02 21:08:12 +00:00
|
|
|
seutil_read_bin_policy(bootloader_t)
|
|
|
|
seutil_read_loadpolicy(bootloader_t)
|
2005-07-18 18:31:49 +00:00
|
|
|
seutil_dontaudit_search_config(bootloader_t)
|
2005-04-22 19:31:32 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_use_user_terminals(bootloader_t)
|
|
|
|
userdom_dontaudit_search_user_home_dirs(bootloader_t)
|
|
|
|
|
2005-06-27 20:59:28 +00:00
|
|
|
ifdef(`distro_debian',`
|
|
|
|
allow bootloader_t bootloader_tmp_t:{ dir file } { relabelfrom relabelto };
|
2005-08-15 19:31:37 +00:00
|
|
|
fs_list_tmpfs(bootloader_t)
|
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
files_relabel_kernel_modules(bootloader_t)
|
|
|
|
files_relabelfrom_boot_files(bootloader_t)
|
|
|
|
files_delete_kernel_modules(bootloader_t)
|
2005-08-15 19:31:37 +00:00
|
|
|
files_relabelto_usr_files(bootloader_t)
|
|
|
|
files_search_var_lib(bootloader_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
# for /usr/share/initrd-tools/scripts
|
|
|
|
files_exec_usr_files(bootloader_t)
|
2005-08-15 19:31:37 +00:00
|
|
|
|
|
|
|
fstools_manage_entry_files(bootloader_t)
|
|
|
|
fstools_relabelto_entry_files(bootloader_t)
|
|
|
|
|
|
|
|
libs_relabelto_lib_files(bootloader_t)
|
2005-05-13 14:37:13 +00:00
|
|
|
')
|
2005-04-28 21:41:09 +00:00
|
|
|
|
2005-06-27 20:59:28 +00:00
|
|
|
ifdef(`distro_redhat',`
|
2005-06-03 12:25:14 +00:00
|
|
|
# for memlock
|
|
|
|
allow bootloader_t self:capability ipc_lock;
|
|
|
|
|
|
|
|
# new file system defaults to file_t, granting file_t access is still bad.
|
2010-10-04 18:23:17 +00:00
|
|
|
allow bootloader_t boot_runtime_t:file { read_file_perms delete_file_perms };
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-27 20:59:28 +00:00
|
|
|
# new file system defaults to file_t, granting file_t access is still bad.
|
2006-01-31 19:21:01 +00:00
|
|
|
files_manage_isid_type_dirs(bootloader_t)
|
|
|
|
files_manage_isid_type_files(bootloader_t)
|
|
|
|
files_manage_isid_type_symlinks(bootloader_t)
|
|
|
|
files_manage_isid_type_blk_files(bootloader_t)
|
|
|
|
files_manage_isid_type_chr_files(bootloader_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
|
2005-06-03 12:25:14 +00:00
|
|
|
# for mke2fs
|
2011-08-12 14:37:56 +00:00
|
|
|
mount_run(bootloader_t, bootloader_roles)
|
2008-08-14 14:19:50 +00:00
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
unconfined_domain(bootloader_t)
|
|
|
|
')
|
2005-05-13 14:37:13 +00:00
|
|
|
')
|
2005-04-28 21:41:09 +00:00
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-09-14 00:30:10 +00:00
|
|
|
fstools_exec(bootloader_t)
|
2005-05-13 14:37:13 +00:00
|
|
|
')
|
2005-04-28 21:41:09 +00:00
|
|
|
|
2006-12-04 20:10:56 +00:00
|
|
|
optional_policy(`
|
|
|
|
hal_dontaudit_append_lib_files(bootloader_t)
|
2007-09-05 14:48:21 +00:00
|
|
|
hal_write_log(bootloader_t)
|
2006-12-04 20:10:56 +00:00
|
|
|
')
|
|
|
|
|
2006-06-21 18:25:06 +00:00
|
|
|
optional_policy(`
|
|
|
|
kudzu_domtrans(bootloader_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_rw_lvm_control(bootloader_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
lvm_domtrans(bootloader_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
lvm_read_config(bootloader_t)
|
2005-05-13 14:37:13 +00:00
|
|
|
')
|
2005-04-28 21:41:09 +00:00
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-18 18:25:33 +00:00
|
|
|
modutils_exec_insmod(bootloader_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
modutils_read_module_deps(bootloader_t)
|
|
|
|
modutils_read_module_config(bootloader_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
modutils_exec_insmod(bootloader_t)
|
|
|
|
modutils_exec_depmod(bootloader_t)
|
|
|
|
modutils_exec_update_mods(bootloader_t)
|
2005-05-13 14:37:13 +00:00
|
|
|
')
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2012-12-17 20:06:29 +00:00
|
|
|
nscd_use(bootloader_t)
|
2005-11-16 21:08:52 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-02-02 21:08:12 +00:00
|
|
|
rpm_rw_pipes(bootloader_t)
|
2005-07-12 20:34:24 +00:00
|
|
|
')
|