Stop auditd from blowing up your disk when you just want to track one file

Security Hardening (SELinux/AppArmor/Auditd)

Stop auditd from blowing up your disk when you just want to track one file

Technical Briefing | 12/2/2026

We have all been there. You get a request to audit every single touch event on a sensitive config file, you drop a rule in audit.rules, and two days later the server is unresponsive because the log partition is full of useless metadata. Auditd is powerful, but it is not a set-and-forget tool. If you are not careful with your syscall filtering, you end up recording every single process that even looks at the file, creating a firehose of data that buries the actual security events you are hunting for.

Filtering out the noise before it hits the disk

The trap most admins fall into is adding a watch rule without a filter key or a specific process constraint. By default, auditd will capture every single read, write, attribute change, or execution related to that file path. You do not need to know that your backup script or monitoring agent touched that file every five minutes. You only care when something unexpected happens. Use the -k flag to tag your events so you can actually grep them later, and define a key that makes sense for your incident response workflow.

auditctl -w /etc/shadow -p wa -k shadow-monitor

  • The p flag restricts the audit to write and attribute change permissions, ignoring reads
  • The k flag allows you to filter specific audit events using ausearch without parsing the whole log
  • Always define an audit backlog limit in audit.rules to prevent the kernel from panicking if the buffer fills up

If you are struggling to keep your audit logs sane, stop watching files directly and start looking at specific syscalls wrapped in a process filter. Sometimes it is easier to audit the behavior of a specific UID or a parent PID instead of the object itself. Take a look at the rules currently generated by your distribution, then prune the ones that are purely informational. Next time you suspect a file integrity issue, verify your audit buffer status with auditctl -s before you spend hours hunting for logs that should have been there but were dropped because the daemon was choking on its own output.

Linux Admin Automation  |  © www.ngelinux.com  |  12/2/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted