Fail2ban denied again by selinux

Cristian Sava csava at central.ucv.ro
Wed Jun 19 05:51:19 UTC 2013


After recent updates fail2ban was broken again.

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

If you believe that python2.7 should be allowed write access on the
fail2ban directory 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:fail2ban_var_run_t:s0
Target Objects                fail2ban [ dir ]
Source                        fail2ban-client
Source Path                   /usr/bin/python2.7
Port                          <Unknown>
Host                          s198.xx.yy.ro
Source RPM Packages           python-2.7.5-1.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-52.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     s198.xx.yy.ro
Platform                      Linux s198.xx.yy.ro 3.9.5-301.fc19.x86_64
#1
                              SMP Tue Jun 11 19:39:38 UTC 2013 x86_64
x86_64
Alert Count                   35
First Seen                    2013-06-17 14:04:13 EEST
Last Seen                     2013-06-19 08:28:22 EEST
Local ID                      9d6fd1b8-250e-4425-b3e3-7590dc3bc1f1

Raw Audit Messages
type=AVC msg=audit(1371619702.236:67): avc:  denied  { write } for
pid=871 comm="fail2ban-client" name="fail2ban" dev="tmpfs" ino=11022
scontext=system_u:system_r:fail2ban_client_t:s0
tcontext=system_u:object_r:fail2ban_var_run_t:s0 tclass=dir


type=SYSCALL msg=audit(1371619702.236:67): arch=x86_64 syscall=access
success=no exit=EACCES a0=1ab48c0 a1=3 a2=32adbbbf88 a3=0 items=0 ppid=1
pid=871 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0
fsgid=0 ses=4294967295 tty=(none) 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,fail2ban_var_run_t,dir,write

****** Fixing .... ******

[cristi at s198 ~]$ systemctl status fail2ban.service
fail2ban.service - Fail2ban Service
   Loaded: loaded (/usr/lib/systemd/system/fail2ban.service; enabled)
   Active: failed (Result: start-limit) since Wed 2013-06-19 08:28:22
EEST; 1min 45s ago
  Process: 871 ExecStart=/usr/bin/fail2ban-client -x start (code=exited,
status=255)

Jun 19 08:28:21 s198.xx.yy.ro systemd[1]: fail2ban.service holdoff
tim....
Jun 19 08:28:21 s198.xx.yy.ro systemd[1]: Stopping Fail2ban Service...
Jun 19 08:28:21 s198.xx.yy.ro systemd[1]: Starting Fail2ban Service...
Jun 19 08:28:22 s198.xx.yy.ro systemd[1]: fail2ban.service: control
pr...5
Jun 19 08:28:22 s198.xx.yy.ro systemd[1]: Failed to start Fail2ban
Ser....
Jun 19 08:28:22 s198.xx.yy.ro systemd[1]: Unit fail2ban.service
entere....
Jun 19 08:28:22 s198.xx.yy.ro systemd[1]: fail2ban.service holdoff
tim....
Jun 19 08:28:22 s198.xx.yy.ro systemd[1]: Stopping Fail2ban Service...
Jun 19 08:28:22 s198.xx.yy.ro systemd[1]: Starting Fail2ban Service...
Jun 19 08:28:22 s198.xx.yy.ro systemd[1]: fail2ban.service: control
pr...5
[cristi at s198 ~]$ sudo grep fail2ban-client /var/log/audit/audit.log |
audit2allow -M myfail2ban_client
[sudo] password for cristi: 
******************** IMPORTANT ***********************
To make this policy package active, execute:

semodule -i myfail2ban_client.pp

[cristi at s198 ~]$ sudo semodule -i myfail2ban_client.pp
[cristi at s198 ~]$ sudo systemctl restart fail2ban.service
[cristi at s198 ~]$ systemctl status fail2ban.servicefail2ban.service -
Fail2ban Service
   Loaded: loaded (/usr/lib/systemd/system/fail2ban.service; enabled)
   Active: active (running) since Wed 2013-06-19 08:33:09 EEST; 7s ago
  Process: 2083 ExecStart=/usr/bin/fail2ban-client -x start
(code=exited, status=0/SUCCESS)
 Main PID: 2086 (fail2ban-server)
   CGroup: name=systemd:/system/fail2ban.service
           └─2086 /usr/bin/python /usr/bin/fail2ban-server -b
-s /var/run/fai...

Jun 19 08:33:09 s198.xx.yy.ro fail2ban-server[2086]:
fail2ban.server : ...
Jun 19 08:33:09 s198.xx.yy.ro fail2ban-server[2086]:
fail2ban.jail   : ...
Jun 19 08:33:09 s198.xx.yy.ro fail2ban-server[2086]:
fail2ban.jail   : ...
Jun 19 08:33:09 s198.xx.yy.ro fail2ban-server[2086]:
fail2ban.jail   : ...
Jun 19 08:33:09 s198.xx.yy.ro fail2ban-server[2086]:
fail2ban.filter : ...
Jun 19 08:33:09 s198.xx.yy.ro fail2ban-server[2086]:
fail2ban.filter : ...
Jun 19 08:33:09 s198.xx.yy.ro fail2ban-server[2086]:
fail2ban.filter : ...
Jun 19 08:33:09 s198.xx.yy.ro fail2ban.actions[2086]: INFO   Set
banTim...
Jun 19 08:33:09 s198.xx.yy.ro fail2ban-server[2086]:
fail2ban.jail   : ...
Jun 19 08:33:09 s198.xx.yy.ro systemd[1]: Started Fail2ban Service.

Cristian Sava





More information about the test mailing list