diff --git a/policy/modules/admin/shorewall.if b/policy/modules/admin/shorewall.if index b83f3db1..f1981194 100644 --- a/policy/modules/admin/shorewall.if +++ b/policy/modules/admin/shorewall.if @@ -185,18 +185,18 @@ interface(`shorewall_admin',` role_transition $2 shorewall_initrc_exec_t system_r; allow $2 system_r; - files_search_etc($1) + files_list_etc($1) admin_pattern($1, shorewall_etc_t) - files_search_locks($1) + files_list_locks($1) admin_pattern($1, shorewall_lock_t) - files_search_var_lib($1) + files_list_var_lib($1) admin_pattern($1, shorewall_var_lib_t) - logging_search_logs($1) + logging_list_logs($1) admin_pattern($1, shorewall_log_t) - files_search_tmp($1) + files_list_tmp($1) admin_pattern($1, shorewall_tmp_t) ') diff --git a/policy/modules/apps/gnome.if b/policy/modules/apps/gnome.if index 250935ae..594dc0f6 100644 --- a/policy/modules/apps/gnome.if +++ b/policy/modules/apps/gnome.if @@ -320,7 +320,7 @@ interface(`gnome_admin_home_gconf_filetrans',` ## ## # -template(`gnome_read_gconf_config',` +interface(`gnome_read_gconf_config',` gen_require(` type gconf_etc_t; ') @@ -498,7 +498,7 @@ interface(`gnome_stream_connect',` ## ## # -template(`gnome_list_home_config',` +interface(`gnome_list_home_config',` gen_require(` type config_home_t; ') @@ -535,7 +535,7 @@ template(`gnome_setattr_home_config',` ## ## # -template(`gnome_read_home_config',` +interface(`gnome_read_home_config',` gen_require(` type config_home_t; ') diff --git a/policy/modules/kernel/files.if b/policy/modules/kernel/files.if index 96a406db..000c53a5 100644 --- a/policy/modules/kernel/files.if +++ b/policy/modules/kernel/files.if @@ -5286,6 +5286,24 @@ interface(`files_manage_mounttab',` manage_files_pattern($1, var_lib_t, var_lib_t) ') +######################################## +## +## List generic lock directories. +## +## +## +## Domain allowed access. +## +## +# +interface(`files_list_locks',` + gen_require(` + type var_t, var_lock_t; + ') + + list_dirs_pattern($1, var_t, var_lock_t) +') + ######################################## ## ## Search the locks directory (/var/lock). diff --git a/policy/modules/services/abrt.if b/policy/modules/services/abrt.if index 022c0792..8961dba6 100644 --- a/policy/modules/services/abrt.if +++ b/policy/modules/services/abrt.if @@ -326,18 +326,18 @@ interface(`abrt_admin',` role_transition $2 abrt_initrc_exec_t system_r; allow $2 system_r; - files_search_etc($1) + files_list_etc($1) admin_pattern($1, abrt_etc_t) - logging_search_logs($1) + logging_list_logs($1) admin_pattern($1, abrt_var_log_t) - files_search_var($1) + files_list_var($1) admin_pattern($1, abrt_var_cache_t) - files_search_pids($1) + files_list_pids($1) admin_pattern($1, abrt_var_run_t) - files_search_tmp($1) + files_list_tmp($1) admin_pattern($1, abrt_tmp_t) ') diff --git a/policy/modules/services/abrt.te b/policy/modules/services/abrt.te index 2bd70ae6..5be7dc8e 100644 --- a/policy/modules/services/abrt.te +++ b/policy/modules/services/abrt.te @@ -6,10 +6,10 @@ policy_module(abrt, 1.1.1) # ## -##

-## Allow ABRT to modify public files -## used for public file transfer services. -##

+##

+## Allow ABRT to modify public files +## used for public file transfer services. +##

##
gen_tunable(abrt_anon_write, false) @@ -154,7 +154,7 @@ userdom_dontaudit_read_user_home_content_files(abrt_t) userdom_dontaudit_read_admin_home_files(abrt_t) tunable_policy(`abrt_anon_write',` - miscfiles_manage_public_files(abrt_t) + miscfiles_manage_public_files(abrt_t) ') optional_policy(` @@ -175,7 +175,7 @@ optional_policy(` ') optional_policy(` - policykit_dbus_chat(abrt_t) + policykit_dbus_chat(abrt_t) policykit_domtrans_auth(abrt_t) policykit_read_lib(abrt_t) policykit_read_reload(abrt_t) @@ -214,7 +214,7 @@ optional_policy(` ######################################## # -# abrt--helper local policy +# abrt-helper local policy # allow abrt_helper_t self:capability { chown setgid sys_nice }; @@ -248,27 +248,27 @@ miscfiles_read_localization(abrt_helper_t) term_dontaudit_use_all_ttys(abrt_helper_t) term_dontaudit_use_all_ptys(abrt_helper_t) -ifdef(`hide_broken_symptoms', ` +ifdef(`hide_broken_symptoms',` domain_dontaudit_leaks(abrt_helper_t) userdom_dontaudit_read_user_home_content_files(abrt_helper_t) userdom_dontaudit_read_user_tmp_files(abrt_helper_t) - optional_policy(` - rpm_dontaudit_leaks(abrt_helper_t) - ') dev_dontaudit_read_all_blk_files(abrt_helper_t) dev_dontaudit_read_all_chr_files(abrt_helper_t) dev_dontaudit_write_all_chr_files(abrt_helper_t) dev_dontaudit_write_all_blk_files(abrt_helper_t) fs_dontaudit_rw_anon_inodefs_files(abrt_helper_t) + + optional_policy(` + rpm_dontaudit_leaks(abrt_helper_t) + ') ') - -ifdef(`hide_broken_symptoms', ` +ifdef(`hide_broken_symptoms',` gen_require(` - attribute domain; + attribute domain; ') - allow abrt_t self:capability sys_resource; + allow abrt_t self:capability sys_resource; allow abrt_t domain:file write; allow abrt_t domain:process setrlimit; ') diff --git a/policy/modules/services/accountsd.if b/policy/modules/services/accountsd.if index b46f76fc..fe060aae 100644 --- a/policy/modules/services/accountsd.if +++ b/policy/modules/services/accountsd.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run accountsd. ##
## -## +## ## Domain allowed access. -## +## ## # interface(`accountsd_domtrans',` diff --git a/policy/modules/services/afs.te b/policy/modules/services/afs.te index 9ec36b90..7e2cdf20 100644 --- a/policy/modules/services/afs.te +++ b/policy/modules/services/afs.te @@ -82,10 +82,6 @@ files_var_filetrans(afs_t, afs_cache_t, { file dir }) kernel_rw_afs_state(afs_t) -ifdef(`hide_broken_symptoms', ` - kernel_rw_unlabeled_files(afs_t) -') - corenet_all_recvfrom_unlabeled(afs_t) corenet_all_recvfrom_netlabel(afs_t) corenet_tcp_sendrecv_generic_if(afs_t) @@ -111,6 +107,10 @@ miscfiles_read_localization(afs_t) sysnet_dns_name_resolve(afs_t) +ifdef(`hide_broken_symptoms',` + kernel_rw_unlabeled_files(afs_t) +') + ######################################## # # AFS bossserver local policy diff --git a/policy/modules/services/aiccu.if b/policy/modules/services/aiccu.if index 420c8560..6bf0ad65 100644 --- a/policy/modules/services/aiccu.if +++ b/policy/modules/services/aiccu.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run aiccu. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`aiccu_domtrans',` @@ -19,7 +19,6 @@ interface(`aiccu_domtrans',` corecmd_search_bin($1) ') - ######################################## ## ## Execute aiccu server in the aiccu domain. @@ -78,7 +77,6 @@ interface(`aiccu_manage_var_run',` files_search_pids($1) ') - ######################################## ## ## All of the rules required to administrate @@ -111,8 +109,8 @@ interface(`aiccu_admin',` allow $2 system_r; admin_pattern($1, aiccu_etc_t) - files_search_etc($1) + files_list_etc($1) admin_pattern($1, aiccu_var_run_t) - files_search_pids($1) + files_list_pids($1) ') diff --git a/policy/modules/services/aiccu.te b/policy/modules/services/aiccu.te index 416c49e3..4b9dc88a 100644 --- a/policy/modules/services/aiccu.te +++ b/policy/modules/services/aiccu.te @@ -35,8 +35,8 @@ allow aiccu_t self:unix_stream_socket create_stream_socket_perms; allow aiccu_t aiccu_etc_t:file read_file_perms; -manage_dirs_pattern(aiccu_t, aiccu_var_run_t, aiccu_var_run_t) -manage_files_pattern(aiccu_t, aiccu_var_run_t, aiccu_var_run_t) +manage_dirs_pattern(aiccu_t, aiccu_var_run_t, aiccu_var_run_t) +manage_files_pattern(aiccu_t, aiccu_var_run_t, aiccu_var_run_t) files_pid_filetrans(aiccu_t, aiccu_var_run_t, { file dir }) kernel_read_system_state(aiccu_t) diff --git a/policy/modules/services/aide.if b/policy/modules/services/aide.if index 838d25b3..0b0db39f 100644 --- a/policy/modules/services/aide.if +++ b/policy/modules/services/aide.if @@ -33,6 +33,7 @@ interface(`aide_domtrans',` ## The role to allow the AIDE domain. ## ## +## # interface(`aide_run',` gen_require(` diff --git a/policy/modules/services/aisexec.if b/policy/modules/services/aisexec.if index 0370dba1..af5d2299 100644 --- a/policy/modules/services/aisexec.if +++ b/policy/modules/services/aisexec.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run aisexec. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`aisexec_domtrans',` diff --git a/policy/modules/services/ajaxterm.if b/policy/modules/services/ajaxterm.if index 581ae6e4..8e6e2c3e 100644 --- a/policy/modules/services/ajaxterm.if +++ b/policy/modules/services/ajaxterm.if @@ -1,4 +1,3 @@ - ## policy for ajaxterm ######################################## @@ -6,9 +5,9 @@ ## Execute a domain transition to run ajaxterm. ## ## -## +## ## Domain allowed access. -## +## ## # interface(`ajaxterm_domtrans',` @@ -19,14 +18,13 @@ interface(`ajaxterm_domtrans',` domtrans_pattern($1, ajaxterm_exec_t, ajaxterm_t) ') - ######################################## ## ## Execute ajaxterm server in the ajaxterm domain. ## ## ## -## The type of the process performing this action. +## Domain allowed to transition. ## ## # @@ -57,8 +55,7 @@ interface(`ajaxterm_initrc_domtrans',` # interface(`ajaxterm_admin',` gen_require(` - type ajaxterm_t; - type ajaxterm_initrc_exec_t; + type ajaxterm_t, ajaxterm_initrc_exec_t; ') allow $1 ajaxterm_t:process { ptrace signal_perms }; @@ -68,5 +65,4 @@ interface(`ajaxterm_admin',` domain_system_change_exemption($1) role_transition $2 ajaxterm_initrc_exec_t system_r; allow $2 system_r; - ') diff --git a/policy/modules/services/ajaxterm.te b/policy/modules/services/ajaxterm.te index 34417586..cf6af134 100644 --- a/policy/modules/services/ajaxterm.te +++ b/policy/modules/services/ajaxterm.te @@ -1,4 +1,4 @@ -policy_module(ajaxterm,1.0.0) +policy_module(ajaxterm, 1.0.0) ######################################## # @@ -30,7 +30,7 @@ allow ajaxterm_t self:fifo_file rw_fifo_file_perms; allow ajaxterm_t self:unix_stream_socket create_stream_socket_perms; allow ajaxterm_t self:tcp_socket create_stream_socket_perms; -allow ajaxterm_t ajaxterm_devpts_t:chr_file { rw_chr_file_perms setattr getattr relabelfrom }; +allow ajaxterm_t ajaxterm_devpts_t:chr_file { rw_chr_file_perms setattr_chr_file_perms relabelfrom }; term_create_pty(ajaxterm_t, ajaxterm_devpts_t) manage_dirs_pattern(ajaxterm_t, ajaxterm_var_run_t, ajaxterm_var_run_t) diff --git a/policy/modules/services/amavis.if b/policy/modules/services/amavis.if index ceb21424..e31d92a4 100644 --- a/policy/modules/services/amavis.if +++ b/policy/modules/services/amavis.if @@ -183,7 +183,7 @@ interface(`amavis_setattr_pid_files',` type amavis_var_run_t; ') - allow $1 amavis_var_run_t:file setattr; + allow $1 amavis_var_run_t:file setattr_file_perms; files_search_pids($1) ') diff --git a/policy/modules/services/amavis.te b/policy/modules/services/amavis.te index c3a1903a..ec402915 100644 --- a/policy/modules/services/amavis.te +++ b/policy/modules/services/amavis.te @@ -76,7 +76,7 @@ files_search_spool(amavis_t) # tmp files manage_files_pattern(amavis_t, amavis_tmp_t, amavis_tmp_t) -allow amavis_t amavis_tmp_t:dir setattr; +allow amavis_t amavis_tmp_t:dir setattr_dir_perms; files_tmp_filetrans(amavis_t, amavis_tmp_t, file) # var/lib files for amavis @@ -86,7 +86,7 @@ manage_sock_files_pattern(amavis_t, amavis_var_lib_t, amavis_var_lib_t) files_search_var_lib(amavis_t) # log files -allow amavis_t amavis_var_log_t:dir setattr; +allow amavis_t amavis_var_log_t:dir setattr_dir_perms; manage_files_pattern(amavis_t, amavis_var_log_t, amavis_var_log_t) manage_sock_files_pattern(amavis_t, amavis_var_log_t, amavis_var_log_t) logging_log_filetrans(amavis_t, amavis_var_log_t, { sock_file file dir }) diff --git a/policy/modules/services/apache.if b/policy/modules/services/apache.if index 2244b11e..ba64143a 100644 --- a/policy/modules/services/apache.if +++ b/policy/modules/services/apache.if @@ -13,8 +13,7 @@ # template(`apache_content_template',` gen_require(` - attribute httpd_exec_scripts; - attribute httpd_script_exec_type; + attribute httpd_exec_scripts, httpd_script_exec_type; type httpd_t, httpd_suexec_t, httpd_log_t; type httpd_sys_content_t; ') @@ -50,8 +49,6 @@ template(`apache_content_template',` read_files_pattern(httpd_t, httpd_$1_content_t, httpd_$1_htaccess_t) - domtrans_pattern(httpd_suexec_t, httpd_$1_script_exec_t, httpd_$1_script_t) - allow httpd_t { httpd_$1_content_t httpd_$1_rw_content_t httpd_$1_script_exec_t }:dir search_dir_perms; allow httpd_suexec_t { httpd_$1_content_t httpd_$1_rw_content_t httpd_$1_script_exec_t }:dir search_dir_perms; @@ -132,6 +129,8 @@ template(`apache_content_template',` tunable_policy(`httpd_enable_cgi',` allow httpd_$1_script_t httpd_$1_script_exec_t:file entrypoint; + domtrans_pattern(httpd_suexec_t, httpd_$1_script_exec_t, httpd_$1_script_t) + # privileged users run the script: domtrans_pattern(httpd_exec_scripts, httpd_$1_script_exec_t, httpd_$1_script_t) @@ -152,6 +151,8 @@ template(`apache_content_template',` allow httpd_$1_script_t httpd_t:fd use; allow httpd_$1_script_t httpd_t:process sigchld; + dontaudit httpd_$1_script_t httpd_t:tcp_socket { read write }; + kernel_read_system_state(httpd_$1_script_t) dev_read_urand(httpd_$1_script_t) @@ -180,8 +181,6 @@ template(`apache_content_template',` optional_policy(` nscd_socket_use(httpd_$1_script_t) ') - - dontaudit httpd_$1_script_t httpd_t:tcp_socket { read write }; ') ######################################## @@ -202,16 +201,15 @@ template(`apache_content_template',` interface(`apache_role',` gen_require(` attribute httpdcontent; - type httpd_user_content_t, httpd_user_htaccess_t; - type httpd_user_script_t, httpd_user_script_exec_t; - type httpd_user_ra_content_t, httpd_user_rw_content_t; + type httpd_user_content_t, httpd_user_htaccess_t, httpd_user_script_t; + type httpd_user_ra_content_t, httpd_user_rw_content_t, httpd_user_script_exec_t; ') role $1 types httpd_user_script_t; allow $2 httpd_user_content_t:{ dir file lnk_file } { relabelto relabelfrom }; - allow $2 httpd_user_htaccess_t:file { manage_file_perms relabelto relabelfrom }; + allow $2 httpd_user_htaccess_t:file { manage_file_perms relabel_file_perms }; manage_dirs_pattern($2, httpd_user_ra_content_t, httpd_user_ra_content_t) manage_files_pattern($2, httpd_user_ra_content_t, httpd_user_ra_content_t) @@ -314,21 +312,21 @@ interface(`apache_domtrans',` ###################################### ## -## Allow the specified domain to execute apache -## in the caller domain. +## Allow the specified domain to execute apache +## in the caller domain. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`apache_exec',` - gen_require(` - type httpd_exec_t; - ') + gen_require(` + type httpd_exec_t; + ') - can_exec($1, httpd_exec_t) + can_exec($1, httpd_exec_t) ') ####################################### @@ -501,7 +499,7 @@ interface(`apache_setattr_cache_dirs',` type httpd_cache_t; ') - allow $1 httpd_cache_t:dir setattr; + allow $1 httpd_cache_t:dir setattr_dir_perms; ') ######################################## @@ -732,7 +730,7 @@ interface(`apache_dontaudit_append_log',` type httpd_log_t; ') - dontaudit $1 httpd_log_t:file { getattr append }; + dontaudit $1 httpd_log_t:file append_file_perms; ') ######################################## @@ -895,7 +893,6 @@ interface(`apache_manage_sys_content',` ') files_search_var($1) - apache_search_sys_content($1) manage_dirs_pattern($1, httpd_sys_content_t, httpd_sys_content_t) manage_files_pattern($1, httpd_sys_content_t, httpd_sys_content_t) manage_lnk_files_pattern($1, httpd_sys_content_t, httpd_sys_content_t) @@ -903,45 +900,45 @@ interface(`apache_manage_sys_content',` ###################################### ## -## Allow the specified domain to read -## apache system content rw files. +## Allow the specified domain to read +## apache system content rw files. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## ## # interface(`apache_read_sys_content_rw_files',` - gen_require(` + gen_require(` type httpd_sys_rw_content_t; ') - read_files_pattern($1, httpd_sys_rw_content_t, httpd_sys_rw_content_t) + read_files_pattern($1, httpd_sys_rw_content_t, httpd_sys_rw_content_t) ') ###################################### ## -## Allow the specified domain to manage -## apache system content rw files. +## Allow the specified domain to manage +## apache system content rw files. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## ## # interface(`apache_manage_sys_content_rw',` - gen_require(` + gen_require(` type httpd_sys_rw_content_t; ') - files_search_var($1) - manage_dirs_pattern($1, httpd_sys_rw_content_t, httpd_sys_rw_content_t) - manage_files_pattern($1, httpd_sys_rw_content_t, httpd_sys_rw_content_t) - manage_lnk_files_pattern($1, httpd_sys_rw_content_t, httpd_sys_rw_content_t) + files_search_var($1) + manage_dirs_pattern($1, httpd_sys_rw_content_t, httpd_sys_rw_content_t) + manage_files_pattern($1, httpd_sys_rw_content_t, httpd_sys_rw_content_t) + manage_lnk_files_pattern($1, httpd_sys_rw_content_t, httpd_sys_rw_content_t) ') ######################################## @@ -985,8 +982,7 @@ interface(`apache_delete_sys_content_rw',` interface(`apache_domtrans_sys_script',` gen_require(` attribute httpdcontent; - type httpd_sys_script_t; - type httpd_sys_content_t; + type httpd_sys_script_t, httpd_sys_content_t; ') tunable_policy(`httpd_enable_cgi',` @@ -1049,9 +1045,10 @@ interface(`apache_domtrans_all_scripts',` ## ## ## -## Role allowed access.. +## Role allowed access. ## ## +## # interface(`apache_run_all_scripts',` gen_require(` @@ -1221,21 +1218,21 @@ interface(`apache_read_tmp_files',` ###################################### ## -## Dontaudit attempts to read and write -## apache tmp files. +## Dontaudit attempts to read and write +## apache tmp files. ## ## -## -## Domain allowed access. -## +## +## Domain to not audit. +## ## # interface(`apache_dontaudit_rw_tmp_files',` - gen_require(` - type httpd_tmp_t; - ') + gen_require(` + type httpd_tmp_t; + ') - dontaudit $1 httpd_tmp_t:file { read write }; + dontaudit $1 httpd_tmp_t:file { read write }; ') ######################################## @@ -1317,17 +1314,14 @@ interface(`apache_cgi_domain',` # interface(`apache_admin',` gen_require(` - attribute httpdcontent; - attribute httpd_script_exec_type; - + attribute httpdcontent, httpd_script_exec_type; type httpd_t, httpd_config_t, httpd_log_t; - type httpd_modules_t, httpd_lock_t; - type httpd_var_run_t, httpd_php_tmp_t; + type httpd_modules_t, httpd_lock_t, httpd_bool_t; + type httpd_var_run_t, httpd_php_tmp_t, httpd_initrc_exec_t; type httpd_suexec_tmp_t, httpd_tmp_t; - type httpd_initrc_exec_t, httpd_bool_t; ') - allow $1 httpd_t:process { getattr ptrace signal_perms }; + allow $1 httpd_t:process { ptrace signal_perms }; ps_process_pattern($1, httpd_t) init_labeled_script_domtrans($1, httpd_initrc_exec_t) @@ -1338,10 +1332,10 @@ interface(`apache_admin',` apache_manage_all_content($1) miscfiles_manage_public_files($1) - files_search_etc($1) + files_list_etc($1) admin_pattern($1, httpd_config_t) - logging_search_logs($1) + logging_list_logs($1) admin_pattern($1, httpd_log_t) admin_pattern($1, httpd_modules_t) @@ -1352,26 +1346,22 @@ interface(`apache_admin',` admin_pattern($1, httpd_var_run_t) files_pid_filetrans($1, httpd_var_run_t, file) - kernel_search_proc($1) - allow $1 httpd_t:dir list_dir_perms; - ps_process_pattern($1, httpd_t) - read_lnk_files_pattern($1, httpd_t, httpd_t) - admin_pattern($1, httpdcontent) admin_pattern($1, httpd_script_exec_type) seutil_domtrans_setfiles($1) + files_list_tmp($1) admin_pattern($1, httpd_tmp_t) admin_pattern($1, httpd_php_tmp_t) admin_pattern($1, httpd_suexec_tmp_t) -ifdef(`TODO',` - apache_set_booleans($1, $2, $3, httpd_bool_t ) - seutil_setsebool_role_template($1, $3, $2) - allow httpd_setsebool_t httpd_bool_t:dir list_dir_perms; - allow httpd_setsebool_t httpd_bool_t:file rw_file_perms; -') + ifdef(`TODO',` + apache_set_booleans($1, $2, $3, httpd_bool_t) + seutil_setsebool_role_template($1, $3, $2) + allow httpd_setsebool_t httpd_bool_t:dir list_dir_perms; + allow httpd_setsebool_t httpd_bool_t:file rw_file_perms; + ') ') ######################################## @@ -1380,7 +1370,7 @@ ifdef(`TODO',` ## ## ## -## Domain allowed access. +## Domain to not audit. ## ## # @@ -1390,7 +1380,7 @@ interface(`apache_dontaudit_leaks',` ') dontaudit $1 httpd_t:fifo_file rw_inherited_fifo_file_perms; - dontaudit $1 httpd_t:tcp_socket { read write }; + dontaudit $1 httpd_t:tcp_socket { read write }; dontaudit $1 httpd_t:unix_dgram_socket { read write }; dontaudit $1 httpd_t:unix_stream_socket { read write }; ') diff --git a/policy/modules/services/apache.te b/policy/modules/services/apache.te index 86641ddf..300dffb6 100644 --- a/policy/modules/services/apache.te +++ b/policy/modules/services/apache.te @@ -21,182 +21,189 @@ policy_module(apache, 2.2.0) selinux_genbool(httpd_bool_t) ## -##

-## Allow Apache to modify public files -## used for public file transfer services. Directories/Files must -## be labeled public_content_rw_t. -##

+##

+## Allow Apache to modify public files +## used for public file transfer services. Directories/Files must +## be labeled public_content_rw_t. +##

##
gen_tunable(allow_httpd_anon_write, false) ## -##

-## Allow Apache to use mod_auth_pam -##

+##

+## Allow Apache to use mod_auth_pam +##

##
gen_tunable(allow_httpd_mod_auth_pam, false) ## -##

-## Allow httpd scripts and modules execmem/execstack -##

+##

+## Allow Apache to use mod_auth_pam +##

+##
+gen_tunable(allow_httpd_mod_auth_ntlm_winbind, false) + +## +##

+## Allow httpd scripts and modules execmem/execstack +##

##
gen_tunable(httpd_execmem, false) ## -##

-## Allow httpd daemon to change system limits -##

+##

+## Allow httpd daemon to change system limits +##

##
gen_tunable(httpd_setrlimit, false) ## -##

-## Allow httpd to use built in scripting (usually php) -##

+##

+## Allow httpd to use built in scripting (usually php) +##

##
gen_tunable(httpd_builtin_scripting, false) ## -##

-## Allow HTTPD scripts and modules to connect to the network using any TCP port. -##

+##

+## Allow HTTPD scripts and modules to connect to the network using any TCP port. +##

##
gen_tunable(httpd_can_network_connect, false) ## -##

-## Allow HTTPD scripts and modules to connect to cobbler over the network. -##

+##

+## Allow HTTPD scripts and modules to connect to cobbler over the network. +##

##
gen_tunable(httpd_can_network_connect_cobbler, false) ## -##

-## Allow HTTPD scripts and modules to connect to databases over the network. -##

+##

+## Allow HTTPD scripts and modules to connect to databases over the network. +##

##
gen_tunable(httpd_can_network_connect_db, false) ## -##

-## Allow httpd to connect to memcache server -##

+##

+## Allow httpd to connect to memcache server +##

##
gen_tunable(httpd_can_network_memcache, false) ## -##

-## Allow httpd to act as a relay -##

+##

+## Allow httpd to act as a relay +##

##
gen_tunable(httpd_can_network_relay, false) ## -##

-## Allow http daemon to send mail -##

+##

+## Allow http daemon to send mail +##

##
gen_tunable(httpd_can_sendmail, false) ## -##

-## Allow http daemon to check spam -##

+##

+## Allow http daemon to check spam +##

##
gen_tunable(httpd_can_check_spam, false) ## -##

-## Allow Apache to communicate with avahi service via dbus -##

+##

+## Allow Apache to communicate with avahi service via dbus +##

##
gen_tunable(httpd_dbus_avahi, false) ## -##

-## Allow httpd to execute cgi scripts -##

+##

+## Allow httpd to execute cgi scripts +##

##
gen_tunable(httpd_enable_cgi, false) ## -##

-## Allow httpd to act as a FTP server by -## listening on the ftp port. -##

+##

+## Allow httpd to act as a FTP server by +## listening on the ftp port. +##

##
gen_tunable(httpd_enable_ftp_server, false) ## -##

-## Allow httpd to read home directories -##

+##

+## Allow httpd to read home directories +##

##
gen_tunable(httpd_enable_homedirs, false) ## -##

-## Allow httpd to read user content -##

+##

+## Allow httpd to read user content +##

##
gen_tunable(httpd_read_user_content, false) ## -##

-## Allow HTTPD to run SSI executables in the same domain as system CGI scripts. -##

+##

+## Allow HTTPD to run SSI executables in the same domain as system CGI scripts. +##

##
gen_tunable(httpd_ssi_exec, false) ## -##

-## Allow Apache to execute tmp content. -##

+##

+## Allow Apache to execute tmp content. +##

##
gen_tunable(httpd_tmp_exec, false) ## -##

-## Unify HTTPD to communicate with the terminal. -## Needed for entering the passphrase for certificates at -## the terminal. -##

+##

+## Unify HTTPD to communicate with the terminal. +## Needed for entering the passphrase for certificates at +## the terminal. +##

##
gen_tunable(httpd_tty_comm, false) ## -##

-## Unify HTTPD handling of all content files. -##

+##

+## Unify HTTPD handling of all content files. +##

##
gen_tunable(httpd_unified, false) ## -##

-## Allow httpd to access cifs file systems -##

+##

+## Allow httpd to access cifs file systems +##

##
gen_tunable(httpd_use_cifs, false) ## -##

-## Allow httpd to run gpg in gpg-web domain -##

+##

+## Allow httpd to run gpg in gpg-web domain +##

##
gen_tunable(httpd_use_gpg, false) ## -##

-## Allow httpd to access nfs file systems -##

+##

+## Allow httpd to access nfs file systems +##

##
gen_tunable(httpd_use_nfs, false) ## -##

-## Allow apache scripts to write to public content. Directories/Files must be labeled public_rw_content_t. -##

+##

+## Allow apache scripts to write to public content. Directories/Files must be labeled public_rw_content_t. +##

##
gen_tunable(allow_httpd_sys_script_anon_write, false) @@ -279,6 +286,13 @@ typeattribute httpd_sys_content_t httpdcontent; # customizable typeattribute httpd_sys_rw_content_t httpdcontent; # customizable typeattribute httpd_sys_ra_content_t httpdcontent; # customizable +# Removal of fastcgi, will cause problems without the following +typealias httpd_sys_script_exec_t alias httpd_fastcgi_script_exec_t; +typealias httpd_sys_content_t alias { httpd_fastcgi_content_t httpd_fastcgi_script_ro_t }; +typealias httpd_sys_rw_content_t alias { httpd_fastcgi_rw_content_t httpd_fastcgi_script_rw_t }; +typealias httpd_sys_ra_content_t alias httpd_fastcgi_script_ra_t; +typealias httpd_sys_script_t alias httpd_fastcgi_script_t; + type httpd_tmp_t; files_tmp_file(httpd_tmp_t) @@ -320,6 +334,9 @@ files_type(httpd_var_lib_t) type httpd_var_run_t; files_pid_file(httpd_var_run_t) +# Removal of fastcgi, will cause problems without the following +typealias httpd_var_run_t alias httpd_fastcgi_var_run_t; + # File Type of squirrelmail attachments type squirrelmail_spool_t; files_tmp_file(squirrelmail_spool_t) @@ -506,22 +523,21 @@ tunable_policy(`allow_httpd_mod_auth_pam',` logging_send_audit_msgs(httpd_t) ') -## -##

-## Allow Apache to use mod_auth_pam -##

-##
-gen_tunable(allow_httpd_mod_auth_ntlm_winbind, false) optional_policy(` -tunable_policy(`allow_httpd_mod_auth_ntlm_winbind',` + tunable_policy(`allow_httpd_mod_auth_ntlm_winbind',` samba_domtrans_winbind_helper(httpd_t) -') + ') ') tunable_policy(`httpd_can_network_connect',` corenet_tcp_connect_all_ports(httpd_t) ') +tunable_policy(`httpd_can_network_connect_db',` + corenet_tcp_connect_mssql_port(httpd_t) + corenet_sendrecv_mssql_client_packets(httpd_t) +') + tunable_policy(`httpd_can_network_memcache',` corenet_tcp_connect_memcache_port(httpd_t) ') @@ -541,6 +557,12 @@ tunable_policy(`httpd_can_network_relay',` corenet_sendrecv_squid_client_packets(httpd_t) ') +tunable_policy(`httpd_execmem',` + allow httpd_t self:process { execmem execstack }; + allow httpd_sys_script_t self:process { execmem execstack }; + allow httpd_suexec_t self:process { execmem execstack }; +') + tunable_policy(`httpd_enable_cgi && httpd_unified',` allow httpd_sys_script_t httpd_sys_content_t:file entrypoint; filetrans_pattern(httpd_sys_script_t, httpd_sys_content_t, httpd_sys_rw_content_t, { file dir lnk_file }) @@ -549,7 +571,7 @@ tunable_policy(`httpd_enable_cgi && httpd_unified',` tunable_policy(`allow_httpd_sys_script_anon_write',` miscfiles_manage_public_files(httpd_sys_script_t) -') +') tunable_policy(`httpd_enable_cgi && httpd_use_nfs',` fs_nfs_domtrans(httpd_t, httpd_sys_script_t) @@ -575,16 +597,12 @@ tunable_policy(`httpd_enable_ftp_server',` corenet_tcp_bind_ftp_port(httpd_t) ') -tunable_policy(`httpd_enable_homedirs',` - userdom_read_user_home_content_files(httpd_t) -') - tunable_policy(`httpd_tmp_exec && httpd_builtin_scripting',` - can_exec(httpd_t, httpd_tmp_t) + can_exec(httpd_t, httpd_tmp_t) ') tunable_policy(`httpd_tmp_exec && httpd_enable_cgi',` - can_exec(httpd_sys_script_t, httpd_tmp_t) + can_exec(httpd_sys_script_t, httpd_tmp_t) ') tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs',` @@ -723,21 +741,15 @@ optional_policy(` ') optional_policy(` - passenger_domtrans(httpd_t) - passenger_manage_pid_content(httpd_t) - passenger_read_lib_files(httpd_t) + passenger_domtrans(httpd_t) + passenger_manage_pid_content(httpd_t) + passenger_read_lib_files(httpd_t) ') optional_policy(` rpc_search_nfs_state_data(httpd_t) ') -tunable_policy(`httpd_execmem',` - allow httpd_t self:process { execmem execstack }; - allow httpd_sys_script_t self:process { execmem execstack }; - allow httpd_suexec_t self:process { execmem execstack }; -') - optional_policy(` # Allow httpd to work with postgresql postgresql_stream_connect(httpd_t) @@ -745,7 +757,6 @@ optional_policy(` tunable_policy(`httpd_can_network_connect_db',` postgresql_tcp_connect(httpd_t) - postgresql_tcp_connect(httpd_sys_script_t) ') ') @@ -830,28 +841,27 @@ libs_exec_lib_files(httpd_php_t) userdom_use_unpriv_users_fds(httpd_php_t) tunable_policy(`httpd_can_network_connect_db',` - corenet_tcp_connect_mysqld_port(httpd_t) - corenet_sendrecv_mysqld_client_packets(httpd_t) - corenet_tcp_connect_mysqld_port(httpd_sys_script_t) - corenet_sendrecv_mysqld_client_packets(httpd_sys_script_t) - corenet_tcp_connect_mysqld_port(httpd_suexec_t) - corenet_sendrecv_mysqld_client_packets(httpd_suexec_t) - - corenet_tcp_connect_mssql_port(httpd_t) - corenet_sendrecv_mssql_client_packets(httpd_t) - corenet_tcp_connect_mssql_port(httpd_sys_script_t) - corenet_sendrecv_mssql_client_packets(httpd_sys_script_t) - corenet_tcp_connect_mssql_port(httpd_suexec_t) - corenet_sendrecv_mssql_client_packets(httpd_suexec_t) + corenet_tcp_connect_mssql_port(httpd_php_t) + corenet_sendrecv_mssql_client_packets(httpd_php_t) ') optional_policy(` mysql_stream_connect(httpd_php_t) + mysql_rw_db_sockets(httpd_php_t) mysql_read_config(httpd_php_t) + + tunable_policy(`httpd_can_network_connect_db',` + mysql_tcp_connect(httpd_php_t) + ') ') optional_policy(` postgresql_stream_connect(httpd_php_t) + postgresql_unpriv_client(httpd_php_t) + + tunable_policy(`httpd_can_network_connect_db',` + postgresql_tcp_connect(httpd_php_t) + ') ') ######################################## @@ -877,6 +887,10 @@ files_tmp_filetrans(httpd_suexec_t, httpd_suexec_tmp_t, { file dir }) can_exec(httpd_suexec_t, httpd_sys_script_exec_t) +read_files_pattern(httpd_suexec_t, httpd_user_content_t, httpd_user_content_t) +read_files_pattern(httpd_suexec_t, httpd_user_rw_content_t, httpd_user_rw_content_t) +read_files_pattern(httpd_suexec_t, httpd_user_ra_content_t, httpd_user_ra_content_t) + kernel_read_kernel_sysctls(httpd_suexec_t) kernel_list_proc(httpd_suexec_t) kernel_read_proc_symlinks(httpd_suexec_t) @@ -917,11 +931,13 @@ tunable_policy(`httpd_can_network_connect',` corenet_sendrecv_all_client_packets(httpd_suexec_t) ') -read_files_pattern(httpd_suexec_t, httpd_user_content_t, httpd_user_content_t) -read_files_pattern(httpd_suexec_t, httpd_user_rw_content_t, httpd_user_rw_content_t) -read_files_pattern(httpd_suexec_t, httpd_user_ra_content_t, httpd_user_ra_content_t) +tunable_policy(`httpd_can_network_connect_db',` + corenet_tcp_connect_mssql_port(httpd_suexec_t) + corenet_sendrecv_mssql_client_packets(httpd_suexec_t) +') domain_entry_file(httpd_sys_script_t, httpd_sys_content_t) + tunable_policy(`httpd_enable_cgi && httpd_unified',` allow httpd_sys_script_t httpdcontent:file entrypoint; domtrans_pattern(httpd_suexec_t, httpdcontent, httpd_sys_script_t) @@ -930,9 +946,6 @@ tunable_policy(`httpd_enable_cgi && httpd_unified',` manage_sock_files_pattern(httpd_sys_script_t, httpdcontent, httpdcontent) manage_lnk_files_pattern(httpd_sys_script_t, httpdcontent, httpdcontent) ') -tunable_policy(`httpd_enable_cgi',` - domtrans_pattern(httpd_suexec_t, httpd_user_script_t, httpd_user_script_t) -') tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs',` fs_read_nfs_files(httpd_suexec_t) @@ -961,6 +974,19 @@ optional_policy(` mysql_stream_connect(httpd_suexec_t) mysql_rw_db_sockets(httpd_suexec_t) mysql_read_config(httpd_suexec_t) + + tunable_policy(`httpd_can_network_connect_db',` + mysql_tcp_connect(httpd_suexec_t) + ') +') + +optional_policy(` + postgresql_stream_connect(httpd_suexec_t) + postgresql_unpriv_client(httpd_suexec_t) + + tunable_policy(`httpd_can_network_connect_db',` + postgresql_tcp_connect(httpd_suexec_t) + ') ') ######################################## @@ -1002,9 +1028,14 @@ tunable_policy(`httpd_can_sendmail',` ') optional_policy(` - tunable_policy(`httpd_can_sendmail && httpd_can_check_spam',` - spamassassin_domtrans_client(httpd_t) - ') + tunable_policy(`httpd_can_sendmail && httpd_can_check_spam',` + spamassassin_domtrans_client(httpd_t) + ') +') + +tunable_policy(`httpd_can_network_connect_db',` + corenet_tcp_connect_mssql_port(httpd_sys_script_t) + corenet_sendrecv_mssql_client_packets(httpd_sys_script_t) ') fs_cifs_entry_type(httpd_sys_script_t) @@ -1042,7 +1073,7 @@ tunable_policy(`httpd_enable_cgi && httpd_can_network_connect',` ') tunable_policy(`httpd_enable_homedirs',` - userdom_read_user_home_content_files(httpd_sys_script_t) + userdom_search_user_home_dirs(httpd_sys_script_t) ') tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs',` @@ -1050,6 +1081,10 @@ tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs',` fs_read_nfs_symlinks(httpd_sys_script_t) ') +tunable_policy(`httpd_read_user_content',` + userdom_read_user_home_content_files(httpd_sys_script_t) +') + tunable_policy(`httpd_use_cifs',` fs_manage_cifs_dirs(httpd_sys_script_t) fs_manage_cifs_files(httpd_sys_script_t) @@ -1073,10 +1108,19 @@ optional_policy(` mysql_stream_connect(httpd_sys_script_t) mysql_rw_db_sockets(httpd_sys_script_t) mysql_read_config(httpd_sys_script_t) + + tunable_policy(`httpd_can_network_connect_db',` + mysql_tcp_connect(httpd_sys_script_t) + ') ') optional_policy(` postgresql_stream_connect(httpd_sys_script_t) + postgresql_unpriv_client(httpd_sys_script_t) + + tunable_policy(`httpd_can_network_connect_db',` + postgresql_tcp_connect(httpd_sys_script_t) + ') ') ######################################## @@ -1136,19 +1180,7 @@ tunable_policy(`httpd_enable_homedirs',` ') tunable_policy(`httpd_read_user_content',` - userdom_read_user_home_content_files(httpd_user_script_t) - userdom_read_user_home_content_files(httpd_suexec_t) -') - -tunable_policy(`httpd_read_user_content && httpd_builtin_scripting',` userdom_read_user_home_content_files(httpd_t) + userdom_read_user_home_content_files(httpd_suexec_t) + userdom_read_user_home_content_files(httpd_user_script_t) ') - -# Removal of fastcgi, will cause problems without the following -typealias httpd_sys_script_exec_t alias httpd_fastcgi_script_exec_t; -typealias httpd_sys_content_t alias { httpd_fastcgi_content_t httpd_fastcgi_script_ro_t }; -typealias httpd_sys_rw_content_t alias { httpd_fastcgi_rw_content_t httpd_fastcgi_script_rw_t }; -typealias httpd_sys_ra_content_t alias httpd_fastcgi_script_ra_t; -typealias httpd_sys_script_t alias httpd_fastcgi_script_t; -typealias httpd_var_run_t alias httpd_fastcgi_var_run_t; - diff --git a/policy/modules/services/apcupsd.if b/policy/modules/services/apcupsd.if index e342775e..d3451b8e 100644 --- a/policy/modules/services/apcupsd.if +++ b/policy/modules/services/apcupsd.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run apcupsd. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`apcupsd_domtrans',` @@ -83,9 +83,9 @@ interface(`apcupsd_read_log',` ## apcupsd log files. ## ## -## +## ## Domain allowed access. -## +## ## # interface(`apcupsd_append_log',` @@ -103,9 +103,9 @@ interface(`apcupsd_append_log',` ## Execute a domain transition to run httpd_apcupsd_cgi_script. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`apcupsd_cgi_script_domtrans',` @@ -140,10 +140,8 @@ interface(`apcupsd_cgi_script_domtrans',` # interface(`apcupsd_admin',` gen_require(` - type apcupsd_t, apcupsd_tmp_t; - type apcupsd_log_t, apcupsd_lock_t; - type apcupsd_var_run_t; - type apcupsd_initrc_exec_t; + type apcupsd_t, apcupsd_tmp_t, apcupsd_log_t; + type apcupsd_lock_t, apcupsd_var_run_t, apcupsd_initrc_exec_t; ') allow $1 apcupsd_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/apm.if b/policy/modules/services/apm.if index 1ea99b29..49e6c741 100644 --- a/policy/modules/services/apm.if +++ b/policy/modules/services/apm.if @@ -52,7 +52,7 @@ interface(`apm_write_pipes',` type apmd_t; ') - allow $1 apmd_t:fifo_file write; + allow $1 apmd_t:fifo_file write_fifo_file_perms; ') ######################################## @@ -89,7 +89,7 @@ interface(`apm_append_log',` ') logging_search_logs($1) - allow $1 apmd_log_t:file append; + allow $1 apmd_log_t:file append_file_perms; ') ######################################## @@ -108,6 +108,5 @@ interface(`apm_stream_connect',` ') files_search_pids($1) - allow $1 apmd_var_run_t:sock_file write; - allow $1 apmd_t:unix_stream_socket connectto; + stream_connect_pattern($1, apmd_var_run_t, apmd_var_run_t, apmd_t) ') diff --git a/policy/modules/services/apm.te b/policy/modules/services/apm.te index c7cba002..62bc9364 100644 --- a/policy/modules/services/apm.te +++ b/policy/modules/services/apm.te @@ -4,6 +4,7 @@ policy_module(apm, 1.11.0) # # Declarations # + type apmd_t; type apmd_exec_t; init_daemon_domain(apmd_t, apmd_exec_t) diff --git a/policy/modules/services/automount.if b/policy/modules/services/automount.if index f3848484..a43e006c 100644 --- a/policy/modules/services/automount.if +++ b/policy/modules/services/automount.if @@ -29,7 +29,6 @@ interface(`automount_domtrans',` ## ## # -# interface(`automount_signal',` gen_require(` type automount_t; @@ -124,7 +123,7 @@ interface(`automount_dontaudit_getattr_tmp_dirs',` type automount_tmp_t; ') - dontaudit $1 automount_tmp_t:dir getattr; + dontaudit $1 automount_tmp_t:dir getattr_dir_perms; ') ######################################## diff --git a/policy/modules/services/avahi.if b/policy/modules/services/avahi.if index e51354dc..11e1ba91 100644 --- a/policy/modules/services/avahi.if +++ b/policy/modules/services/avahi.if @@ -151,8 +151,7 @@ interface(`avahi_dontaudit_search_pid',` # interface(`avahi_admin',` gen_require(` - type avahi_t, avahi_var_run_t; - type avahi_initrc_exec_t; + type avahi_t, avahi_var_run_t, avahi_initrc_exec_t; ') allow $1 avahi_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/avahi.te b/policy/modules/services/avahi.te index 803adbf2..52dcf09b 100644 --- a/policy/modules/services/avahi.te +++ b/policy/modules/services/avahi.te @@ -40,7 +40,7 @@ files_var_lib_filetrans(avahi_t, avahi_var_lib_t, { dir file }) manage_dirs_pattern(avahi_t, avahi_var_run_t, avahi_var_run_t) manage_files_pattern(avahi_t, avahi_var_run_t, avahi_var_run_t) manage_sock_files_pattern(avahi_t, avahi_var_run_t, avahi_var_run_t) -allow avahi_t avahi_var_run_t:dir setattr; +allow avahi_t avahi_var_run_t:dir setattr_dir_perms; files_pid_filetrans(avahi_t, avahi_var_run_t, { dir file }) kernel_read_system_state(avahi_t) diff --git a/policy/modules/services/bind.if b/policy/modules/services/bind.if index 71f55141..7e9d2fb1 100644 --- a/policy/modules/services/bind.if +++ b/policy/modules/services/bind.if @@ -186,7 +186,7 @@ interface(`bind_write_config',` ') write_files_pattern($1, named_conf_t, named_conf_t) - allow $1 named_conf_t:file setattr; + allow $1 named_conf_t:file setattr_file_perms; ') ######################################## @@ -266,7 +266,7 @@ interface(`bind_setattr_pid_dirs',` type named_var_run_t; ') - allow $1 named_var_run_t:dir setattr; + allow $1 named_var_run_t:dir setattr_dir_perms; ') ######################################## @@ -284,7 +284,7 @@ interface(`bind_setattr_zone_dirs',` type named_zone_t; ') - allow $1 named_zone_t:dir setattr; + allow $1 named_zone_t:dir setattr_dir_perms; ') ######################################## @@ -380,10 +380,9 @@ interface(`bind_udp_chat_named',` interface(`bind_admin',` gen_require(` type named_t, named_tmp_t, named_log_t; - type named_conf_t, named_var_run_t; - type named_cache_t, named_zone_t; + type named_conf_t, named_var_run_t, named_cache_t; + type named_zone_t, named_initrc_exec_t; type dnssec_t, ndc_t, named_keytab_t; - type named_initrc_exec_t; ') allow $1 named_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/bind.te b/policy/modules/services/bind.te index ece1f1f8..0bde2257 100644 --- a/policy/modules/services/bind.te +++ b/policy/modules/services/bind.te @@ -6,10 +6,10 @@ policy_module(bind, 1.11.0) # ## -##

-## Allow BIND to write the master zone files. -## Generally this is used for dynamic DNS or zone transfers. -##

+##

+## Allow BIND to write the master zone files. +## Generally this is used for dynamic DNS or zone transfers. +##

##
gen_tunable(named_write_master_zones, false) @@ -202,12 +202,12 @@ allow ndc_t self:tcp_socket create_socket_perms; allow ndc_t self:netlink_route_socket r_netlink_socket_perms; allow ndc_t dnssec_t:file read_file_perms; -allow ndc_t dnssec_t:lnk_file { getattr read }; +allow ndc_t dnssec_t:lnk_file read_lnk_file_perms; stream_connect_pattern(ndc_t, named_var_run_t, named_var_run_t, named_t) allow ndc_t named_conf_t:file read_file_perms; -allow ndc_t named_conf_t:lnk_file { getattr read }; +allow ndc_t named_conf_t:lnk_file read_lnk_file_perms; allow ndc_t named_zone_t:dir search_dir_perms; @@ -245,7 +245,7 @@ term_dontaudit_use_console(ndc_t) # for /etc/rndc.key ifdef(`distro_redhat',` - allow ndc_t named_conf_t:dir search; + allow ndc_t named_conf_t:dir search_dir_perms; ') optional_policy(` diff --git a/policy/modules/services/bitlbee.if b/policy/modules/services/bitlbee.if index ed4e7a2f..a64d94d8 100644 --- a/policy/modules/services/bitlbee.if +++ b/policy/modules/services/bitlbee.if @@ -6,7 +6,7 @@ ## ## ## -## Domain allowed accesss. +## Domain allowed accesss. ## ## # diff --git a/policy/modules/services/bitlbee.te b/policy/modules/services/bitlbee.te index e74f728b..2ba2d1f6 100644 --- a/policy/modules/services/bitlbee.te +++ b/policy/modules/services/bitlbee.te @@ -26,7 +26,7 @@ files_type(bitlbee_var_t) # # Local policy # -# + allow bitlbee_t self:capability { setgid setuid }; allow bitlbee_t self:udp_socket create_socket_perms; diff --git a/policy/modules/services/bluetooth.if b/policy/modules/services/bluetooth.if index 328302d3..fa57a6fd 100644 --- a/policy/modules/services/bluetooth.if +++ b/policy/modules/services/bluetooth.if @@ -14,6 +14,7 @@ ## User domain for the role ## ## +## # interface(`bluetooth_role',` gen_require(` @@ -27,7 +28,7 @@ interface(`bluetooth_role',` # allow ps to show cdrecord and allow the user to kill it ps_process_pattern($2, bluetooth_helper_t) - allow $2 bluetooth_helper_t:process signal; + allow $2 bluetooth_helper_t:process { ptrace signal_perms }; manage_dirs_pattern($2, bluetooth_helper_tmp_t, bluetooth_helper_tmp_t) manage_files_pattern($2, bluetooth_helper_tmp_t, bluetooth_helper_tmp_t) @@ -91,7 +92,7 @@ interface(`bluetooth_read_config',` type bluetooth_conf_t; ') - allow $1 bluetooth_conf_t:file { getattr read ioctl }; + allow $1 bluetooth_conf_t:file read_file_perms; ') ######################################## @@ -178,7 +179,7 @@ interface(`bluetooth_run_helper',` ######################################## ## -## Read bluetooth helper state files. +## Do not audit attempts to read bluetooth helper state files. ## ## ## @@ -191,8 +192,8 @@ interface(`bluetooth_dontaudit_read_helper_state',` type bluetooth_helper_t; ') - dontaudit $1 bluetooth_helper_t:dir search; - dontaudit $1 bluetooth_helper_t:file { read getattr }; + dontaudit $1 bluetooth_helper_t:dir search_dir_perms; + dontaudit $1 bluetooth_helper_t:file read_file_perms; ') ######################################## @@ -215,9 +216,8 @@ interface(`bluetooth_dontaudit_read_helper_state',` interface(`bluetooth_admin',` gen_require(` type bluetooth_t, bluetooth_tmp_t, bluetooth_lock_t; - type bluetooth_var_lib_t, bluetooth_var_run_t; + type bluetooth_var_lib_t, bluetooth_var_run_t, bluetooth_initrc_exec_t; type bluetooth_conf_t, bluetooth_conf_rw_t; - type bluetooth_initrc_exec_t; ') allow $1 bluetooth_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/bluetooth.te b/policy/modules/services/bluetooth.te index 215b86b7..08afbb97 100644 --- a/policy/modules/services/bluetooth.te +++ b/policy/modules/services/bluetooth.te @@ -4,6 +4,7 @@ policy_module(bluetooth, 3.3.0) # # Declarations # + type bluetooth_t; type bluetooth_exec_t; init_daemon_domain(bluetooth_t, bluetooth_exec_t) diff --git a/policy/modules/services/boinc.if b/policy/modules/services/boinc.if index 272bf743..fa9b95a9 100644 --- a/policy/modules/services/boinc.if +++ b/policy/modules/services/boinc.if @@ -1,4 +1,3 @@ - ## policy for boinc ######################################## @@ -6,9 +5,9 @@ ## Execute a domain transition to run boinc. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`boinc_domtrans',` @@ -21,20 +20,20 @@ interface(`boinc_domtrans',` ####################################### ## -## Execute boinc server in the boinc domain. +## Execute boinc server in the boinc domain. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`boinc_initrc_domtrans',` - gen_require(` - type boinc_initrc_exec_t; - ') + gen_require(` + type boinc_initrc_exec_t; + ') - init_labeled_script_domtrans($1, boinc_initrc_exec_t) + init_labeled_script_domtrans($1, boinc_initrc_exec_t) ') ######################################## @@ -72,7 +71,7 @@ interface(`boinc_read_lib_files',` ') files_search_var_lib($1) - read_files_pattern($1, boinc_var_lib_t, boinc_var_lib_t) + read_files_pattern($1, boinc_var_lib_t, boinc_var_lib_t) ') ######################################## @@ -92,7 +91,7 @@ interface(`boinc_manage_lib_files',` ') files_search_var_lib($1) - manage_files_pattern($1, boinc_var_lib_t, boinc_var_lib_t) + manage_files_pattern($1, boinc_var_lib_t, boinc_var_lib_t) ') ######################################## @@ -110,9 +109,10 @@ interface(`boinc_manage_var_lib',` type boinc_var_lib_t; ') - manage_dirs_pattern($1, boinc_var_lib_t, boinc_var_lib_t) - manage_files_pattern($1, boinc_var_lib_t, boinc_var_lib_t) - manage_lnk_files_pattern($1, boinc_var_lib_t, boinc_var_lib_t) + files_search_var_lib($1) + manage_dirs_pattern($1, boinc_var_lib_t, boinc_var_lib_t) + manage_files_pattern($1, boinc_var_lib_t, boinc_var_lib_t) + manage_lnk_files_pattern($1, boinc_var_lib_t, boinc_var_lib_t) ') ######################################## @@ -134,8 +134,7 @@ interface(`boinc_manage_var_lib',` # interface(`boinc_admin',` gen_require(` - type boinc_t, boinc_initrc_exec_t; - type boinc_var_lib_t; + type boinc_t, boinc_initrc_exec_t, boinc_var_lib_t; ') allow $1 boinc_t:process { ptrace signal_perms }; @@ -145,7 +144,7 @@ interface(`boinc_admin',` domain_system_change_exemption($1) role_transition $2 boinc_initrc_exec_t system_r; allow $2 system_r; - + files_list_var_lib($1) admin_pattern($1, boinc_var_lib_t) ') diff --git a/policy/modules/services/boinc.te b/policy/modules/services/boinc.te index aaf0ba36..c9622ef5 100644 --- a/policy/modules/services/boinc.te +++ b/policy/modules/services/boinc.te @@ -1,4 +1,4 @@ -policy_module(boinc,1.0.0) +policy_module(boinc, 1.0.0) ######################################## # @@ -27,6 +27,9 @@ role system_r types boinc_project_t; permissive boinc_project_t; +type boinc_project_tmp_t; +files_tmp_file(boinc_project_tmp_t) + type boinc_project_var_lib_t; files_type(boinc_project_var_lib_t) @@ -49,15 +52,15 @@ manage_files_pattern(boinc_t, boinc_tmp_t, boinc_tmp_t) files_tmp_filetrans(boinc_t, boinc_tmp_t, { dir file }) manage_files_pattern(boinc_t, boinc_tmpfs_t, boinc_tmpfs_t) -fs_tmpfs_filetrans(boinc_t, boinc_tmpfs_t,file) +fs_tmpfs_filetrans(boinc_t, boinc_tmpfs_t, file) -exec_files_pattern(boinc_t, boinc_var_lib_t, boinc_var_lib_t) -manage_dirs_pattern(boinc_t, boinc_var_lib_t, boinc_var_lib_t) -manage_files_pattern(boinc_t, boinc_var_lib_t, boinc_var_lib_t) -filetrans_pattern(boinc_t, boinc_var_lib_t, boinc_project_var_lib_t, { dir }) +exec_files_pattern(boinc_t, boinc_var_lib_t, boinc_var_lib_t) +manage_dirs_pattern(boinc_t, boinc_var_lib_t, boinc_var_lib_t) +manage_files_pattern(boinc_t, boinc_var_lib_t, boinc_var_lib_t) +filetrans_pattern(boinc_t, boinc_var_lib_t, boinc_project_var_lib_t, dir) -manage_dirs_pattern(boinc_t, boinc_project_var_lib_t, boinc_project_var_lib_t) -manage_files_pattern(boinc_t, boinc_project_var_lib_t, boinc_project_var_lib_t) +manage_dirs_pattern(boinc_t, boinc_project_var_lib_t, boinc_project_var_lib_t) +manage_files_pattern(boinc_t, boinc_project_var_lib_t, boinc_project_var_lib_t) kernel_read_system_state(boinc_t) @@ -120,16 +123,20 @@ allow boinc_project_t self:process { execmem execstack }; allow boinc_project_t self:fifo_file rw_fifo_file_perms; +manage_dirs_pattern(boinc_project_t, boinc_project_tmp_t, boinc_project_tmp_t) +manage_files_pattern(boinc_project_t, boinc_project_tmp_t, boinc_project_tmp_t) +files_tmp_filetrans(boinc_project_t, boinc_project_tmp_t, { dir file }) + allow boinc_project_t boinc_project_var_lib_t:file entrypoint; -exec_files_pattern(boinc_project_t, boinc_project_var_lib_t, boinc_project_var_lib_t) -manage_dirs_pattern(boinc_project_t, boinc_project_var_lib_t, boinc_project_var_lib_t) -manage_files_pattern(boinc_project_t, boinc_project_var_lib_t, boinc_project_var_lib_t) +exec_files_pattern(boinc_project_t, boinc_project_var_lib_t, boinc_project_var_lib_t) +manage_dirs_pattern(boinc_project_t, boinc_project_var_lib_t, boinc_project_var_lib_t) +manage_files_pattern(boinc_project_t, boinc_project_var_lib_t, boinc_project_var_lib_t) files_var_lib_filetrans(boinc_project_t, boinc_project_var_lib_t, { file dir }) allow boinc_project_t boinc_project_var_lib_t:file execmod; allow boinc_project_t boinc_t:shm rw_shm_perms; -allow boinc_project_t boinc_tmpfs_t:file { read write }; +allow boinc_project_t boinc_tmpfs_t:file rw_inherited_file_perms; list_dirs_pattern(boinc_project_t, boinc_var_lib_t, boinc_var_lib_t) rw_files_pattern(boinc_project_t, boinc_var_lib_t, boinc_var_lib_t) @@ -144,10 +151,16 @@ corecmd_exec_shell(boinc_project_t) corenet_tcp_connect_boinc_port(boinc_project_t) +dev_read_rand(boinc_project_t) dev_read_urand(boinc_project_t) +dev_read_sysfs(boinc_project_t) dev_rw_xserver_misc(boinc_project_t) files_read_etc_files(boinc_project_t) +miscfiles_read_fonts(boinc_project_t) miscfiles_read_localization(boinc_project_t) +optional_policy(` + java_exec(boinc_project_t) +') diff --git a/policy/modules/services/bugzilla.if b/policy/modules/services/bugzilla.if index 922c4ba4..3964548e 100644 --- a/policy/modules/services/bugzilla.if +++ b/policy/modules/services/bugzilla.if @@ -57,10 +57,9 @@ interface(`bugzilla_dontaudit_rw_script_stream_sockets',` # interface(`bugzilla_admin',` gen_require(` - type httpd_bugzilla_script_t; - type httpd_bugzilla_content_t, httpd_bugzilla_ra_content_t; - type httpd_bugzilla_rw_content_t, httpd_bugzilla_tmp_t; - type httpd_bugzilla_script_exec_t, httpd_bugzilla_htaccess_t; + type httpd_bugzilla_script_t, httpd_bugzilla_content_t, httpd_bugzilla_ra_content_t; + type httpd_bugzilla_rw_content_t, httpd_bugzilla_tmp_t, httpd_bugzilla_script_exec_t; + type httpd_bugzilla_htaccess_t; ') allow $1 httpd_bugzilla_script_t:process { ptrace signal_perms }; @@ -69,9 +68,9 @@ interface(`bugzilla_admin',` files_list_tmp($1) admin_pattern($1, httpd_bugzilla_tmp_t) - files_search_var_lib(httpd_bugzilla_script_t) + files_list_var_lib(httpd_bugzilla_script_t) - apache_search_sys_content($1) + apache_list_sys_content($1) admin_pattern($1, httpd_bugzilla_script_exec_t) admin_pattern($1, httpd_bugzilla_script_t) admin_pattern($1, httpd_bugzilla_content_t) diff --git a/policy/modules/services/bugzilla.te b/policy/modules/services/bugzilla.te index d31736b8..c63c8fa5 100644 --- a/policy/modules/services/bugzilla.te +++ b/policy/modules/services/bugzilla.te @@ -53,4 +53,3 @@ optional_policy(` optional_policy(` postgresql_stream_connect(httpd_bugzilla_script_t) ') - diff --git a/policy/modules/services/cachefilesd.if b/policy/modules/services/cachefilesd.if index 89d19e04..3b419455 100644 --- a/policy/modules/services/cachefilesd.if +++ b/policy/modules/services/cachefilesd.if @@ -14,7 +14,6 @@ # # Define the policy interface for the CacheFiles userspace management daemon. # - ## policy for cachefilesd ######################################## @@ -22,9 +21,9 @@ ## Execute a domain transition to run cachefilesd. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`cachefilesd_domtrans',` @@ -32,10 +31,5 @@ interface(`cachefilesd_domtrans',` type cachefilesd_t, cachefilesd_exec_t; ') - domain_auto_trans($1,cachefilesd_exec_t,cachefilesd_t) - - allow $1 cachefilesd_t:fd use; - allow cachefilesd_t $1:fd use; - allow cachefilesd_t $1:fifo_file rw_file_perms; - allow cachefilesd_t $1:process sigchld; + domtrans_pattern($1, cachefilesd_exec_t, cachefilesd_t) ') diff --git a/policy/modules/services/cachefilesd.te b/policy/modules/services/cachefilesd.te index e67f9871..575c16e0 100644 --- a/policy/modules/services/cachefilesd.te +++ b/policy/modules/services/cachefilesd.te @@ -17,7 +17,7 @@ # cache, on behalf of the processes accessing the cache through a network # filesystem such as NFS # -policy_module(cachefilesd,1.0.17) +policy_module(cachefilesd, 1.0.17) ############################################################################### # @@ -42,7 +42,6 @@ dev_node(cachefiles_dev_t) # type cachefilesd_t; type cachefilesd_exec_t; -domain_type(cachefilesd_t) init_daemon_domain(cachefilesd_t, cachefilesd_exec_t) # @@ -78,36 +77,33 @@ rpm_use_script_fds(cachefilesd_t) # Check in /usr/share/selinux/devel/include/ for macros to use instead of allow # rules. # -allow cachefilesd_t self : capability { setuid setgid sys_admin dac_override }; +allow cachefilesd_t self:capability { setuid setgid sys_admin dac_override }; + +# Allow manipulation of pid file +allow cachefilesd_t cachefilesd_var_run_t:file create_file_perms; +manage_files_pattern(cachefilesd_t, cachefilesd_var_run_t, cachefilesd_var_run_t) +manage_dirs_pattern(cachefilesd_t, cachefilesd_var_run_t, cachefilesd_var_run_t) +files_pid_filetrans(cachefilesd_t, cachefilesd_var_run_t, file) +files_create_as_is_all_files(cachefilesd_t) + +# Allow access to cachefiles device file +allow cachefilesd_t cachefiles_dev_t:chr_file rw_file_perms; + +# Allow access to cache superstructure +allow cachefilesd_t cachefiles_var_t:dir { rw_dir_perms delete_dir_perms }; +allow cachefilesd_t cachefiles_var_t:file { rename delete_file_perms }; + +# Permit statfs on the backing filesystem +fs_getattr_xattr_fs(cachefilesd_t) # Basic access files_read_etc_files(cachefilesd_t) -libs_use_ld_so(cachefilesd_t) -libs_use_shared_libs(cachefilesd_t) miscfiles_read_localization(cachefilesd_t) logging_send_syslog_msg(cachefilesd_t) init_dontaudit_use_script_ptys(cachefilesd_t) term_dontaudit_use_generic_ptys(cachefilesd_t) term_dontaudit_getattr_unallocated_ttys(cachefilesd_t) -# Allow manipulation of pid file -allow cachefilesd_t cachefilesd_var_run_t:file create_file_perms; -manage_files_pattern(cachefilesd_t,cachefilesd_var_run_t, cachefilesd_var_run_t) -manage_dirs_pattern(cachefilesd_t,cachefilesd_var_run_t, cachefilesd_var_run_t) -files_pid_file(cachefilesd_var_run_t) -files_pid_filetrans(cachefilesd_t,cachefilesd_var_run_t,file) -files_create_as_is_all_files(cachefilesd_t) - -# Allow access to cachefiles device file -allow cachefilesd_t cachefiles_dev_t : chr_file rw_file_perms; - -# Allow access to cache superstructure -allow cachefilesd_t cachefiles_var_t : dir { rw_dir_perms rmdir }; -allow cachefilesd_t cachefiles_var_t : file { getattr rename unlink }; - -# Permit statfs on the backing filesystem -fs_getattr_xattr_fs(cachefilesd_t) - ############################################################################### # # When cachefilesd invokes the kernel module to begin caching, it has to tell @@ -119,14 +115,14 @@ fs_getattr_xattr_fs(cachefilesd_t) # (1) the security context used by the module to access files in the cache, # as set by the 'secctx' command in /etc/cachefilesd.conf, and # -allow cachefilesd_t cachefiles_kernel_t : kernel_service { use_as_override }; +allow cachefilesd_t cachefiles_kernel_t:kernel_service { use_as_override }; # # (2) the label that will be assigned to new files and directories created in # the cache by the module, which will be the same as the label on the # directory pointed to by the 'dir' command. # -allow cachefilesd_t cachefiles_var_t : kernel_service { create_files_as }; +allow cachefilesd_t cachefiles_var_t:kernel_service { create_files_as }; ############################################################################### # @@ -136,11 +132,12 @@ allow cachefilesd_t cachefiles_var_t : kernel_service { create_files_as }; # cache. # allow cachefiles_kernel_t self:capability { dac_override dac_read_search }; -allow cachefiles_kernel_t initrc_t:process sigchld; -manage_dirs_pattern(cachefiles_kernel_t,cachefiles_var_t, cachefiles_var_t) -manage_files_pattern(cachefiles_kernel_t,cachefiles_var_t, cachefiles_var_t) +manage_dirs_pattern(cachefiles_kernel_t, cachefiles_var_t, cachefiles_var_t) +manage_files_pattern(cachefiles_kernel_t, cachefiles_var_t, cachefiles_var_t) fs_getattr_xattr_fs(cachefiles_kernel_t) dev_search_sysfs(cachefiles_kernel_t) + +init_sigchld_script(cachefiles_kernel_t) diff --git a/policy/modules/services/canna.te b/policy/modules/services/canna.te index a0dfd2f4..d60e2bf3 100644 --- a/policy/modules/services/canna.te +++ b/policy/modules/services/canna.te @@ -34,7 +34,7 @@ allow canna_t self:unix_dgram_socket create_stream_socket_perms; allow canna_t self:tcp_socket create_stream_socket_perms; manage_files_pattern(canna_t, canna_log_t, canna_log_t) -allow canna_t canna_log_t:dir setattr; +allow canna_t canna_log_t:dir setattr_dir_perms; logging_log_filetrans(canna_t, canna_log_t, { file dir }) manage_dirs_pattern(canna_t, canna_var_lib_t, canna_var_lib_t) diff --git a/policy/modules/services/ccs.if b/policy/modules/services/ccs.if index 6ee2cc8c..3105b095 100644 --- a/policy/modules/services/ccs.if +++ b/policy/modules/services/ccs.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run ccs. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`ccs_domtrans',` diff --git a/policy/modules/services/ccs.te b/policy/modules/services/ccs.te index bffe6b61..8d7e14e0 100644 --- a/policy/modules/services/ccs.te +++ b/policy/modules/services/ccs.te @@ -61,7 +61,7 @@ manage_dirs_pattern(ccs_t, ccs_var_lib_t, ccs_var_lib_t) manage_files_pattern(ccs_t, ccs_var_lib_t, ccs_var_lib_t) files_var_lib_filetrans(ccs_t, ccs_var_lib_t, { file dir }) -allow ccs_t ccs_var_log_t:dir setattr; +allow ccs_t ccs_var_log_t:dir setattr_dir_perms; manage_files_pattern(ccs_t, ccs_var_log_t, ccs_var_log_t) manage_sock_files_pattern(ccs_t, ccs_var_log_t, ccs_var_log_t) logging_log_filetrans(ccs_t, ccs_var_log_t, { sock_file file dir }) @@ -107,7 +107,7 @@ sysnet_dns_name_resolve(ccs_t) userdom_manage_unpriv_user_shared_mem(ccs_t) userdom_manage_unpriv_user_semaphores(ccs_t) -ifdef(`hide_broken_symptoms', ` +ifdef(`hide_broken_symptoms',` corecmd_dontaudit_write_bin_dirs(ccs_t) files_manage_isid_type_files(ccs_t) ') diff --git a/policy/modules/services/certmaster.if b/policy/modules/services/certmaster.if index fa627873..ffd0da52 100644 --- a/policy/modules/services/certmaster.if +++ b/policy/modules/services/certmaster.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run certmaster. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`certmaster_domtrans',` @@ -108,7 +108,7 @@ interface(`certmaster_manage_log',` ## ## ## -## The role to be allowed to manage the syslog domain. +## Role allowed access. ## ## ## @@ -116,8 +116,7 @@ interface(`certmaster_manage_log',` interface(`certmaster_admin',` gen_require(` type certmaster_t, certmaster_var_run_t, certmaster_var_lib_t; - type certmaster_etc_rw_t, certmaster_var_log_t; - type certmaster_initrc_exec_t; + type certmaster_etc_rw_t, certmaster_var_log_t, certmaster_initrc_exec_t; ') allow $1 certmaster_t:process { ptrace signal_perms }; @@ -129,8 +128,8 @@ interface(`certmaster_admin',` allow $2 system_r; files_list_etc($1) - miscfiles_manage_generic_cert_dirs($1) - miscfiles_manage_generic_cert_files($1) + miscfiles_manage_generic_cert_dirs($1) + miscfiles_manage_generic_cert_files($1) admin_pattern($1, certmaster_etc_rw_t) diff --git a/policy/modules/services/certmaster.te b/policy/modules/services/certmaster.te index 4aef8648..dbfd0a64 100644 --- a/policy/modules/services/certmaster.te +++ b/policy/modules/services/certmaster.te @@ -43,12 +43,12 @@ files_var_lib_filetrans(certmaster_t, certmaster_var_lib_t, { file dir }) # log files manage_files_pattern(certmaster_t, certmaster_var_log_t, certmaster_var_log_t) -logging_log_filetrans(certmaster_t, certmaster_var_log_t, file ) +logging_log_filetrans(certmaster_t, certmaster_var_log_t, file) # pid file manage_files_pattern(certmaster_t, certmaster_var_run_t, certmaster_var_run_t) manage_sock_files_pattern(certmaster_t, certmaster_var_run_t, certmaster_var_run_t) -files_pid_filetrans(certmaster_t ,certmaster_var_run_t, { file sock_file }) +files_pid_filetrans(certmaster_t, certmaster_var_run_t, { file sock_file }) # read meminfo kernel_read_system_state(certmaster_t) diff --git a/policy/modules/services/certmonger.if b/policy/modules/services/certmonger.if index 7a6e5bae..d664be8f 100644 --- a/policy/modules/services/certmonger.if +++ b/policy/modules/services/certmonger.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run certmonger. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`certmonger_domtrans',` @@ -166,9 +166,9 @@ interface(`certmonger_admin',` role_transition $2 certmonger_initrc_exec_t system_r; allow $2 system_r; - files_search_var_lib($1) + files_list_var_lib($1) admin_pattern($1, certmonger_var_lib_t) - files_search_pids($1) + files_list_pids($1) admin_pattern($1, certmonger_var_run_t) ') diff --git a/policy/modules/services/certmonger.te b/policy/modules/services/certmonger.te index 1a65b5e4..1c87fb35 100644 --- a/policy/modules/services/certmonger.te +++ b/policy/modules/services/certmonger.te @@ -32,7 +32,7 @@ allow certmonger_t self:netlink_route_socket r_netlink_socket_perms; manage_dirs_pattern(certmonger_t, certmonger_var_lib_t, certmonger_var_lib_t) manage_files_pattern(certmonger_t, certmonger_var_lib_t, certmonger_var_lib_t) -files_var_lib_filetrans(certmonger_t, certmonger_var_lib_t, { file dir } ) +files_var_lib_filetrans(certmonger_t, certmonger_var_lib_t, { file dir }) manage_dirs_pattern(certmonger_t, certmonger_var_run_t, certmonger_var_run_t) manage_files_pattern(certmonger_t, certmonger_var_run_t, certmonger_var_run_t) diff --git a/policy/modules/services/cgroup.if b/policy/modules/services/cgroup.if index d020c939..e5cbcefd 100644 --- a/policy/modules/services/cgroup.if +++ b/policy/modules/services/cgroup.if @@ -6,9 +6,9 @@ ## CG Clear. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`cgroup_domtrans_cgclear',` @@ -26,9 +26,9 @@ interface(`cgroup_domtrans_cgclear',` ## CG config parser. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`cgroup_domtrans_cgconfig',` @@ -65,9 +65,9 @@ interface(`cgroup_initrc_domtrans_cgconfig',` ## CG rules engine daemon. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`cgroup_domtrans_cgred',` @@ -182,10 +182,10 @@ interface(`cgroup_admin',` admin_pattern($1, cgconfig_etc_t) admin_pattern($1, cgrules_etc_t) - files_search_etc($1) + files_list_etc($1) admin_pattern($1, cgred_var_run_t) - files_search_pids($1) + files_list_pids($1) cgroup_initrc_domtrans_cgconfig($1) domain_system_change_exemption($1) diff --git a/policy/modules/services/chronyd.if b/policy/modules/services/chronyd.if index 5a98145e..2ede737e 100644 --- a/policy/modules/services/chronyd.if +++ b/policy/modules/services/chronyd.if @@ -25,7 +25,7 @@ interface(`chronyd_domtrans',` ## ## ## -## Domain allowed access. +## Domain allowed to transition. ## ## # @@ -151,10 +151,9 @@ interface(`chronyd_append_keys',` # interface(`chronyd_admin',` gen_require(` - type chronyd_t, chronyd_var_log_t; - type chronyd_var_run_t, chronyd_var_lib_t; - type chronyd_tmpfs_t; - type chronyd_initrc_exec_t, chronyd_keys_t; + type chronyd_t, chronyd_var_log_t, chronyd_var_run_t; + type chronyd_var_lib_t, chronyd_tmpfs_t, chronyd_initrc_exec_t; + type chronyd_keys_t; ') allow $1 chronyd_t:process { ptrace signal_perms }; @@ -165,16 +164,16 @@ interface(`chronyd_admin',` role_transition $2 chronyd_initrc_exec_t system_r; allow $2 system_r; - files_search_etc($1) + files_list_etc($1) admin_pattern($1, chronyd_keys_t) - logging_search_logs($1) + logging_list_logs($1) admin_pattern($1, chronyd_var_log_t) - files_search_var_lib($1) + files_list_var_lib($1) admin_pattern($1, chronyd_var_lib_t) - files_search_pids($1) + files_list_pids($1) admin_pattern($1, chronyd_var_run_t) admin_pattern($1, chronyd_tmpfs_t) diff --git a/policy/modules/services/clamav.if b/policy/modules/services/clamav.if index 1f115723..01b02f32 100644 --- a/policy/modules/services/clamav.if +++ b/policy/modules/services/clamav.if @@ -33,6 +33,7 @@ interface(`clamav_stream_connect',` type clamd_t, clamd_var_run_t; ') + files_search_pids($1) stream_connect_pattern($1, clamd_var_run_t, clamd_var_run_t, clamd_t) ') @@ -151,9 +152,8 @@ interface(`clamav_exec_clamscan',` interface(`clamav_admin',` gen_require(` type clamd_t, clamd_etc_t, clamd_tmp_t; - type clamd_var_log_t, clamd_var_lib_t; - type clamd_var_run_t, clamscan_t, clamscan_tmp_t; - type clamd_initrc_exec_t; + type clamd_var_log_t, clamd_var_lib_t, clamd_var_run_t; + type clamscan_t, clamscan_tmp_t, clamd_initrc_exec_t; type freshclam_t, freshclam_var_log_t; ') diff --git a/policy/modules/services/clamav.te b/policy/modules/services/clamav.te index 16598a4f..f9af97c2 100644 --- a/policy/modules/services/clamav.te +++ b/policy/modules/services/clamav.te @@ -1,9 +1,9 @@ policy_module(clamav, 1.8.1) ## -##

-## Allow clamd to use JIT compiler -##

+##

+## Allow clamd to use JIT compiler +##

##
gen_tunable(clamd_use_jit, false) @@ -150,7 +150,7 @@ optional_policy(` tunable_policy(`clamd_use_jit',` allow clamd_t self:process execmem; allow clamscan_t self:process execmem; -', ` +',` dontaudit clamd_t self:process execmem; dontaudit clamscan_t self:process execmem; ') @@ -182,7 +182,7 @@ files_pid_filetrans(freshclam_t, clamd_var_run_t, file) # log files (own logfiles only) manage_files_pattern(freshclam_t, freshclam_var_log_t, freshclam_var_log_t) -allow freshclam_t freshclam_var_log_t:dir setattr; +allow freshclam_t freshclam_var_log_t:dir setattr_dir_perms; read_files_pattern(freshclam_t, clamd_var_log_t, clamd_var_log_t) logging_log_filetrans(freshclam_t, freshclam_var_log_t, file) @@ -220,16 +220,16 @@ clamav_stream_connect(freshclam_t) userdom_stream_connect(freshclam_t) -optional_policy(` - cron_system_entry(freshclam_t, freshclam_exec_t) -') - tunable_policy(`clamd_use_jit',` allow freshclam_t self:process execmem; -', ` +',` dontaudit freshclam_t self:process execmem; ') +optional_policy(` + cron_system_entry(freshclam_t, freshclam_exec_t) +') + ######################################## # # clamscam local policy diff --git a/policy/modules/services/clogd.if b/policy/modules/services/clogd.if index c0a66a41..e438c5fd 100644 --- a/policy/modules/services/clogd.if +++ b/policy/modules/services/clogd.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run clogd. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`clogd_domtrans',` diff --git a/policy/modules/services/clogd.te b/policy/modules/services/clogd.te index 60773390..d10acd29 100644 --- a/policy/modules/services/clogd.te +++ b/policy/modules/services/clogd.te @@ -23,7 +23,6 @@ files_pid_file(clogd_var_run_t) allow clogd_t self:capability { net_admin mknod }; allow clogd_t self:process signal; - allow clogd_t self:sem create_sem_perms; allow clogd_t self:shm create_shm_perms; allow clogd_t self:netlink_socket create_socket_perms; @@ -36,7 +35,7 @@ fs_tmpfs_filetrans(clogd_t, clogd_tmpfs_t, { dir file }) # pid files manage_files_pattern(clogd_t, clogd_var_run_t, clogd_var_run_t) manage_sock_files_pattern(clogd_t, clogd_var_run_t, clogd_var_run_t) -files_pid_filetrans(clogd_t, clogd_var_run_t, { file }) +files_pid_filetrans(clogd_t, clogd_var_run_t, file) dev_read_lvm_control(clogd_t) dev_manage_generic_blk_files(clogd_t) diff --git a/policy/modules/services/cmirrord.if b/policy/modules/services/cmirrord.if index d5b410f9..756ac919 100644 --- a/policy/modules/services/cmirrord.if +++ b/policy/modules/services/cmirrord.if @@ -1,4 +1,3 @@ - ## policy for cmirrord ######################################## @@ -6,9 +5,9 @@ ## Execute a domain transition to run cmirrord. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`cmirrord_domtrans',` @@ -58,26 +57,25 @@ interface(`cmirrord_read_pid_files',` ####################################### ## -## Read and write to cmirrord shared memory. +## Read and write to cmirrord shared memory. ## ## -## +## ## Domain allowed access. -## +## ## # interface(`cmirrord_rw_shm',` - gen_require(` - type cmirrord_t; - type cmirrord_tmpfs_t; - ') + gen_require(` + type cmirrord_t, cmirrord_tmpfs_t; + ') - allow $1 cmirrord_t:shm { rw_shm_perms destroy }; - allow $1 cmirrord_tmpfs_t:dir list_dir_perms; - rw_files_pattern($1, cmirrord_tmpfs_t, cmirrord_tmpfs_t) + allow $1 cmirrord_t:shm { rw_shm_perms destroy }; + allow $1 cmirrord_tmpfs_t:dir list_dir_perms; + rw_files_pattern($1, cmirrord_tmpfs_t, cmirrord_tmpfs_t) delete_files_pattern($1, cmirrord_tmpfs_t, cmirrord_tmpfs_t) read_lnk_files_pattern($1, cmirrord_tmpfs_t, cmirrord_tmpfs_t) - fs_search_tmpfs($1) + fs_search_tmpfs($1) ') ######################################## @@ -99,9 +97,7 @@ interface(`cmirrord_rw_shm',` # interface(`cmirrord_admin',` gen_require(` - type cmirrord_t; - type cmirrord_initrc_exec_t; - type cmirrord_var_run_t; + type cmirrord_t, cmirrord_initrc_exec_t, cmirrord_var_run_t; ') allow $1 cmirrord_t:process { ptrace signal_perms }; @@ -112,7 +108,6 @@ interface(`cmirrord_admin',` role_transition $2 cmirrord_initrc_exec_t system_r; allow $2 system_r; - files_search_pids($1) + files_list_pids($1) admin_pattern($1, cmirrord_var_run_t) - ') diff --git a/policy/modules/services/cmirrord.te b/policy/modules/services/cmirrord.te index bb7d429b..a2c71341 100644 --- a/policy/modules/services/cmirrord.te +++ b/policy/modules/services/cmirrord.te @@ -1,4 +1,4 @@ -policy_module(cmirrord,1.0.0) +policy_module(cmirrord, 1.0.0) ######################################## # @@ -26,9 +26,7 @@ files_pid_file(cmirrord_var_run_t) allow cmirrord_t self:capability { net_admin kill }; dontaudit cmirrord_t self:capability sys_tty_config; allow cmirrord_t self:process signal; - allow cmirrord_t self:fifo_file rw_fifo_file_perms; - allow cmirrord_t self:sem create_sem_perms; allow cmirrord_t self:shm create_shm_perms; allow cmirrord_t self:netlink_socket create_socket_perms; @@ -40,7 +38,7 @@ fs_tmpfs_filetrans(cmirrord_t, cmirrord_tmpfs_t, { dir file }) manage_dirs_pattern(cmirrord_t, cmirrord_var_run_t, cmirrord_var_run_t) manage_files_pattern(cmirrord_t, cmirrord_var_run_t, cmirrord_var_run_t) -files_pid_filetrans(cmirrord_t, cmirrord_var_run_t, { file }) +files_pid_filetrans(cmirrord_t, cmirrord_var_run_t, file) domain_use_interactive_fds(cmirrord_t) @@ -51,5 +49,5 @@ logging_send_syslog_msg(cmirrord_t) miscfiles_read_localization(cmirrord_t) optional_policy(` - corosync_stream_connect(cmirrord_t) + corosync_stream_connect(cmirrord_t) ') diff --git a/policy/modules/services/cobbler.if b/policy/modules/services/cobbler.if index b2198bb0..e3787fb1 100644 --- a/policy/modules/services/cobbler.if +++ b/policy/modules/services/cobbler.if @@ -1,12 +1,12 @@ ## Cobbler installation server. ## ##

-## Cobbler is a Linux installation server that allows for -## rapid setup of network installation environments. It -## glues together and automates many associated Linux -## tasks so you do not have to hop between lots of various -## commands and applications when rolling out new systems, -## and, in some cases, changing existing ones. +## Cobbler is a Linux installation server that allows for +## rapid setup of network installation environments. It +## glues together and automates many associated Linux +## tasks so you do not have to hop between lots of various +## commands and applications when rolling out new systems, +## and, in some cases, changing existing ones. ##

##
@@ -15,9 +15,9 @@ ## Execute a domain transition to run cobblerd. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`cobblerd_domtrans',` @@ -153,7 +153,7 @@ interface(`cobbler_manage_lib_files',` ## ## ## -## Domain allowed access. +## Domain to not audit. ## ## # @@ -185,25 +185,23 @@ interface(`cobbler_dontaudit_rw_log',` interface(`cobblerd_admin',` gen_require(` type cobblerd_t, cobbler_var_lib_t, cobbler_var_log_t; - type cobbler_etc_t, cobblerd_initrc_exec_t; - type httpd_cobbler_content_t; - type httpd_cobbler_content_ra_t; - type httpd_cobbler_content_rw_t; + type cobbler_etc_t, cobblerd_initrc_exec_t, httpd_cobbler_content_t; + type httpd_cobbler_content_ra_t, httpd_cobbler_content_rw_t; ') allow $1 cobblerd_t:process { ptrace signal_perms }; ps_process_pattern($1, cobblerd_t) - files_search_etc($1) + files_list_etc($1) admin_pattern($1, cobbler_etc_t) files_list_var_lib($1) admin_pattern($1, cobbler_var_lib_t) - logging_search_logs($1) + logging_list_logs($1) admin_pattern($1, cobbler_var_log_t) - apache_search_sys_content($1) + apache_list_sys_content($1) admin_pattern($1, httpd_cobbler_content_t) admin_pattern($1, httpd_cobbler_content_ra_t) admin_pattern($1, httpd_cobbler_content_rw_t) diff --git a/policy/modules/services/cobbler.te b/policy/modules/services/cobbler.te index 6a6d7d7d..c4d678b0 100644 --- a/policy/modules/services/cobbler.te +++ b/policy/modules/services/cobbler.te @@ -6,32 +6,32 @@ policy_module(cobbler, 1.1.0) # ## -##

-## Allow Cobbler to modify public files -## used for public file transfer services. -##

+##

+## Allow Cobbler to modify public files +## used for public file transfer services. +##

##
gen_tunable(cobbler_anon_write, false) - + ## -##

-## Allow Cobbler to connect to the -## network using TCP. -##

+##

+## Allow Cobbler to connect to the +## network using TCP. +##

##
gen_tunable(cobbler_can_network_connect, false) ## -##

-## Allow Cobbler to access cifs file systems. -##

+##

+## Allow Cobbler to access cifs file systems. +##

##
gen_tunable(cobbler_use_cifs, false) ## -##

-## Allow Cobbler to access nfs file systems. -##

+##

+## Allow Cobbler to access nfs file systems. +##

##
gen_tunable(cobbler_use_nfs, false) diff --git a/policy/modules/services/consolekit.if b/policy/modules/services/consolekit.if index 51afa67b..53b10e34 100644 --- a/policy/modules/services/consolekit.if +++ b/policy/modules/services/consolekit.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run consolekit. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`consolekit_domtrans',` diff --git a/policy/modules/services/consolekit.te b/policy/modules/services/consolekit.te index cc2058ba..16c0746f 100644 --- a/policy/modules/services/consolekit.te +++ b/policy/modules/services/consolekit.te @@ -113,7 +113,7 @@ optional_policy(` ') optional_policy(` - policykit_dbus_chat(consolekit_t) + policykit_dbus_chat(consolekit_t) policykit_domtrans_auth(consolekit_t) policykit_read_lib(consolekit_t) policykit_read_reload(consolekit_t) diff --git a/policy/modules/services/corosync.if b/policy/modules/services/corosync.if index 05f7296b..a2e68307 100644 --- a/policy/modules/services/corosync.if +++ b/policy/modules/services/corosync.if @@ -20,21 +20,21 @@ interface(`corosync_domtrans',` ###################################### ## -## Execute corosync in the caller domain. +## Execute corosync in the caller domain. ## ## -## -## Domain allowed to transition. -## +## +## Domain allowed access. +## ## # interface(`corosync_exec',` - gen_require(` - type corosync_exec_t; - ') + gen_require(` + type corosync_exec_t; + ') - corecmd_search_bin($1) - can_exec($1, corosync_exec_t) + corecmd_search_bin($1) + can_exec($1, corosync_exec_t) ') ####################################### diff --git a/policy/modules/services/corosync.te b/policy/modules/services/corosync.te index ed9dd2f9..c3620a0d 100644 --- a/policy/modules/services/corosync.te +++ b/policy/modules/services/corosync.te @@ -92,10 +92,6 @@ userdom_delete_user_tmpfs_files(corosync_t) userdom_rw_user_tmpfs_files(corosync_t) optional_policy(` - gen_require(` - attribute unconfined_services; - ') - fs_manage_tmpfs_files(corosync_t) init_manage_script_status_files(corosync_t) ') diff --git a/policy/modules/services/courier.if b/policy/modules/services/courier.if index 99713375..f0818996 100644 --- a/policy/modules/services/courier.if +++ b/policy/modules/services/courier.if @@ -138,6 +138,7 @@ interface(`courier_read_config',` type courier_etc_t; ') + files_search_etc($1) read_files_pattern($1, courier_etc_t, courier_etc_t) ') @@ -157,6 +158,7 @@ interface(`courier_manage_spool_dirs',` type courier_spool_t; ') + files_search_spool($1) manage_dirs_pattern($1, courier_spool_t, courier_spool_t) ') @@ -176,6 +178,7 @@ interface(`courier_manage_spool_files',` type courier_spool_t; ') + files_search_spool($1) manage_files_pattern($1, courier_spool_t, courier_spool_t) ') @@ -194,6 +197,7 @@ interface(`courier_read_spool',` type courier_spool_t; ') + files_search_spool($1) read_files_pattern($1, courier_spool_t, courier_spool_t) ') diff --git a/policy/modules/services/courier.te b/policy/modules/services/courier.te index 37f48108..cc939583 100644 --- a/policy/modules/services/courier.te +++ b/policy/modules/services/courier.te @@ -93,7 +93,7 @@ allow courier_pop_t courier_authdaemon_t:process sigchld; allow courier_pop_t courier_tcpd_t:{ unix_stream_socket tcp_socket } rw_stream_socket_perms; # inherits file handle - should it? -allow courier_pop_t courier_var_lib_t:file { read write }; +allow courier_pop_t courier_var_lib_t:file rw_inherited_file_perms; miscfiles_read_localization(courier_pop_t) diff --git a/policy/modules/services/cron.if b/policy/modules/services/cron.if index 98220745..b6402c9f 100644 --- a/policy/modules/services/cron.if +++ b/policy/modules/services/cron.if @@ -52,7 +52,7 @@ template(`cron_common_crontab_template',` files_list_spool($1_t) # crontab signals crond by updating the mtime on the spooldir - allow $1_t cron_spool_t:dir setattr; + allow $1_t cron_spool_t:dir setattr_dir_perms; kernel_read_system_state($1_t) @@ -113,12 +113,12 @@ template(`cron_common_crontab_template',` ## User domain for the role ## ## +## # interface(`cron_role',` gen_require(` type cronjob_t, crontab_t, crontab_exec_t; - type user_cron_spool_t; - type crond_t; + type user_cron_spool_t, crond_t; ') role $1 types { cronjob_t crontab_t }; @@ -138,7 +138,7 @@ interface(`cron_role',` # crontab shows up in user ps ps_process_pattern($2, crontab_t) - allow $2 crontab_t:process signal; + allow $2 crontab_t:process { ptrace signal_perms }; # Run helper programs as the user domain #corecmd_bin_domtrans(crontab_t, $2) @@ -152,9 +152,8 @@ interface(`cron_role',` ') dbus_stub(cronjob_t) - allow cronjob_t $2:dbus send_msg; - ') + ') ') ######################################## @@ -171,6 +170,7 @@ interface(`cron_role',` ## User domain for the role ## ## +## # interface(`cron_unconfined_role',` gen_require(` @@ -181,6 +181,7 @@ interface(`cron_unconfined_role',` # cronjob shows up in user ps ps_process_pattern($2, unconfined_cronjob_t) + allow $2 unconfined_cronjob_t:process { ptrace signal_perms }; optional_policy(` gen_require(` @@ -188,9 +189,8 @@ interface(`cron_unconfined_role',` ') dbus_stub(unconfined_cronjob_t) - allow unconfined_cronjob_t $2:dbus send_msg; - ') + ') ') ######################################## @@ -207,6 +207,7 @@ interface(`cron_unconfined_role',` ## User domain for the role ## ## +## # interface(`cron_admin_role',` gen_require(` @@ -227,7 +228,7 @@ interface(`cron_admin_role',` # crontab shows up in user ps ps_process_pattern($2, admin_crontab_t) - allow $2 admin_crontab_t:process signal; + allow $2 admin_crontab_t:process { ptrace signal_perms }; # Run helper programs as the user domain #corecmd_bin_domtrans(admin_crontab_t, $2) @@ -241,9 +242,8 @@ interface(`cron_admin_role',` ') dbus_stub(admin_cronjob_t) - allow cronjob_t $2:dbus send_msg; - ') + ') ') ######################################## @@ -311,7 +311,7 @@ interface(`cron_exec',` ######################################## ## -## Execute crond server in the nscd domain. +## Execute crond server in the crond domain. ## ## ## @@ -524,6 +524,7 @@ interface(`cron_manage_pid_files',` type crond_var_run_t; ') + files_search_pids($1) manage_files_pattern($1, crond_var_run_t, crond_var_run_t) ') @@ -579,7 +580,7 @@ interface(`cron_write_system_job_pipes',` type system_cronjob_t; ') - allow $1 system_cronjob_t:file write; + allow $1 system_cronjob_t:fifo_file write; ') ######################################## @@ -695,8 +696,8 @@ interface(`cron_read_system_job_lib_files',` type system_cronjob_var_lib_t; ') - - read_files_pattern($1, system_cronjob_var_lib_t, system_cronjob_var_lib_t) + files_search_var_lib($1) + read_files_pattern($1, system_cronjob_var_lib_t, system_cronjob_var_lib_t) ') ######################################## @@ -714,6 +715,6 @@ interface(`cron_manage_system_job_lib_files',` type system_cronjob_var_lib_t; ') - - manage_files_pattern($1, system_cronjob_var_lib_t, system_cronjob_var_lib_t) + files_search_var_lib($1) + manage_files_pattern($1, system_cronjob_var_lib_t, system_cronjob_var_lib_t) ') diff --git a/policy/modules/services/cron.te b/policy/modules/services/cron.te index 45f5a6f1..2a7f7f42 100644 --- a/policy/modules/services/cron.te +++ b/policy/modules/services/cron.te @@ -10,18 +10,18 @@ gen_require(` # ## -##

-## Allow system cron jobs to relabel filesystem -## for restoring file contexts. -##

+##

+## Allow system cron jobs to relabel filesystem +## for restoring file contexts. +##

##
gen_tunable(cron_can_relabel, false) ## -##

-## Enable extra rules in the cron domain -## to support fcron. -##

+##

+## Enable extra rules in the cron domain +## to support fcron. +##

##
gen_tunable(fcron_crond, false) @@ -99,10 +99,6 @@ files_lock_file(system_cronjob_lock_t) type system_cronjob_tmp_t alias system_crond_tmp_t; files_tmp_file(system_cronjob_tmp_t) -ifdef(`enable_mcs',` - init_ranged_daemon_domain(crond_t, crond_exec_t, s0 - mcs_systemhigh) -') - type unconfined_cronjob_t; domain_type(unconfined_cronjob_t) domain_cron_exemption_target(unconfined_cronjob_t) @@ -122,13 +118,17 @@ typealias system_cronjob_var_lib_t alias system_crond_var_lib_t; type system_cronjob_var_run_t; files_pid_file(system_cronjob_var_run_t) +ifdef(`enable_mcs',` + init_ranged_daemon_domain(crond_t, crond_exec_t, s0 - mcs_systemhigh) +') + ######################################## # # Admin crontab local policy # # Allow our crontab domain to unlink a user cron spool file. -allow admin_crontab_t user_cron_spool_t:file { getattr read unlink }; +allow admin_crontab_t user_cron_spool_t:file { read_file_perms delete_file_perms }; # Manipulate other users crontab. selinux_get_fs_mount(admin_crontab_t) @@ -138,7 +138,7 @@ selinux_compute_create_context(admin_crontab_t) selinux_compute_relabel_context(admin_crontab_t) selinux_compute_user_contexts(admin_crontab_t) -tunable_policy(`fcron_crond', ` +tunable_policy(`fcron_crond',` # fcron wants an instant update of a crontab change for the administrator # also crontab does a security check for crontab -u allow admin_crontab_t self:process setfscreate; @@ -251,7 +251,7 @@ ifdef(`distro_debian',` ') ') -ifdef(`distro_redhat', ` +ifdef(`distro_redhat',` # Run the rpm program in the rpm_t domain. Allow creation of RPM log files # via redirection of standard out. optional_policy(` @@ -263,13 +263,17 @@ tunable_policy(`allow_polyinstantiation',` files_polyinstantiate_all(crond_t) ') +tunable_policy(`fcron_crond',` + allow crond_t system_cron_spool_t:file manage_file_perms; +') + optional_policy(` apache_search_sys_content(crond_t) ') optional_policy(` - djbdns_search_tinydns_keys(crond_t) - djbdns_link_tinydns_keys(crond_t) + djbdns_search_tinydns_keys(crond_t) + djbdns_link_tinydns_keys(crond_t) ') optional_policy(` @@ -287,10 +291,6 @@ optional_policy(` mono_domtrans(crond_t) ') -tunable_policy(`fcron_crond', ` - allow crond_t system_cron_spool_t:file manage_file_perms; -') - optional_policy(` amanda_search_var_lib(crond_t) ') @@ -351,7 +351,7 @@ logging_log_filetrans(system_cronjob_t, cron_log_t, file) # This is to handle /var/lib/misc directory. Used currently # by prelink var/lib files for cron -allow system_cronjob_t cron_var_lib_t:file { manage_file_perms relabelfrom relabelto }; +allow system_cronjob_t cron_var_lib_t:file { manage_file_perms relabel_file_perms }; files_var_lib_filetrans(system_cronjob_t, cron_var_lib_t, file) allow system_cronjob_t cron_var_run_t:file manage_file_perms; @@ -472,7 +472,7 @@ miscfiles_manage_man_pages(system_cronjob_t) seutil_read_config(system_cronjob_t) -ifdef(`distro_redhat', ` +ifdef(`distro_redhat',` # Run the rpm program in the rpm_t domain. Allow creation of RPM log files allow crond_t system_cron_spool_t:file manage_file_perms; @@ -687,7 +687,7 @@ read_files_pattern(crond_t, user_cron_spool_t, user_cron_spool_t) read_lnk_files_pattern(crond_t, user_cron_spool_t, user_cron_spool_t) allow crond_t user_cron_spool_t:file manage_lnk_file_perms; -tunable_policy(`fcron_crond', ` +tunable_policy(`fcron_crond',` allow crond_t user_cron_spool_t:file manage_file_perms; ') diff --git a/policy/modules/services/cups.if b/policy/modules/services/cups.if index fb3454a5..777091a3 100644 --- a/policy/modules/services/cups.if +++ b/policy/modules/services/cups.if @@ -316,12 +316,10 @@ interface(`cups_stream_connect_ptal',` interface(`cups_admin',` gen_require(` type cupsd_t, cupsd_tmp_t, cupsd_lpd_tmp_t; - type cupsd_etc_t, cupsd_log_t; - type cupsd_config_var_run_t, cupsd_lpd_var_run_t; - type cupsd_var_run_t, ptal_etc_t; - type ptal_var_run_t, hplip_var_run_t; - type cupsd_initrc_exec_t; - type hplip_etc_t; + type cupsd_etc_t, cupsd_log_t, hplip_etc_t; + type cupsd_config_var_run_t, cupsd_lpd_var_run_t, cupsd_initrc_exec_t; + type cupsd_var_run_t, ptal_etc_t, hplip_var_run_t; + type ptal_var_run_t; ') allow $1 cupsd_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/cups.te b/policy/modules/services/cups.te index 11e74af8..b3ab30f4 100644 --- a/policy/modules/services/cups.te +++ b/policy/modules/services/cups.te @@ -149,7 +149,7 @@ manage_files_pattern(cupsd_t, cupsd_tmp_t, cupsd_tmp_t) manage_fifo_files_pattern(cupsd_t, cupsd_tmp_t, cupsd_tmp_t) files_tmp_filetrans(cupsd_t, cupsd_tmp_t, { file dir fifo_file }) -allow cupsd_t cupsd_var_run_t:dir setattr; +allow cupsd_t cupsd_var_run_t:dir setattr_dir_perms; manage_dirs_pattern(cupsd_t, cupsd_var_run_t, cupsd_var_run_t) manage_files_pattern(cupsd_t, cupsd_var_run_t, cupsd_var_run_t) manage_sock_files_pattern(cupsd_t, cupsd_var_run_t, cupsd_var_run_t) @@ -163,7 +163,7 @@ read_files_pattern(cupsd_t, hplip_etc_t, hplip_etc_t) allow cupsd_t hplip_var_run_t:file read_file_perms; stream_connect_pattern(cupsd_t, ptal_var_run_t, ptal_var_run_t, ptal_t) -allow cupsd_t ptal_var_run_t : sock_file setattr; +allow cupsd_t ptal_var_run_t:sock_file setattr_sock_file_perms; kernel_read_system_state(cupsd_t) kernel_read_network_state(cupsd_t) @@ -609,10 +609,6 @@ userdom_dontaudit_search_admin_dir(cups_pdf_t) lpd_manage_spool(cups_pdf_t) -optional_policy(` - gnome_read_config(cups_pdf_t) -') - tunable_policy(`use_nfs_home_dirs',` fs_search_auto_mountpoints(cups_pdf_t) fs_manage_nfs_dirs(cups_pdf_t) @@ -624,6 +620,10 @@ tunable_policy(`use_samba_home_dirs',` fs_manage_cifs_files(cups_pdf_t) ') +optional_policy(` + gnome_read_config(cups_pdf_t) +') + ######################################## # # HPLIP local policy @@ -657,7 +657,7 @@ manage_files_pattern(hplip_t, hplip_var_lib_t, hplip_var_lib_t) manage_lnk_files_pattern(hplip_t, hplip_var_lib_t, hplip_var_lib_t) manage_fifo_files_pattern(hplip_t, hplip_tmp_t, hplip_tmp_t) -files_tmp_filetrans(hplip_t, hplip_tmp_t, fifo_file ) +files_tmp_filetrans(hplip_t, hplip_tmp_t, fifo_file) manage_files_pattern(hplip_t, hplip_var_run_t, hplip_var_run_t) files_pid_filetrans(hplip_t, hplip_var_run_t, file) diff --git a/policy/modules/services/cvs.if b/policy/modules/services/cvs.if index c43ff4c1..5bf3e60d 100644 --- a/policy/modules/services/cvs.if +++ b/policy/modules/services/cvs.if @@ -58,9 +58,8 @@ interface(`cvs_exec',` # interface(`cvs_admin',` gen_require(` - type cvs_t, cvs_tmp_t; + type cvs_t, cvs_tmp_t, cvs_initrc_exec_t; type cvs_data_t, cvs_var_run_t; - type cvs_initrc_exec_t; ') allow $1 cvs_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/cvs.te b/policy/modules/services/cvs.te index 9e8d14b3..e18dc0b2 100644 --- a/policy/modules/services/cvs.te +++ b/policy/modules/services/cvs.te @@ -6,9 +6,9 @@ policy_module(cvs, 1.9.0) # ## -##

-## Allow cvs daemon to read shadow -##

+##

+## Allow cvs daemon to read shadow +##

##
gen_tunable(allow_cvs_read_shadow, false) @@ -35,12 +35,12 @@ files_pid_file(cvs_var_run_t) # Local policy # +allow cvs_t self:capability { setuid setgid }; allow cvs_t self:process signal_perms; allow cvs_t self:fifo_file rw_fifo_file_perms; allow cvs_t self:tcp_socket connected_stream_socket_perms; # for identd; cjp: this should probably only be inetd_child rules? allow cvs_t self:netlink_tcpdiag_socket r_netlink_socket_perms; -allow cvs_t self:capability { setuid setgid }; manage_dirs_pattern(cvs_t, cvs_data_t, cvs_data_t) manage_files_pattern(cvs_t, cvs_data_t, cvs_data_t) diff --git a/policy/modules/services/cyphesis.if b/policy/modules/services/cyphesis.if index 9d445386..7e9057ed 100644 --- a/policy/modules/services/cyphesis.if +++ b/policy/modules/services/cyphesis.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run cyphesis. ##
## -## +## ## Domain allowed to transition. -## +## ## # interface(`cyphesis_domtrans',` diff --git a/policy/modules/services/dbus.if b/policy/modules/services/dbus.if index 78524415..74fa3d6c 100644 --- a/policy/modules/services/dbus.if +++ b/policy/modules/services/dbus.if @@ -41,9 +41,7 @@ interface(`dbus_stub',` template(`dbus_role_template',` gen_require(` class dbus { send_msg acquire_svc }; - - attribute dbusd_unconfined; - attribute session_bus_type; + attribute dbusd_unconfined, session_bus_type; type system_dbusd_t, session_dbusd_tmp_t, dbusd_exec_t, dbusd_etc_t; type $1_t; ') @@ -90,14 +88,15 @@ template(`dbus_role_template',` files_tmp_filetrans($1_dbusd_t, session_dbusd_tmp_t, { file dir }) domtrans_pattern($3, dbusd_exec_t, $1_dbusd_t) - allow $3 $1_dbusd_t:process { signull sigkill signal }; + + ps_process_pattern($3, $1_dbusd_t) + allow $3 $1_dbusd_t:process { ptrace signal_perms }; # cjp: this seems very broken corecmd_bin_domtrans($1_dbusd_t, $1_t) allow $1_dbusd_t $3:process sigkill; allow $3 $1_dbusd_t:fd use; allow $3 $1_dbusd_t:fifo_file rw_fifo_file_perms; - allow $3 $1_dbusd_t:process sigchld; kernel_read_system_state($1_dbusd_t) kernel_read_kernel_sysctls($1_dbusd_t) @@ -118,7 +117,7 @@ template(`dbus_role_template',` dev_read_urand($1_dbusd_t) - domain_use_interactive_fds($1_dbusd_t) + domain_use_interactive_fds($1_dbusd_t) domain_read_all_domains_state($1_dbusd_t) files_read_etc_files($1_dbusd_t) @@ -156,7 +155,7 @@ template(`dbus_role_template',` userdom_manage_user_home_content_files($1_dbusd_t) userdom_user_home_dir_filetrans_user_home_content($1_dbusd_t, { dir file }) - ifdef(`hide_broken_symptoms', ` + ifdef(`hide_broken_symptoms',` dontaudit $3 $1_dbusd_t:netlink_selinux_socket { read write }; ') @@ -463,7 +462,7 @@ interface(`dbus_system_domain',` unconfined_dbus_send($1) ') - ifdef(`hide_broken_symptoms', ` + ifdef(`hide_broken_symptoms',` dontaudit $1 system_dbusd_t:netlink_selinux_socket { read write }; ') ') @@ -520,6 +519,6 @@ interface(`dbus_delete_pid_files',` type system_dbusd_var_run_t; ') + files_search_pids($1) delete_files_pattern($1, system_dbusd_var_run_t, system_dbusd_var_run_t) ') - diff --git a/policy/modules/services/dbus.te b/policy/modules/services/dbus.te index c725caee..d9416fcf 100644 --- a/policy/modules/services/dbus.te +++ b/policy/modules/services/dbus.te @@ -152,7 +152,7 @@ optional_policy(` ') optional_policy(` - policykit_dbus_chat(system_dbusd_t) + policykit_dbus_chat(system_dbusd_t) policykit_domtrans_auth(system_dbusd_t) policykit_search_lib(system_dbusd_t) ') diff --git a/policy/modules/services/dcc.if b/policy/modules/services/dcc.if index 784753e6..bf65e7d6 100644 --- a/policy/modules/services/dcc.if +++ b/policy/modules/services/dcc.if @@ -168,6 +168,6 @@ interface(`dcc_stream_connect_dccifd',` type dcc_var_t, dccifd_var_run_t, dccifd_t; ') - files_search_var($1) + files_search_pids($1) stream_connect_pattern($1, dcc_var_t, dccifd_var_run_t, dccifd_t) ') diff --git a/policy/modules/services/ddclient.if b/policy/modules/services/ddclient.if index 0a1a61b3..da508f46 100644 --- a/policy/modules/services/ddclient.if +++ b/policy/modules/services/ddclient.if @@ -64,8 +64,8 @@ interface(`ddclient_run',` interface(`ddclient_admin',` gen_require(` type ddclient_t, ddclient_etc_t, ddclient_log_t; - type ddclient_var_t, ddclient_var_lib_t; - type ddclient_var_run_t, ddclient_initrc_exec_t; + type ddclient_var_t, ddclient_var_lib_t, ddclient_initrc_exec_t; + type ddclient_var_run_t; ') allow $1 ddclient_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/denyhosts.if b/policy/modules/services/denyhosts.if index 567865f3..9c9e65c3 100644 --- a/policy/modules/services/denyhosts.if +++ b/policy/modules/services/denyhosts.if @@ -13,12 +13,12 @@ ## Execute a domain transition to run denyhosts. ## ## -## +## ## Domain allowed to transition. -## +## ## # -interface(`denyhosts_domtrans', ` +interface(`denyhosts_domtrans',` gen_require(` type denyhosts_t, denyhosts_exec_t; ') @@ -36,7 +36,7 @@ interface(`denyhosts_domtrans', ` ## ## # -interface(`denyhosts_initrc_domtrans', ` +interface(`denyhosts_initrc_domtrans',` gen_require(` type denyhosts_initrc_exec_t; ') @@ -59,8 +59,9 @@ interface(`denyhosts_initrc_domtrans', ` ## Role allowed access. ## ## +## # -interface(`denyhosts_admin', ` +interface(`denyhosts_admin',` gen_require(` type denyhosts_t, denyhosts_var_lib_t, denyhosts_var_lock_t; type denyhosts_var_log_t, denyhosts_initrc_exec_t; @@ -74,12 +75,12 @@ interface(`denyhosts_admin', ` role_transition $2 denyhosts_initrc_exec_t system_r; allow $2 system_r; - files_search_var_lib($1) + files_list_var_lib($1) admin_pattern($1, denyhosts_var_lib_t) - logging_search_logs($1) + logging_list_logs($1) admin_pattern($1, denyhosts_var_log_t) - files_search_locks($1) + files_list_locks($1) admin_pattern($1, denyhosts_var_lock_t) ') diff --git a/policy/modules/services/denyhosts.te b/policy/modules/services/denyhosts.te index d53ee7e3..b10da2c0 100644 --- a/policy/modules/services/denyhosts.te +++ b/policy/modules/services/denyhosts.te @@ -77,5 +77,5 @@ optional_policy(` ') optional_policy(` - gnome_dontaudit_search_config(denyhosts_t) + gnome_dontaudit_search_config(denyhosts_t) ') diff --git a/policy/modules/services/devicekit.if b/policy/modules/services/devicekit.if index 70cf0184..ab2edfc1 100644 --- a/policy/modules/services/devicekit.if +++ b/policy/modules/services/devicekit.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run devicekit. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`devicekit_domtrans',` @@ -147,16 +147,6 @@ interface(`devicekit_read_pid_files',` ## Domain allowed access. ## ## -## -## -## The role to be allowed to manage the devicekit domain. -## -## -## -## -## The type of the user terminal. -## -## ## # interface(`devicekit_admin',` @@ -175,11 +165,11 @@ interface(`devicekit_admin',` ps_process_pattern($1, devicekit_power_t) admin_pattern($1, devicekit_tmp_t) - files_search_tmp($1) + files_list_tmp($1) admin_pattern($1, devicekit_var_lib_t) - files_search_var_lib($1) + files_list_var_lib($1) admin_pattern($1, devicekit_var_run_t) - files_search_pids($1) + files_list_pids($1) ') diff --git a/policy/modules/services/devicekit.te b/policy/modules/services/devicekit.te index 6cee08fa..58416a02 100644 --- a/policy/modules/services/devicekit.te +++ b/policy/modules/services/devicekit.te @@ -309,4 +309,3 @@ optional_policy(` optional_policy(` vbetool_domtrans(devicekit_power_t) ') - diff --git a/policy/modules/services/dhcp.if b/policy/modules/services/dhcp.if index aa4da1d9..7e129ffc 100644 --- a/policy/modules/services/dhcp.if +++ b/policy/modules/services/dhcp.if @@ -36,7 +36,7 @@ interface(`dhcpd_setattr_state_files',` ') sysnet_search_dhcp_state($1) - allow $1 dhcpd_state_t:file setattr; + allow $1 dhcpd_state_t:file setattr_file_perms; ') ######################################## diff --git a/policy/modules/services/djbdns.te b/policy/modules/services/djbdns.te index e7232667..51e2ce8e 100644 --- a/policy/modules/services/djbdns.te +++ b/policy/modules/services/djbdns.te @@ -23,11 +23,6 @@ djbdns_daemontools_domain_template(tinydns) # Local policy for axfrdns component # -files_config_file(djbdns_axfrdns_conf_t) - -daemontools_ipc_domain(djbdns_axfrdns_t) -daemontools_read_svc(djbdns_axfrdns_t) - allow djbdns_axfrdns_t self:capability { setuid setgid sys_chroot }; allow djbdns_axfrdns_t djbdns_axfrdns_conf_t:dir list_dir_perms; @@ -41,6 +36,9 @@ allow djbdns_axfrdns_t djbdns_tinydns_conf_t:file read_file_perms; files_search_var(djbdns_axfrdns_t) +daemontools_ipc_domain(djbdns_axfrdns_t) +daemontools_read_svc(djbdns_axfrdns_t) + ucspitcp_service_domain(djbdns_axfrdns_t, djbdns_axfrdns_exec_t) ######################################## diff --git a/policy/modules/services/dnsmasq.if b/policy/modules/services/dnsmasq.if index 9bd812b4..c808b311 100644 --- a/policy/modules/services/dnsmasq.if +++ b/policy/modules/services/dnsmasq.if @@ -101,9 +101,9 @@ interface(`dnsmasq_kill',` ## Read dnsmasq config files. ## ## -## +## ## Domain allowed access. -## +## ## # interface(`dnsmasq_read_config',` @@ -120,9 +120,9 @@ interface(`dnsmasq_read_config',` ## Write to dnsmasq config files. ## ## -## +## ## Domain allowed access. -## +## ## # interface(`dnsmasq_write_config',` @@ -144,12 +144,12 @@ interface(`dnsmasq_write_config',` ## ## # -# interface(`dnsmasq_delete_pid_files',` gen_require(` type dnsmasq_var_run_t; ') + files_search_pids($1) delete_files_pattern($1, dnsmasq_var_run_t, dnsmasq_var_run_t) ') @@ -169,6 +169,7 @@ interface(`dnsmasq_read_pid_files',` type dnsmasq_var_run_t; ') + files_search_pids($1) read_files_pattern($1, dnsmasq_var_run_t, dnsmasq_var_run_t) ') diff --git a/policy/modules/services/dovecot.if b/policy/modules/services/dovecot.if index 09f6f301..ee51a19b 100644 --- a/policy/modules/services/dovecot.if +++ b/policy/modules/services/dovecot.if @@ -9,13 +9,13 @@ ## Domain allowed access. ## ## -## # interface(`dovecot_stream_connect_auth',` gen_require(` type dovecot_auth_t, dovecot_var_run_t; ') + files_search_pids($1) stream_connect_pattern($1, dovecot_var_run_t, dovecot_var_run_t, dovecot_auth_t) ') @@ -52,6 +52,7 @@ interface(`dovecot_manage_spool',` type dovecot_spool_t; ') + files_search_spool($1) manage_files_pattern($1, dovecot_spool_t, dovecot_spool_t) manage_lnk_files_pattern($1, dovecot_spool_t, dovecot_spool_t) ') @@ -94,13 +95,9 @@ interface(`dovecot_dontaudit_unlink_lib_files',` interface(`dovecot_admin',` gen_require(` type dovecot_t, dovecot_etc_t, dovecot_auth_tmp_t; - type dovecot_spool_t, dovecot_var_lib_t; - type dovecot_var_run_t, dovecot_tmp_t; - type dovecot_var_log_t; - - type dovecot_cert_t, dovecot_passwd_t; - type dovecot_initrc_exec_t; - type dovecot_keytab_t; + type dovecot_spool_t, dovecot_var_lib_t, dovecot_var_log_t; + type dovecot_var_run_t, dovecot_tmp_t, dovecot_keytab_t; + type dovecot_cert_t, dovecot_passwd_t, dovecot_initrc_exec_t; ') allow $1 dovecot_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/dovecot.te b/policy/modules/services/dovecot.te index 64bc566b..aff22962 100644 --- a/policy/modules/services/dovecot.te +++ b/policy/modules/services/dovecot.te @@ -164,8 +164,8 @@ optional_policy(` ') optional_policy(` - postfix_manage_private_sockets(dovecot_t) - postfix_search_spool(dovecot_t) + postfix_manage_private_sockets(dovecot_t) + postfix_search_spool(dovecot_t) ') optional_policy(` diff --git a/policy/modules/services/exim.if b/policy/modules/services/exim.if index 1685c5d5..464669c1 100644 --- a/policy/modules/services/exim.if +++ b/policy/modules/services/exim.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run exim. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`exim_domtrans',` @@ -24,11 +24,11 @@ interface(`exim_domtrans',` ## ## ## -## Domain allowed access. +## Domain allowed to transition. ## ## # -interface(`exim_initrc_domtrans', ` +interface(`exim_initrc_domtrans',` gen_require(` type exim_initrc_exec_t; ') @@ -119,9 +119,9 @@ interface(`exim_read_log',` ## exim log files. ## ## -## +## ## Domain allowed access. -## +## ## # interface(`exim_append_log',` @@ -229,10 +229,10 @@ interface(`exim_manage_spool_files',` ## ## # -interface(`exim_admin', ` +interface(`exim_admin',` gen_require(` - type exim_t, exim_initrc_exec_t, exim_log_t; - type exim_tmp_t, exim_spool_t, exim_var_run_t; + type exim_t, exim_initrc_exec_t, exim_log_t; + type exim_tmp_t, exim_spool_t, exim_var_run_t; ') allow $1 exim_t:process { ptrace signal_perms }; @@ -243,15 +243,15 @@ interface(`exim_admin', ` role_transition $2 exim_initrc_exec_t system_r; allow $2 system_r; - logging_search_logs($1) + logging_list_logs($1) admin_pattern($1, exim_log_t) - files_search_tmp($1) + files_list_tmp($1) admin_pattern($1, exim_tmp_t) - files_search_spool($1) + files_list_spool($1) admin_pattern($1, exim_spool_t) - files_search_pids($1) + files_list_pids($1) admin_pattern($1, exim_var_run_t) ') diff --git a/policy/modules/services/exim.te b/policy/modules/services/exim.te index 6c819a37..18c3c336 100644 --- a/policy/modules/services/exim.te +++ b/policy/modules/services/exim.te @@ -6,24 +6,24 @@ policy_module(exim, 1.5.0) # ## -##

-## Allow exim to connect to databases (postgres, mysql) -##

+##

+## Allow exim to connect to databases (postgres, mysql) +##

##
gen_tunable(exim_can_connect_db, false) ## -##

-## Allow exim to read unprivileged user files. -##

+##

+## Allow exim to read unprivileged user files. +##

##
gen_tunable(exim_read_user_files, false) ## -##

-## Allow exim to create, read, write, and delete -## unprivileged user files. -##

+##

+## Allow exim to create, read, write, and delete +## unprivileged user files. +##

##
gen_tunable(exim_manage_user_files, false) @@ -174,7 +174,7 @@ optional_policy(` ') optional_policy(` - nagios_search_spool(exim_t) + nagios_search_spool(exim_t) ') optional_policy(` diff --git a/policy/modules/services/fail2ban.if b/policy/modules/services/fail2ban.if index e4261f5e..87f6bfb4 100644 --- a/policy/modules/services/fail2ban.if +++ b/policy/modules/services/fail2ban.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run fail2ban. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`fail2ban_domtrans',` @@ -102,9 +102,9 @@ interface(`fail2ban_read_log',` ## fail2ban log files. ## ## -## +## ## Domain allowed access. -## +## ## # interface(`fail2ban_append_log',` @@ -175,8 +175,8 @@ interface(`fail2ban_dontaudit_leaks',` # interface(`fail2ban_admin',` gen_require(` - type fail2ban_t, fail2ban_log_t; - type fail2ban_var_run_t, fail2ban_initrc_exec_t; + type fail2ban_t, fail2ban_log_t, fail2ban_initrc_exec_t; + type fail2ban_var_run_t; ') allow $1 fail2ban_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/fail2ban.te b/policy/modules/services/fail2ban.te index fd30b024..7c5bf195 100644 --- a/policy/modules/services/fail2ban.te +++ b/policy/modules/services/fail2ban.te @@ -36,7 +36,7 @@ allow fail2ban_t self:unix_dgram_socket create_socket_perms; allow fail2ban_t self:tcp_socket create_stream_socket_perms; # log files -allow fail2ban_t fail2ban_log_t:dir setattr; +allow fail2ban_t fail2ban_log_t:dir setattr_dir_perms; manage_files_pattern(fail2ban_t, fail2ban_log_t, fail2ban_log_t) logging_log_filetrans(fail2ban_t, fail2ban_log_t, file) @@ -94,7 +94,7 @@ optional_policy(` ') optional_policy(` - gnome_dontaudit_search_config(fail2ban_t) + gnome_dontaudit_search_config(fail2ban_t) ') optional_policy(` diff --git a/policy/modules/services/fprintd.if b/policy/modules/services/fprintd.if index ebad8c42..c02062c7 100644 --- a/policy/modules/services/fprintd.if +++ b/policy/modules/services/fprintd.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run fprintd. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`fprintd_domtrans',` @@ -38,4 +38,3 @@ interface(`fprintd_dbus_chat',` allow $1 fprintd_t:dbus send_msg; allow fprintd_t $1:dbus send_msg; ') - diff --git a/policy/modules/services/ftp.if b/policy/modules/services/ftp.if index bc274219..26cc64b2 100644 --- a/policy/modules/services/ftp.if +++ b/policy/modules/services/ftp.if @@ -51,25 +51,6 @@ interface(`ftp_read_config',` allow $1 ftpd_etc_t:file read_file_perms; ') -######################################## -## -## Execute FTP daemon entry point programs. -## -## -## -## Domain allowed access. -## -## -# -interface(`ftp_check_exec',` - gen_require(` - type ftpd_exec_t; - ') - - corecmd_search_bin($1) - allow $1 ftpd_exec_t:file { getattr execute }; -') - ######################################## ## ## Read FTP transfer logs @@ -171,9 +152,8 @@ interface(`ftp_dyntrans_sftpd',` interface(`ftp_admin',` gen_require(` type ftpd_t, ftpdctl_t, ftpd_tmp_t; - type ftpd_etc_t, ftpd_lock_t; + type ftpd_etc_t, ftpd_lock_t, ftpd_initrc_exec_t; type ftpd_var_run_t, xferlog_t; - type ftpd_initrc_exec_t; ') allow $1 ftpd_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/ftp.te b/policy/modules/services/ftp.te index 34a00149..2284f4e3 100644 --- a/policy/modules/services/ftp.te +++ b/policy/modules/services/ftp.te @@ -6,82 +6,82 @@ policy_module(ftp, 1.12.0) # ## -##

-## Allow ftp servers to upload files, used for public file -## transfer services. Directories must be labeled -## public_content_rw_t. -##

+##

+## Allow ftp servers to upload files, used for public file +## transfer services. Directories must be labeled +## public_content_rw_t. +##

##
gen_tunable(allow_ftpd_anon_write, false) ## -##

-## Allow ftp servers to login to local users and -## read/write all files on the system, governed by DAC. -##

+##

+## Allow ftp servers to login to local users and +## read/write all files on the system, governed by DAC. +##

##
gen_tunable(allow_ftpd_full_access, false) ## -##

-## Allow ftp servers to use cifs -## used for public file transfer services. -##

+##

+## Allow ftp servers to use cifs +## used for public file transfer services. +##

##
gen_tunable(allow_ftpd_use_cifs, false) ## -##

-## Allow ftp servers to use nfs -## used for public file transfer services. -##

+##

+## Allow ftp servers to use nfs +## used for public file transfer services. +##

##
gen_tunable(allow_ftpd_use_nfs, false) ## -##

-## Allow ftp servers to use connect to mysql database -##

+##

+## Allow ftp servers to use connect to mysql database +##

##
gen_tunable(ftpd_connect_db, false) ## -##

-## Allow ftp to read and write files in the user home directories -##

+##

+## Allow ftp to read and write files in the user home directories +##

##
gen_tunable(ftp_home_dir, false) ## -##

-## Allow anon internal-sftp to upload files, used for -## public file transfer services. Directories must be labeled -## public_content_rw_t. -##

+##

+## Allow anon internal-sftp to upload files, used for +## public file transfer services. Directories must be labeled +## public_content_rw_t. +##

##
gen_tunable(sftpd_anon_write, false) ## -##

-## Allow sftp-internal to read and write files -## in the user home directories -##

+##

+## Allow sftp-internal to read and write files +## in the user home directories +##

##
gen_tunable(sftpd_enable_homedirs, false) ## -##

-## Allow sftp-internal to login to local users and -## read/write all files on the system, governed by DAC. -##

+##

+## Allow sftp-internal to login to local users and +## read/write all files on the system, governed by DAC. +##

##
gen_tunable(sftpd_full_access, false) ## -##

-## Allow interlnal-sftp to read and write files -## in the user ssh home directories. -##

+##

+## Allow interlnal-sftp to read and write files +## in the user ssh home directories. +##

##
gen_tunable(sftpd_write_ssh_home, false) @@ -181,13 +181,13 @@ fs_tmpfs_filetrans(ftpd_t, ftpd_tmpfs_t, { dir file lnk_file sock_file fifo_file manage_dirs_pattern(ftpd_t, ftpd_var_run_t, ftpd_var_run_t) manage_files_pattern(ftpd_t, ftpd_var_run_t, ftpd_var_run_t) manage_sock_files_pattern(ftpd_t, ftpd_var_run_t, ftpd_var_run_t) -files_pid_filetrans(ftpd_t, ftpd_var_run_t, { file dir} ) +files_pid_filetrans(ftpd_t, ftpd_var_run_t, { file dir }) # proftpd requires the client side to bind a socket so that # it can stat the socket to perform access control decisions, # since getsockopt with SO_PEERCRED is not available on all # proftpd-supported OSs -allow ftpd_t ftpdctl_tmp_t:sock_file { getattr unlink }; +allow ftpd_t ftpdctl_tmp_t:sock_file delete_sock_file_perms; # Create and modify /var/log/xferlog. manage_files_pattern(ftpd_t, xferlog_t, xferlog_t) @@ -291,10 +291,10 @@ tunable_policy(`ftp_home_dir',` userdom_manage_user_home_content(ftpd_t) userdom_manage_user_tmp_files(ftpd_t) userdom_tmp_filetrans_user_tmp(ftpd_t, file) -', ` - # Needed for permissive mode, to make sure everything gets labeled correctly - userdom_user_home_dir_filetrans_pattern(ftpd_t, { dir file lnk_file }) - files_tmp_filetrans(ftpd_t, ftpd_tmp_t, { file dir }) +',` + # Needed for permissive mode, to make sure everything gets labeled correctly + userdom_user_home_dir_filetrans_pattern(ftpd_t, { dir file lnk_file }) + files_tmp_filetrans(ftpd_t, ftpd_tmp_t, { file dir }) ') tunable_policy(`ftp_home_dir && use_nfs_home_dirs',` @@ -349,8 +349,8 @@ optional_policy(` ') tunable_policy(`ftpd_connect_db',` - corenet_tcp_connect_mysqld_port(ftpd_t) - corenet_tcp_connect_postgresql_port(ftpd_t) + mysql_tcp_connect(ftpd_t) + postgresql_tcp_connect(ftpd_t) ') optional_policy(` @@ -385,10 +385,11 @@ optional_policy(` # Allow ftpdctl to talk to ftpd over a socket connection stream_connect_pattern(ftpdctl_t, ftpd_var_run_t, ftpd_var_run_t, ftpd_t) +files_search_pids(ftpdctl_t) # ftpdctl creates a socket so that the daemon can perform # access control decisions (see comments in ftpd_t rules above) -allow ftpdctl_t ftpdctl_tmp_t:sock_file { create setattr }; +allow ftpdctl_t ftpdctl_tmp_t:sock_file manage_sock_file_perms; files_tmp_filetrans(ftpdctl_t, ftpdctl_tmp_t, sock_file) # Allow ftpdctl to read config files @@ -400,6 +401,7 @@ userdom_use_user_terminals(ftpdctl_t) # # sftpd local policy # + files_read_etc_files(sftpd_t) # allow read access to /home by default @@ -408,13 +410,13 @@ userdom_read_user_home_content_symlinks(sftpd_t) userdom_dontaudit_list_admin_dir(sftpd_t) tunable_policy(`sftpd_full_access',` - allow sftpd_t self:capability { dac_override dac_read_search }; - fs_read_noxattr_fs_files(sftpd_t) - auth_manage_all_files_except_shadow(sftpd_t) + allow sftpd_t self:capability { dac_override dac_read_search }; + fs_read_noxattr_fs_files(sftpd_t) + auth_manage_all_files_except_shadow(sftpd_t) ') tunable_policy(`sftpd_write_ssh_home',` - ssh_manage_home_files(sftpd_t) + ssh_manage_home_files(sftpd_t) ') tunable_policy(`sftpd_enable_homedirs',` @@ -424,9 +426,9 @@ tunable_policy(`sftpd_enable_homedirs',` files_list_home(sftpd_t) userdom_read_user_home_content_files(sftpd_t) userdom_manage_user_home_content(sftpd_t) -', ` - # Needed for permissive mode, to make sure everything gets labeled correctly - userdom_user_home_dir_filetrans_pattern(sftpd_t, { dir file lnk_file }) +',` + # Needed for permissive mode, to make sure everything gets labeled correctly + userdom_user_home_dir_filetrans_pattern(sftpd_t, { dir file lnk_file }) ') tunable_policy(`sftpd_enable_homedirs && use_nfs_home_dirs',` diff --git a/policy/modules/services/gatekeeper.te b/policy/modules/services/gatekeeper.te index 99a94de5..6dbc203a 100644 --- a/policy/modules/services/gatekeeper.te +++ b/policy/modules/services/gatekeeper.te @@ -33,7 +33,7 @@ allow gatekeeper_t self:fifo_file rw_fifo_file_perms; allow gatekeeper_t self:tcp_socket create_stream_socket_perms; allow gatekeeper_t self:udp_socket create_socket_perms; -allow gatekeeper_t gatekeeper_etc_t:lnk_file { getattr read }; +allow gatekeeper_t gatekeeper_etc_t:lnk_file read_lnk_file_perms; allow gatekeeper_t gatekeeper_etc_t:file read_file_perms; files_search_etc(gatekeeper_t) diff --git a/policy/modules/services/git.fc b/policy/modules/services/git.fc index 7ab4c92c..28b71f61 100644 --- a/policy/modules/services/git.fc +++ b/policy/modules/services/git.fc @@ -1,9 +1,10 @@ -HOME_DIR/public_git(/.*)? gen_context(system_u:object_r:git_session_content_t, s0) -HOME_DIR/\.gitconfig -- gen_context(system_u:object_r:git_session_content_t, s0) +HOME_DIR/public_git(/.*)? gen_context(system_u:object_r:git_session_content_t,s0) +HOME_DIR/\.gitaliases -- gen_context(system_u:object_r:git_session_content_t,s0) +HOME_DIR/\.gitconfig -- gen_context(system_u:object_r:git_session_content_t,s0) -/srv/git(/.*)? gen_context(system_u:object_r:git_system_content_t, s0) +/srv/git(/.*)? gen_context(system_u:object_r:git_system_content_t,s0) -/usr/libexec/git-core/git-daemon -- gen_context(system_u:object_r:gitd_exec_t, s0) +/usr/libexec/git-core/git-daemon -- gen_context(system_u:object_r:gitd_exec_t,s0) /var/cache/cgit(/.*)? gen_context(system_u:object_r:httpd_git_rw_content_t,s0) /var/lib/git(/.*)? gen_context(system_u:object_r:httpd_git_content_t,s0) diff --git a/policy/modules/services/git.if b/policy/modules/services/git.if index 63742a3c..3780650b 100644 --- a/policy/modules/services/git.if +++ b/policy/modules/services/git.if @@ -1,10 +1,10 @@ ## Fast Version Control System. ## ##

-## A really simple TCP git daemon that normally listens on -## port DEFAULT_GIT_PORT aka 9418. It waits for a -## connection asking for a service, and will serve that -## service if it is enabled. +## A really simple TCP git daemon that normally listens on +## port DEFAULT_GIT_PORT aka 9418. It waits for a +## connection asking for a service, and will serve that +## service if it is enabled. ##

##
@@ -25,8 +25,7 @@ # interface(`git_session_role',` gen_require(` - type git_session_t, gitd_exec_t; - type git_session_content_t; + type git_session_t, gitd_exec_t, git_session_content_t; ') ######################################## @@ -59,10 +58,8 @@ interface(`git_session_role',` ## # template(`git_content_template',` - gen_require(` - attribute git_system_content; - attribute git_content; + attribute git_system_content, git_content; ') ######################################## @@ -86,7 +83,6 @@ template(`git_content_template',` ## # template(`git_role_template',` - gen_require(` class context contains; role system_r; @@ -522,4 +518,3 @@ interface(`git_relabel_session_content',` relabel_files_pattern($1, git_session_content_t, git_session_content_t) userdom_search_user_home_dirs($1) ') - diff --git a/policy/modules/services/git.te b/policy/modules/services/git.te index cf170850..8d10fc5b 100644 --- a/policy/modules/services/git.te +++ b/policy/modules/services/git.te @@ -1,23 +1,23 @@ policy_module(git, 1.0.3) ## -##

-## Allow Git daemon system to search home directories. -##

+##

+## Allow Git daemon system to search home directories. +##

##
gen_tunable(git_system_enable_homedirs, false) ## -##

-## Allow Git daemon system to access cifs file systems. -##

+##

+## Allow Git daemon system to access cifs file systems. +##

##
gen_tunable(git_system_use_cifs, false) ## -##

-## Allow Git daemon system to access nfs file systems. -##

+##

+## Allow Git daemon system to access nfs file systems. +##

##
gen_tunable(git_system_use_nfs, false) @@ -31,6 +31,7 @@ attribute git_system_content; attribute git_content; type gitd_exec_t; +application_executable_file(gitd_exec_t) ######################################## # @@ -51,10 +52,10 @@ typealias git_system_content_t alias git_data_t; # ## -##

-## Allow Git daemon session to bind -## tcp sockets to all unreserved ports. -##

+##

+## Allow Git daemon session to bind +## tcp sockets to all unreserved ports. +##

##
gen_tunable(git_session_bind_all_unreserved_ports, false) @@ -119,26 +120,26 @@ list_dirs_pattern(git_system_t, git_content, git_content) read_files_pattern(git_system_t, git_content, git_content) files_search_var_lib(git_system_t) -tunable_policy(`git_system_enable_homedirs', ` +tunable_policy(`git_system_enable_homedirs',` userdom_search_user_home_dirs(git_system_t) ') -tunable_policy(`git_system_enable_homedirs && use_nfs_home_dirs', ` +tunable_policy(`git_system_enable_homedirs && use_nfs_home_dirs',` fs_list_nfs(git_system_t) fs_read_nfs_files(git_system_t) ') -tunable_policy(`git_system_enable_homedirs && use_samba_home_dirs', ` +tunable_policy(`git_system_enable_homedirs && use_samba_home_dirs',` fs_list_cifs(git_system_t) fs_read_cifs_files(git_system_t) ') -tunable_policy(`git_system_use_cifs', ` +tunable_policy(`git_system_use_cifs',` fs_list_cifs(git_system_t) fs_read_cifs_files(git_system_t) ') -tunable_policy(`git_system_use_nfs', ` +tunable_policy(`git_system_use_nfs',` fs_list_nfs(git_system_t) fs_read_nfs_files(git_system_t) ') @@ -156,17 +157,17 @@ userdom_search_user_home_dirs(git_session_t) userdom_use_user_terminals(git_session_t) -tunable_policy(`git_session_bind_all_unreserved_ports', ` +tunable_policy(`git_session_bind_all_unreserved_ports',` corenet_tcp_bind_all_unreserved_ports(git_session_t) corenet_sendrecv_generic_server_packets(git_session_t) ') -tunable_policy(`use_nfs_home_dirs', ` +tunable_policy(`use_nfs_home_dirs',` fs_list_nfs(git_session_t) fs_read_nfs_files(git_session_t) ') -tunable_policy(`use_samba_home_dirs', ` +tunable_policy(`use_samba_home_dirs',` fs_list_cifs(git_session_t) fs_read_cifs_files(git_session_t) ') @@ -189,4 +190,3 @@ optional_policy(` git_role_template(git_shell) gen_user(git_shell_u, user, git_shell_r, s0, s0) - diff --git a/policy/modules/services/gnomeclock.if b/policy/modules/services/gnomeclock.if index da0e8446..b1f8f939 100644 --- a/policy/modules/services/gnomeclock.if +++ b/policy/modules/services/gnomeclock.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run gnomeclock. ##
## -## +## ## Domain allowed to transition. -## +## ## # interface(`gnomeclock_domtrans',` @@ -71,7 +71,7 @@ interface(`gnomeclock_dbus_chat',` ## ## ## -## Domain allowed access. +## Domain to not audit. ## ## # diff --git a/policy/modules/services/gpm.if b/policy/modules/services/gpm.if index 7d972985..d6b29595 100644 --- a/policy/modules/services/gpm.if +++ b/policy/modules/services/gpm.if @@ -16,8 +16,8 @@ interface(`gpm_stream_connect',` type gpmctl_t, gpm_t; ') - allow $1 gpmctl_t:sock_file rw_sock_file_perms; - allow $1 gpm_t:unix_stream_socket connectto; + dev_list_all_dev_nodes($1) + stream_connect_pattern($1, gpmctl_t, gpmctl_t, gpm_t) ') ######################################## @@ -37,7 +37,7 @@ interface(`gpm_getattr_gpmctl',` ') dev_list_all_dev_nodes($1) - allow $1 gpmctl_t:sock_file getattr; + allow $1 gpmctl_t:sock_file getattr_sock_file_perms; ') ######################################## @@ -57,7 +57,7 @@ interface(`gpm_dontaudit_getattr_gpmctl',` type gpmctl_t; ') - dontaudit $1 gpmctl_t:sock_file getattr; + dontaudit $1 gpmctl_t:sock_file getattr_sock_file_perms; ') ######################################## @@ -77,5 +77,5 @@ interface(`gpm_setattr_gpmctl',` ') dev_list_all_dev_nodes($1) - allow $1 gpmctl_t:sock_file setattr; + allow $1 gpmctl_t:sock_file setattr_sock_file_perms; ') diff --git a/policy/modules/services/hal.if b/policy/modules/services/hal.if index 0d50d0d5..26de57aa 100644 --- a/policy/modules/services/hal.if +++ b/policy/modules/services/hal.if @@ -18,24 +18,6 @@ interface(`hal_domtrans',` domtrans_pattern($1, hald_exec_t, hald_t) ') -######################################## -## -## Get the attributes of a hal process. -## -## -## -## Domain allowed access. -## -## -# -interface(`hal_getattr',` - gen_require(` - type hald_t; - ') - - allow $1 hald_t:process getattr; -') - ######################################## ## ## Read hal system state @@ -88,7 +70,7 @@ interface(`hal_use_fds',` type hald_t; ') - allow $1 hald_t:fd use; + allow $1 hald_t:fd use; ') ######################################## @@ -106,7 +88,7 @@ interface(`hal_dontaudit_use_fds',` type hald_t; ') - dontaudit $1 hald_t:fd use; + dontaudit $1 hald_t:fd use; ') ######################################## @@ -125,7 +107,7 @@ interface(`hal_rw_pipes',` type hald_t; ') - allow $1 hald_t:fifo_file rw_fifo_file_perms; + allow $1 hald_t:fifo_file rw_fifo_file_perms; ') ######################################## @@ -144,7 +126,7 @@ interface(`hal_dontaudit_rw_pipes',` type hald_t; ') - dontaudit $1 hald_t:fifo_file rw_fifo_file_perms; + dontaudit $1 hald_t:fifo_file rw_fifo_file_perms; ') ######################################## @@ -378,7 +360,7 @@ interface(`hal_read_pid_files',` ######################################## ## -## Do not audit attempts to read +## Do not audit attempts to read ## hald PID files. ## ## @@ -464,14 +446,12 @@ interface(`hal_manage_pid_files',` # interface(`hal_dontaudit_leaks',` gen_require(` - type hald_log_t; - type hald_t; - type hald_var_run_t; + type hald_log_t, hald_t, hald_var_run_t; ') - dontaudit $1 hald_t:fd use; + dontaudit $1 hald_t:fd use; dontaudit $1 hald_log_t:file rw_inherited_file_perms; - dontaudit $1 hald_t:fifo_file rw_inherited_fifo_file_perms; + dontaudit $1 hald_t:fifo_file rw_inherited_fifo_file_perms; dontaudit hald_t $1:socket_class_set { read write }; dontaudit $1 hald_var_run_t:file read_inherited_file_perms; ') diff --git a/policy/modules/services/hal.te b/policy/modules/services/hal.te index e72b0633..b3fdcd56 100644 --- a/policy/modules/services/hal.te +++ b/policy/modules/services/hal.te @@ -316,7 +316,7 @@ optional_policy(` ') optional_policy(` - policykit_dbus_chat(hald_t) + policykit_dbus_chat(hald_t) policykit_domtrans_auth(hald_t) policykit_domtrans_resolve(hald_t) policykit_read_lib(hald_t) @@ -333,7 +333,7 @@ optional_policy(` optional_policy(` shutdown_domtrans(hald_t) -') +') optional_policy(` udev_domtrans(hald_t) @@ -411,7 +411,7 @@ logging_send_syslog_msg(hald_acl_t) miscfiles_read_localization(hald_acl_t) optional_policy(` - policykit_dbus_chat(hald_acl_t) + policykit_dbus_chat(hald_acl_t) policykit_domtrans_auth(hald_acl_t) policykit_read_lib(hald_acl_t) policykit_read_reload(hald_acl_t) @@ -493,7 +493,7 @@ files_read_usr_files(hald_keymap_t) miscfiles_read_localization(hald_keymap_t) -# This is caused by a bug in hald and PolicyKit. +# This is caused by a bug in hald and PolicyKit. # Should be removed when this is fixed cron_read_system_job_lib_files(hald_t) diff --git a/policy/modules/services/hddtemp.if b/policy/modules/services/hddtemp.if index 777b0362..db2d189e 100644 --- a/policy/modules/services/hddtemp.if +++ b/policy/modules/services/hddtemp.if @@ -69,5 +69,5 @@ interface(`hddtemp_admin',` allow $2 system_r; admin_pattern($1, hddtemp_etc_t) - files_search_etc($1) + files_list_etc($1) ') diff --git a/policy/modules/services/hddtemp.te b/policy/modules/services/hddtemp.te index 267bb4ce..1647fc40 100644 --- a/policy/modules/services/hddtemp.te +++ b/policy/modules/services/hddtemp.te @@ -46,4 +46,3 @@ storage_raw_read_fixed_disk(hddtemp_t) logging_send_syslog_msg(hddtemp_t) miscfiles_read_localization(hddtemp_t) - diff --git a/policy/modules/services/icecast.if b/policy/modules/services/icecast.if index 3aa86f30..40affd8e 100644 --- a/policy/modules/services/icecast.if +++ b/policy/modules/services/icecast.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run icecast. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`icecast_domtrans',` @@ -118,9 +118,9 @@ interface(`icecast_read_log',` ## icecast log files. ## ## -## +## ## Domain allowed access. -## +## ## # interface(`icecast_append_log',` @@ -183,7 +183,5 @@ interface(`icecast_admin',` allow $2 system_r; icecast_manage_pid_files($1) - icecast_manage_log($1) - ') diff --git a/policy/modules/services/icecast.te b/policy/modules/services/icecast.te index 80befb0f..6bf7cc3b 100644 --- a/policy/modules/services/icecast.te +++ b/policy/modules/services/icecast.te @@ -6,10 +6,10 @@ policy_module(icecast, 1.0.1) # ## -##

-## Allow icecast to connect to all ports, not just -## sound ports. -##

+##

+## Allow icecast to connect to all ports, not just +## sound ports. +##

##
gen_tunable(icecast_connect_any, false) @@ -39,7 +39,7 @@ allow icecast_t self:tcp_socket create_stream_socket_perms; manage_dirs_pattern(icecast_t, icecast_log_t, icecast_log_t) manage_files_pattern(icecast_t, icecast_log_t, icecast_log_t) -logging_log_filetrans(icecast_t, icecast_log_t, { file dir } ) +logging_log_filetrans(icecast_t, icecast_log_t, { file dir }) manage_dirs_pattern(icecast_t, icecast_var_run_t, icecast_var_run_t) manage_files_pattern(icecast_t, icecast_var_run_t, icecast_var_run_t) diff --git a/policy/modules/services/ifplugd.if b/policy/modules/services/ifplugd.if index dfb42326..76654296 100644 --- a/policy/modules/services/ifplugd.if +++ b/policy/modules/services/ifplugd.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run ifplugd. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`ifplugd_domtrans',` @@ -113,8 +113,8 @@ interface(`ifplugd_read_pid_files',` # interface(`ifplugd_admin',` gen_require(` - type ifplugd_t, ifplugd_etc_t; - type ifplugd_var_run_t, ifplugd_initrc_exec_t; + type ifplugd_t, ifplugd_etc_t, ifplugd_var_run_t; + type ifplugd_initrc_exec_t; ') allow $1 ifplugd_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/inetd.if b/policy/modules/services/inetd.if index df48e5ed..6985546a 100644 --- a/policy/modules/services/inetd.if +++ b/policy/modules/services/inetd.if @@ -55,7 +55,6 @@ interface(`inetd_core_service_domain',` ## # interface(`inetd_tcp_service_domain',` - gen_require(` type inetd_t; ') diff --git a/policy/modules/services/inn.if b/policy/modules/services/inn.if index ebc9e0d7..2f3d8dc4 100644 --- a/policy/modules/services/inn.if +++ b/policy/modules/services/inn.if @@ -93,6 +93,7 @@ interface(`inn_read_config',` type innd_etc_t; ') + files_search_etc($1) allow $1 innd_etc_t:dir list_dir_perms; allow $1 innd_etc_t:file read_file_perms; allow $1 innd_etc_t:lnk_file read_lnk_file_perms; @@ -113,6 +114,7 @@ interface(`inn_read_news_lib',` type innd_var_lib_t; ') + files_search_var_lib($1) allow $1 innd_var_lib_t:dir list_dir_perms; allow $1 innd_var_lib_t:file read_file_perms; allow $1 innd_var_lib_t:lnk_file read_lnk_file_perms; @@ -133,6 +135,7 @@ interface(`inn_read_news_spool',` type news_spool_t; ') + files_search_spool($1) allow $1 news_spool_t:dir list_dir_perms; allow $1 news_spool_t:file read_file_perms; allow $1 news_spool_t:lnk_file read_lnk_file_perms; @@ -195,8 +198,8 @@ interface(`inn_domtrans',` interface(`inn_admin',` gen_require(` type innd_t, innd_etc_t, innd_log_t; - type news_spool_t, innd_var_lib_t; - type innd_var_run_t, innd_initrc_exec_t; + type news_spool_t, innd_var_lib_t, innd_var_run_t; + type innd_initrc_exec_t; ') allow $1 innd_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/inn.te b/policy/modules/services/inn.te index 05119f72..dc7dd01e 100644 --- a/policy/modules/services/inn.te +++ b/policy/modules/services/inn.te @@ -4,6 +4,7 @@ policy_module(inn, 1.9.0) # # Declarations # + type innd_t; type innd_exec_t; init_daemon_domain(innd_t, innd_exec_t) @@ -30,6 +31,7 @@ files_mountpoint(news_spool_t) # # Local policy # + allow innd_t self:capability { dac_override kill setgid setuid }; dontaudit innd_t self:capability sys_tty_config; allow innd_t self:process { setsched signal_perms }; @@ -46,7 +48,7 @@ read_lnk_files_pattern(innd_t, innd_etc_t, innd_etc_t) can_exec(innd_t, innd_exec_t) manage_files_pattern(innd_t, innd_log_t, innd_log_t) -allow innd_t innd_log_t:dir setattr; +allow innd_t innd_log_t:dir setattr_dir_perms; logging_log_filetrans(innd_t, innd_log_t, file) manage_dirs_pattern(innd_t, innd_var_lib_t, innd_var_lib_t) diff --git a/policy/modules/services/jabber.if b/policy/modules/services/jabber.if index f17e6297..9167dc91 100644 --- a/policy/modules/services/jabber.if +++ b/policy/modules/services/jabber.if @@ -2,95 +2,95 @@ ####################################### ## -## Execute a domain transition to run jabberd services +## Execute a domain transition to run jabberd services ## ## -## -## Domain allowed to transition. -## +## +## Domain allowed to transition. +## ## # interface(`jabber_domtrans_jabberd',` - gen_require(` - type jabberd_t, jabberd_exec_t; - ') + gen_require(` + type jabberd_t, jabberd_exec_t; + ') - domtrans_pattern($1, jabberd_exec_t, jabberd_t) + domtrans_pattern($1, jabberd_exec_t, jabberd_t) ') ###################################### ## -## Execute a domain transition to run jabberd router service +## Execute a domain transition to run jabberd router service ## ## -## -## Domain allowed to transition. -## +## +## Domain allowed to transition. +## ## # interface(`jabber_domtrans_jabberd_router',` - gen_require(` - type jabberd_router_t, jabberd_router_exec_t; - ') + gen_require(` + type jabberd_router_t, jabberd_router_exec_t; + ') - domtrans_pattern($1, jabberd_router_exec_t, jabberd_router_t) + domtrans_pattern($1, jabberd_router_exec_t, jabberd_router_t) ') ####################################### ## -## Read jabberd lib files. +## Read jabberd lib files. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`jabberd_read_lib_files',` - gen_require(` - type jabberd_var_lib_t; - ') + gen_require(` + type jabberd_var_lib_t; + ') - files_search_var_lib($1) - read_files_pattern($1, jabberd_var_lib_t, jabberd_var_lib_t) + files_search_var_lib($1) + read_files_pattern($1, jabberd_var_lib_t, jabberd_var_lib_t) ') ####################################### ## -## Dontaudit inherited read jabberd lib files. +## Dontaudit inherited read jabberd lib files. ## ## -## -## Domain to not audit. -## +## +## Domain to not audit. +## ## # interface(`jabberd_dontaudit_read_lib_files',` - gen_require(` - type jabberd_var_lib_t; - ') + gen_require(` + type jabberd_var_lib_t; + ') - dontaudit $1 jabberd_var_lib_t:file read_inherited_file_perms; + dontaudit $1 jabberd_var_lib_t:file read_inherited_file_perms; ') ####################################### ## -## Create, read, write, and delete -## jabberd lib files. +## Create, read, write, and delete +## jabberd lib files. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`jabberd_manage_lib_files',` - gen_require(` - type jabberd_var_lib_t; - ') + gen_require(` + type jabberd_var_lib_t; + ') - files_search_var_lib($1) - manage_files_pattern($1, jabberd_var_lib_t, jabberd_var_lib_t) + files_search_var_lib($1) + manage_files_pattern($1, jabberd_var_lib_t, jabberd_var_lib_t) ') ######################################## @@ -113,15 +113,14 @@ interface(`jabberd_manage_lib_files',` interface(`jabber_admin',` gen_require(` type jabberd_t, jabberd_log_t, jabberd_var_lib_t; - type jabberd_var_run_t, jabberd_initrc_exec_t; - type jabberd_router_t; + type jabberd_var_run_t, jabberd_initrc_exec_t, jabberd_router_t; ') allow $1 jabberd_t:process { ptrace signal_perms }; ps_process_pattern($1, jabberd_t) allow $1 jabberd_router_t:process { ptrace signal_perms }; - ps_process_pattern($1, jabberd_router_t) + ps_process_pattern($1, jabberd_router_t) init_labeled_script_domtrans($1, jabberd_initrc_exec_t) domain_system_change_exemption($1) diff --git a/policy/modules/services/jabber.te b/policy/modules/services/jabber.te index 975bbcde..5f8840f9 100644 --- a/policy/modules/services/jabber.te +++ b/policy/modules/services/jabber.te @@ -1,4 +1,3 @@ - policy_module(jabber, 1.8.0) ######################################## @@ -84,7 +83,7 @@ corenet_tcp_bind_jabber_router_port(jabberd_router_t) corenet_sendrecv_jabber_router_server_packets(jabberd_router_t) optional_policy(` - kerberos_use(jabberd_router_t) + kerberos_use(jabberd_router_t) ') ######################################## diff --git a/policy/modules/services/kerberos.if b/policy/modules/services/kerberos.if index 604f67bf..8c725042 100644 --- a/policy/modules/services/kerberos.if +++ b/policy/modules/services/kerberos.if @@ -26,9 +26,9 @@ ## Execute kadmind in the current domain ## ## -## +## ## Domain allowed access. -## +## ## # interface(`kerberos_exec_kadmind',` @@ -44,9 +44,9 @@ interface(`kerberos_exec_kadmind',` ## Execute a domain transition to run kpropd. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`kerberos_domtrans_kpropd',` @@ -69,8 +69,7 @@ interface(`kerberos_domtrans_kpropd',` # interface(`kerberos_use',` gen_require(` - type krb5_conf_t, krb5kdc_conf_t; - type krb5_host_rcache_t; + type krb5_conf_t, krb5kdc_conf_t, krb5_host_rcache_t; ') files_search_etc($1) @@ -103,7 +102,7 @@ interface(`kerberos_use',` corenet_sendrecv_kerberos_client_packets($1) corenet_sendrecv_ocsp_client_packets($1) - allow $1 krb5_host_rcache_t:file getattr; + allow $1 krb5_host_rcache_t:file getattr_file_perms; ') optional_policy(` @@ -235,7 +234,7 @@ template(`kerberos_keytab_template',` type $1_keytab_t; files_type($1_keytab_t) - allow $2 $1_keytab_t:file read_file_perms; + allow $2 $1_keytab_t:file read_file_perms; kerberos_read_keytab($2) kerberos_use($2) @@ -338,9 +337,8 @@ interface(`kerberos_admin',` type kadmind_t, krb5kdc_t, kerberos_initrc_exec_t; type kadmind_log_t, kadmind_tmp_t, kadmind_var_run_t; type krb5_conf_t, krb5_keytab_t, krb5kdc_conf_t; - type krb5kdc_principal_t, krb5kdc_tmp_t; + type krb5kdc_principal_t, krb5kdc_tmp_t, kpropd_t; type krb5kdc_var_run_t, krb5_host_rcache_t; - type kpropd_t; ') allow $1 kadmind_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/kerberos.te b/policy/modules/services/kerberos.te index 225e33fb..744e7d6d 100644 --- a/policy/modules/services/kerberos.te +++ b/policy/modules/services/kerberos.te @@ -6,9 +6,9 @@ policy_module(kerberos, 1.11.0) # ## -##

-## Allow confined applications to run with kerberos. -##

+##

+## Allow confined applications to run with kerberos. +##

##
gen_tunable(allow_kerberos, false) @@ -93,9 +93,9 @@ allow kadmind_t krb5_conf_t:file read_file_perms; dontaudit kadmind_t krb5_conf_t:file write; read_files_pattern(kadmind_t, krb5kdc_conf_t, krb5kdc_conf_t) -dontaudit kadmind_t krb5kdc_conf_t:file { write setattr }; +dontaudit kadmind_t krb5kdc_conf_t:file { write_file_perms setattr_file_perms }; -allow kadmind_t krb5kdc_lock_t:file { rw_file_perms setattr }; +allow kadmind_t krb5kdc_lock_t:file { rw_file_perms setattr_file_perms }; allow kadmind_t krb5kdc_principal_t:file manage_file_perms; filetrans_pattern(kadmind_t, krb5kdc_conf_t, krb5kdc_principal_t, file) @@ -197,7 +197,7 @@ can_exec(krb5kdc_t, krb5kdc_exec_t) read_files_pattern(krb5kdc_t, krb5kdc_conf_t, krb5kdc_conf_t) dontaudit krb5kdc_t krb5kdc_conf_t:file write; -allow krb5kdc_t krb5kdc_lock_t:file { rw_file_perms setattr }; +allow krb5kdc_t krb5kdc_lock_t:file { rw_file_perms setattr_file_perms }; allow krb5kdc_t krb5kdc_log_t:file manage_file_perms; logging_log_filetrans(krb5kdc_t, krb5kdc_log_t, file) diff --git a/policy/modules/services/kerneloops.if b/policy/modules/services/kerneloops.if index 835b16b0..dd328830 100644 --- a/policy/modules/services/kerneloops.if +++ b/policy/modules/services/kerneloops.if @@ -5,15 +5,14 @@ ## Execute a domain transition to run kerneloops. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`kerneloops_domtrans',` gen_require(` - type kerneloops_t; - type kerneloops_exec_t; + type kerneloops_t, kerneloops_exec_t; ') domtrans_pattern($1, kerneloops_exec_t, kerneloops_t) @@ -99,8 +98,7 @@ interface(`kerneloops_manage_tmp_files',` # interface(`kerneloops_admin',` gen_require(` - type kerneloops_t, kerneloops_initrc_exec_t; - type kerneloops_tmp_t; + type kerneloops_t, kerneloops_initrc_exec_t, kerneloops_tmp_t; ') allow $1 kerneloops_t:process { ptrace signal_perms }; @@ -111,5 +109,6 @@ interface(`kerneloops_admin',` role_transition $2 kerneloops_initrc_exec_t system_r; allow $2 system_r; + files_list_tmp($1) admin_pattern($1, kerneloops_tmp_t) ') diff --git a/policy/modules/services/ksmtuned.if b/policy/modules/services/ksmtuned.if index d17f349b..b733e45d 100644 --- a/policy/modules/services/ksmtuned.if +++ b/policy/modules/services/ksmtuned.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run ksmtuned. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`ksmtuned_domtrans',` @@ -55,8 +55,7 @@ interface(`ksmtuned_initrc_domtrans',` # interface(`ksmtuned_admin',` gen_require(` - type ksmtuned_t, ksmtuned_var_run_t; - type ksmtuned_initrc_exec_t; + type ksmtuned_t, ksmtuned_var_run_t, ksmtuned_initrc_exec_t; ') allow $1 ksmtuned_t:process { ptrace signal_perms }; @@ -70,5 +69,4 @@ interface(`ksmtuned_admin',` domain_system_change_exemption($1) role_transition $2 ksmtuned_initrc_exec_t system_r; allow $2 system_r; - ') diff --git a/policy/modules/services/ksmtuned.te b/policy/modules/services/ksmtuned.te index ffe035c1..01adbede 100644 --- a/policy/modules/services/ksmtuned.te +++ b/policy/modules/services/ksmtuned.te @@ -49,4 +49,3 @@ mls_file_read_to_clearance(ksmtuned_t) term_use_all_terms(ksmtuned_t) miscfiles_read_localization(ksmtuned_t) - diff --git a/policy/modules/services/ldap.if b/policy/modules/services/ldap.if index d15f94d8..c51c1f6d 100644 --- a/policy/modules/services/ldap.if +++ b/policy/modules/services/ldap.if @@ -2,42 +2,40 @@ ####################################### ## -## Execute OpenLDAP in the ldap domain. +## Execute OpenLDAP in the ldap domain. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`ldap_domtrans',` - gen_require(` - type slapd_t, slapd_exec_t; - ') - - domtrans_pattern($1, slapd_exec_t, slapd_t) + gen_require(` + type slapd_t, slapd_exec_t; + ') + domtrans_pattern($1, slapd_exec_t, slapd_t) ') ####################################### ## -## Execute OpenLDAP server in the ldap domain. +## Execute OpenLDAP server in the ldap domain. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`ldap_initrc_domtrans',` - gen_require(` - type slapd_initrc_exec_t; - ') + gen_require(` + type slapd_initrc_exec_t; + ') - init_labeled_script_domtrans($1, slapd_initrc_exec_t) + init_labeled_script_domtrans($1, slapd_initrc_exec_t) ') - ######################################## ## ## Read the contents of the OpenLDAP @@ -189,6 +187,7 @@ interface(`ldap_admin',` admin_pattern($1, slapd_lock_t) + files_list_var_lib($1) admin_pattern($1, slapd_replog_t) files_list_tmp($1) diff --git a/policy/modules/services/ldap.te b/policy/modules/services/ldap.te index ee5e3457..10c2d543 100644 --- a/policy/modules/services/ldap.te +++ b/policy/modules/services/ldap.te @@ -82,7 +82,7 @@ manage_files_pattern(slapd_t, slapd_tmp_t, slapd_tmp_t) files_tmp_filetrans(slapd_t, slapd_tmp_t, { file dir }) manage_files_pattern(slapd_t, slapd_tmpfs_t, slapd_tmpfs_t) -fs_tmpfs_filetrans(slapd_t, slapd_tmpfs_t,file) +fs_tmpfs_filetrans(slapd_t, slapd_tmpfs_t, file) manage_dirs_pattern(slapd_t, slapd_var_run_t, slapd_var_run_t) manage_files_pattern(slapd_t, slapd_var_run_t, slapd_var_run_t) diff --git a/policy/modules/services/likewise.if b/policy/modules/services/likewise.if index 771e04b6..81d98b34 100644 --- a/policy/modules/services/likewise.if +++ b/policy/modules/services/likewise.if @@ -63,7 +63,7 @@ template(`likewise_domain_template',` allow $1_t self:tcp_socket create_stream_socket_perms; allow $1_t self:udp_socket create_socket_perms; - allow $1_t likewise_var_lib_t:dir setattr; + allow $1_t likewise_var_lib_t:dir setattr_dir_perms; manage_files_pattern($1_t, $1_var_run_t, $1_var_run_t) files_pid_filetrans($1_t, $1_var_run_t, file) diff --git a/policy/modules/services/likewise.te b/policy/modules/services/likewise.te index ae9d49fa..65e6d812 100644 --- a/policy/modules/services/likewise.te +++ b/policy/modules/services/likewise.te @@ -205,7 +205,7 @@ stream_connect_pattern(lwsmd_t, likewise_var_lib_t, lwregd_var_socket_t, lwregd_ # Likewise DC location service local policy # -allow netlogond_t self:capability {dac_override}; +allow netlogond_t self:capability dac_override; manage_files_pattern(netlogond_t, likewise_etc_t, likewise_etc_t) diff --git a/policy/modules/services/lircd.if b/policy/modules/services/lircd.if index 418cc811..5cfe9500 100644 --- a/policy/modules/services/lircd.if +++ b/policy/modules/services/lircd.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run lircd. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`lircd_domtrans',` @@ -16,7 +16,6 @@ interface(`lircd_domtrans',` ') domain_auto_trans($1, lircd_exec_t, lircd_t) - ') ###################################### @@ -44,9 +43,9 @@ interface(`lircd_stream_connect',` ## Read lircd etc file ## ## -## +## ## Domain allowed access. -## +## ## # interface(`lircd_read_config',` @@ -76,8 +75,8 @@ interface(`lircd_read_config',` # interface(`lircd_admin',` gen_require(` - type lircd_t, lircd_var_run_t; - type lircd_initrc_exec_t, lircd_etc_t; + type lircd_t, lircd_var_run_t, lircd_etc_t; + type lircd_initrc_exec_t; ') allow $1 lircd_t:process { ptrace signal_perms }; @@ -88,9 +87,9 @@ interface(`lircd_admin',` role_transition $2 lircd_initrc_exec_t system_r; allow $2 system_r; - files_search_etc($1) + files_list_etc($1) admin_pattern($1, lircd_etc_t) - files_search_pids($1) + files_list_pids($1) admin_pattern($1, lircd_var_run_t) ') diff --git a/policy/modules/services/lpd.if b/policy/modules/services/lpd.if index d801ec0e..ea7dca02 100644 --- a/policy/modules/services/lpd.if +++ b/policy/modules/services/lpd.if @@ -14,6 +14,7 @@ ## User domain for the role ## ## +## # interface(`lpd_role',` gen_require(` @@ -27,7 +28,7 @@ interface(`lpd_role',` dontaudit lpr_t $2:unix_stream_socket { read write }; ps_process_pattern($2, lpr_t) - allow $2 lpr_t:process signull; + allow $2 lpr_t:process { ptrace signal_perms }; optional_policy(` cups_read_config($2) @@ -186,7 +187,7 @@ interface(`lpd_read_config',` ## ## # -template(`lpd_domtrans_lpr',` +interface(`lpd_domtrans_lpr',` gen_require(` type lpr_t, lpr_exec_t; ') diff --git a/policy/modules/services/lpd.te b/policy/modules/services/lpd.te index 4d311188..80671d96 100644 --- a/policy/modules/services/lpd.te +++ b/policy/modules/services/lpd.te @@ -6,9 +6,9 @@ policy_module(lpd, 1.12.0) # ## -##

-## Use lpd server instead of cups -##

+##

+## Use lpd server instead of cups +##

##
gen_tunable(use_lpd_server, false) @@ -80,7 +80,7 @@ rw_files_pattern(checkpc_t, print_spool_t, print_spool_t) delete_files_pattern(checkpc_t, print_spool_t, print_spool_t) files_search_spool(checkpc_t) -allow checkpc_t printconf_t:file getattr; +allow checkpc_t printconf_t:file getattr_file_perms; allow checkpc_t printconf_t:dir list_dir_perms; kernel_read_system_state(checkpc_t) @@ -284,13 +284,13 @@ userdom_read_user_tmp_files(lpr_t) tunable_policy(`use_lpd_server',` # lpr can run in lightweight mode, without a local print spooler. - allow lpr_t lpd_var_run_t:dir search; - allow lpr_t lpd_var_run_t:sock_file write; + allow lpr_t lpd_var_run_t:dir search_dir_perms; + allow lpr_t lpd_var_run_t:sock_file write_sock_file_perms; files_read_var_files(lpr_t) # Connect to lpd via a Unix domain socket. - allow lpr_t printer_t:sock_file rw_sock_file_perms; - allow lpr_t lpd_t:unix_stream_socket connectto; + allow lpr_t printer_t:sock_file read_sock_file_perms; + stream_connect_pattern(lpr_t, printer_t, printer_t, lpd_t) # Send SIGHUP to lpd. allow lpr_t lpd_t:process signal; diff --git a/policy/modules/services/mailman.if b/policy/modules/services/mailman.if index 19bcae2a..84b76265 100644 --- a/policy/modules/services/mailman.if +++ b/policy/modules/services/mailman.if @@ -16,7 +16,7 @@ ## ## # -template(`mailman_domain_template', ` +template(`mailman_domain_template',` type mailman_$1_t; domain_type(mailman_$1_t) role system_r types mailman_$1_t; diff --git a/policy/modules/services/mailman.te b/policy/modules/services/mailman.te index ac97ed9d..96e3c804 100644 --- a/policy/modules/services/mailman.te +++ b/policy/modules/services/mailman.te @@ -61,9 +61,9 @@ optional_policy(` # Mailman mail local policy # -allow mailman_mail_t self:unix_dgram_socket create_socket_perms; -allow mailman_mail_t self:process { signal signull }; allow mailman_mail_t self:capability { kill dac_override setuid setgid sys_tty_config }; +allow mailman_mail_t self:process { signal signull }; +allow mailman_mail_t self:unix_dgram_socket create_socket_perms; manage_dirs_pattern(mailman_mail_t, mailman_archive_t, mailman_archive_t) manage_files_pattern(mailman_mail_t, mailman_archive_t, mailman_archive_t) diff --git a/policy/modules/services/memcached.if b/policy/modules/services/memcached.if index ee60e591..5008a6c1 100644 --- a/policy/modules/services/memcached.if +++ b/policy/modules/services/memcached.if @@ -5,15 +5,14 @@ ## Execute a domain transition to run memcached. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`memcached_domtrans',` gen_require(` - type memcached_t; - type memcached_exec_t; + type memcached_t, memcached_exec_t; ') domtrans_pattern($1, memcached_exec_t, memcached_t) @@ -57,9 +56,7 @@ interface(`memcached_read_pid_files',` # interface(`memcached_admin',` gen_require(` - type memcached_t; - type memcached_initrc_exec_t; - type memcached_var_run_t; + type memcached_t, memcached_initrc_exec_t, memcached_var_run_t; ') allow $1 memcached_t:process { ptrace signal_perms }; @@ -70,6 +67,6 @@ interface(`memcached_admin',` role_transition $2 memcached_initrc_exec_t system_r; allow $2 system_r; - files_search_pids($1) + files_list_pids($1) admin_pattern($1, memcached_var_run_t) ') diff --git a/policy/modules/services/milter.if b/policy/modules/services/milter.if index a000225c..d7e81f30 100644 --- a/policy/modules/services/milter.if +++ b/policy/modules/services/milter.if @@ -59,7 +59,7 @@ interface(`milter_stream_connect_all',` attribute milter_data_type, milter_domains; ') - getattr_dirs_pattern($1, milter_data_type, milter_data_type) + files_search_pids($1) stream_connect_pattern($1, milter_data_type, milter_data_type, milter_domains) ') @@ -78,7 +78,6 @@ interface(`milter_getattr_all_sockets',` attribute milter_data_type; ') - getattr_dirs_pattern($1, milter_data_type, milter_data_type) getattr_sock_files_pattern($1, milter_data_type, milter_data_type) ') @@ -123,19 +122,19 @@ interface(`milter_manage_spamass_state',` ####################################### ## -## Delete dkim-milter PID files. +## Delete dkim-milter PID files. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`milter_delete_dkim_pid_files',` - gen_require(` - type dkim_milter_data_t; - ') + gen_require(` + type dkim_milter_data_t; + ') - files_search_pids($1) - delete_files_pattern($1, dkim_milter_data_t, dkim_milter_data_t) + files_search_pids($1) + delete_files_pattern($1, dkim_milter_data_t, dkim_milter_data_t) ') diff --git a/policy/modules/services/milter.te b/policy/modules/services/milter.te index 6ba48ffe..f42a4895 100644 --- a/policy/modules/services/milter.te +++ b/policy/modules/services/milter.te @@ -33,7 +33,6 @@ files_type(spamass_milter_state_t) # allow dkim_milter_t self:capability { kill setgid setuid }; - allow dkim_milter_t self:unix_stream_socket create_stream_socket_perms; read_files_pattern(dkim_milter_t, dkim_milter_private_key_t, dkim_milter_private_key_t) @@ -47,8 +46,8 @@ mta_read_config(dkim_milter_t) ######################################## # # milter-greylist local policy -# ensure smtp clients retry mail like real MTAs and not spamware -# http://hcpnet.free.fr/milter-greylist/ +# ensure smtp clients retry mail like real MTAs and not spamware +# http://hcpnet.free.fr/milter-greylist/ # # It removes any existing socket (not owned by root) whilst running as root, @@ -76,8 +75,8 @@ mta_read_config(greylist_milter_t) ######################################## # # milter-regex local policy -# filter emails using regular expressions -# http://www.benzedrine.cx/milter-regex.html +# filter emails using regular expressions +# http://www.benzedrine.cx/milter-regex.html # # It removes any existing socket (not owned by root) whilst running as root @@ -96,8 +95,8 @@ mta_read_config(regex_milter_t) ######################################## # # spamass-milter local policy -# pipe emails through SpamAssassin -# http://savannah.nongnu.org/projects/spamass-milt/ +# pipe emails through SpamAssassin +# http://savannah.nongnu.org/projects/spamass-milt/ # # The milter runs from /var/lib/spamass-milter diff --git a/policy/modules/services/mock.if b/policy/modules/services/mock.if index 5a1698c3..d76fb118 100644 --- a/policy/modules/services/mock.if +++ b/policy/modules/services/mock.if @@ -1,4 +1,3 @@ - ## policy for mock ######################################## @@ -6,9 +5,9 @@ ## Execute a domain transition to run mock. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`mock_domtrans',` @@ -19,7 +18,6 @@ interface(`mock_domtrans',` domtrans_pattern($1, mock_exec_t, mock_t) ') - ######################################## ## ## Search mock lib directories. @@ -55,7 +53,7 @@ interface(`mock_read_lib_files',` ') files_search_var_lib($1) - read_files_pattern($1, mock_var_lib_t, mock_var_lib_t) + read_files_pattern($1, mock_var_lib_t, mock_var_lib_t) ') ######################################## @@ -75,7 +73,7 @@ interface(`mock_manage_lib_files',` ') files_search_var_lib($1) - manage_files_pattern($1, mock_var_lib_t, mock_var_lib_t) + manage_files_pattern($1, mock_var_lib_t, mock_var_lib_t) ') ######################################## @@ -94,7 +92,7 @@ interface(`mock_manage_lib_dirs',` ') files_search_var_lib($1) - manage_dirs_pattern($1, mock_var_lib_t, mock_var_lib_t) + manage_dirs_pattern($1, mock_var_lib_t, mock_var_lib_t) ') ######################################### @@ -113,7 +111,7 @@ interface(`mock_manage_lib_symlinks',` ') files_search_var_lib($1) - manage_lnk_files_pattern($1, mock_var_lib_t, mock_var_lib_t) + manage_lnk_files_pattern($1, mock_var_lib_t, mock_var_lib_t) ') ######################################## @@ -132,7 +130,7 @@ interface(`mock_manage_lib_chr_files',` ') files_search_var_lib($1) - manage_chr_files_pattern($1, mock_var_lib_t, mock_var_lib_t) + manage_chr_files_pattern($1, mock_var_lib_t, mock_var_lib_t) ') ######################################## @@ -150,6 +148,7 @@ interface(`mock_manage_lib_chr_files',` ## The role to be allowed the mock domain. ## ## +## # interface(`mock_run',` gen_require(` @@ -174,10 +173,11 @@ interface(`mock_run',` ## User domain for the role ## ## +## # interface(`mock_role',` gen_require(` - type mock_t; + type mock_t; ') role $1 types mock_t; @@ -185,7 +185,7 @@ interface(`mock_role',` mock_domtrans($2) ps_process_pattern($2, mock_t) - allow $2 mock_t:process signal; + allow $2 mock_t:process { ptrace signal_perms }; ') ####################################### @@ -225,14 +225,12 @@ interface(`mock_signal',` # interface(`mock_admin',` gen_require(` - type mock_t; - type mock_var_lib_t; + type mock_t, mock_var_lib_t; ') allow $1 mock_t:process { ptrace signal_perms }; ps_process_pattern($1, mock_t) - files_search_var_lib($1) + files_list_var_lib($1) admin_pattern($1, mock_var_lib_t) - ') diff --git a/policy/modules/services/mock.te b/policy/modules/services/mock.te index 6f8fda5e..b05a9cdf 100644 --- a/policy/modules/services/mock.te +++ b/policy/modules/services/mock.te @@ -27,6 +27,7 @@ files_type(mock_var_lib_t) # # mock local policy # + allow mock_t self:capability { sys_admin setfcap setuid sys_ptrace sys_chroot chown audit_write dac_override sys_nice mknod fsetid setgid fowner }; allow mock_t self:process { siginh noatsecure signull transition rlimitinh setsched setpgid sigkill }; dontaudit mock_t self:process { siginh noatsecure rlimitinh }; @@ -40,14 +41,14 @@ files_var_filetrans(mock_t, mock_cache_t, { dir file } ) manage_dirs_pattern(mock_t, mock_tmp_t, mock_tmp_t) manage_files_pattern(mock_t, mock_tmp_t, mock_tmp_t) -files_tmp_filetrans(mock_t, mock_tmp_t, { dir file } ) +files_tmp_filetrans(mock_t, mock_tmp_t, { dir file }) can_exec(mock_t, mock_tmp_t) manage_dirs_pattern(mock_t, mock_var_lib_t, mock_var_lib_t) manage_files_pattern(mock_t, mock_var_lib_t, mock_var_lib_t) manage_lnk_files_pattern(mock_t, mock_var_lib_t, mock_var_lib_t) manage_chr_files_pattern(mock_t, mock_var_lib_t, mock_var_lib_t) -files_var_lib_filetrans(mock_t, mock_var_lib_t, { dir file } ) +files_var_lib_filetrans(mock_t, mock_var_lib_t, { dir file }) can_exec(mock_t, mock_var_lib_t) allow mock_t mock_var_lib_t:dir mounton; diff --git a/policy/modules/services/modemmanager.if b/policy/modules/services/modemmanager.if index 33686991..7a7fc026 100644 --- a/policy/modules/services/modemmanager.if +++ b/policy/modules/services/modemmanager.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run modemmanager. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`modemmanager_domtrans',` diff --git a/policy/modules/services/mojomojo.if b/policy/modules/services/mojomojo.if index cf7968d4..88e7330f 100644 --- a/policy/modules/services/mojomojo.if +++ b/policy/modules/services/mojomojo.if @@ -19,10 +19,9 @@ # interface(`mojomojo_admin',` gen_require(` - type httpd_mojomojo_script_t; - type httpd_mojomojo_content_t, httpd_mojomojo_ra_content_t; - type httpd_mojomojo_rw_content_t, httpd_mojomojo_tmp_t; - type httpd_mojomojo_script_exec_t, httpd_mojomojo_htaccess_t; + type httpd_mojomojo_script_t, httpd_mojomojo_content_t, httpd_mojomojo_ra_content_t; + type httpd_mojomojo_rw_content_t, httpd_mojomojo_tmp_t, httpd_mojomojo_htaccess_t; + type httpd_mojomojo_script_exec_t; ') allow $1 httpd_mojomojo_script_t:process { ptrace signal_perms }; @@ -31,9 +30,9 @@ interface(`mojomojo_admin',` files_list_tmp($1) admin_pattern($1, httpd_mojomojo_tmp_t) - files_search_var_lib(httpd_mojomojo_script_t) + files_list_var_lib(httpd_mojomojo_script_t) - apache_search_sys_content($1) + apache_list_sys_content($1) admin_pattern($1, httpd_mojomojo_script_exec_t) admin_pattern($1, httpd_mojomojo_script_t) admin_pattern($1, httpd_mojomojo_content_t) diff --git a/policy/modules/services/mpd.if b/policy/modules/services/mpd.if index 5599d14a..311aaed7 100644 --- a/policy/modules/services/mpd.if +++ b/policy/modules/services/mpd.if @@ -1,4 +1,3 @@ - ## policy for daemon for playing music ######################################## @@ -6,9 +5,9 @@ ## Execute a domain transition to run mpd. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`mpd_domtrans',` @@ -19,7 +18,6 @@ interface(`mpd_domtrans',` domtrans_pattern($1, mpd_exec_t, mpd_t) ') - ######################################## ## ## Execute mpd server in the mpd domain. @@ -40,79 +38,79 @@ interface(`mpd_initrc_domtrans',` ####################################### ## -## Read mpd data files. +## Read mpd data files. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`mpd_read_data_files',` - gen_require(` - type mpd_data_t; - ') + gen_require(` + type mpd_data_t; + ') mpd_search_lib($1) - read_files_pattern($1, mpd_data_t, mpd_data_t) + read_files_pattern($1, mpd_data_t, mpd_data_t) ') ####################################### ## -## Read mpd tmpfs files. +## Read mpd tmpfs files. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`mpd_read_tmpfs_files',` - gen_require(` - type mpd_tmpfs_t; - ') + gen_require(` + type mpd_tmpfs_t; + ') fs_search_tmpfs($1) - read_files_pattern($1, mpd_tmpfs_t, mpd_tmpfs_t) + read_files_pattern($1, mpd_tmpfs_t, mpd_tmpfs_t) ') ################################### ## -## Manage mpd tmpfs files. +## Manage mpd tmpfs files. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`mpd_manage_tmpfs_files',` - gen_require(` - type mpd_tmpfs_t; - ') + gen_require(` + type mpd_tmpfs_t; + ') fs_search_tmpfs($1) - manage_files_pattern($1, mpd_tmpfs_t, mpd_tmpfs_t) - manage_lnk_files_pattern($1, mpd_tmpfs_t, mpd_tmpfs_t) + manage_files_pattern($1, mpd_tmpfs_t, mpd_tmpfs_t) + manage_lnk_files_pattern($1, mpd_tmpfs_t, mpd_tmpfs_t) ') ###################################### ## -## Manage mpd data files. +## Manage mpd data files. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`mpd_manage_data_files',` - gen_require(` - type mpd_data_t; - ') + gen_require(` + type mpd_data_t; + ') - mpd_search_lib($1) - manage_files_pattern($1, mpd_data_t, mpd_data_t) + mpd_search_lib($1) + manage_files_pattern($1, mpd_data_t, mpd_data_t) ') ######################################## @@ -150,7 +148,7 @@ interface(`mpd_read_lib_files',` ') files_search_var_lib($1) - read_files_pattern($1, mpd_var_lib_t, mpd_var_lib_t) + read_files_pattern($1, mpd_var_lib_t, mpd_var_lib_t) ') ######################################## @@ -170,36 +168,37 @@ interface(`mpd_manage_lib_files',` ') files_search_var_lib($1) - manage_files_pattern($1, mpd_var_lib_t, mpd_var_lib_t) + manage_files_pattern($1, mpd_var_lib_t, mpd_var_lib_t) ') ####################################### ## -## Create an object in the root directory, with a private -## type using a type transition. +## Create an object in the root directory, with a private +## type using a type transition. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## ## -## -## The type of the object to be created. -## +## +## The type of the object to be created. +## ## ## -## -## The object class of the object being created. -## +## +## The object class of the object being created. +## ## # interface(`mpd_var_lib_filetrans',` - gen_require(` - type mpd_var_lib_t; - ') + gen_require(` + type mpd_var_lib_t; + ') - filetrans_pattern($1, mpd_var_lib_t, $2, $3) + files_search_var_lib($1) + filetrans_pattern($1, mpd_var_lib_t, $2, $3) ') ######################################## @@ -218,7 +217,7 @@ interface(`mpd_manage_lib_dirs',` ') files_search_var_lib($1) - manage_dirs_pattern($1, mpd_var_lib_t, mpd_var_lib_t) + manage_dirs_pattern($1, mpd_var_lib_t, mpd_var_lib_t) ') ######################################## @@ -240,12 +239,8 @@ interface(`mpd_manage_lib_dirs',` # interface(`mpd_admin',` gen_require(` - type mpd_t; - type mpd_initrc_exec_t; - type mpd_etc_t; - type mpd_data_t; - type mpd_log_t; - type mpd_var_lib_t; + type mpd_t, mpd_initrc_exec_t, mpd_etc_t; + type mpd_data_t, mpd_log_t, mpd_var_lib_t; type mpd_tmpfs_t; ') @@ -258,16 +253,15 @@ interface(`mpd_admin',` allow $2 system_r; admin_pattern($1, mpd_etc_t) - files_search_etc($1) + files_list_etc($1) - files_search_var_lib($1) + files_list_var_lib($1) admin_pattern($1, mpd_var_lib_t) - - mpd_search_lib($1) + admin_pattern($1, mpd_data_t) admin_pattern($1, mpd_log_t) - fs_search_tmpfs($1) + fs_list_tmpfs($1) admin_pattern($1, mpd_tmpfs_t) ') diff --git a/policy/modules/services/mpd.te b/policy/modules/services/mpd.te index 71464f65..84bc8bb3 100644 --- a/policy/modules/services/mpd.te +++ b/policy/modules/services/mpd.te @@ -1,4 +1,4 @@ -policy_module(mpd,1.0.0) +policy_module(mpd, 1.0.0) ######################################## # @@ -41,7 +41,6 @@ files_type(mpd_var_lib_t) #cjp: dac_override bug in mpd relating to mpd.log file allow mpd_t self:capability { dac_override kill setgid setuid }; allow mpd_t self:process { getsched setsched setrlimit signal signull }; - allow mpd_t self:fifo_file rw_fifo_file_perms; allow mpd_t self:unix_stream_socket { connectto create_stream_socket_perms }; allow mpd_t self:tcp_socket create_stream_socket_perms; @@ -102,10 +101,10 @@ optional_policy(` optional_policy(` pulseaudio_exec(mpd_t) - pulseaudio_stream_connect(mpd_t) - pulseaudio_signull(mpd_t) + pulseaudio_stream_connect(mpd_t) + pulseaudio_signull(mpd_t) ') optional_policy(` - udev_read_db(mpd_t) + udev_read_db(mpd_t) ') diff --git a/policy/modules/services/mta.if b/policy/modules/services/mta.if index a9ebda27..2f948ad1 100644 --- a/policy/modules/services/mta.if +++ b/policy/modules/services/mta.if @@ -37,9 +37,9 @@ interface(`mta_stub',` ## is the prefix for user_t). ## ## +## # template(`mta_base_mail_template',` - gen_require(` attribute user_mail_domain; type sendmail_exec_t; @@ -158,6 +158,7 @@ template(`mta_base_mail_template',` ## User domain for the role ## ## +## # interface(`mta_role',` gen_require(` @@ -169,7 +170,7 @@ interface(`mta_role',` # Transition from the user domain to the derived domain. domtrans_pattern($2, sendmail_exec_t, user_mail_t) - allow $2 sendmail_exec_t:lnk_file { getattr read }; + allow $2 sendmail_exec_t:lnk_file read_lnk_file_perms; allow mta_user_agent $2:fd use; allow mta_user_agent $2:process sigchld; @@ -225,18 +226,18 @@ interface(`mta_agent_executable',` ## Dontaudit read and write an leaked file descriptors ## ## -## -## Domain allowed access. -## +## +## Domain to not audit. +## ## # interface(`mta_dontaudit_leaks_system_mail',` - gen_require(` - type system_mail_t; - ') + gen_require(` + type system_mail_t; + ') - dontaudit $1 system_mail_t:fifo_file write; - dontaudit $1 system_mail_t:tcp_socket { read write }; + dontaudit $1 system_mail_t:fifo_file write; + dontaudit $1 system_mail_t:tcp_socket { read write }; ') ######################################## @@ -325,7 +326,6 @@ interface(`mta_mailserver_sender',` interface(`mta_mailserver_delivery',` gen_require(` attribute mailserver_delivery; - type mail_spool_t; ') typeattribute $1 mailserver_delivery; @@ -363,9 +363,8 @@ interface(`mta_mailserver_user_agent',` # interface(`mta_send_mail',` gen_require(` - attribute mta_user_agent; + attribute mta_user_agent, mta_exec_type; type system_mail_t; - attribute mta_exec_type; ') allow $1 mta_exec_type:lnk_file read_lnk_file_perms; @@ -376,7 +375,7 @@ interface(`mta_send_mail',` allow mta_user_agent $1:process sigchld; allow mta_user_agent $1:fifo_file rw_fifo_file_perms; - ifdef(`hide_broken_symptoms', ` + ifdef(`hide_broken_symptoms',` dontaudit system_mail_t $1:socket_class_set { read write }; ') ') @@ -429,7 +428,6 @@ interface(`mta_sendmail_domtrans',` ## ## # -# interface(`mta_signal_system_mail',` gen_require(` type system_mail_t; @@ -448,7 +446,6 @@ interface(`mta_signal_system_mail',` ## ## # -# interface(`mta_kill_system_mail',` gen_require(` type system_mail_t; @@ -514,7 +511,7 @@ interface(`mta_write_config',` ') manage_files_pattern($1, etc_mail_t, etc_mail_t) - allow $1 etc_mail_t:file setattr; + allow $1 etc_mail_t:file setattr_file_perms; ') ######################################## @@ -592,7 +589,7 @@ interface(`mta_rw_aliases',` ') files_search_etc($1) - allow $1 etc_aliases_t:file { rw_file_perms setattr }; + allow $1 etc_aliases_t:file { rw_file_perms setattr_file_perms }; ') ####################################### @@ -686,8 +683,8 @@ interface(`mta_dontaudit_getattr_spool_files',` files_dontaudit_search_spool($1) dontaudit $1 mail_spool_t:dir search_dir_perms; - dontaudit $1 mail_spool_t:lnk_file read; - dontaudit $1 mail_spool_t:file getattr; + dontaudit $1 mail_spool_t:lnk_file read_lnk_file_perms; + dontaudit $1 mail_spool_t:file getattr_file_perms; ') ####################################### @@ -737,7 +734,7 @@ interface(`mta_rw_spool',` files_search_spool($1) allow $1 mail_spool_t:dir list_dir_perms; - allow $1 mail_spool_t:file setattr; + allow $1 mail_spool_t:file setattr_file_perms; manage_files_pattern($1, mail_spool_t, mail_spool_t) read_lnk_files_pattern($1, mail_spool_t, mail_spool_t) ') @@ -878,7 +875,7 @@ interface(`mta_dontaudit_rw_queue',` ') dontaudit $1 mqueue_spool_t:dir search_dir_perms; - dontaudit $1 mqueue_spool_t:file { getattr read write }; + dontaudit $1 mqueue_spool_t:file rw_file_perms; ') ######################################## @@ -957,25 +954,32 @@ interface(`mta_rw_user_mail_stream_sockets',` ## # interface(`mta_filetrans_aliases',` + gen_require(` + type etc_aliases_t; + ') + filetrans_pattern($1, $2, etc_aliases_t, file) ') ###################################### ## -## ALlow domain to read mail content in the homedir +## ALlow domain to read mail content in the homedir ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`mta_read_home',` - gen_require(` - type mail_home_t; - ') + gen_require(` + type mail_home_t; + ') - userdom_search_user_home_dirs($1) - userdom_search_admin_dir($1) - read_files_pattern($1, mail_home_t, mail_home_t) + userdom_search_user_home_dirs($1) + read_files_pattern($1, mail_home_t, mail_home_t) + + ifdef(`distro_redhat',` + userdom_search_admin_dir($1) + ') ') diff --git a/policy/modules/services/mta.te b/policy/modules/services/mta.te index f99b9fc4..36e64e92 100644 --- a/policy/modules/services/mta.te +++ b/policy/modules/services/mta.te @@ -93,7 +93,7 @@ optional_policy(` optional_policy(` arpwatch_manage_tmp_files(system_mail_t) - ifdef(`hide_broken_symptoms', ` + ifdef(`hide_broken_symptoms',` arpwatch_dontaudit_rw_packet_sockets(system_mail_t) ') ') @@ -194,7 +194,7 @@ optional_policy(` arpwatch_search_data(mailserver_delivery) arpwatch_manage_tmp_files(mta_user_agent) - ifdef(`hide_broken_symptoms', ` + ifdef(`hide_broken_symptoms',` arpwatch_dontaudit_rw_packet_sockets(mta_user_agent) ') @@ -314,8 +314,6 @@ kernel_read_system_state(user_mail_domain) kernel_read_network_state(user_mail_domain) kernel_request_load_module(user_mail_domain) - - optional_policy(` # postfix needs this for newaliases files_getattr_tmp_dirs(user_mail_domain) diff --git a/policy/modules/services/munin.if b/policy/modules/services/munin.if index dda8ca9c..92c9dcae 100644 --- a/policy/modules/services/munin.if +++ b/policy/modules/services/munin.if @@ -37,8 +37,7 @@ template(`munin_plugin_template',` # automatic transition rules from munin domain # to specific munin plugin domain domtrans_pattern(munin_t, $1_munin_plugin_exec_t, $1_munin_plugin_t) - allow munin_t $1_munin_plugin_t:process signal; - + allow munin_t $1_munin_plugin_t:process signal; ') ######################################## @@ -79,26 +78,26 @@ interface(`munin_read_config',` allow $1 munin_etc_t:dir list_dir_perms; allow $1 munin_etc_t:file read_file_perms; - allow $1 munin_etc_t:lnk_file { getattr read }; + allow $1 munin_etc_t:lnk_file read_lnk_file_perms; files_search_etc($1) ') ###################################### ## -## dontaudit read and write an leaked file descriptors +## dontaudit read and write an leaked file descriptors ## ## -## -## Domain allowed access. -## +## +## Domain to not audit. +## ## # interface(`munin_dontaudit_leaks',` - gen_require(` - type munin_t; - ') + gen_require(` + type munin_t; + ') - dontaudit $1 munin_t:tcp_socket { read write }; + dontaudit $1 munin_t:tcp_socket { read write }; ') ####################################### @@ -181,8 +180,7 @@ interface(`munin_admin',` gen_require(` type munin_t, munin_etc_t, munin_tmp_t; type munin_log_t, munin_var_lib_t, munin_var_run_t; - type httpd_munin_content_t; - type munin_initrc_exec_t; + type httpd_munin_content_t, munin_initrc_exec_t; ') allow $1 munin_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/munin.te b/policy/modules/services/munin.te index 13d365dd..6f8b0fdc 100644 --- a/policy/modules/services/munin.te +++ b/policy/modules/services/munin.te @@ -193,7 +193,7 @@ optional_policy(` # local policy for disk plugins # -allow munin_disk_plugin_t self:capability { sys_admin sys_rawio }; +allow munin_disk_plugin_t self:capability { sys_admin sys_rawio }; allow disk_munin_plugin_t self:tcp_socket create_stream_socket_perms; rw_files_pattern(disk_munin_plugin_t, munin_var_lib_t, munin_var_lib_t) diff --git a/policy/modules/services/mysql.if b/policy/modules/services/mysql.if index b81e257b..4d3b2080 100644 --- a/policy/modules/services/mysql.if +++ b/policy/modules/services/mysql.if @@ -253,7 +253,7 @@ interface(`mysql_write_log',` ') logging_search_logs($1) - allow $1 mysqld_log_t:file { write_file_perms setattr }; + allow $1 mysqld_log_t:file { write_file_perms setattr_file_perms }; ') ###################################### @@ -330,10 +330,9 @@ interface(`mysql_search_pid_files',` # interface(`mysql_admin',` gen_require(` - type mysqld_t, mysqld_var_run_t; - type mysqld_tmp_t, mysqld_db_t; - type mysqld_etc_t, mysqld_log_t; - type mysqld_initrc_exec_t; + type mysqld_t, mysqld_var_run_t, mysqld_initrc_exec_t; + type mysqld_tmp_t, mysqld_db_t, mysqld_log_t; + type mysqld_etc_t; ') allow $1 mysqld_t:process { ptrace signal_perms }; @@ -344,13 +343,17 @@ interface(`mysql_admin',` role_transition $2 mysqld_initrc_exec_t system_r; allow $2 system_r; + files_list_pids($1) admin_pattern($1, mysqld_var_run_t) admin_pattern($1, mysqld_db_t) + files_list_etc($1) admin_pattern($1, mysqld_etc_t) + logging_list_logs($1) admin_pattern($1, mysqld_log_t) + files_list_tmp($1) admin_pattern($1, mysqld_tmp_t) ') diff --git a/policy/modules/services/mysql.te b/policy/modules/services/mysql.te index b370d536..086df224 100644 --- a/policy/modules/services/mysql.te +++ b/policy/modules/services/mysql.te @@ -6,9 +6,9 @@ policy_module(mysql, 1.12.0) # ## -##

-## Allow mysqld to connect to all ports -##

+##

+## Allow mysqld to connect to all ports +##

##
gen_tunable(mysql_connect_any, false) @@ -69,7 +69,7 @@ manage_lnk_files_pattern(mysqld_t, mysqld_db_t, mysqld_db_t) files_var_lib_filetrans(mysqld_t, mysqld_db_t, { dir file lnk_file }) allow mysqld_t mysqld_etc_t:file read_file_perms; -allow mysqld_t mysqld_etc_t:lnk_file { getattr read }; +allow mysqld_t mysqld_etc_t:lnk_file read_lnk_file_perms; allow mysqld_t mysqld_etc_t:dir list_dir_perms; allow mysqld_t mysqld_log_t:file manage_file_perms; @@ -129,8 +129,7 @@ userdom_dontaudit_use_unpriv_user_fds(mysqld_t) userdom_read_user_home_content_files(mysqld_t) ifdef(`distro_redhat',` - # because Fedora has the sock_file in the database directory - type_transition mysqld_t mysqld_db_t:sock_file mysqld_var_run_t; + filetrans_pattern(mysqld_t, mysqld_db_t, mysqld_var_run_t, sock_file) ') tunable_policy(`mysql_connect_any',` @@ -157,8 +156,8 @@ optional_policy(` allow mysqld_safe_t self:capability { chown dac_override fowner kill }; dontaudit mysqld_safe_t self:capability sys_ptrace; -allow mysqld_safe_t self:fifo_file rw_fifo_file_perms; allow mysqld_safe_t self:process { setsched getsched setrlimit }; +allow mysqld_safe_t self:fifo_file rw_fifo_file_perms; read_lnk_files_pattern(mysqld_safe_t, mysqld_db_t, mysqld_db_t) diff --git a/policy/modules/services/nagios.if b/policy/modules/services/nagios.if index 33d9d440..89e1edf6 100644 --- a/policy/modules/services/nagios.if +++ b/policy/modules/services/nagios.if @@ -12,10 +12,8 @@ ## # template(`nagios_plugin_template',` - gen_require(` - type nagios_t, nrpe_t; - type nagios_log_t; + type nagios_t, nrpe_t, nagios_log_t; ') type nagios_$1_plugin_t; @@ -50,7 +48,6 @@ template(`nagios_plugin_template',` ## Domain to not audit. ## ## -## # interface(`nagios_dontaudit_rw_pipes',` gen_require(` @@ -216,11 +213,9 @@ interface(`nagios_domtrans_nrpe',` # interface(`nagios_admin',` gen_require(` - type nagios_t, nrpe_t; - type nagios_tmp_t, nagios_log_t; - type nagios_etc_t, nrpe_etc_t; - type nagios_spool_t, nagios_var_run_t; - type nagios_initrc_exec_t; + type nagios_t, nrpe_t, nagios_initrc_exec_t; + type nagios_tmp_t, nagios_log_t, nagios_var_run_t; + type nagios_etc_t, nrpe_etc_t, nagios_spool_t; ') allow $1 nagios_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/nagios.te b/policy/modules/services/nagios.te index 10293892..61a3920f 100644 --- a/policy/modules/services/nagios.te +++ b/policy/modules/services/nagios.te @@ -141,6 +141,7 @@ optional_policy(` # # Nagios CGI local policy # + optional_policy(` apache_content_template(nagios) typealias httpd_nagios_script_t alias nagios_cgi_t; @@ -268,7 +269,6 @@ files_getattr_all_file_type_fs(nagios_admin_plugin_t) # allow nagios_mail_plugin_t self:capability { setuid setgid dac_override }; - allow nagios_mail_plugin_t self:netlink_route_socket r_netlink_socket_perms; allow nagios_mail_plugin_t self:tcp_socket create_stream_socket_perms; allow nagios_mail_plugin_t self:udp_socket create_socket_perms; @@ -321,7 +321,6 @@ storage_raw_read_fixed_disk(nagios_checkdisk_plugin_t) allow nagios_services_plugin_t self:capability { net_bind_service net_raw }; allow nagios_services_plugin_t self:process { signal sigkill }; - allow nagios_services_plugin_t self:tcp_socket create_stream_socket_perms; allow nagios_services_plugin_t self:udp_socket create_socket_perms; diff --git a/policy/modules/services/networkmanager.if b/policy/modules/services/networkmanager.if index 1a1bfe4d..80694872 100644 --- a/policy/modules/services/networkmanager.if +++ b/policy/modules/services/networkmanager.if @@ -43,9 +43,9 @@ interface(`networkmanager_rw_packet_sockets',` ## Allow caller to relabel tun_socket ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`networkmanager_attach_tun_iface',` @@ -137,12 +137,13 @@ interface(`networkmanager_dbus_chat',` ######################################## ## -## Send and receive messages from -## NetworkManager over dbus. +## Do not audit attempts to send and +## receive messages from NetworkManager +## over dbus. ## ## ## -## Domain allowed access. +## Domain to not audit. ## ## # @@ -220,12 +221,12 @@ interface(`networkmanager_read_pid_files',` ## ## ## -## Domain allowed access. +## Domain allowed to transition. ## ## ## ## -## The role to be allowed the NetworkManager domain. +## Role allowed access. ## ## ## diff --git a/policy/modules/services/nis.if b/policy/modules/services/nis.if index c42c2687..995a6cba 100644 --- a/policy/modules/services/nis.if +++ b/policy/modules/services/nis.if @@ -34,7 +34,7 @@ interface(`nis_use_ypbind_uncond',` allow $1 self:udp_socket create_socket_perms; allow $1 var_yp_t:dir list_dir_perms; - allow $1 var_yp_t:lnk_file { getattr read }; + allow $1 var_yp_t:lnk_file read_lnk_file_perms; allow $1 var_yp_t:file read_file_perms; corenet_all_recvfrom_unlabeled($1) @@ -241,25 +241,6 @@ interface(`nis_read_ypbind_pid',` allow $1 ypbind_var_run_t:file read_file_perms; ') -######################################## -## -## Delete ypbind pid files. -## -## -## -## Domain allowed access. -## -## -# -interface(`nis_delete_ypbind_pid',` - gen_require(` - type ypbind_t; - ') - - # TODO: add delete pid from dir call to files - allow $1 ypbind_t:file unlink; -') - ######################################## ## ## Read ypserv configuration files. @@ -354,10 +335,10 @@ interface(`nis_initrc_domtrans_ypbind',` # interface(`nis_admin',` gen_require(` - type ypbind_t, yppasswdd_t, ypserv_t, ypxfr_t; + type ypbind_t, yppasswdd_t, ypserv_t; type ypbind_tmp_t, ypserv_tmp_t, ypserv_conf_t; type ypbind_var_run_t, yppasswdd_var_run_t, ypserv_var_run_t; - type ypbind_initrc_exec_t, nis_initrc_exec_t; + type ypbind_initrc_exec_t, nis_initrc_exec_t, ypxfr_t; ') allow $1 ypbind_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/nis.te b/policy/modules/services/nis.te index 4876caec..5f2ba873 100644 --- a/policy/modules/services/nis.te +++ b/policy/modules/services/nis.te @@ -55,10 +55,11 @@ files_pid_file(ypxfr_var_run_t) ######################################## # # ypbind local policy +# dontaudit ypbind_t self:capability { net_admin sys_tty_config }; -allow ypbind_t self:fifo_file rw_fifo_file_perms; allow ypbind_t self:process signal_perms; +allow ypbind_t self:fifo_file rw_fifo_file_perms; allow ypbind_t self:{ unix_dgram_socket unix_stream_socket } create_socket_perms; allow ypbind_t self:netlink_route_socket r_netlink_socket_perms; allow ypbind_t self:tcp_socket create_stream_socket_perms; @@ -142,8 +143,8 @@ optional_policy(` allow yppasswdd_t self:capability dac_override; dontaudit yppasswdd_t self:capability sys_tty_config; -allow yppasswdd_t self:fifo_file rw_fifo_file_perms; allow yppasswdd_t self:process { getsched setfscreate signal_perms }; +allow yppasswdd_t self:fifo_file rw_fifo_file_perms; allow yppasswdd_t self:unix_dgram_socket create_socket_perms; allow yppasswdd_t self:unix_stream_socket create_stream_socket_perms; allow yppasswdd_t self:netlink_route_socket r_netlink_socket_perms; @@ -224,8 +225,8 @@ optional_policy(` # dontaudit ypserv_t self:capability sys_tty_config; -allow ypserv_t self:fifo_file rw_fifo_file_perms; allow ypserv_t self:process signal_perms; +allow ypserv_t self:fifo_file rw_fifo_file_perms; allow ypserv_t self:unix_dgram_socket create_socket_perms; allow ypserv_t self:unix_stream_socket create_stream_socket_perms; allow ypserv_t self:netlink_route_socket r_netlink_socket_perms; diff --git a/policy/modules/services/nscd.if b/policy/modules/services/nscd.if index ded2734a..99cefb80 100644 --- a/policy/modules/services/nscd.if +++ b/policy/modules/services/nscd.if @@ -116,7 +116,7 @@ interface(`nscd_socket_use',` dontaudit $1 nscd_t:nscd { getserv shmempwd shmemgrp shmemhost shmemserv }; files_search_pids($1) stream_connect_pattern($1, nscd_var_run_t, nscd_var_run_t, nscd_t) - dontaudit $1 nscd_var_run_t:file { getattr read }; + dontaudit $1 nscd_var_run_t:file read_file_perms; ') ######################################## @@ -164,11 +164,14 @@ interface(`nscd_shm_use',` # nscd_socket_domain macro. need to investigate # if they are all actually required allow $1 self:unix_stream_socket create_stream_socket_perms; - allow $1 nscd_t:unix_stream_socket connectto; - allow $1 nscd_var_run_t:sock_file rw_file_perms; + + # dg: This may not be required. + allow $1 nscd_var_run_t:sock_file read_sock_file_perms; + + stream_connect_pattern($1, nscd_var_run_t, nscd_var_run_t, nscd_t) files_search_pids($1) allow $1 nscd_t:nscd { getpwd getgrp gethost }; - dontaudit $1 nscd_var_run_t:file { getattr read }; + dontaudit $1 nscd_var_run_t:file read_file_perms; ') ######################################## @@ -242,6 +245,7 @@ interface(`nscd_unconfined',` ## Role allowed access. ## ## +## # interface(`nscd_run',` gen_require(` diff --git a/policy/modules/services/nscd.te b/policy/modules/services/nscd.te index 6a174f5c..6b54db71 100644 --- a/policy/modules/services/nscd.te +++ b/policy/modules/services/nscd.te @@ -5,9 +5,9 @@ gen_require(` ') ## -##

-## Allow confined applications to use nscd shared memory. -##

+##

+## Allow confined applications to use nscd shared memory. +##

##
gen_tunable(nscd_use_shm, false) @@ -146,6 +146,7 @@ optional_policy(` samba_append_log(nscd_t) samba_dontaudit_use_fds(nscd_t) ') + samba_read_config(nscd_t) samba_read_var_files(nscd_t) ') diff --git a/policy/modules/services/nslcd.if b/policy/modules/services/nslcd.if index b94add15..be5a5b4f 100644 --- a/policy/modules/services/nslcd.if +++ b/policy/modules/services/nslcd.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run nslcd. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`nslcd_domtrans',` @@ -93,8 +93,8 @@ interface(`nslcd_stream_connect',` # interface(`nslcd_admin',` gen_require(` - type nslcd_t, nslcd_initrc_exec_t; - type nslcd_conf_t, nslcd_var_run_t; + type nslcd_t, nslcd_initrc_exec_t, nslcd_var_run_t; + type nslcd_conf_t; ') ps_process_pattern($1, nslcd_t) @@ -106,9 +106,9 @@ interface(`nslcd_admin',` role_transition $2 nslcd_initrc_exec_t system_r; allow $2 system_r; - files_search_etc($1) + files_list_etc($1) admin_pattern($1, nslcd_conf_t) - files_search_pids($1) + files_list_pids($1) admin_pattern($1, nslcd_var_run_t, nslcd_var_run_t) ') diff --git a/policy/modules/services/ntp.if b/policy/modules/services/ntp.if index 6b240d98..694b002f 100644 --- a/policy/modules/services/ntp.if +++ b/policy/modules/services/ntp.if @@ -140,8 +140,7 @@ interface(`ntp_rw_shm',` interface(`ntp_admin',` gen_require(` type ntpd_t, ntpd_tmp_t, ntpd_log_t; - type ntpd_key_t, ntpd_var_run_t; - type ntpd_initrc_exec_t; + type ntpd_key_t, ntpd_var_run_t, ntpd_initrc_exec_t; ') allow $1 ntpd_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/nx.if b/policy/modules/services/nx.if index b1384ade..cbb2bced 100644 --- a/policy/modules/services/nx.if +++ b/policy/modules/services/nx.if @@ -33,6 +33,7 @@ interface(`nx_read_home_files',` type nx_server_home_ssh_t, nx_server_var_lib_t; ') + files_search_var_lib($1) allow $1 nx_server_var_lib_t:dir search_dir_perms; read_files_pattern($1, nx_server_home_ssh_t, nx_server_home_ssh_t) read_lnk_files_pattern($1, nx_server_home_ssh_t, nx_server_home_ssh_t) @@ -53,6 +54,7 @@ interface(`nx_search_var_lib',` type nx_server_var_lib_t; ') + files_search_var_lib($1) allow $1 nx_server_var_lib_t:dir search_dir_perms; ') @@ -82,5 +84,6 @@ interface(`nx_var_lib_filetrans',` type nx_server_var_lib_t; ') + files_search_var_lib($1) filetrans_pattern($1, nx_server_var_lib_t, $2, $3) ') diff --git a/policy/modules/services/oddjob.if b/policy/modules/services/oddjob.if index ca33ae3d..ca6517bb 100644 --- a/policy/modules/services/oddjob.if +++ b/policy/modules/services/oddjob.if @@ -9,9 +9,9 @@ ## Execute a domain transition to run oddjob. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`oddjob_domtrans',` @@ -24,21 +24,21 @@ interface(`oddjob_domtrans',` ##################################### ## -## Do not audit attempts to read and write -## oddjob fifo file. +## Do not audit attempts to read and write +## oddjob fifo file. ## ## -## -## Domain to not audit. -## +## +## Domain to not audit. +## ## # interface(`oddjob_dontaudit_rw_fifo_file',` - gen_require(` - type shutdown_t; - ') + gen_require(` + type oddjob_t; + ') - dontaudit $1 oddjob_t:fifo_file rw_inherited_fifo_file_perms; + dontaudit $1 oddjob_t:fifo_file rw_inherited_fifo_file_perms; ') ######################################## @@ -89,20 +89,20 @@ interface(`oddjob_dbus_chat',` ###################################### ## -## Send a SIGCHLD signal to oddjob. +## Send a SIGCHLD signal to oddjob. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`oddjob_sigchld',` - gen_require(` - type oddjob_t; - ') + gen_require(` + type oddjob_t; + ') - allow $1 oddjob_t:process sigchld; + allow $1 oddjob_t:process sigchld; ') ######################################## diff --git a/policy/modules/services/oident.if b/policy/modules/services/oident.if index bb4fae51..b1b5e51e 100644 --- a/policy/modules/services/oident.if +++ b/policy/modules/services/oident.if @@ -18,7 +18,7 @@ ## ## # -interface(`oident_read_user_content', ` +interface(`oident_read_user_content',` gen_require(` type oidentd_home_t; ') @@ -38,7 +38,7 @@ interface(`oident_read_user_content', ` ## ## # -interface(`oident_manage_user_content', ` +interface(`oident_manage_user_content',` gen_require(` type oidentd_home_t; ') @@ -58,7 +58,7 @@ interface(`oident_manage_user_content', ` ## ## # -interface(`oident_relabel_user_content', ` +interface(`oident_relabel_user_content',` gen_require(` type oidentd_home_t; ') @@ -66,3 +66,37 @@ interface(`oident_relabel_user_content', ` allow $1 oidentd_home_t:file relabel_file_perms; userdom_search_user_home_dirs($1) ') + +######################################## +## +## All of the rules required to administrate +## an oident environment +## +## +## +## Domain allowed access. +## +## +## +## +## Role allowed access. +## +## +## +# +interface(`oident_admin',` + gen_require(` + type oidentd_t, oidentd_initrc_exec_t, oidentd_config_t; + ') + + allow $1 oidentd_t:process { ptrace signal_perms }; + ps_process_pattern($1, oidentd_t) + + init_labeled_script_domtrans($1, oidentd_initrc_exec_t) + domain_system_change_exemption($1) + role_transition $2 oidentd_initrc_exec_t system_r; + allow $2 system_r; + + files_list_etc($1) + admin_pattern($1, oidentd_config_t) +') diff --git a/policy/modules/services/openct.if b/policy/modules/services/openct.if index 9d0a67bf..9197ef04 100644 --- a/policy/modules/services/openct.if +++ b/policy/modules/services/openct.if @@ -23,9 +23,9 @@ interface(`openct_signull',` ## Execute openct in the caller domain. ## ## -## +## ## Domain allowed access. -## +## ## # interface(`openct_exec',` @@ -42,9 +42,9 @@ interface(`openct_exec',` ## Execute a domain transition to run openct. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`openct_domtrans',` diff --git a/policy/modules/services/pads.if b/policy/modules/services/pads.if index 4452d3b1..8235fb6b 100644 --- a/policy/modules/services/pads.if +++ b/policy/modules/services/pads.if @@ -25,10 +25,10 @@ ## ## # -interface(`pads_admin', ` +interface(`pads_admin',` gen_require(` - type pads_t, pads_config_t; - type pads_var_run_t, pads_initrc_exec_t; + type pads_t, pads_config_t, pads_initrc_exec_t; + type pads_var_run_t; ') allow $1 pads_t:process { ptrace signal_perms }; @@ -39,9 +39,9 @@ interface(`pads_admin', ` role_transition $2 pads_initrc_exec_t system_r; allow $2 system_r; - files_search_pids($1) + files_list_pids($1) admin_pattern($1, pads_var_run_t) - files_search_etc($1) + files_list_etc($1) admin_pattern($1, pads_config_t) ') diff --git a/policy/modules/services/passenger.if b/policy/modules/services/passenger.if index 7ca90f64..66f9799a 100644 --- a/policy/modules/services/passenger.if +++ b/policy/modules/services/passenger.if @@ -2,19 +2,18 @@ ###################################### ## -## Execute passenger in the passenger domain. +## Execute passenger in the passenger domain. ## ## -## -## The type of the process performing this action. -## +## +## Domain allowed to transition. +## ## # interface(`passenger_domtrans',` - gen_require(` - type passenger_t; - type passenger_exec_t; - ') + gen_require(` + type passenger_t, passenger_exec_t; + ') allow $1 self:capability { fowner fsetid }; @@ -27,43 +26,42 @@ interface(`passenger_domtrans',` ###################################### ## -## Manage passenger var_run content. +## Manage passenger var_run content. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`passenger_manage_pid_content',` - gen_require(` - type passenger_var_run_t; - ') + gen_require(` + type passenger_var_run_t; + ') - files_search_pids($1) + files_search_pids($1) manage_dirs_pattern($1, passenger_var_run_t, passenger_var_run_t) - manage_files_pattern($1, passenger_var_run_t, passenger_var_run_t) + manage_files_pattern($1, passenger_var_run_t, passenger_var_run_t) manage_fifo_files_pattern($1, passenger_var_run_t, passenger_var_run_t) manage_sock_files_pattern($1, passenger_var_run_t, passenger_var_run_t) ') ######################################## ## -## Read passenger lib files +## Read passenger lib files ## ## -## -## Domain to not audit. -## +## +## Domain allowed access. +## ## # interface(`passenger_read_lib_files',` - gen_require(` - type passenger_var_lib_t; - ') + gen_require(` + type passenger_var_lib_t; + ') files_search_var_lib($1) - read_files_pattern($1, passenger_var_lib_t, passenger_var_lib_t) - read_lnk_files_pattern($1, passenger_var_lib_t, passenger_var_lib_t) + read_files_pattern($1, passenger_var_lib_t, passenger_var_lib_t) + read_lnk_files_pattern($1, passenger_var_lib_t, passenger_var_lib_t) ') - diff --git a/policy/modules/services/pcscd.if b/policy/modules/services/pcscd.if index 1c2a0913..ea5ae69a 100644 --- a/policy/modules/services/pcscd.if +++ b/policy/modules/services/pcscd.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run pcscd. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`pcscd_domtrans',` diff --git a/policy/modules/services/pingd.if b/policy/modules/services/pingd.if index 8688aaec..1bfd8d2c 100644 --- a/policy/modules/services/pingd.if +++ b/policy/modules/services/pingd.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run pingd. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`pingd_domtrans',` @@ -55,7 +55,6 @@ interface(`pingd_manage_config',` files_search_etc($1) manage_dirs_pattern($1, pingd_etc_t, pingd_etc_t) manage_files_pattern($1, pingd_etc_t, pingd_etc_t) - ') ####################################### @@ -77,8 +76,8 @@ interface(`pingd_manage_config',` # interface(`pingd_admin',` gen_require(` - type pingd_t, pingd_etc_t; - type pingd_initrc_exec_t, pingd_modules_t; + type pingd_t, pingd_etc_t, pingd_modules_t; + type pingd_initrc_exec_t; ') allow $1 pingd_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/piranha.if b/policy/modules/services/piranha.if index 8ecd2764..6403c171 100644 --- a/policy/modules/services/piranha.if +++ b/policy/modules/services/piranha.if @@ -1,44 +1,42 @@ - ## policy for piranha ####################################### ## -## Creates types and rules for a basic -## cluster init daemon domain. +## Creates types and rules for a basic +## cluster init daemon domain. ## ## -## -## Prefix for the domain. -## +## +## Prefix for the domain. +## ## # template(`piranha_domain_template',` - - gen_require(` - attribute piranha_domain; - ') + gen_require(` + attribute piranha_domain; + ') ############################## - # - # piranha_$1_t declarations - # + # + # piranha_$1_t declarations + # type piranha_$1_t, piranha_domain; type piranha_$1_exec_t; init_daemon_domain(piranha_$1_t, piranha_$1_exec_t) # pid files - type piranha_$1_var_run_t; - files_pid_file(piranha_$1_var_run_t) + type piranha_$1_var_run_t; + files_pid_file(piranha_$1_var_run_t) ############################## - # - # piranha_$1_t local policy - # + # + # piranha_$1_t local policy + # - manage_files_pattern(piranha_$1_t, piranha_$1_var_run_t, piranha_$1_var_run_t) + manage_files_pattern(piranha_$1_t, piranha_$1_var_run_t, piranha_$1_var_run_t) manage_dirs_pattern(piranha_$1_t, piranha_$1_var_run_t, piranha_$1_var_run_t) - files_pid_filetrans(piranha_$1_t, piranha_$1_var_run_t, { file }) + files_pid_filetrans(piranha_$1_t, piranha_$1_var_run_t, { dir file }) ') ######################################## @@ -46,9 +44,9 @@ template(`piranha_domain_template',` ## Execute a domain transition to run fos. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`piranha_domtrans_fos',` @@ -61,56 +59,56 @@ interface(`piranha_domtrans_fos',` ####################################### ## -## Execute a domain transition to run lvsd. +## Execute a domain transition to run lvsd. ## ## -## -## Domain allowed to transition. -## +## +## Domain allowed to transition. +## ## # interface(`piranha_domtrans_lvs',` - gen_require(` - type piranha_lvs_t, piranha_lvs_exec_t; - ') + gen_require(` + type piranha_lvs_t, piranha_lvs_exec_t; + ') - domtrans_pattern($1, piranha_lvs_exec_t, piranha_lvs_t) + domtrans_pattern($1, piranha_lvs_exec_t, piranha_lvs_t) ') ####################################### ## -## Execute a domain transition to run pulse. +## Execute a domain transition to run pulse. ## ## -## -## Domain allowed to transition. -## +## +## Domain allowed to transition. +## ## # interface(`piranha_domtrans_pulse',` - gen_require(` - type piranha_pulse_t, piranha_pulse_exec_t; - ') + gen_require(` + type piranha_pulse_t, piranha_pulse_exec_t; + ') - domtrans_pattern($1, piranha_pulse_exec_t, piranha_pulse_t) + domtrans_pattern($1, piranha_pulse_exec_t, piranha_pulse_t) ') ####################################### ## -## Execute pulse server in the pulse domain. +## Execute pulse server in the pulse domain. ## ## -## -## Domain allowed access. -## +## +## Domain allowed to transition. +## ## # interface(`piranha_pulse_initrc_domtrans',` - gen_require(` - type piranha_pulse_initrc_exec_t; - ') + gen_require(` + type piranha_pulse_initrc_exec_t; + ') - init_labeled_script_domtrans($1, piranha_pulse_initrc_exec_t) + init_labeled_script_domtrans($1, piranha_pulse_initrc_exec_t) ') ######################################## @@ -130,7 +128,7 @@ interface(`piranha_read_log',` ') logging_search_logs($1) - read_files_pattern($1, piranha_log_t, piranha_log_t) + read_files_pattern($1, piranha_log_t, piranha_log_t) ') ######################################## @@ -139,9 +137,9 @@ interface(`piranha_read_log',` ## piranha log files. ## ## -## -## Domain allowed to transition. -## +## +## Domain allowed access. +## ## # interface(`piranha_append_log',` @@ -159,7 +157,7 @@ interface(`piranha_append_log',` ## ## ## -## Domain to not audit. +## Domain allowed access. ## ## # @@ -169,7 +167,7 @@ interface(`piranha_manage_log',` ') logging_search_logs($1) - manage_dirs_pattern($1, piranha_log_t, piranha_log_t) - manage_files_pattern($1, piranha_log_t, piranha_log_t) - manage_lnk_files_pattern($1, piranha_log_t, piranha_log_t) + manage_dirs_pattern($1, piranha_log_t, piranha_log_t) + manage_files_pattern($1, piranha_log_t, piranha_log_t) + manage_lnk_files_pattern($1, piranha_log_t, piranha_log_t) ') diff --git a/policy/modules/services/plymouthd.if b/policy/modules/services/plymouthd.if index fecc0dc3..07dd3ff5 100644 --- a/policy/modules/services/plymouthd.if +++ b/policy/modules/services/plymouthd.if @@ -5,12 +5,12 @@ ## Execute a domain transition to run plymouthd. ## ## -## +## ## Domain allowed to transition. -## +## ## # -interface(`plymouthd_domtrans', ` +interface(`plymouthd_domtrans',` gen_require(` type plymouthd_t, plymouthd_exec_t; ') @@ -23,12 +23,12 @@ interface(`plymouthd_domtrans', ` ## Execute the plymoth daemon in the current domain ## ## -## +## ## Domain allowed access. -## +## ## # -interface(`plymouthd_exec', ` +interface(`plymouthd_exec',` gen_require(` type plymouthd_exec_t; ') @@ -47,7 +47,7 @@ interface(`plymouthd_exec', ` ## ## # -interface(`plymouthd_stream_connect', ` +interface(`plymouthd_stream_connect',` gen_require(` type plymouthd_t; ') @@ -60,12 +60,12 @@ interface(`plymouthd_stream_connect', ` ## Execute the plymoth command in the current domain ## ## -## +## ## Domain allowed access. -## +## ## # -interface(`plymouthd_exec_plymouth', ` +interface(`plymouthd_exec_plymouth',` gen_require(` type plymouth_exec_t; ') @@ -78,12 +78,12 @@ interface(`plymouthd_exec_plymouth', ` ## Execute a domain transition to run plymouthd. ## ## -## +## ## Domain allowed to transition. -## +## ## # -interface(`plymouthd_domtrans_plymouth', ` +interface(`plymouthd_domtrans_plymouth',` gen_require(` type plymouth_t, plymouth_exec_t; ') @@ -101,7 +101,7 @@ interface(`plymouthd_domtrans_plymouth', ` ## ## # -interface(`plymouthd_search_spool', ` +interface(`plymouthd_search_spool',` gen_require(` type plymouthd_spool_t; ') @@ -120,7 +120,7 @@ interface(`plymouthd_search_spool', ` ## ## # -interface(`plymouthd_read_spool_files', ` +interface(`plymouthd_read_spool_files',` gen_require(` type plymouthd_spool_t; ') @@ -140,7 +140,7 @@ interface(`plymouthd_read_spool_files', ` ## ## # -interface(`plymouthd_manage_spool_files', ` +interface(`plymouthd_manage_spool_files',` gen_require(` type plymouthd_spool_t; ') @@ -159,7 +159,7 @@ interface(`plymouthd_manage_spool_files', ` ## ## # -interface(`plymouthd_search_lib', ` +interface(`plymouthd_search_lib',` gen_require(` type plymouthd_var_lib_t; ') @@ -178,7 +178,7 @@ interface(`plymouthd_search_lib', ` ## ## # -interface(`plymouthd_read_lib_files', ` +interface(`plymouthd_read_lib_files',` gen_require(` type plymouthd_var_lib_t; ') @@ -198,7 +198,7 @@ interface(`plymouthd_read_lib_files', ` ## ## # -interface(`plymouthd_manage_lib_files', ` +interface(`plymouthd_manage_lib_files',` gen_require(` type plymouthd_var_lib_t; ') @@ -217,7 +217,7 @@ interface(`plymouthd_manage_lib_files', ` ## ## # -interface(`plymouthd_read_pid_files', ` +interface(`plymouthd_read_pid_files',` gen_require(` type plymouthd_var_run_t; ') @@ -243,7 +243,7 @@ interface(`plymouthd_read_pid_files', ` ## ## # -interface(`plymouthd_admin', ` +interface(`plymouthd_admin',` gen_require(` type plymouthd_t, plymouthd_spool_t, plymouthd_var_lib_t; type plymouthd_var_run_t; @@ -252,11 +252,11 @@ interface(`plymouthd_admin', ` allow $1 plymouthd_t:process { ptrace signal_perms }; ps_process_pattern($1, plymouthd_t) - files_search_var_lib($1) + files_list_var_lib($1) admin_pattern($1, plymouthd_spool_t) admin_pattern($1, plymouthd_var_lib_t) - files_search_pids($1) + files_list_pids($1) admin_pattern($1, plymouthd_var_run_t) ') diff --git a/policy/modules/services/policykit.if b/policy/modules/services/policykit.if index 29c99068..13cdc77f 100644 --- a/policy/modules/services/policykit.if +++ b/policy/modules/services/policykit.if @@ -51,9 +51,9 @@ interface(`policykit_dbus_chat_auth',` ## Execute a domain transition to run polkit_auth. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`policykit_domtrans_auth',` @@ -79,6 +79,7 @@ interface(`policykit_domtrans_auth',` ## Role allowed access. ## ## +## # interface(`policykit_run_auth',` gen_require(` @@ -97,9 +98,9 @@ interface(`policykit_run_auth',` ## Execute a domain transition to run polkit_grant. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`policykit_domtrans_grant',` @@ -183,9 +184,9 @@ interface(`policykit_rw_reload',` ## Execute a domain transition to run polkit_resolve. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`policykit_domtrans_resolve',` @@ -261,14 +262,15 @@ template(`policykit_role',` policykit_read_reload($2) policykit_dbus_chat($2) ') + ######################################## ## ## Send generic signal to policy_auth ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`policykit_signal_auth',` diff --git a/policy/modules/services/portreserve.if b/policy/modules/services/portreserve.if index d91c1f5a..73850562 100644 --- a/policy/modules/services/portreserve.if +++ b/policy/modules/services/portreserve.if @@ -24,11 +24,11 @@ interface(`portreserve_domtrans',` ## ## ## -## Domain allowed access. +## Domain allowed to transition. ## ## # -interface(`portreserve_initrc_domtrans', ` +interface(`portreserve_initrc_domtrans',` gen_require(` type portreserve_initrc_exec_t; ') @@ -47,7 +47,6 @@ interface(`portreserve_initrc_domtrans', ` ## ## ## -## # interface(`portreserve_read_config',` gen_require(` @@ -70,7 +69,6 @@ interface(`portreserve_read_config',` ## Domain allowed access. ## ## -## # interface(`portreserve_manage_config',` gen_require(` @@ -98,24 +96,25 @@ interface(`portreserve_manage_config',` ## Role allowed access. ## ## +## # -interface(`portreserve_admin', ` +interface(`portreserve_admin',` gen_require(` - type portreserve_t, portreserve_etc_t; - type portreserve_initrc_exec_t, portreserve_var_run_t; + type portreserve_t, portreserve_etc_t, portreserve_var_run_t; + type portreserve_initrc_exec_t; ') allow $1 portreserve_t:process { ptrace signal_perms }; ps_process_pattern($1, portreserve_t) - + portreserve_initrc_domtrans($1) domain_system_change_exemption($1) role_transition $2 portreserve_initrc_exec_t system_r; allow $2 system_r; - files_search_etc($1) + files_list_etc($1) admin_pattern($1, portreserve_etc_t) - files_search_pids($1) + files_list_pids($1) admin_pattern($1, portreserve_var_run_t) ') diff --git a/policy/modules/services/postfix.if b/policy/modules/services/postfix.if index cfcbac74..7391f7ed 100644 --- a/policy/modules/services/postfix.if +++ b/policy/modules/services/postfix.if @@ -50,7 +50,7 @@ template(`postfix_domain_template',` can_exec(postfix_$1_t, postfix_$1_exec_t) - allow postfix_$1_t postfix_exec_t:file { mmap_file_perms lock ioctl }; + allow postfix_$1_t postfix_exec_t:file { mmap_file_perms lock }; allow postfix_$1_t postfix_master_t:process sigchld; @@ -273,7 +273,8 @@ interface(`postfix_read_local_state',` type postfix_local_t; ') - read_files_pattern($1, postfix_local_t, postfix_local_t) + kernel_search_proc($1) + ps_process_pattern($1, postfix_local_t) ') ######################################## @@ -291,7 +292,8 @@ interface(`postfix_read_master_state',` type postfix_master_t; ') - read_files_pattern($1, postfix_master_t, postfix_master_t) + kernel_search_proc($1) + ps_process_pattern($1, postfix_master_t) ') ######################################## @@ -388,7 +390,7 @@ interface(`postfix_domtrans_master',` ## ## # -interface(`postfix_initrc_domtrans', ` +interface(`postfix_initrc_domtrans',` gen_require(` type postfix_initrc_exec_t; ') @@ -424,7 +426,6 @@ interface(`postfix_exec_master',` ## Domain allowed access. ## ## -## # interface(`postfix_stream_connect_master',` gen_require(` @@ -676,19 +677,16 @@ interface(`postfix_domtrans_user_mail_handler',` ## Role allowed access. ## ## +## # -interface(`postfix_admin', ` +interface(`postfix_admin',` gen_require(` - type postfix_bounce_t, postfix_cleanup_t, postfix_local_t; - type postfix_master_t, postfix_pickup_t, postfix_qmgr_t; - type postfix_smtpd_t; - attribute postfix_spool_type; - + type postfix_bounce_t, postfix_cleanup_t, postfix_local_t; + type postfix_master_t, postfix_pickup_t, postfix_qmgr_t; type postfix_initrc_exec_t, postfix_data_t, postfix_etc_t; - type postfix_var_run_t; - type postfix_map_tmp_t, postfix_prng_t, postfix_public_t; + type postfix_smtpd_t, postfix_var_run_t; ') allow $1 postfix_bounce_t:process { ptrace signal_perms }; @@ -712,9 +710,9 @@ interface(`postfix_admin', ` allow $1 postfix_smtpd_t:process { ptrace signal_perms }; ps_process_pattern($1, postfix_smtpd_t) - postfix_run_map($1,$2) - postfix_run_postdrop($1,$2) - + postfix_run_map($1, $2) + postfix_run_postdrop($1, $2) + postfix_initrc_domtrans($1) domain_system_change_exemption($1) role_transition $2 postfix_initrc_exec_t system_r; @@ -725,12 +723,12 @@ interface(`postfix_admin', ` files_list_etc($1) admin_pattern($1, postfix_etc_t) - files_search_spool($1) - admin_pattern($1,postfix_spool_type) + files_list_spool($1) + admin_pattern($1, postfix_spool_type) admin_pattern($1, postfix_var_run_t) - files_search_tmp($1) + files_list_tmp($1) admin_pattern($1, postfix_map_tmp_t) admin_pattern($1, postfix_prng_t) @@ -745,9 +743,10 @@ interface(`postfix_admin', ` ## ## ## -## Domain allowed access. +## Domain allowed to transition. ## ## +## # interface(`postfix_run_postdrop',` gen_require(` @@ -757,4 +756,3 @@ interface(`postfix_run_postdrop',` postfix_domtrans_postdrop($1) role $2 types postfix_postdrop_t; ') - diff --git a/policy/modules/services/postfixpolicyd.if b/policy/modules/services/postfixpolicyd.if index feae93b0..d960d3f2 100644 --- a/policy/modules/services/postfixpolicyd.if +++ b/policy/modules/services/postfixpolicyd.if @@ -20,8 +20,7 @@ interface(`postfixpolicyd_admin',` gen_require(` type postfix_policyd_t, postfix_policyd_conf_t; - type postfix_policyd_var_run_t; - type postfix_policyd_initrc_exec_t; + type postfix_policyd_var_run_t, postfix_policyd_initrc_exec_t; ') allow $1 postfix_policyd_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/postgresql.if b/policy/modules/services/postgresql.if index 2c6b7232..4782bdbe 100644 --- a/policy/modules/services/postgresql.if +++ b/policy/modules/services/postgresql.if @@ -10,7 +10,7 @@ ## ## ## -## +## ## The type of the user domain. ## ## @@ -45,14 +45,6 @@ interface(`postgresql_role',` # Client local policy # - tunable_policy(`sepgsql_enable_users_ddl',` - allow $2 user_sepgsql_table_t:db_table { create drop setattr }; - allow $2 user_sepgsql_table_t:db_column { create drop setattr }; - - allow $2 user_sepgsql_sysobj_t:db_tuple { update insert delete }; - allow $2 user_sepgsql_proc_exec_t:db_procedure { create drop setattr }; - ') - allow $2 user_sepgsql_table_t:db_table { getattr use select update insert delete lock }; allow $2 user_sepgsql_table_t:db_column { getattr use select update insert }; allow $2 user_sepgsql_table_t:db_tuple { use select update insert delete }; @@ -69,6 +61,14 @@ interface(`postgresql_role',` allow $2 sepgsql_trusted_proc_t:process transition; type_transition $2 sepgsql_trusted_proc_exec_t:process sepgsql_trusted_proc_t; + + tunable_policy(`sepgsql_enable_users_ddl',` + allow $2 user_sepgsql_table_t:db_table { create drop setattr }; + allow $2 user_sepgsql_table_t:db_column { create drop setattr }; + + allow $2 user_sepgsql_sysobj_t:db_tuple { update insert delete }; + allow $2 user_sepgsql_proc_exec_t:db_procedure { create drop setattr }; + ') ') ######################################## @@ -195,7 +195,7 @@ interface(`postgresql_search_db',` type postgresql_db_t; ') - allow $1 postgresql_db_t:dir search; + allow $1 postgresql_db_t:dir search_dir_perms; ') ######################################## @@ -207,6 +207,7 @@ interface(`postgresql_search_db',` ## Domain allowed access. ## ## +# interface(`postgresql_manage_db',` gen_require(` type postgresql_db_t; @@ -214,7 +215,7 @@ interface(`postgresql_manage_db',` allow $1 postgresql_db_t:dir rw_dir_perms; allow $1 postgresql_db_t:file rw_file_perms; - allow $1 postgresql_db_t:lnk_file { getattr read }; + allow $1 postgresql_db_t:lnk_file read_lnk_file_perms; ') ######################################## @@ -304,7 +305,6 @@ interface(`postgresql_tcp_connect',` ## Domain allowed access. ## ## -## # interface(`postgresql_stream_connect',` gen_require(` @@ -313,7 +313,7 @@ interface(`postgresql_stream_connect',` files_search_pids($1) files_search_tmp($1) - stream_connect_pattern($1, { postgresql_var_run_t postgresql_tmp_t}, { postgresql_var_run_t postgresql_tmp_t}, postgresql_t) + stream_connect_pattern($1, { postgresql_var_run_t postgresql_tmp_t }, { postgresql_var_run_t postgresql_tmp_t }, postgresql_t) ') ######################################## @@ -359,13 +359,6 @@ interface(`postgresql_unpriv_client',` type_transition $1 sepgsql_trusted_proc_exec_t:process sepgsql_trusted_proc_t; allow $1 sepgsql_trusted_proc_t:process transition; - tunable_policy(`sepgsql_enable_users_ddl',` - allow $1 unpriv_sepgsql_table_t:db_table { create drop setattr }; - allow $1 unpriv_sepgsql_table_t:db_column { create drop setattr }; - allow $1 unpriv_sepgsql_sysobj_t:db_tuple { update insert delete }; - allow $1 unpriv_sepgsql_proc_exec_t:db_procedure { create drop setattr }; - ') - allow $1 unpriv_sepgsql_table_t:db_table { getattr use select update insert delete lock }; allow $1 unpriv_sepgsql_table_t:db_column { getattr use select update insert }; allow $1 unpriv_sepgsql_table_t:db_tuple { use select update insert delete }; @@ -379,6 +372,13 @@ interface(`postgresql_unpriv_client',` allow $1 unpriv_sepgsql_blob_t:db_blob { create drop getattr setattr read write import export }; type_transition $1 sepgsql_database_type:db_blob unpriv_sepgsql_blob_t; + + tunable_policy(`sepgsql_enable_users_ddl',` + allow $1 unpriv_sepgsql_table_t:db_table { create drop setattr }; + allow $1 unpriv_sepgsql_table_t:db_column { create drop setattr }; + allow $1 unpriv_sepgsql_sysobj_t:db_tuple { update insert delete }; + allow $1 unpriv_sepgsql_proc_exec_t:db_procedure { create drop setattr }; + ') ') ######################################## @@ -418,13 +418,10 @@ interface(`postgresql_unconfined',` # interface(`postgresql_admin',` gen_require(` - attribute sepgsql_admin_type; - attribute sepgsql_client_type; - - type postgresql_t, postgresql_var_run_t; - type postgresql_tmp_t, postgresql_db_t; - type postgresql_etc_t, postgresql_log_t; - type postgresql_initrc_exec_t; + attribute sepgsql_admin_type, sepgsql_client_type; + type postgresql_t, postgresql_var_run_t, postgresql_initrc_exec_t; + type postgresql_tmp_t, postgresql_db_t, postgresql_log_t; + type postgresql_etc_t; ') typeattribute $1 sepgsql_admin_type; @@ -437,17 +434,19 @@ interface(`postgresql_admin',` role_transition $2 postgresql_initrc_exec_t system_r; allow $2 system_r; + files_list_pids($1) admin_pattern($1, postgresql_var_run_t) - files_search_var_lib($1) + files_list_var_lib($1) admin_pattern($1, postgresql_db_t) - files_search_etc($1) + files_list_etc($1) admin_pattern($1, postgresql_etc_t) - logging_search_logs($1) + logging_list_logs($1) admin_pattern($1, postgresql_log_t) + files_list_tmp($1) admin_pattern($1, postgresql_tmp_t) postgresql_tcp_connect($1) diff --git a/policy/modules/services/postgrey.if b/policy/modules/services/postgrey.if index ad15fde7..6f554454 100644 --- a/policy/modules/services/postgrey.if +++ b/policy/modules/services/postgrey.if @@ -15,9 +15,9 @@ interface(`postgrey_stream_connect',` type postgrey_var_run_t, postgrey_t, postgrey_spool_t; ') - stream_connect_pattern($1, postgrey_var_run_t, postgrey_var_run_t, postgrey_t) - stream_connect_pattern($1, postgrey_spool_t, postgrey_spool_t, postgrey_t) + stream_connect_pattern($1, { postgrey_spool_t postgrey_var_run_t }, { postgrey_spool_t postgrey_var_run_t }, postgrey_t) files_search_pids($1) + files_search_spool($1) ') ######################################## @@ -35,6 +35,7 @@ interface(`postgrey_search_spool',` type postgrey_spool_t; ') + files_search_spool($1) allow $1 postgrey_spool_t:dir search_dir_perms; ') @@ -57,9 +58,8 @@ interface(`postgrey_search_spool',` # interface(`postgrey_admin',` gen_require(` - type postgrey_t, postgrey_etc_t; + type postgrey_t, postgrey_etc_t, postgrey_initrc_exec_t; type postgrey_var_lib_t, postgrey_var_run_t; - type postgrey_initrc_exec_t; ') allow $1 postgrey_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/ppp.if b/policy/modules/services/ppp.if index f916c76b..09699d12 100644 --- a/policy/modules/services/ppp.if +++ b/policy/modules/services/ppp.if @@ -66,7 +66,6 @@ interface(`ppp_sigchld',` ## ## # -# interface(`ppp_kill',` gen_require(` type pppd_t; @@ -180,8 +179,7 @@ interface(`ppp_run',` ') ppp_domtrans($1) - role $2 types pppd_t; - role $2 types pptp_t; + role $2 types { pppd_t pptp_t }; optional_policy(` ddclient_run(pppd_t, $2) @@ -281,6 +279,7 @@ interface(`ppp_read_pid_files',` type pppd_var_run_t; ') + files_search_pids($1) allow $1 pppd_var_run_t:file read_file_perms; ') @@ -299,6 +298,7 @@ interface(`ppp_manage_pid_files',` type pppd_var_run_t; ') + files_search_pids($1) allow $1 pppd_var_run_t:file manage_file_perms; ') @@ -353,16 +353,17 @@ interface(`ppp_initrc_domtrans',` interface(`ppp_admin',` gen_require(` type pppd_t, pppd_tmp_t, pppd_log_t, pppd_lock_t; - type pppd_etc_t, pppd_secret_t; - type pppd_etc_rw_t, pppd_var_run_t; - + type pppd_etc_t, pppd_secret_t, pppd_var_run_t; type pptp_t, pptp_log_t, pptp_var_run_t; - type pppd_initrc_exec_t; + type pppd_initrc_exec_t, pppd_etc_rw_t; ') allow $1 pppd_t:process { ptrace signal_perms }; ps_process_pattern($1, pppd_t) + allow $1 pptp_t:process { ptrace signal_perms }; + ps_process_pattern($1, pptp_t) + ppp_initrc_domtrans($1) domain_system_change_exemption($1) role_transition $2 pppd_initrc_exec_t system_r; @@ -374,6 +375,7 @@ interface(`ppp_admin',` logging_list_logs($1) admin_pattern($1, pppd_log_t) + files_list_locks($1) admin_pattern($1, pppd_lock_t) files_list_etc($1) @@ -386,9 +388,6 @@ interface(`ppp_admin',` files_list_pids($1) admin_pattern($1, pppd_var_run_t) - allow $1 pptp_t:process { ptrace signal_perms }; - ps_process_pattern($1, pptp_t) - admin_pattern($1, pptp_log_t) admin_pattern($1, pptp_var_run_t) diff --git a/policy/modules/services/prelude.if b/policy/modules/services/prelude.if index e4d87971..77ef7686 100644 --- a/policy/modules/services/prelude.if +++ b/policy/modules/services/prelude.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run prelude. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`prelude_domtrans',` @@ -23,9 +23,9 @@ interface(`prelude_domtrans',` ## Execute a domain transition to run prelude_audisp. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`prelude_domtrans_audisp',` @@ -41,9 +41,9 @@ interface(`prelude_domtrans_audisp',` ## Signal the prelude_audisp domain. ## ## -## +## ## Domain allowed acccess. -## +## ## # interface(`prelude_signal_audisp',` @@ -78,9 +78,9 @@ interface(`prelude_read_spool',` ## Manage to prelude-manager spool files. ## ## -## +## ## Domain allowed access. -## +## ## # interface(`prelude_manage_spool',` @@ -112,13 +112,10 @@ interface(`prelude_manage_spool',` # interface(`prelude_admin',` gen_require(` - type prelude_t, prelude_spool_t; - type prelude_var_run_t, prelude_var_lib_t; - type prelude_audisp_t, prelude_audisp_var_run_t; - type prelude_initrc_exec_t; - - type prelude_lml_t, prelude_lml_tmp_t; - type prelude_lml_var_run_t; + type prelude_t, prelude_spool_t, prelude_initrc_exec_t; + type prelude_var_run_t, prelude_var_lib_t, prelude_lml_var_run_t; + type prelude_audisp_t, prelude_audisp_var_run_t, prelude_lml_tmp_t; + type prelude_lml_t; ') allow $1 prelude_t:process { ptrace signal_perms }; @@ -135,17 +132,17 @@ interface(`prelude_admin',` role_transition $2 prelude_initrc_exec_t system_r; allow $2 system_r; + files_list_spool($1) admin_pattern($1, prelude_spool_t) - files_search_var_lib($1) + files_list_var_lib($1) admin_pattern($1, prelude_var_lib_t) - files_search_pids($1) + files_list_pids($1) admin_pattern($1, prelude_var_run_t) admin_pattern($1, prelude_audisp_var_run_t) - - files_search_tmp($1) - admin_pattern($1, prelude_lml_tmp_t) - admin_pattern($1, prelude_lml_var_run_t) + + files_list_tmp($1) + admin_pattern($1, prelude_lml_tmp_t) ') diff --git a/policy/modules/services/privoxy.if b/policy/modules/services/privoxy.if index c8f6cb52..72215262 100644 --- a/policy/modules/services/privoxy.if +++ b/policy/modules/services/privoxy.if @@ -19,9 +19,8 @@ # interface(`privoxy_admin',` gen_require(` - type privoxy_t, privoxy_log_t; + type privoxy_t, privoxy_log_t, privoxy_initrc_exec_t; type privoxy_etc_rw_t, privoxy_var_run_t; - type privoxy_initrc_exec_t; ') allow $1 privoxy_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/procmail.if b/policy/modules/services/procmail.if index 5bfbd7b6..166e9c33 100644 --- a/policy/modules/services/procmail.if +++ b/policy/modules/services/procmail.if @@ -93,7 +93,6 @@ interface(`procmail_read_home_files',` type procmail_home_t; ') - userdom_search_user_home_dirs($1) + userdom_search_user_home_dirs($1) read_files_pattern($1, procmail_home_t, procmail_home_t) ') - diff --git a/policy/modules/services/psad.if b/policy/modules/services/psad.if index a5ec9f55..d1a3745d 100644 --- a/policy/modules/services/psad.if +++ b/policy/modules/services/psad.if @@ -91,7 +91,6 @@ interface(`psad_manage_config',` files_search_etc($1) manage_dirs_pattern($1, psad_etc_t, psad_etc_t) manage_files_pattern($1, psad_etc_t, psad_etc_t) - ') ######################################## @@ -115,7 +114,7 @@ interface(`psad_read_pid_files',` ######################################## ## -## Read psad PID files. +## Read and write psad PID files. ## ## ## @@ -253,8 +252,8 @@ interface(`psad_rw_tmp_files',` interface(`psad_admin',` gen_require(` type psad_t, psad_var_run_t, psad_var_log_t; - type psad_initrc_exec_t, psad_var_lib_t; - type psad_tmp_t, psad_etc_t; + type psad_initrc_exec_t, psad_var_lib_t, psad_etc_t; + type psad_tmp_t; ') allow $1 psad_t:process { ptrace signal_perms }; @@ -265,18 +264,18 @@ interface(`psad_admin',` role_transition $2 psad_initrc_exec_t system_r; allow $2 system_r; - files_search_etc($1) + files_list_etc($1) admin_pattern($1, psad_etc_t) - files_search_pids($1) + files_list_pids($1) admin_pattern($1, psad_var_run_t) - logging_search_logs($1) + logging_list_logs($1) admin_pattern($1, psad_var_log_t) - files_search_var_lib($1) + files_list_var_lib($1) admin_pattern($1, psad_var_lib_t) - files_search_tmp($1) + files_list_tmp($1) admin_pattern($1, psad_tmp_t) ') diff --git a/policy/modules/services/puppet.if b/policy/modules/services/puppet.if index 2855a443..0456b110 100644 --- a/policy/modules/services/puppet.if +++ b/policy/modules/services/puppet.if @@ -21,7 +21,7 @@ ## ## # -interface(`puppet_rw_tmp', ` +interface(`puppet_rw_tmp',` gen_require(` type puppet_tmp_t; ') diff --git a/policy/modules/services/pyzor.if b/policy/modules/services/pyzor.if index 6443f306..aa3d0b4c 100644 --- a/policy/modules/services/pyzor.if +++ b/policy/modules/services/pyzor.if @@ -14,6 +14,7 @@ ## User domain for the role ## ## +## # interface(`pyzor_role',` gen_require(` @@ -28,7 +29,7 @@ interface(`pyzor_role',` # allow ps to show pyzor and allow the user to kill it ps_process_pattern($2, pyzor_t) - allow $2 pyzor_t:process signal; + allow $2 pyzor_t:process { ptrace signal_perms }; ') ######################################## @@ -109,13 +110,12 @@ interface(`pyzor_exec',` interface(`pyzor_admin',` gen_require(` type pyzord_t, pyzor_tmp_t, pyzord_log_t; - type pyzor_etc_t, pyzor_var_lib_t; - type pyzord_initrc_exec_t; + type pyzor_etc_t, pyzor_var_lib_t, pyzord_initrc_exec_t; ') allow $1 pyzord_t:process { ptrace signal_perms }; ps_process_pattern($1, pyzord_t) - + init_labeled_script_domtrans($1, pyzord_initrc_exec_t) domain_system_change_exemption($1) role_transition $2 pyzord_initrc_exec_t system_r; @@ -133,5 +133,3 @@ interface(`pyzor_admin',` files_list_var_lib($1) admin_pattern($1, pyzor_var_lib_t) ') - - diff --git a/policy/modules/services/qmail.if b/policy/modules/services/qmail.if index a55bf44b..77a25f5e 100644 --- a/policy/modules/services/qmail.if +++ b/policy/modules/services/qmail.if @@ -62,14 +62,13 @@ interface(`qmail_domtrans_inject',` type qmail_inject_t, qmail_inject_exec_t; ') + corecmd_search_bin($1) domtrans_pattern($1, qmail_inject_exec_t, qmail_inject_t) ifdef(`distro_debian',` files_search_usr($1) - corecmd_search_bin($1) ',` files_search_var($1) - corecmd_search_bin($1) ') ') @@ -88,14 +87,13 @@ interface(`qmail_domtrans_queue',` type qmail_queue_t, qmail_queue_exec_t; ') + corecmd_search_bin($1) domtrans_pattern($1, qmail_queue_exec_t, qmail_queue_t) ifdef(`distro_debian',` files_search_usr($1) - corecmd_search_bin($1) ',` files_search_var($1) - corecmd_search_bin($1) ') ') diff --git a/policy/modules/services/qpidd.if b/policy/modules/services/qpidd.if index 5dbca44f..c403abc1 100644 --- a/policy/modules/services/qpidd.if +++ b/policy/modules/services/qpidd.if @@ -1,4 +1,3 @@ - ## policy for qpidd ######################################## @@ -6,9 +5,9 @@ ## Execute a domain transition to run qpidd. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`qpidd_domtrans',` @@ -19,7 +18,6 @@ interface(`qpidd_domtrans',` domtrans_pattern($1, qpidd_exec_t, qpidd_t) ') - ######################################## ## ## Execute qpidd server in the qpidd domain. @@ -72,12 +70,12 @@ interface(`qpidd_manage_var_run',` type qpidd_var_run_t; ') - manage_dirs_pattern($1, qpidd_var_run_t, qpidd_var_run_t) - manage_files_pattern($1, qpidd_var_run_t, qpidd_var_run_t) - manage_lnk_files_pattern($1, qpidd_var_run_t, qpidd_var_run_t) + files_search_pids($1) + manage_dirs_pattern($1, qpidd_var_run_t, qpidd_var_run_t) + manage_files_pattern($1, qpidd_var_run_t, qpidd_var_run_t) + manage_lnk_files_pattern($1, qpidd_var_run_t, qpidd_var_run_t) ') - ######################################## ## ## Search qpidd lib directories. @@ -113,7 +111,7 @@ interface(`qpidd_read_lib_files',` ') files_search_var_lib($1) - read_files_pattern($1, qpidd_var_lib_t, qpidd_var_lib_t) + read_files_pattern($1, qpidd_var_lib_t, qpidd_var_lib_t) ') ######################################## @@ -133,7 +131,7 @@ interface(`qpidd_manage_lib_files',` ') files_search_var_lib($1) - manage_files_pattern($1, qpidd_var_lib_t, qpidd_var_lib_t) + manage_files_pattern($1, qpidd_var_lib_t, qpidd_var_lib_t) ') ######################################## @@ -151,12 +149,12 @@ interface(`qpidd_manage_var_lib',` type qpidd_var_lib_t; ') - manage_dirs_pattern($1, qpidd_var_lib_t, qpidd_var_lib_t) - manage_files_pattern($1, qpidd_var_lib_t, qpidd_var_lib_t) - manage_lnk_files_pattern($1, qpidd_var_lib_t, qpidd_var_lib_t) + files_search_var_lib($1) + manage_dirs_pattern($1, qpidd_var_lib_t, qpidd_var_lib_t) + manage_files_pattern($1, qpidd_var_lib_t, qpidd_var_lib_t) + manage_lnk_files_pattern($1, qpidd_var_lib_t, qpidd_var_lib_t) ') - ######################################## ## ## All of the rules required to administrate @@ -176,16 +174,11 @@ interface(`qpidd_manage_var_lib',` # interface(`qpidd_admin',` gen_require(` - type qpidd_t; + type qpidd_t, qpidd_initrc_exec_t; ') allow $1 qpidd_t:process { ptrace signal_perms }; ps_process_pattern($1, qpidd_t) - - - gen_require(` - type qpidd_initrc_exec_t; - ') # Allow qpidd_t to restart the apache service qpidd_initrc_domtrans($1) @@ -196,41 +189,40 @@ interface(`qpidd_admin',` qpidd_manage_var_run($1) qpidd_manage_var_lib($1) - ') ##################################### ## -## Allow read and write access to qpidd semaphores. +## Allow read and write access to qpidd semaphores. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`qpidd_rw_semaphores',` - gen_require(` - type qpidd_t; - ') + gen_require(` + type qpidd_t; + ') - allow $1 qpidd_t:sem rw_sem_perms; + allow $1 qpidd_t:sem rw_sem_perms; ') ######################################## ## -## Read and write to qpidd shared memory. +## Read and write to qpidd shared memory. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`qpidd_rw_shm',` - gen_require(` - type qpidd_t; - ') + gen_require(` + type qpidd_t; + ') - allow $1 qpidd_t:shm rw_shm_perms; + allow $1 qpidd_t:shm rw_shm_perms; ') diff --git a/policy/modules/services/radvd.if b/policy/modules/services/radvd.if index be05bff5..2bd662a9 100644 --- a/policy/modules/services/radvd.if +++ b/policy/modules/services/radvd.if @@ -19,8 +19,8 @@ # interface(`radvd_admin',` gen_require(` - type radvd_t, radvd_etc_t; - type radvd_var_run_t, radvd_initrc_exec_t; + type radvd_t, radvd_etc_t, radvd_initrc_exec_t; + type radvd_var_run_t; ') allow $1 radvd_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/razor.if b/policy/modules/services/razor.if index 13ad2fe0..3203212f 100644 --- a/policy/modules/services/razor.if +++ b/policy/modules/services/razor.if @@ -26,6 +26,7 @@ template(`razor_common_domain_template',` gen_require(` type razor_exec_t, razor_etc_t, razor_log_t, razor_var_lib_t; ') + type $1_t; domain_type($1_t) domain_entry_file($1_t, razor_exec_t) @@ -46,7 +47,7 @@ template(`razor_common_domain_template',` # Read system config file allow $1_t razor_etc_t:dir list_dir_perms; allow $1_t razor_etc_t:file read_file_perms; - allow $1_t razor_etc_t:lnk_file { getattr read }; + allow $1_t razor_etc_t:lnk_file read_lnk_file_perms; manage_dirs_pattern($1_t, razor_log_t, razor_log_t) manage_files_pattern($1_t, razor_log_t, razor_log_t) @@ -117,6 +118,7 @@ template(`razor_common_domain_template',` ## User domain for the role ## ## +## # interface(`razor_role',` gen_require(` @@ -130,7 +132,7 @@ interface(`razor_role',` # allow ps to show razor and allow the user to kill it ps_process_pattern($2, razor_t) - allow $2 razor_t:process signal; + allow $2 razor_t:process { ptrace signal_perms }; manage_dirs_pattern($2, razor_home_t, razor_home_t) manage_files_pattern($2, razor_home_t, razor_home_t) @@ -169,7 +171,7 @@ interface(`razor_domtrans',` ## ## # -template(`razor_manage_user_home_files',` +interface(`razor_manage_user_home_files',` gen_require(` type razor_home_t; ') @@ -197,4 +199,3 @@ interface(`razor_read_lib_files',` files_search_var_lib($1) read_files_pattern($1, razor_var_lib_t, razor_var_lib_t) ') - diff --git a/policy/modules/services/rgmanager.if b/policy/modules/services/rgmanager.if index aaf7c852..9c2c9635 100644 --- a/policy/modules/services/rgmanager.if +++ b/policy/modules/services/rgmanager.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run rgmanager. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`rgmanager_domtrans',` @@ -78,20 +78,20 @@ interface(`rgmanager_manage_tmpfs_files',` ####################################### ## -## Allow read and write access to rgmanager semaphores. +## Allow read and write access to rgmanager semaphores. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`rgmanager_rw_semaphores',` - gen_require(` - type rgmanager_t; - ') + gen_require(` + type rgmanager_t; + ') - allow $1 rgmanager_t:sem { unix_read unix_write associate read write }; + allow $1 rgmanager_t:sem rw_sem_perms; ') ###################################### @@ -100,9 +100,9 @@ interface(`rgmanager_rw_semaphores',` ## an rgmanager environment ## ## -## +## ## Domain allowed access. -## +## ## ## ## @@ -115,7 +115,7 @@ interface(`rgmanager_admin',` gen_require(` type rgmanager_t, rgmanager_initrc_exec_t, rgmanager_tmp_t; type rgmanager_tmpfs_t, rgmanager_var_log_t, rgmanager_var_run_t; - ') + ') allow $1 rgmanager_t:process { ptrace signal_perms }; ps_process_pattern($1, rgmanager_t) @@ -125,14 +125,14 @@ interface(`rgmanager_admin',` role_transition $2 rgmanager_initrc_exec_t system_r; allow $2 system_r; - files_search_tmp($1) + files_list_tmp($1) admin_pattern($1, rgmanager_tmp_t) admin_pattern($1, rgmanager_tmpfs_t) - logging_search_logs($1) + logging_list_logs($1) admin_pattern($1, rgmanager_var_log_t) - files_search_pids($1) + files_list_pids($1) admin_pattern($1, rgmanager_var_run_t) ') diff --git a/policy/modules/services/rhcs.if b/policy/modules/services/rhcs.if index d8b97c2b..229a3c74 100644 --- a/policy/modules/services/rhcs.if +++ b/policy/modules/services/rhcs.if @@ -13,9 +13,7 @@ # template(`rhcs_domain_template',` gen_require(` - attribute cluster_domain; - attribute cluster_tmpfs; - attribute cluster_pid; + attribute cluster_domain, cluster_tmpfs, cluster_pid; ') ############################## @@ -53,7 +51,6 @@ template(`rhcs_domain_template',` manage_fifo_files_pattern($1_t, $1_var_run_t, $1_var_run_t) manage_sock_files_pattern($1_t, $1_var_run_t, $1_var_run_t) files_pid_filetrans($1_t, $1_var_run_t, { file fifo_file }) - ') ###################################### @@ -61,9 +58,9 @@ template(`rhcs_domain_template',` ## Execute a domain transition to run dlm_controld. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`rhcs_domtrans_dlm_controld',` @@ -171,9 +168,8 @@ interface(`rhcs_stream_connect_fenced',` type fenced_var_run_t, fenced_t; ') - allow $1 fenced_t:unix_stream_socket connectto; - allow $1 fenced_var_run_t:sock_file { getattr write }; files_search_pids($1) + stream_connect_pattern($1, fenced_var_run_t, fenced_var_run_t, fenced_t) ') ##################################### @@ -349,8 +345,7 @@ interface(`rhcs_rw_groupd_shm',` # interface(`rhcs_rw_cluster_shm',` gen_require(` - attribute cluster_domain; - attribute cluster_tmpfs; + attribute cluster_domain, cluster_tmpfs; ') allow $1 cluster_domain:shm { rw_shm_perms destroy }; @@ -361,41 +356,40 @@ interface(`rhcs_rw_cluster_shm',` #################################### ## -## Read and write access to cluster domains semaphores. +## Read and write access to cluster domains semaphores. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`rhcs_rw_cluster_semaphores',` - gen_require(` + gen_require(` attribute cluster_domain; - ') + ') - allow $1 cluster_domain:sem { rw_sem_perms destroy }; + allow $1 cluster_domain:sem { rw_sem_perms destroy }; ') #################################### ## -## Connect to cluster domains over a unix domain -## stream socket. +## Connect to cluster domains over a unix domain +## stream socket. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`rhcs_stream_connect_cluster',` - gen_require(` - attribute cluster_domain; - attribute cluster_pid; - ') + gen_require(` + attribute cluster_domain, cluster_pid; + ') - files_search_pids($1) - stream_connect_pattern($1, cluster_pid, cluster_pid, cluster_domain) + files_search_pids($1) + stream_connect_pattern($1, cluster_pid, cluster_pid, cluster_domain) ') ###################################### @@ -432,24 +426,25 @@ interface(`rhcs_read_qdiskd_tmpfs_files',` type qdiskd_tmpfs_t; ') + fs_search_tmpfs($1) allow $1 qdiskd_tmpfs_t:file read_file_perms; ') ###################################### ## -## Allow domain to read cluster lib files +## Allow domain to read cluster lib files ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`rhcs_read_cluster_lib_files',` - gen_require(` - type cluster_var_lib_t; - ') + gen_require(` + type cluster_var_lib_t; + ') - files_search_var_lib($1) - read_files_pattern($1, cluster_var_lib_t, cluster_var_lib_t) + files_search_var_lib($1) + read_files_pattern($1, cluster_var_lib_t, cluster_var_lib_t) ') diff --git a/policy/modules/services/rhgb.if b/policy/modules/services/rhgb.if index 96efae7f..793a29f8 100644 --- a/policy/modules/services/rhgb.if +++ b/policy/modules/services/rhgb.if @@ -194,5 +194,6 @@ interface(`rhgb_rw_tmpfs_files',` type rhgb_tmpfs_t; ') + fs_search_tmpfs($1) allow $1 rhgb_tmpfs_t:file rw_file_perms; ') diff --git a/policy/modules/services/ricci.if b/policy/modules/services/ricci.if index ecc341c8..3128dd8d 100644 --- a/policy/modules/services/ricci.if +++ b/policy/modules/services/ricci.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run ricci. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`ricci_domtrans',` @@ -20,20 +20,20 @@ interface(`ricci_domtrans',` ####################################### ## -## Execute ricci server in the ricci domain. +## Execute ricci server in the ricci domain. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # -interface(`ricci_initrc_domtrans', ` - gen_require(` - type ricci_initrc_exec_t; - ') +interface(`ricci_initrc_domtrans',` + gen_require(` + type ricci_initrc_exec_t; + ') - init_labeled_script_domtrans($1, ricci_initrc_exec_t) + init_labeled_script_domtrans($1, ricci_initrc_exec_t) ') ######################################## @@ -41,9 +41,9 @@ interface(`ricci_initrc_domtrans', ` ## Execute a domain transition to run ricci_modcluster. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`ricci_domtrans_modcluster',` @@ -89,7 +89,7 @@ interface(`ricci_dontaudit_rw_modcluster_pipes',` type ricci_modcluster_t; ') - dontaudit $1 ricci_modcluster_t:fifo_file { read write }; + dontaudit $1 ricci_modcluster_t:fifo_file rw_inherited_fifo_file_perms; ') ######################################## @@ -126,6 +126,7 @@ interface(`ricci_rw_modclusterd_tmpfs_files',` type ricci_modcluserd_tmpfs_t; ') + fs_search_tmpfs($1) allow $1 ricci_modcluserd_tmpfs_t:file rw_file_perms; ') @@ -134,9 +135,9 @@ interface(`ricci_rw_modclusterd_tmpfs_files',` ## Execute a domain transition to run ricci_modlog. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`ricci_domtrans_modlog',` @@ -152,9 +153,9 @@ interface(`ricci_domtrans_modlog',` ## Execute a domain transition to run ricci_modrpm. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`ricci_domtrans_modrpm',` @@ -170,9 +171,9 @@ interface(`ricci_domtrans_modrpm',` ## Execute a domain transition to run ricci_modservice. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`ricci_domtrans_modservice',` @@ -188,9 +189,9 @@ interface(`ricci_domtrans_modservice',` ## Execute a domain transition to run ricci_modstorage. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`ricci_domtrans_modstorage',` @@ -203,22 +204,22 @@ interface(`ricci_domtrans_modstorage',` #################################### ## -## Allow the specified domain to manage ricci's lib files. +## Allow the specified domain to manage ricci's lib files. ## ## -## -## Domain allowed access. -## +## +## Domain allowed access. +## ## # interface(`ricci_manage_lib_files',` - gen_require(` - type ricci_var_lib_t; - ') + gen_require(` + type ricci_var_lib_t; + ') - files_search_var_lib($1) - manage_dirs_pattern($1, ricci_var_lib_t, ricci_var_lib_t) - manage_files_pattern($1, ricci_var_lib_t, ricci_var_lib_t) + files_search_var_lib($1) + manage_dirs_pattern($1, ricci_var_lib_t, ricci_var_lib_t) + manage_files_pattern($1, ricci_var_lib_t, ricci_var_lib_t) ') ######################################## @@ -252,15 +253,15 @@ interface(`ricci_admin',` role_transition $2 ricci_initrc_exec_t system_r; allow $2 system_r; - files_search_tmp($1) + files_list_tmp($1) admin_pattern($1, ricci_tmp_t) - - files_search_var_lib($1) + + files_list_var_lib($1) admin_pattern($1, ricci_var_lib_t) - logging_search_logs($1) + logging_list_logs($1) admin_pattern($1, ricci_var_log_t) - files_search_pids($1) + files_list_pids($1) admin_pattern($1, ricci_var_run_t) ') diff --git a/policy/modules/services/rpc.if b/policy/modules/services/rpc.if index b65be0cc..28e75762 100644 --- a/policy/modules/services/rpc.if +++ b/policy/modules/services/rpc.if @@ -32,7 +32,11 @@ interface(`rpc_stub',` ## ## # -template(`rpc_domain_template', ` +template(`rpc_domain_template',` + gen_require(` + type var_lib_nfs_t; + ') + ######################################## # # Declarations @@ -152,7 +156,7 @@ interface(`rpc_dontaudit_getattr_exports',` type exports_t; ') - dontaudit $1 exports_t:file getattr; + dontaudit $1 exports_t:file getattr_file_perms; ') ######################################## @@ -188,7 +192,7 @@ interface(`rpc_write_exports',` type exports_t; ') - allow $1 exports_t:file write; + allow $1 exports_t:file write_file_perms; ') ######################################## @@ -302,7 +306,7 @@ interface(`rpc_read_nfs_content',` allow $1 { nfsd_ro_t nfsd_rw_t }:dir list_dir_perms; allow $1 { nfsd_ro_t nfsd_rw_t }:file read_file_perms; - allow $1 { nfsd_ro_t nfsd_rw_t }:lnk_file { getattr read }; + allow $1 { nfsd_ro_t nfsd_rw_t }:lnk_file read_lnk_file_perms; ') ######################################## @@ -395,7 +399,7 @@ interface(`rpc_search_nfs_state_data',` ') files_search_var_lib($1) - allow $1 var_lib_nfs_t:dir search; + allow $1 var_lib_nfs_t:dir search_dir_perms; ') ######################################## diff --git a/policy/modules/services/rpcbind.if b/policy/modules/services/rpcbind.if index 5a4d69d2..0458ba73 100644 --- a/policy/modules/services/rpcbind.if +++ b/policy/modules/services/rpcbind.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run rpcbind. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`rpcbind_domtrans',` @@ -145,9 +145,9 @@ interface(`rpcbind_admin',` role_transition $2 rpcbind_initrc_exec_t system_r; allow $2 system_r; - files_search_var_lib($1) + files_list_var_lib($1) admin_pattern($1, rpcbind_var_lib_t) - files_search_pids($1) + files_list_pids($1) admin_pattern($1, rpcbind_var_run_t) ') diff --git a/policy/modules/services/rsync.if b/policy/modules/services/rsync.if index eefa3298..b28cae51 100644 --- a/policy/modules/services/rsync.if +++ b/policy/modules/services/rsync.if @@ -109,9 +109,9 @@ interface(`rsync_exec',` ## Read rsync config files. ## ## -## +## ## Domain allowed access. -## +## ## # interface(`rsync_read_config',` @@ -128,9 +128,9 @@ interface(`rsync_read_config',` ## Write to rsync config files. ## ## -## +## ## Domain allowed access. -## +## ## # interface(`rsync_write_config',` @@ -147,9 +147,9 @@ interface(`rsync_write_config',` ## Manage rsync config files. ## ## -## -## Domain allowed. -## +## +## Domain allowed access. +## ## # interface(`rsync_manage_config',` diff --git a/policy/modules/services/rtkit.if b/policy/modules/services/rtkit.if index 21079f8f..d632bc0b 100644 --- a/policy/modules/services/rtkit.if +++ b/policy/modules/services/rtkit.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run rtkit_daemon. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`rtkit_daemon_domtrans',` @@ -46,7 +46,7 @@ interface(`rtkit_daemon_dbus_chat',` ## ## ## -## Domain allowed access. +## Domain to not audit. ## ## # @@ -75,6 +75,7 @@ interface(`rtkit_scheduled',` type rtkit_daemon_t; ') + kernel_search_proc($1) ps_process_pattern(rtkit_daemon_t, $1) allow rtkit_daemon_t $1:process { getsched setsched }; rtkit_daemon_dbus_chat($1) diff --git a/policy/modules/services/rwho.if b/policy/modules/services/rwho.if index 71ea0eab..664e68e7 100644 --- a/policy/modules/services/rwho.if +++ b/policy/modules/services/rwho.if @@ -5,9 +5,9 @@ ## Execute a domain transition to run rwho. ## ## -## +## ## Domain allowed to transition. -## +## ## # interface(`rwho_domtrans',` diff --git a/policy/modules/services/samba.if b/policy/modules/services/samba.if index 84732e51..9e729701 100644 --- a/policy/modules/services/samba.if +++ b/policy/modules/services/samba.if @@ -83,7 +83,7 @@ interface(`samba_domtrans_net',` ## ## ## -## Domain allowed access. +## Domain allowed to transition. ## ## # @@ -133,7 +133,7 @@ interface(`samba_run_net',` ## ## # -template(`samba_role_notrans',` +interface(`samba_role_notrans',` gen_require(` type smbd_t; ') @@ -148,7 +148,7 @@ template(`samba_role_notrans',` ## ## ## -## Domain allowed access. +## Domain allowed to transition. ## ## ## @@ -391,7 +391,6 @@ interface(`samba_search_var',` type samba_var_t; ') - files_search_var($1) files_search_var_lib($1) allow $1 samba_var_t:dir search_dir_perms; ') @@ -412,7 +411,6 @@ interface(`samba_read_var_files',` type samba_var_t; ') - files_search_var($1) files_search_var_lib($1) read_files_pattern($1, samba_var_t, samba_var_t) ') @@ -452,7 +450,6 @@ interface(`samba_rw_var_files',` type samba_var_t; ') - files_search_var($1) files_search_var_lib($1) rw_files_pattern($1, samba_var_t, samba_var_t) ') @@ -473,7 +470,6 @@ interface(`samba_manage_var_files',` type samba_var_t; ') - files_search_var($1) files_search_var_lib($1) manage_files_pattern($1, samba_var_t, samba_var_t) manage_lnk_files_pattern($1, samba_var_t, samba_var_t) @@ -761,9 +757,8 @@ interface(`samba_admin',` type smbd_t, smbd_tmp_t, samba_secrets_t; type samba_initrc_exec_t, samba_log_t, samba_var_t; type samba_etc_t, samba_share_t, winbind_log_t; - type swat_var_run_t, swat_tmp_t; - type winbind_var_run_t, winbind_tmp_t; - type samba_unconfined_script_t, samba_unconfined_script_exec_t; + type swat_var_run_t, swat_tmp_t, samba_unconfined_script_exec_t; + type winbind_var_run_t, winbind_tmp_t, samba_unconfined_script_t; ') allow $1 smbd_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/sendmail.if b/policy/modules/services/sendmail.if index cf9fdcdd..5700fb80 100644 --- a/policy/modules/services/sendmail.if +++ b/policy/modules/services/sendmail.if @@ -329,7 +329,7 @@ interface(`sendmail_run_unconfined',` # interface(`sendmail_admin',` gen_require(` - type sendmail_t, sendmail_initrc_exec_t, sendmail_log_t; + type sendmail_t, sendmail_initrc_exec_t, sendmail_log_t; type sendmail_tmp_t, sendmail_var_run_t, unconfined_sendmail_t; type mail_spool_t; ') @@ -344,15 +344,15 @@ interface(`sendmail_admin',` domain_system_change_exemption($1) role_transition $2 sendmail_initrc_exec_t system_r; - logging_search_logs($1) + logging_list_logs($1) admin_pattern($1, sendmail_log_t) - files_search_tmp($1) + files_list_tmp($1) admin_pattern($1, sendmail_tmp_t) - files_search_pids($1) + files_list_pids($1) admin_pattern($1, sendmail_var_run_t) - files_search_spool($1) + files_list_spool($1) admin_pattern($1, mail_spool_t) ') diff --git a/policy/modules/services/setroubleshoot.if b/policy/modules/services/setroubleshoot.if index a7fbedc2..d9f5dbc2 100644 --- a/policy/modules/services/setroubleshoot.if +++ b/policy/modules/services/setroubleshoot.if @@ -136,8 +136,8 @@ interface(`setroubleshoot_fixit_dontaudit_leaks',` # interface(`setroubleshoot_admin',` gen_require(` - type setroubleshootd_t, setroubleshoot_var_log_t; - type setroubleshoot_var_lib_t, setroubleshoot_var_run_t; + type setroubleshootd_t, setroubleshoot_var_log_t, setroubleshoot_var_run_t; + type setroubleshoot_var_lib_t; ') allow $1 setroubleshootd_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/snmp.if b/policy/modules/services/snmp.if index 6aa68d80..bfdf1973 100644 --- a/policy/modules/services/snmp.if +++ b/policy/modules/services/snmp.if @@ -125,9 +125,8 @@ interface(`snmp_dontaudit_write_snmp_var_lib_files',` # interface(`snmp_admin',` gen_require(` - type snmpd_t, snmpd_log_t; + type snmpd_t, snmpd_log_t, snmpd_initrc_exec_t; type snmpd_var_lib_t, snmpd_var_run_t; - type snmpd_initrc_exec_t; ') allow $1 snmpd_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/snort.if b/policy/modules/services/snort.if index 215f4254..88ebedbc 100644 --- a/policy/modules/services/snort.if +++ b/policy/modules/services/snort.if @@ -50,11 +50,11 @@ interface(`snort_admin',` allow $2 system_r; admin_pattern($1, snort_etc_t) - files_search_etc($1) + files_list_etc($1) admin_pattern($1, snort_log_t) - logging_search_logs($1) + logging_list_logs($1) admin_pattern($1, snort_var_run_t) - files_search_pids($1) + files_list_pids($1) ') diff --git a/policy/modules/services/soundserver.if b/policy/modules/services/soundserver.if index 93fe7bf8..4a156336 100644 --- a/policy/modules/services/soundserver.if +++ b/policy/modules/services/soundserver.if @@ -33,9 +33,8 @@ interface(`soundserver_tcp_connect',` # interface(`soundserver_admin',` gen_require(` - type soundd_t, soundd_etc_t; + type soundd_t, soundd_etc_t, soundd_initrc_exec_t; type soundd_tmp_t, soundd_var_run_t; - type soundd_initrc_exec_t; ') allow $1 soundd_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/squid.if b/policy/modules/services/squid.if index dc4f590c..1d0c078e 100644 --- a/policy/modules/services/squid.if +++ b/policy/modules/services/squid.if @@ -206,8 +206,7 @@ interface(`squid_use',` interface(`squid_admin',` gen_require(` type squid_t, squid_cache_t, squid_conf_t; - type squid_log_t, squid_var_run_t; - type squid_initrc_exec_t; + type squid_log_t, squid_var_run_t, squid_initrc_exec_t; ') allow $1 squid_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/tuned.if b/policy/modules/services/tuned.if index 329f1390..752697f6 100644 --- a/policy/modules/services/tuned.if +++ b/policy/modules/services/tuned.if @@ -123,6 +123,6 @@ interface(`tuned_admin',` role_transition $2 tuned_initrc_exec_t system_r; allow $2 system_r; - files_search_pids($1) + files_list_pids($1) admin_pattern($1, tuned_var_run_t) ') diff --git a/policy/modules/services/ulogd.if b/policy/modules/services/ulogd.if index e3c66d8a..fd72fe88 100644 --- a/policy/modules/services/ulogd.if +++ b/policy/modules/services/ulogd.if @@ -131,12 +131,12 @@ interface(`ulogd_admin',` role_transition $2 ulogd_initrc_exec_t system_r; allow $2 system_r; - files_search_etc($1) + files_list_etc($1) admin_pattern($1, ulogd_etc_t) logging_list_logs($1) admin_pattern($1, ulogd_var_log_t) - files_search_usr($1) + files_list_usr($1) admin_pattern($1, ulogd_modules_t) ') diff --git a/policy/modules/services/varnishd.if b/policy/modules/services/varnishd.if index e0f819e9..fe5ce10a 100644 --- a/policy/modules/services/varnishd.if +++ b/policy/modules/services/varnishd.if @@ -58,7 +58,7 @@ interface(`varnishd_read_config',` ##################################### ## -## Read varnish lib files. +## Read varnish lib files. ## ## ## @@ -151,8 +151,8 @@ interface(`varnishd_manage_log',` # interface(`varnishd_admin_varnishlog',` gen_require(` - type varnishlog_t, varnishlog_initrc_exec_t; - type varnishlog_var_run_t, varnishlog_log_t; + type varnishlog_t, varnishlog_initrc_exec_t, varnishlog_log_t; + type varnishlog_var_run_t; ') allow $1 varnishlog_t:process { ptrace signal_perms }; @@ -163,7 +163,7 @@ interface(`varnishd_admin_varnishlog',` role_transition $2 varnishlog_initrc_exec_t system_r; allow $2 system_r; - files_search_pids($1) + files_list_pids($1) admin_pattern($1, varnishlog_var_run_t) logging_list_logs($1) @@ -202,15 +202,15 @@ interface(`varnishd_admin',` role_transition $2 varnishd_initrc_exec_t system_r; allow $2 system_r; - files_search_var_lib($1) + files_list_var_lib($1) admin_pattern($1, varnishd_var_lib_t) - files_search_etc($1) + files_list_etc($1) admin_pattern($1, varnishd_etc_t) - files_search_pids($1) + files_list_pids($1) admin_pattern($1, varnishd_var_run_t) - files_search_tmp($1) + files_list_tmp($1) admin_pattern($1, varnishd_tmp_t) ') diff --git a/policy/modules/services/virt.if b/policy/modules/services/virt.if index 0198dc2a..dbdc0e0d 100644 --- a/policy/modules/services/virt.if +++ b/policy/modules/services/virt.if @@ -597,7 +597,7 @@ interface(`virt_transition_svirt',` ## ## ## -## Domain allowed access. +## Domain to not audit. ## ## # diff --git a/policy/modules/services/vnstatd.if b/policy/modules/services/vnstatd.if index 85dba863..14f89062 100644 --- a/policy/modules/services/vnstatd.if +++ b/policy/modules/services/vnstatd.if @@ -1,15 +1,13 @@ - ## policy for vnstatd - ######################################## ## ## Execute a domain transition to run vnstatd. ## ## -## +## ## Domain allowed access. -## +## ## # interface(`vnstatd_domtrans',` @@ -20,16 +18,14 @@ interface(`vnstatd_domtrans',` domtrans_pattern($1, vnstatd_exec_t, vnstatd_t) ') - - ######################################## ## ## Execute a domain transition to run vnstat. ## ## -## +## ## Domain allowed access. -## +## ## # interface(`vnstatd_domtrans_vnstat',` @@ -75,7 +71,7 @@ interface(`vnstatd_read_lib_files',` ') files_search_var_lib($1) - read_files_pattern($1, vnstatd_var_lib_t, vnstatd_var_lib_t) + read_files_pattern($1, vnstatd_var_lib_t, vnstatd_var_lib_t) ') ######################################## @@ -95,7 +91,7 @@ interface(`vnstatd_manage_lib_files',` ') files_search_var_lib($1) - manage_files_pattern($1, vnstatd_var_lib_t, vnstatd_var_lib_t) + manage_files_pattern($1, vnstatd_var_lib_t, vnstatd_var_lib_t) ') ######################################## @@ -114,7 +110,7 @@ interface(`vnstatd_manage_lib_dirs',` ') files_search_var_lib($1) - manage_dirs_pattern($1, vnstatd_var_lib_t, vnstatd_var_lib_t) + manage_dirs_pattern($1, vnstatd_var_lib_t, vnstatd_var_lib_t) ') @@ -137,14 +133,12 @@ interface(`vnstatd_manage_lib_dirs',` # interface(`vnstatd_admin',` gen_require(` - type vnstatd_t; - type vnstatd_var_lib_t; + type vnstatd_t, vnstatd_var_lib_t; ') allow $1 vnstatd_t:process { ptrace signal_perms }; ps_process_pattern($1, vnstatd_t) - files_search_var_lib($1) + files_list_var_lib($1) admin_pattern($1, vnstatd_var_lib_t) - ') diff --git a/policy/modules/services/xserver.if b/policy/modules/services/xserver.if index 265c5df6..61cc0213 100644 --- a/policy/modules/services/xserver.if +++ b/policy/modules/services/xserver.if @@ -47,7 +47,7 @@ interface(`xserver_restricted_role',` manage_files_pattern($2, user_fonts_cache_t, user_fonts_cache_t) stream_connect_pattern($2, xserver_tmp_t, xserver_tmp_t, xserver_t) - allow $2 xserver_tmp_t:sock_file unlink; + allow $2 xserver_tmp_t:sock_file delete_sock_file_perms; files_search_tmp($2) # Communicate via System V shared memory. @@ -248,7 +248,7 @@ interface(`xserver_rw_session',` type xserver_t, xserver_tmpfs_t; ') - xserver_ro_session($1,$2) + xserver_ro_session($1, $2) allow $1 xserver_t:shm rw_shm_perms; allow $1 xserver_tmpfs_t:file rw_file_perms; ') @@ -276,7 +276,7 @@ interface(`xserver_non_drawing_client',` allow $1 self:x_gc { create setattr }; - allow $1 xdm_var_run_t:dir search; + allow $1 xdm_var_run_t:dir search_dir_perms; allow $1 xserver_t:unix_stream_socket connectto; allow $1 xextension_t:x_extension { query use }; @@ -318,7 +318,7 @@ interface(`xserver_user_client',` # for when /tmp/.X11-unix is created by the system allow $1 xdm_t:fd use; allow $1 xdm_t:fifo_file rw_inherited_fifo_file_perms; - allow $1 xdm_tmp_t:dir search; + allow $1 xdm_tmp_t:dir search_dir_perms; allow $1 xdm_tmp_t:sock_file { read write }; dontaudit $1 xdm_t:tcp_socket { read write }; @@ -363,7 +363,7 @@ interface(`xserver_user_client',` # template(`xserver_common_x_domain_template',` gen_require(` - type root_xdrawable_t; + type root_xdrawable_t, xdm_t, xserver_t; type xproperty_t, $1_xproperty_t; type xevent_t, client_xevent_t; type input_xevent_t, $1_input_xevent_t; @@ -380,7 +380,6 @@ template(`xserver_common_x_domain_template',` class x_screen { saver_setattr saver_hide saver_show }; class x_pointer { get_property set_property manage }; class x_keyboard { read manage }; - type xdm_t, xserver_t; ') ############################## @@ -479,8 +478,8 @@ template(`xserver_object_types_template',` # template(`xserver_user_x_domain_template',` gen_require(` - type xdm_t, xdm_tmp_t; - type xauth_home_t, iceauth_home_t, xserver_t, xserver_tmpfs_t; + type xdm_t, xdm_tmp_t, xserver_tmpfs_t; + type xauth_home_t, iceauth_home_t, xserver_t; ') allow $2 self:shm create_shm_perms; @@ -792,8 +791,7 @@ interface(`xserver_stream_connect_xdm',` files_search_tmp($1) files_search_pids($1) - stream_connect_pattern($1, xdm_tmp_t, xdm_tmp_t, xdm_t) - stream_connect_pattern($1, xdm_var_run_t, xdm_var_run_t, xdm_t) + stream_connect_pattern($1, { xdm_tmp_t xdm_var_run_t }, { xdm_tmp_t xdm_var_run_t }, xdm_t) ') ######################################## @@ -1549,7 +1547,7 @@ interface(`xserver_xdm_append_log',` ## ## # -template(`xserver_read_user_iceauth',` +interface(`xserver_read_user_iceauth',` gen_require(` type iceauth_home_t; ') diff --git a/policy/modules/services/zarafa.if b/policy/modules/services/zarafa.if index 78fc1043..4f2dde84 100644 --- a/policy/modules/services/zarafa.if +++ b/policy/modules/services/zarafa.if @@ -98,5 +98,5 @@ interface(`zarafa_stream_connect_server',` ') files_search_var_lib($1) - stream_connect_pattern($1, zarafa_server_t, zarafa_server_var_run_t, zarafa_server_t) + stream_connect_pattern($1, zarafa_server_var_run_t, zarafa_server_var_run_t, zarafa_server_t) ') diff --git a/policy/modules/services/zebra.if b/policy/modules/services/zebra.if index 5860687f..347f754a 100644 --- a/policy/modules/services/zebra.if +++ b/policy/modules/services/zebra.if @@ -61,8 +61,7 @@ interface(`zebra_stream_connect',` interface(`zebra_admin',` gen_require(` type zebra_t, zebra_tmp_t, zebra_log_t; - type zebra_conf_t, zebra_var_run_t; - type zebra_initrc_exec_t; + type zebra_conf_t, zebra_var_run_t, zebra_initrc_exec_t; ') allow $1 zebra_t:process { ptrace signal_perms }; diff --git a/policy/modules/services/zosremote.if b/policy/modules/services/zosremote.if index 1d24e1ed..13f0eef1 100644 --- a/policy/modules/services/zosremote.if +++ b/policy/modules/services/zosremote.if @@ -34,6 +34,7 @@ interface(`zosremote_domtrans',` ## Role allowed access. ## ## +## # interface(`zosremote_run',` gen_require(` diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if index 447aaec3..666a58f3 100644 --- a/policy/modules/system/init.if +++ b/policy/modules/system/init.if @@ -1207,12 +1207,7 @@ interface(`init_read_script_state',` ') kernel_search_proc($1) - read_files_pattern($1, initrc_t, initrc_t) - read_lnk_files_pattern($1, initrc_t, initrc_t) - list_dirs_pattern($1, initrc_t, initrc_t) - - # should move this to separate interface - allow $1 initrc_t:process getattr; + ps_process_pattern($1, initrc_t) ') ######################################## diff --git a/policy/modules/system/kdump.if b/policy/modules/system/kdump.if index 4198ff5f..672d323d 100644 --- a/policy/modules/system/kdump.if +++ b/policy/modules/system/kdump.if @@ -106,6 +106,6 @@ interface(`kdump_admin',` role_transition $2 kdump_initrc_exec_t system_r; allow $2 system_r; - files_search_etc($1) + files_list_etc($1) admin_pattern($1, kdump_etc_t) ')