RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1133248 - fail2ban needs to be able to read the journal
Summary: fail2ban needs to be able to read the journal
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.0
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On: 1133251
Blocks: 1132514
TreeView+ depends on / blocked
 
Reported: 2014-08-23 18:55 UTC by Orion Poplawski
Modified: 2015-03-05 10:44 UTC (History)
2 users (show)

Fixed In Version: selinux-policy-3.13.1-2.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 10:44:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1114821 0 unspecified CLOSED fail2ban selinux denial 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2015:0458 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2015-03-05 15:17:00 UTC

Internal Links: 1114821

Description Orion Poplawski 2014-08-23 18:55:49 UTC
Description of problem:

With fail2ban 0.9 it reads the journal by default, but cannot:

type=AVC msg=audit(1408819296.642:22362): avc:  denied  { read } for  pid=14066 comm="fail2ban-server" name="journal" dev="tmpfs" ino=6280 scontext=system_u:system_r:fail2ban_t:s0 tcontext=system_u:object_r:syslogd_var_run_t:s0 tclass=dir

Version-Release number of selected component (if applicable):
selinux-policy-3.12.1-153.el7_0.10.noarch

Comment 2 Miroslav Grepl 2014-08-25 10:17:45 UTC
commit 2b6acf049dfae68d9c40342ad0bc676a52f41ce9
Author: Miroslav Grepl <mgrepl>
Date:   Mon Aug 25 12:15:47 2014 +0200

    fail2ban 0.9 reads the journal by default.

Comment 4 Orion Poplawski 2014-11-06 16:33:53 UTC
Any chance this could get pushed to http://people.redhat.com/dwalsh/SELinux/RHEL7 ?

Comment 5 Milos Malik 2014-11-06 20:23:18 UTC
The AVC mentioned in comment#0 was caught in enforcing mode, right? What AVCs do you see in permissive mode?

Comment 6 Orion Poplawski 2014-11-06 20:30:19 UTC
In permissive:

type=AVC msg=audit(1415305749.900:35204): avc:  denied  { read } for  pid=9420 comm="fail2ban-server" name="journal" dev="tmpfs" ino=6307 scontext=system_u:system_r:fail2ban_t:s0 tcontext=system_u:object_r:syslogd_var_run_t:s0 tclass=dir
type=AVC msg=audit(1415305749.900:35205): avc:  denied  { read } for  pid=9420 comm="fail2ban-server" name="system.journal" dev="tmpfs" ino=8587718 scontext=system_u:system_r:fail2ban_t:s0 tcontext=system_u:object_r:syslogd_var_run_t:s0 tclass=file
type=AVC msg=audit(1415305749.900:35205): avc:  denied  { open } for  pid=9420 comm="fail2ban-server" path="/run/log/journal/9ed6ab66be5d88d1aae4c4e953abd471/system.journal" dev="tmpfs" ino=8587718 scontext=system_u:system_r:fail2ban_t:s0 tcontext=system_u:object_r:syslogd_var_run_t:s0 tclass=file
type=AVC msg=audit(1415305749.900:35206): avc:  denied  { getattr } for  pid=9420 comm="fail2ban-server" path="/run/log/journal/9ed6ab66be5d88d1aae4c4e953abd471/system.journal" dev="tmpfs" ino=8587718 scontext=system_u:system_r:fail2ban_t:s0 tcontext=system_u:object_r:syslogd_var_run_t:s0 tclass=file

Comment 7 Miroslav Grepl 2014-11-07 09:44:12 UTC
#============= fail2ban_t ==============

#!!!! This avc is allowed in the current policy
allow fail2ban_t syslogd_var_run_t:dir read;

#!!!! This avc is allowed in the current policy
allow fail2ban_t syslogd_var_run_t:file { read getattr open };


We have fixes in the latest builds.

Comment 9 Jason Bradley Nance 2014-11-25 02:15:18 UTC
Note sure what the final changes are from this report but here are the additions I had to make to get fail2ban to be fully functional for the ssh jails on selinux-policy-targeted-3.12.1-153.el7_0.11.noarch:

require {
        type fail2ban_client_exec_t;
        type logrotate_t;
        class file { read execute open execute_no_trans };
}

#============= logrotate_t ==============
allow logrotate_t fail2ban_client_exec_t:file { read execute open execute_no_trans };

require {
        type syslogd_var_run_t;
        type fail2ban_t;
        class dir read;
}

#============= fail2ban_t ==============
allow fail2ban_t syslogd_var_run_t:dir read;

require {
        type syslogd_var_run_t;
        type fail2ban_t;
        class file { read open getattr };
}

#============= fail2ban_t ==============
allow fail2ban_t syslogd_var_run_t:file { read open getattr };

Comment 10 Orion Poplawski 2014-11-26 16:14:59 UTC
No denials seen with 3.13.1-10.el7

Comment 12 errata-xmlrpc 2015-03-05 10:44:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0458.html


Note You need to log in before you can comment on or make changes to this bug.