Bug 1304334 - aide rules need RHEL7 update
aide rules need RHEL7 update
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: aide (Show other bugs)
Unspecified Linux
high Severity high
: rc
: ---
Assigned To: Daniel Kopeček
Karel Srot
Depends On:
  Show dependency treegraph
Reported: 2016-02-03 05:51 EST by Steve Grubb
Modified: 2016-11-04 03:34 EDT (History)
3 users (show)

See Also:
Fixed In Version: aide-0.15.1-10.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-11-04 03:34:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Steve Grubb 2016-02-03 05:51:43 EST
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):
Comment 2 Steve Grubb 2016-02-15 13:58 EST
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 01:43:55 EST
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 10:13:53 EST
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 16:05 EST
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 10:31:23 EST
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 03:07:37 EST
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 07:36:21 EDT
From config file proposed in #c6 I have filtered out all lines with path terminated with '$' or '/', this is what remains:


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


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 07:40:25 EDT
(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 03:10:45 EDT
(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 10:37:25 EDT
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 03:34:42 EDT
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.


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