Documentation
Audit retention
Decide how long audit events stay online and how long their encrypted archives are kept, check archive health, and run an archive pass on demand.
Overview
Audit events stay online in the database, where the Audit log searches them directly, for a set number of days. After that, the audit retention service moves them into encrypted archive files on the server’s disk and keeps those files for a set number of years. Use Admin → Audit Retention to set both periods to match your compliance requirements, to check that archiving is healthy, and to start an archive pass yourself.
Only administrators, with admin:manage, can open this page. Other people see an Access restricted page.
Screen tour
- Keep audit logs online (days): how long events stay in the online audit log before they are archived.
- Keep archived logs (years): how long archive files are kept before they are removed.
- Save retention settings: saves both values. The note beside the button shows No changes to save., Unsaved changes. or Fix the highlighted fields to save.
- Archive status: Archive healthy, Archive pending or Archive failed. See Statuses.
- Last successful archive and Next archive run: when the last archive pass completed and when the next scheduled pass starts, in UTC.
- Run archive now: starts an archive pass for your organisation straight away, after you confirm.
At the bottom of the Archive health card, View the audit log opens the audit log, where each archive run is recorded.
How archiving works
- Every day at 03:00 UTC, the audit retention service runs an archive pass for every organisation.
- The pass takes the events that are older than Keep audit logs online (days), writes them to an archive file encrypted with AES-256-GCM, and verifies the file and its checksum. Only then does it remove those events from the online audit log.
- Archive files are stored on the local server disk managed by the application, in the archive directory configured for the control plane.
- Each archive file is kept for Keep archived logs (years), counted from the day it was written. After that, the next archive pass removes it.
- Each pass records audit events of its own, such as
audit.archive.completedandaudit.archive.expired, so the audit log shows what was archived and when.
Archived events stay searchable. Administrators switch on Include archived logs on the audit log to search them together with online events. See Include archived logs.
Change the retention policy
- Open Admin → Audit Retention.
- In Keep audit logs online (days), enter a whole number of days from 1 to 3,650. The default is 365.
- In Keep archived logs (years), enter a whole number of years from 1 to 20. The default is 7.
- Click Save retention settings. The button shows Saving…, then the page confirms Retention settings saved.
The online period must fit inside the archive period, so the number of online days can’t be more than the archive years × 365. If a value is out of range, the field shows why when you leave it, and Save retention settings stays disabled until you fix it.
The new online period applies from the next archive pass. Shortening it moves more events to the archive on that pass. Every change is recorded in the audit log as audit.retention_settings.updated, with the old and new values.
Run an archive pass now
Use Run archive now to archive eligible events without waiting for the nightly pass, for example after you shorten the online period.
- Consequence: how many days of audit logs stay online and how long the archive keeps the rest.
- Cancel: closes the dialog without archiving anything.
- Run archive now: starts the archive pass.
- In the Archive health card, click Run archive now.
- Read the dialog Run archive now?. It tells you that audit logs older than the online period are moved to the local archive and kept for the archive period, and that this can’t be undone from this page.
- Click Run archive now to start, or Cancel to close the dialog.
- While the pass runs, the button shows Running archive…. When it finishes, the card shows one of:
- Archive run completed.: eligible events were archived. Last successful archive and the status update.
- No audit logs are old enough to archive yet.: every event is still inside the online period, so there was nothing to move.
Each run is recorded in the audit log as audit.archive.run_requested.
Fields
| Field | Description | Rules |
|---|---|---|
| Keep audit logs online (days) | Days an event stays in the online audit log before the archive pass moves it. | Required. Whole number from 1 to 3,650. Must be no more than the archive years × 365. Default 365. |
| Keep archived logs (years) | Years an archive file is kept before it is removed. | Required. Whole number from 1 to 20. Default 7. |
| Last successful archive | Date and time of the most recent completed archive pass, in UTC. | Read-only. Empty until the first pass completes. |
| Next archive run | Date and time of the next scheduled pass, in UTC. | Read-only. Always the next 03:00 UTC. |
Statuses
| Status | Meaning | Next possible status |
|---|---|---|
| Archive pending | No archive pass has completed for your organisation yet. This is normal until the first events reach the end of the online period. | Archive healthy, Archive failed |
| Archive healthy | The most recent archive pass completed and verified its files. | Archive failed |
| Archive failed | The most recent archive pass needs attention. Older events stay online until a pass succeeds. The card shows The most recent archive run needs attention before older audit logs can be removed from online storage. | Archive healthy, after the next successful pass |
When a pass fails, check the control plane’s archive configuration and logs, then click Run archive now to retry. A successful pass clears the failed status.