Introduction
The Linux audit daemon (auditd) records security-relevant events to /var/log/audit/audit.log. When the partition containing the audit log fills up, auditd stops recording events. Depending on the disk_full_action configuration, it may halt the system, suspend logging, or execute a custom action. This creates a security compliance gap where critical events go unrecorded.
Symptoms
systemctl status auditdshowsinactive (dead)orfailedausearch -m USER_LOGINreturns no recent results/var/log/audit/audit.logis at or near filesystem capacitydmesgshowsaudit: backlog limit exceeded- Applications may hang if
auditdis inHALTmode and kernel is blocking syscalls
Common Causes
- Audit log retention policy not configured, logs grow unbounded
- High volume of audit rules generating excessive events
- Log rotation not configured or
logrotatenot running - Separate
/var/log/auditpartition too small for the workload max_log_fileandmax_log_file_actionnot set correctly
Step-by-Step Fix
- 1.Check auditd status and disk usage:
- 2.```bash
- 3.sudo systemctl status auditd
- 4.df -h /var/log/audit
- 5.ls -lh /var/log/audit/audit.log
- 6.sudo auditctl -s
- 7.
` - 8.Free space by compressing or archiving old logs:
- 9.```bash
- 10.cd /var/log/audit
- 11.sudo gzip audit.log
- 12.sudo mv audit.log.gz audit.log.$(date +%Y%m%d).gz
- 13.# Restart auditd to create a fresh log file
- 14.sudo systemctl restart auditd
- 15.
` - 16.Configure log rotation in auditd.conf:
- 17.```bash
- 18.sudo nano /etc/audit/auditd.conf
- 19.
` - 20.Set:
- 21.```ini
- 22.max_log_file = 100
- 23.max_log_file_action = ROTATE
- 24.num_logs = 10
- 25.space_left = 2000
- 26.space_left_action = SYSLOG
- 27.admin_space_left = 1000
- 28.admin_space_left_action = SUSPEND
- 29.disk_full_action = SUSPEND
- 30.disk_error_action = SUSPEND
- 31.
` - 32.Reload auditd configuration:
- 33.```bash
- 34.sudo service auditd rotate
- 35.sudo systemctl restart auditd
- 36.sudo auditctl -s
- 37.
` - 38.Reduce audit rule volume if generating too many events:
- 39.```bash
- 40.sudo auditctl -l
- 41.# Remove overly broad rules like -w /etc -p wa
- 42.sudo auditctl -D # Clear all rules
- 43.# Add targeted rules instead
- 44.sudo auditctl -w /etc/shadow -p wa -k identity
- 45.sudo auditctl -w /etc/sudoers -p wa -k sudoers
- 46.
` - 47.Move audit log to a larger partition or remote server:
- 48.```bash
- 49.# Configure remote logging via audispd-plugins
- 50.sudo apt install audispd-plugins
- 51.sudo nano /etc/audisp/plugins.d/syslog.conf
- 52.
`
Prevention
- Set
max_log_fileandnum_logsbased on available disk space and compliance requirements - Use a dedicated partition for
/var/log/auditwith adequate sizing (at least 10-20GB) - Monitor audit log disk usage with automated alerts at 70% capacity
- Configure
space_left_action = EMAILfor proactive notification - Ship audit logs to a centralized SIEM to avoid local storage constraints