--- nsaserefpolicy/policy/modules/kernel/files.fc 2008-08-07 11:15:01.000000000 -0400 +++ serefpolicy-3.5.5/policy/modules/kernel/files.fc 2008-08-14 13:53:54.000000000 -0400 @@ -32,6 +32,7 @@ /boot/lost\+found -d gen_context(system_u:object_r:lost_found_t,mls_systemhigh) /boot/lost\+found/.* <> /boot/System\.map(-.*)? -- gen_context(system_u:object_r:system_map_t,s0) +/boot/efi(/.*)?/System\.map(-.*)? -- gen_context(system_u:object_r:system_map_t,s0) # # /emul --- nsaserefpolicy/policy/modules/kernel/files.if 2008-08-07 11:15:01.000000000 -0400 +++ serefpolicy-3.5.5/policy/modules/kernel/files.if 2008-08-14 13:53:54.000000000 -0400 @@ -110,6 +110,11 @@ ## # interface(`files_config_file',` + gen_require(` + attribute etcfile; + ') + + typeattribute $1 etcfile; files_type($1) ') @@ -1303,6 +1308,24 @@ ######################################## ## +## Remove entries from the tmp directory. +## +## +## +## Domain allowed access. +## +## +# +interface(`files_delete_tmp_dir_entry',` + gen_require(` + type root_t; + ') + + allow $1 tmp_t:dir del_entry_dir_perms; +') + +######################################## +## ## Unmount a rootfs filesystem. ## ## @@ -1889,6 +1912,26 @@ ######################################## ## +## Read config files in /etc. +## +## +## +## Domain allowed access. +## +## +# +interface(`files_read_config_files',` + gen_require(` + attribute etcfile; + ') + + allow $1 etcfile:dir list_dir_perms; + read_files_pattern($1, etcfile, etcfile) + read_lnk_files_pattern($1, etcfile, etcfile) +') + +######################################## +## ## Do not audit attempts to write generic files in /etc. ## ## @@ -2224,6 +2267,49 @@ ######################################## ## +## Delete directories on new filesystems +## that have not yet been labeled. +## +## +## +## Domain allowed access. +## +## +# +interface(`files_delete_isid_type_dirs',` + gen_require(` + type file_t; + ') + + delete_dirs_pattern($1, file_t, file_t) +') + +######################################## +## +## Delete files on new filesystems +## that have not yet been labeled. +## +## +## +## Domain allowed access. +## +## +# +interface(`files_delete_isid_type_files',` + gen_require(` + type file_t; + ') + + delete_files_pattern($1, file_t, file_t) + delete_lnk_files_pattern($1, file_t, file_t) + delete_fifo_files_pattern($1, file_t, file_t) + delete_sock_files_pattern($1, file_t, file_t) + delete_blk_files_pattern($1, file_t, file_t) + delete_chr_files_pattern($1, file_t, file_t) +') + +######################################## +## ## Do not audit attempts to search directories on new filesystems ## that have not yet been labeled. ## @@ -2744,6 +2830,24 @@ ######################################## ## +## read files in /mnt. +## +## +## +## Domain allowed access. +## +## +# +interface(`files_read_mnt_files',` + gen_require(` + type mnt_t; + ') + + read_files_pattern($1, mnt_t, mnt_t) +') + +######################################## +## ## Create, read, write, and delete symbolic links in /mnt. ## ## @@ -3394,6 +3498,8 @@ delete_lnk_files_pattern($1, tmpfile, tmpfile) delete_fifo_files_pattern($1, tmpfile, tmpfile) delete_sock_files_pattern($1, tmpfile, tmpfile) + files_delete_isid_type_dirs($1) + files_delete_isid_type_files($1) ') ######################################## @@ -3471,6 +3577,47 @@ ######################################## ## +## Delete generic directories in /usr in the caller domain. +## +## +## +## Domain allowed access. +## +## +# +interface(`files_delete_usr_dirs',` + gen_require(` + type usr_t; + ') + + delete_dirs_pattern($1, usr_t, usr_t) +') + +######################################## +## +## Delete generic files in /usr in the caller domain. +## +## +## +## Domain allowed access. +## +## +# +interface(`files_delete_usr_files',` + gen_require(` + type usr_t; + ') + + delete_files_pattern($1, usr_t, usr_t) + delete_lnk_files_pattern($1, usr_t, usr_t) + delete_fifo_files_pattern($1, usr_t, usr_t) + delete_sock_files_pattern($1, usr_t, usr_t) + delete_blk_files_pattern($1, usr_t, usr_t) + delete_chr_files_pattern($1, usr_t, usr_t) +') + +######################################## +## ## Get the attributes of files in /usr. ## ## @@ -3547,6 +3694,24 @@ ######################################## ## +## dontaudit write of /usr files +## +## +## +## Domain allowed access. +## +## +# +interface(`files_dontaudit_write_usr_files',` + gen_require(` + type usr_t; + ') + + dontaudit $1 usr_t:file write; +') + +######################################## +## ## Relabel a file to the type used in /usr. ## ## @@ -4761,12 +4926,14 @@ allow $1 poly_t:dir { create mounton }; fs_unmount_xattr_fs($1) + fs_mount_tmpfs($1) + fs_unmount_tmpfs($1) + ifdef(`distro_redhat',` # namespace.init files_search_home($1) corecmd_exec_bin($1) seutil_domtrans_setfiles($1) - mount_domtrans($1) ') ') @@ -4787,3 +4954,53 @@ typeattribute $1 files_unconfined_type; ') + +######################################## +## +## Create a core files in / +## +## +##

+## Create a core file in /, +##

+##
+## +## +## Domain allowed access. +## +## +## +# +interface(`files_dump_core',` + gen_require(` + type root_t; + ') + + manage_files_pattern($1, root_t, root_t) +') + +######################################## +## +## Create a default directory in / +## +## +##

+## Create a default_t direcrory in / +##

+##
+## +## +## Domain allowed access. +## +## +## +# +interface(`files_create_default_dir',` + gen_require(` + type root_t, default_t; + ') + + allow $1 default_t:dir create; + filetrans_pattern($1, root_t, default_t, dir) +') + --- nsaserefpolicy/policy/modules/kernel/files.te 2008-08-07 11:15:01.000000000 -0400 +++ serefpolicy-3.5.5/policy/modules/kernel/files.te 2008-08-14 13:53:54.000000000 -0400 @@ -52,11 +52,14 @@ # # etc_t is the type of the system etc directories. # -type etc_t; +attribute etcfile; + +type etc_t, etcfile; files_type(etc_t) # compatibility aliases for removed types: typealias etc_t alias automount_etc_t; typealias etc_t alias snmpd_etc_t; +typealias etc_t alias gconf_etc_t; # # etc_runtime_t is the type of various @@ -174,6 +177,7 @@ # type var_run_t; files_pid_file(var_run_t) +files_mountpoint(var_run_t) # # var_spool_t is the type of /var/spool @@ -197,10 +201,7 @@ # # Rules for all tmp file types # - -allow tmpfile tmp_t:filesystem associate; - -fs_associate_tmpfs(tmpfile) +allow file_type tmp_t:filesystem associate; ######################################## #