Bug 734423

Summary: SELinux is preventing /usr/bin/python from 'read' accesses on the lnk_file /var/www/html.
Product: [Fedora] Fedora Reporter: eric
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 15CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:6058b956b6d68abadc0071c0ee14d0837d05de85b355e67fbf0d4cb3c5970244
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-07 15:03:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description eric 2011-08-30 11:15:52 UTC
SELinux is preventing /usr/bin/python from 'read' accesses on the lnk_file /var/www/html.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that python should be allowed read access on the html lnk_file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep fail2ban-client /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:fail2ban_client_t:s0
Target Context                system_u:object_r:httpd_sys_content_t:s0
Target Objects                /var/www/html [ lnk_file ]
Source                        fail2ban-client
Source Path                   /usr/bin/python
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           python-2.7.1-7.fc15
Target RPM Packages           httpd-2.2.19-2.fc15
Policy RPM                    selinux-policy-3.9.16-35.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux localhost.localdomain 2.6.40.3-0.fc15.x86_64
                              #1 SMP Tue Aug 16 04:10:59 UTC 2011 x86_64 x86_64
Alert Count                   5
First Seen                    Tue 26 Jul 2011 06:35:25 AM EDT
Last Seen                     Tue 30 Aug 2011 07:11:47 AM EDT
Local ID                      b463cc62-c80d-410a-8e36-f5492f3f38ed

Raw Audit Messages
type=AVC msg=audit(1314702707.881:51): avc:  denied  { read } for  pid=2195 comm="fail2ban-client" name="html" dev=dm-2 ino=10356107 scontext=system_u:system_r:fail2ban_client_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=lnk_file


type=SYSCALL msg=audit(1314702707.881:51): arch=x86_64 syscall=lstat success=no exit=ENOENT a0=1104650 a1=7fffb8701dd0 a2=7fffb8701dd0 a3=6d74682f items=0 ppid=2188 pid=2195 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(removed) ses=4294967295 comm=fail2ban-client exe=/usr/bin/python subj=system_u:system_r:fail2ban_client_t:s0 key=(null)

Hash: fail2ban-client,fail2ban_client_t,httpd_sys_content_t,lnk_file,read

audit2allow

#============= fail2ban_client_t ==============
allow fail2ban_client_t httpd_sys_content_t:lnk_file read;

audit2allow -R

#============= fail2ban_client_t ==============
allow fail2ban_client_t httpd_sys_content_t:lnk_file read;

Comment 1 Daniel Walsh 2011-08-30 16:02:51 UTC
This looks like you did local customization

/var/www/html is not a link on a normal system.