From: konrad.azzopardi@gmail.com (Konrad Azzopardi) Date: Sun, 26 Oct 2008 19:43:44 +0100 Subject: [refpolicy] Help with policy writing Message-ID: To: refpolicy@oss.tresys.com List-Id: refpolicy.oss.tresys.com Dear all, To gain an understanding of SELinux I am trying to write a policy in Fedora 9 and try to understand as I go along. I need to write a policy for "samhain" , an integrity checker. I looked for tripwire refpolicy to get some inspiration. {attached pls find policy files that I wrote} I ran in permissive mode and although I am getting a lot of errors, what is worrying me is the first error I am getting {see below}, am I missing some trivial definition ? samhain is pretty standard, an init file, a config file, a pid file, and library files. Thanks Summary: SELinux is preventing samhain (samhain_t) "execute_no_trans" to /usr/local/sbin/samhain (samhain_exec_t). Detailed Description: [SELinux is in permissive mode, the operation would have been denied but was permitted due to permissive mode.] SELinux denied access requested by samhain. It is not expected that this access is required by samhain and this access may signal an intrusion attempt. It is also possible that the specific version or configuration of the application is causing it to require additional access. Allowing Access: Sometimes labeling problems can cause SELinux denials. You could try to restore the default system file context for /usr/local/sbin/samhain, restorecon -v '/usr/local/sbin/samhain' If this does not work, there is currently no automatic way to allow this access. Instead, you can generate a local policy module to allow this access - see FAQ (http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Or you can disable SELinux protection altogether. Disabling SELinux protection is not recommended. Please file a bug report (http://bugzilla.redhat.com/bugzilla/enter_bug.cgi) against this package. Additional Information: Source Context unconfined_u:system_r:samhain_t:s0 Target Context system_u:object_r:samhain_exec_t:s0 Target Objects /usr/local/sbin/samhain [ file ] Source samhain Source Path /usr/local/sbin/samhain Port Host MALTA Source RPM Packages Target RPM Packages Policy RPM selinux-policy-3.3.1-99.fc9 Selinux Enabled True Policy Type targeted MLS Enabled True Enforcing Mode Permissive Plugin Name catchall_file Host Name MALTA Platform Linux MALTA 2.6.26.5-45.fc9.i686 #1 SMP Sat Sep 20 03:45:00 EDT 2008 i686 i686 Alert Count 1 First Seen Sun 26 Oct 2008 07:19:12 PM CET Last Seen Sun 26 Oct 2008 07:19:12 PM CET Local ID 4b802823-267f-4b94-bafc-c8050310203b Line Numbers Raw Audit Messages host=MALTA type=AVC msg=audit(1225045152.583:1290): avc: denied { execute_no_trans } for pid=7159 comm="samhain" path="/usr/local/sbin/samhain" dev=dm-0 ino=7552222 scontext=unconfined_u:system_r:samhain_t:s0 tcontext=system_u:object_r:samhain_exec_t:s0 tclass=file host=MALTA type=SYSCALL msg=audit(1225045152.583:1290): arch=40000003 syscall=11 success=yes exit=0 a0=b8f57000 a1=bfc3cc48 a2=bfc3cfa0 a3=bfc3cd4c items=0 ppid=7158 pid=7159 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=1 comm="samhain" exe="/usr/local/sbin/samhain" subj=unconfined_u:system_r:samhain_t:s0 key=(null) -------------- next part -------------- A non-text attachment was scrubbed... Name: samhain.fc Type: application/octet-stream Size: 547 bytes Desc: not available Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20081026/c1d65872/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: samhain.if Type: application/octet-stream Size: 48 bytes Desc: not available Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20081026/c1d65872/attachment-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: samhain.te Type: application/octet-stream Size: 1773 bytes Desc: not available Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20081026/c1d65872/attachment-0002.obj