Hide Forgot
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
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.
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?
I'm testing a new config file. I'll attach it in a couple days after I've seen more logrotates without warnings.
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.
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.
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.
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.
(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.
(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?
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.
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