How to prevent logging USER_AUTH and USER_LOGIN events with auditd

auditd

I am trying to log changes to a file system using auditd, but I am seeing also many other things being logged, for example all failed SSH logging attempts (USER_AUTH and USER_LOGIN events). How can I prevent them from being logged? When I do auditctl -l I see only the path watching rules and no other rules.

Best Answer

For things you don't want in the audit logs, you can add them to an exclude filter. So if you want to exclude logins, you can do

[root@finch jenny]# auditctl -a exclude,never -F msgtype=USER_AUTH
[root@finch jenny]# auditctl -a exclude,never -F msgtype=LOGIN

will stop logging of all logins, successful or not. For more information about how to create these rules, see the man page for auditctl.

However, you might simply use aureport to search for the logs you do want, instead of blocking the ones you don't.