AUDITD.CRON(5)
π AUDITD.CRON(5) β ok bestie, it's giving "rotating audit logs on a schedule" β¨
so this one lives in the System Administration Utilities corner of your manual pages, and it's literally all about time-based rotation of audit logs. buckle up, we're doing cron magic π
πΈ NAME πΈ
auditd.conf β time-based rotation of audit logs
π¦ DESCRIPTION π¦
okay so, by default, the audit daemon (auditd) is out here doing size-based log rotation. that means logs get rotated once they hit a specified size, and that size lives in /etc/audit/auditd.conf. very demure, very mindful, but not the whole story π
this manual is describing the alternative: time-based log rotation using cron. with this approach, your audit logs get rotated at specified intervals β hourly, daily, weekly, or even on a custom date β regardless of their size. no cap. size doesn't get a vote anymore. periodt. π₯
β¨ CONFIGURATION β¨
1. π« Disable Size-Based Rotation
to enable time-based log rotation, first disable auditd's built-in size-based rotation by setting this parameter in /etc/audit/auditd.conf:
max_log_file_action = ignore
she's off duty, bestie π
2. π¦ Configure Log Retention
the num_logs parameter is the one deciding how many rotated log files you keep. for daily rotation, setting
num_logs = 7
ensures that logs from the last seven days are retained. cute, right? a whole week of receipts π§Ύβ¨
but β heads up β on busy systems, audit logs may grow rapidly, potentially leading to a lack of disk space π to prevent this, make sure the space_left_action parameter is configured to handle low-disk-space situations appropriately. do not skip this one, fr fr.
3. π Apply Configuration Changes
after modifying the main auditd configuration file, reload auditd to apply the changes:
auditctl --signal reload
let her know the glow-up happened π
4. π Deploy the Rotation Script
copy the provided auditd.cron script to the appropriate cron directory (cron.daily or cron.hourly or cron.weekly, depending on your rotation preference). then, ensure the file has the correct SELinux labels:
cp /usr/share/doc/audit/auditd.cron /etc/cron.daily
SELinux labels are not a vibe you want to fumble, ngl. get those right π
π SEE ALSO π
π«Ά AUTHOR π«Ά
Attila Lakatos
and that's the whole page, bestie β brought to you by Red Hat, dated Feb 2025, manual name AUDITD.CRON(5). you ate that. go rotate some logs π πΈ
π¦ where this page comes from
- alpine 3.23: audit-doc 4.1.2-r2 Β· LGPL-2.1-or-later
- alpine 3.24: audit-doc 4.1.2-r6 Β· LGPL-2.1-or-later
- arch rolling: audit 4.2.1-1 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- centos-stream 10: audit 4.2.1-3.el10 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- fedora 43: audit 4.1.1-2.fc43 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- fedora 43: audit 4.2.1-1.fc43 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- fedora 44: audit 4.1.4-1.fc44 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- fedora 44: audit 4.2.1-1.fc44 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- nixpkgs unstable: audit 4.2.1
- ubuntu questing: auditd 1:4.0.5-1build1
- ubuntu resolute: auditd 1:4.1.2-1build1 Β· GPL-2.0-only
- ubuntu resolute: auditd 1:4.1.2-1ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: auditd 1:4.1.2-1ubuntu1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms