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 1304334 - aide rules need RHEL7 update
Summary: aide rules need RHEL7 update
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: aide
Version: 7.2
Hardware: Unspecified
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Daniel Kopeček
QA Contact: Karel Srot
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-03 10:51 UTC by Steve Grubb
Modified: 2016-11-04 07:34 UTC (History)
3 users (show)

Fixed In Version: aide-0.15.1-10.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 07:34:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed config file (6.84 KB, text/plain)
2016-02-15 18:58 UTC, Steve Grubb
no flags Details
updated aide config file (7.16 KB, text/plain)
2016-03-01 21:05 UTC, Steve Grubb
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2486 0 normal SHIPPED_LIVE aide bug fix update 2016-11-03 14:10:05 UTC

Description Steve Grubb 2016-02-03 10:51:43 UTC
Description of problem:
The aide configuration file has 2 issues. When the system is just idling and nothing is happening, several files are updated as part of house-keeping. Aide is mistakenly pointing them out as suspicious changes:

File: /etc/aide.conf
File: /var/log/audit/audit.log
File: /var/log/boot.log
File: /var/log/btmp
File: /var/log/cron
File: /var/log/dmesg
File: /var/log/dmesg.old
File: /var/log/httpd/error_log
File: /var/log/httpd/ssl_access_log
File: /var/log/httpd/ssl_error_log
File: /var/log/httpd/ssl_request_log
File: /var/log/maillog
File: /var/log/messages
File: /var/log/secure
File: /var/log/spooler
File: /var/run/utmp

The problem is that an aide scan with changes gets reported as a failure in the audit logs:

type=ANOM_RBAC_INTEGRITY_FAIL msg=audit(1454495991.881:274231): pid=25364 uid=0 auid=1000 ses=181 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='added=15 removed=0 changed=19 exe="/usr/sbin/aide" hostname=? addr=? terminal=pts/0 res=failed'

Additionally, there are new subsystems in RHEL7 that need watching like /etc/systemd/ as well as deprecating things like /etc/host which systemd has obsoleted.

Version-Release number of selected component (if applicable):
aide-0.15.1-9.el7

Comment 2 Steve Grubb 2016-02-15 18:58:37 UTC
Created attachment 1127405 [details]
Proposed config file

The attached config file is what I am testing as a solution. I place it here in case others want to try it out.

Comment 3 Karel Srot 2016-02-23 06:43:55 UTC
Hi Steve,
looking at the proposed config file, I would propose to terminate all
directory paths with / and all file paths with $ in order to ensure that we are really matching only the required file/path. What is your opinion?

Comment 5 Steve Grubb 2016-02-24 15:13:53 UTC
I'm testing a new config file. I'll attach it in a couple days after I've seen more logrotates without warnings.

Comment 6 Steve Grubb 2016-03-01 21:05:59 UTC
Created attachment 1132037 [details]
updated aide config file

This new config file should meet the changes asked for. It has survived daily, weekly, and monthly cron jobs.

Comment 8 Steve Grubb 2016-03-02 15:31:23 UTC
One important issue that I found in testing is that if a file check is more in depth than a directory check, then the file check needs to come before the directory check. For example, if you just check perms in /etc but want to do a sha256 hash of /etc/hosts, then the hosts file check has to come before /etc or you will only get the perm check and not the content check.

If this can be independently verified, it should probably be mentioned in the release notes.

Comment 9 Karel Srot 2016-03-04 08:07:37 UTC
Hi Steve,
I can confirm your findings. This behaviour is both with v0.14 and v0.15.1. But it seems to me that such behaviour is quite strange, given that even the official documentation is listing file paths 'from top to bottom'. I have asked about the it on the aide user mailing list so let's see what would be the answer.

Comment 12 Karel Srot 2016-06-29 11:36:21 UTC
From config file proposed in #c6 I have filtered out all lines with path terminated with '$' or '/', this is what remains:

!/etc/.*~
/etc/sudoers
/root/\..*
!/var/log/aide.log
!/var/log/and-httpd
!/var/log/sa

Would it make sense to terminate with $ or / at least some of those paths too? E.g.

/etc/sudoers$
!/var/log/aide.log$
!/var/log/sa/

Regarding
!/var/log/and-httpd
I am not sure whether this is supposed to be file or directory. Btw, is this filepath real? The only occurrences found by google were related to aide config file.

Comment 13 Karel Srot 2016-06-29 11:40:25 UTC
(In reply to Karel Srot from comment #12)
> !/var/log/aide.log$

OK, probably not for that ^^ one as it is supposed to be rotated and we probably don't want to track rotated logs.

Comment 15 Daniel Kopeček 2016-07-18 07:10:45 UTC
(In reply to Karel Srot from comment #12)
> Regarding
> !/var/log/and-httpd
> I am not sure whether this is supposed to be file or directory. Btw, is this
> filepath real? The only occurrences found by google were related to aide
> config file.

I have no idea what that directory is. Looks like a typo. I would say that Steve meant /var/log/httpd. Steve, could you please confirm?

Comment 16 Steve Grubb 2016-07-18 14:37:25 UTC
I would say that its a typo. Should probably be /var/log/httpd. The sentence above it also has a typo. It should be "same" rather than "sa". This is a pretty old typo looking at the Fedora git history.

Comment 20 errata-xmlrpc 2016-11-04 07:34:42 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-2016-2486.html


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