commit:     2ea4214ce55c1f5dfa9a23bd74e6b8bc01db9611
Author:     cgzones <cgzones <AT> googlemail <DOT> com>
AuthorDate: Mon Feb 20 13:20:00 2017 +0000
Commit:     Sven Vermeulen <swift <AT> gentoo <DOT> org>
CommitDate: Thu Mar  2 10:16:40 2017 +0000
URL:        
https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=2ea4214c

add corecmd_check_exec_bin_files()

useful for monit

 policy/modules/kernel/corecommands.if | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/policy/modules/kernel/corecommands.if 
b/policy/modules/kernel/corecommands.if
index 60c1feb7..d7ccec3a 100644
--- a/policy/modules/kernel/corecommands.if
+++ b/policy/modules/kernel/corecommands.if
@@ -218,6 +218,25 @@ interface(`corecmd_dontaudit_getattr_bin_files',`
 
 ########################################
 ## <summary>
+##     Check if files in bin directories are executable (DAC-wise)
+## </summary>
+## <param name="domain">
+##     <summary>
+##     Domain allowed access.
+##     </summary>
+## </param>
+#
+interface(`corecmd_check_exec_bin_files',`
+       gen_require(`
+               type bin_t;
+       ')
+
+       allow $1 bin_t:dir search_dir_perms;
+       allow $1 bin_t:file { execute getattr };
+')
+
+########################################
+## <summary>
 ##     Read files in bin directories.
 ## </summary>
 ## <param name="domain">

Reply via email to