Bug 529023

Summary: current policy prevents fail2ban from working correctly
Product: [Fedora] Fedora Reporter: Simo Sorce <ssorce>
Component: selinux-policy-targetedAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: steven.chapel
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.6.12-96.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-04-13 01:58:55 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:
Attachments:
Description Flags
policy to be able to run fail2ban none

Description Simo Sorce 2009-10-14 16:42:27 UTC
Created attachment 364779 [details]
policy to be able to run fail2ban

With the current policy version 3.6.12-83.fc11 fail2ban fails to work.

Attached find a custom local.te file that allows me to run fail2ban

Comment 1 Daniel Walsh 2009-10-14 16:52:54 UTC
#============= fail2ban_t ==============
allow fail2ban_t devlog_t:sock_file write;
allow fail2ban_t self:unix_dgram_socket { read write create connect };
allow fail2ban_t syslogd_t:unix_dgram_socket sendto;

I have never gotten a bugzilla showing fail2ban writing to syslog, is this a configuration that you setup?

#============= iptables_t ==============
allow iptables_t fail2ban_t:unix_dgram_socket { read write };
allow iptables_t fail2ban_t:unix_stream_socket { read write };

#============= system_mail_t ==============
allow system_mail_t fail2ban_t:unix_dgram_socket { read write };
allow system_mail_t fail2ban_t:unix_stream_socket { read write };

These four are caused by leaked file descriptors.  Are you sure you have the latest fail2ban?

Comment 2 Daniel Walsh 2009-10-14 16:55:54 UTC
Miroslav adding 

logging_send_syslog_msg(fail2ban_t)

Needs to be added.

Comment 3 Simo Sorce 2009-10-14 17:55:21 UTC
(In reply to comment #1)
> #============= fail2ban_t ==============
> allow fail2ban_t devlog_t:sock_file write;
> allow fail2ban_t self:unix_dgram_socket { read write create connect };
> allow fail2ban_t syslogd_t:unix_dgram_socket sendto;
> 
> I have never gotten a bugzilla showing fail2ban writing to syslog, is this a
> configuration that you setup?

Not that I know of. I am using the standard ssh target.

> #============= iptables_t ==============
> allow iptables_t fail2ban_t:unix_dgram_socket { read write };
> allow iptables_t fail2ban_t:unix_stream_socket { read write };
> 
> #============= system_mail_t ==============
> allow system_mail_t fail2ban_t:unix_dgram_socket { read write };
> allow system_mail_t fail2ban_t:unix_stream_socket { read write };
> 
> These four are caused by leaked file descriptors.  Are you sure you have the
> latest fail2ban?  

I am using 0.8.4-23.fc11 which seem to be the latest for F11.

Simo.

Comment 4 Miroslav Grepl 2009-10-16 12:03:36 UTC
(In reply to comment #2)
> Miroslav adding 
> 
> logging_send_syslog_msg(fail2ban_t)
> 
> Needs to be added.  

Fixed in selinux-policy-3.6.12-86.fc11

Comment 5 Steve Chapel 2010-03-23 16:48:43 UTC
I still have problems with SELinux preventing fail2ban from making changes to iptables and sendmail:

SELinux is preventing iptables (iptables_t) "read write" fail2ban_t. 
SELinux is preventing sendmail (system_mail_t) "read write" fail2ban_t. 

I have SELinux Version 3.6.12 Release 94.fc11 and fail2ban Version 0.8.4 Release  24.fc11. I installed fail2ban yesterday and didn't create or modify any rules.

Comment 6 Miroslav Grepl 2010-03-23 17:31:20 UTC
The problem is fail2ban is still leaking file descriptors. I will dontaudit it.

Fixed in selinux-policy-3.6.12-96.fc11

Comment 7 Fedora Update System 2010-03-24 12:47:59 UTC
selinux-policy-3.6.12-96.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.12-96.fc11

Comment 8 Fedora Update System 2010-03-25 22:34:07 UTC
selinux-policy-3.6.12-96.fc11 has been pushed to the Fedora 11 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: http://admin.fedoraproject.org/updates/selinux-policy-3.6.12-96.fc11

Comment 9 Fedora Update System 2010-04-13 01:58:39 UTC
selinux-policy-3.6.12-96.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.