Bug 829930

Summary: SELinux is preventing /usr/bin/python2.7 from 'connectto' accesses on the unix_stream_socket /run/fail2ban/fail2ban.sock.
Product: [Fedora] Fedora Reporter: frywalker <fry.futurateam>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:bbf18a9d428a371ac5f71fc41179876088754430a0c9846b7b3dc337f78d15c9
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-22 08:42:15 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 frywalker 2012-06-07 20:10:02 UTC
libreport version: 2.0.10
executable:     /usr/bin/python2.7
hashmarkername: setroubleshoot
kernel:         3.3.7-1.fc17.x86_64
time:           jeu. 07 juin 2012 22:09:48 CEST

description:
:SELinux is preventing /usr/bin/python2.7 from 'connectto' accesses on the unix_stream_socket /run/fail2ban/fail2ban.sock.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that python2.7 should be allowed connectto access on the fail2ban.sock unix_stream_socket 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                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
:                              023
:Target Objects                /run/fail2ban/fail2ban.sock [ unix_stream_socket ]
:Source                        fail2ban-client
:Source Path                   /usr/bin/python2.7
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           python-2.7.3-6.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-128.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.3.7-1.fc17.x86_64 #1 SMP Mon
:                              May 21 22:32:19 UTC 2012 x86_64 x86_64
:Alert Count                   1
:First Seen                    jeu. 07 juin 2012 20:27:34 CEST
:Last Seen                     jeu. 07 juin 2012 20:27:34 CEST
:Local ID                      b21f9f6d-04b3-401c-aeba-d3126adc9065
:
:Raw Audit Messages
:type=AVC msg=audit(1339093654.419:79996): avc:  denied  { connectto } for  pid=18788 comm="fail2ban-client" path="/run/fail2ban/fail2ban.sock" scontext=system_u:system_r:fail2ban_client_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=unix_stream_socket
:
:
:type=SYSCALL msg=audit(1339093654.419:79996): arch=x86_64 syscall=connect success=no exit=EACCES a0=3 a1=7fff99f91e00 a2=21 a3=6e75722f7261762f items=0 ppid=18783 pid=18788 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=fail2ban-client exe=/usr/bin/python2.7 subj=system_u:system_r:fail2ban_client_t:s0 key=(null)
:
:Hash: fail2ban-client,fail2ban_client_t,unconfined_t,unix_stream_socket,connectto
:
:audit2allowunable to open /sys/fs/selinux/policy:  Permission denied
:
:
:audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
:
:

Comment 1 Daniel Walsh 2012-06-07 21:19:27 UTC
This looks like you are running the fail2ban server as unconfined_t?  Did you run it outside of the init script?

Comment 2 Miroslav Grepl 2012-06-22 08:42:15 UTC
Please reopen the bug if you still see this. I believe you ran in without init script as Dan mentioned.