Bug 640796

Summary: SELinux is preventing /usr/bin/python "dac_override" access .
Product: [Fedora] Fedora Reporter: Russell Odom <russ+bugzilla-redhat>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:904e9f7454c0082e3ce2850f36bd807b6b9c4d39af5fee78124108be4b62b929
Fixed In Version: selinux-policy-3.7.19-65.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-19 07:06:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Russell Odom 2010-10-06 19:44:52 UTC
Summary:

SELinux is preventing /usr/bin/python "dac_override" access .

Detailed Description:

[fail2ban-server has a permissive type (fail2ban_t). This access was not
denied.]

SELinux denied access requested by fail2ban-server. It is not expected that this
access is required by fail2ban-server 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:

You can generate a local policy module to allow this access - see FAQ
(http://docs.fedoraproject.org/selinux-faq-fc5/#id2961385) Please file a bug
report.

Additional Information:

Source Context                unconfined_u:system_r:fail2ban_t:s0
Target Context                unconfined_u:system_r:fail2ban_t:s0
Target Objects                None [ capability ]
Source                        fail2ban-server
Source Path                   /usr/bin/python
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           python-2.6.4-27.fc13
Target RPM Packages           
Policy RPM                    selinux-policy-3.7.19-62.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.34.7-56.fc13.x86_64 #1 SMP Wed Sep 15 03:36:55
                              UTC 2010 x86_64 x86_64
Alert Count                   2
First Seen                    Wed 06 Oct 2010 20:42:58 BST
Last Seen                     Wed 06 Oct 2010 20:42:58 BST
Local ID                      0a7f53a3-67f5-43ad-b8dc-696ecd7581cb
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1286394178.876:3653): avc:  denied  { dac_override } for  pid=5658 comm="fail2ban-server" capability=1  scontext=unconfined_u:system_r:fail2ban_t:s0 tcontext=unconfined_u:system_r:fail2ban_t:s0 tclass=capability

node=(removed) type=AVC msg=audit(1286394178.876:3653): avc:  denied  { dac_read_search } for  pid=5658 comm="fail2ban-server" capability=2  scontext=unconfined_u:system_r:fail2ban_t:s0 tcontext=unconfined_u:system_r:fail2ban_t:s0 tclass=capability

node=(removed) type=SYSCALL msg=audit(1286394178.876:3653): arch=c000003e syscall=2 success=yes exit=4294967424 a0=ef4a20 a1=0 a2=1b6 a3=0 items=0 ppid=1 pid=5658 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=50 comm="fail2ban-server" exe="/usr/bin/python" subj=unconfined_u:system_r:fail2ban_t:s0 key=(null)



Hash String generated from  catchall,fail2ban-server,fail2ban_t,fail2ban_t,capability,dac_override
audit2allow suggests:

#============= fail2ban_t ==============
allow fail2ban_t self:capability { dac_read_search dac_override };

Comment 1 Russell Odom 2010-10-06 19:46:38 UTC
This occurred when restarting fail2ban.

Comment 2 Russell Odom 2010-10-06 21:05:15 UTC
OK, an update on this, it only seems to occur when I enable a jail which tries to read /var/log/exim/reject.log:

[exim-spammers]
enabled  = true
filter   = exim-spammers
action   = iptables-allports[name=exim-spammers]
           mynetwatchman[port=25]
	   dshield[port=25]
	   complain[logpath=/var/log/exim/main.log]
logpath  = /var/log/exim/reject.log
maxretry = 1

This is not really much different to any of my other jails, which work fine.

In fail2ban.log, I see messages like:
2010-10-06 21:58:47,426 fail2ban.comm   : WARNING Invalid command: ['set', 'exim-spammers', 'addlogpath', '/var/log/exim/reject.log']

Comment 3 Miroslav Grepl 2010-10-07 08:07:55 UTC
Could you add your output of the following command

# ls -lZ /var/log/exim/reject.log


dac_override means that a root process is trying to access a file/dir which
root does not over permission to look at based on the permissions.

Comment 4 Russell Odom 2010-10-07 10:51:32 UTC
[root@gigalith ~]# ls -lZ /var/log/exim/reject.log
-rw-r-----. exim exim unconfined_u:object_r:exim_log_t:s0 /var/log/exim/reject.log

Comment 5 Miroslav Grepl 2010-10-07 11:05:28 UTC
Now it's clear.

Dan,
I think we should add

allow fail2ban self:capability { dac_read_search dac_override };

For reading all log files.

Comment 6 Daniel Walsh 2010-10-07 12:29:09 UTC
Ok.

Comment 7 Miroslav Grepl 2010-10-08 08:29:29 UTC
Fixed in selinux-policy-3.7.19-65.fc13

Comment 8 Fedora Update System 2010-10-08 10:31:45 UTC
selinux-policy-3.7.19-65.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/selinux-policy-3.7.19-65.fc13

Comment 9 Russell Odom 2010-10-08 15:04:15 UTC
Have installed selinux-policy-3.7.19-65.fc13.noarch and selinux-policy-targeted-3.7.19-65.fc13.noarch from koji and these appear to fix the problem for me.

Comment 10 Daniel Walsh 2010-10-08 15:51:23 UTC
Update karma please

Comment 11 Fedora Update System 2010-10-08 20:48:15 UTC
selinux-policy-3.7.19-65.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/selinux-policy-3.7.19-65.fc13

Comment 12 Fedora Update System 2010-10-19 07:05:00 UTC
selinux-policy-3.7.19-65.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.