CMP-28Recommended
Keep audit logs for a set time
Keep audit logs for a stated period, longer than debug logs, then delete them on schedule.
How to do it
Pick the period from your duties and write it in the retention schedule. At least 12 months is a common floor. PCI DSS 4.0.1 requirement 10.5.1 asks for 12 months, with the last three months ready to search at once. Keep audit logs apart from debug logs, which follow the log retention rule. Set the storage lock to the same period, so deletion and protection agree. The lock itself follows Make the audit log impossible to change.
How to check
A daily query fails when the oldest audit event is older than the stated period plus one day. It also fails when the log has run longer than the period but its oldest event is younger. The storage lock period equals the stated period.
Sources
Related rules
- OPS-10 Keep logs for a fixed time in Operations and observability
- INF-85 Keep one audit trail for the whole organization that no account can change in Infrastructure and environments
- CMP-27 Make the audit log impossible to change in Compliance and governance
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/compliance/audit-logs-and-access/audit-log-retention">Agent Wranglers compliance and governance playbook</a>. In code you write, add a comment next to it with the same link.