auditd.conf — Audit log retention
auditd.conf controls the userspace audit daemon, not the kernel audit rule set. log_file identifies the log destination; max_log_file is a size threshold in megabytes; max_log_file_action determines the action at the threshold. num_logs limits rotated files for rotation behavior. Disk-space and disk-error policies are separate and can affect availability and evidence retention. The values shown are illustrative, not a compliance recommendation. Check the installed audit version, available filesystem space, log permissions and organizational retention requirements; avoid choosing shutdown or suspend actions without impact analysis. Rules and daemon settings have distinct loaders. The example extracts fields from a private file without touching audit logs. Apply approved changes via the supported daemon management procedure in a VM; confirm event delivery, disk behavior and retention. Restore policy on failure; a configuration rollback cannot recover deleted evidence.
Formal Syntax & Structure
log_file = /var/log/audit/audit.logmax_log_file = 32max_log_file_action = ROTATEnum_logs = 5Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| log_file | directive or field | Audit log destination |
| max_log_file | directive or field | Per-file threshold in MB |
| max_log_file_action | directive or field | Action when threshold reached |
| num_logs | directive or field | Retention count for rotation |
Return Value
Daemon configuration, not evidence of logging.
Working Example
set -eud=$(mktemp -d)trap 'rm -rf -- "$d"' EXITcat > "$d/auditd.conf" <<'EOF'log_file = /var/log/audit/audit.logmax_log_file = 32max_log_file_action = ROTATEnum_logs = 5EOFawk -F ' = ' '$1=="max_log_file" || $1=="max_log_file_action" {print $1 "=" $2}' "$d/auditd.conf"