Data Retention
This page explains OpenTremor’s retention periods and how a platform superadmin can change them. Telemetry and audit events expire through MongoDB TTL indexes. Findings, review feedback, and raw resource content are handled by an application sweep.
Retention periods
Section titled “Retention periods”| Data | Setting | Default | Behavior |
|---|---|---|---|
| Telemetry spans and usage events | telemetry_days | 30 days | Expire through a MongoDB TTL index. |
| Audit events | audit_days | 730 days | Expire through a separate MongoDB TTL index. |
| Resolved low, medium, info, and unknown severity findings | finding_low_medium_days | 180 days | The sweep purges eligible terminal findings after this period. |
| Resolved high and critical severity findings | finding_high_critical_days | 730 days | The sweep purges eligible terminal findings after this period. |
| Raw analyzed resource content | resource_content_days | 90 days | The sweep redacts the raw resources.value content and embedded finding evidence. It keeps the resource document, analysis, and findings. |
| Review feedback | feedback_days | 730 days | The sweep purges review feedback after this period. |
| Refused network access events | network_events_days | 7 days | Expire through a MongoDB TTL index. Each event contains a client IP address. |
The day settings can be changed through PATCH /v1/admin/settings. telemetry_days accepts 1–365 days; audit_days accepts 30–3650 days. Each of the finding, resource content, and feedback settings accepts 1–3650 days. network_events_days accepts 1–90 days.
Open and needs-review findings are never purged, regardless of age or severity. The sweep only purges findings with terminal statuses: acknowledged, suppressed, false positive, or closed.
When a revision’s analysis completes, findings it no longer reports are closed. A closed finding ages out based on its severity’s retention period, measured from when it was last seen. The findings list omits closed findings unless you filter on status=closed. See Revision history.
Two settings control when the sweep runs:
| Setting | Default | Bounds |
|---|---|---|
sweep_enabled | true | — |
sweep_interval_hours | 24 hours | 1–168 hours |
When retention changes take effect
Section titled “When retention changes take effect”Changes to telemetry_days and audit_days update the running system’s TTL indexes immediately. They do not require a restart or another prepare step.
Changes to finding, resource content, and feedback periods take effect on the next sweep. A MongoDB TTL index cannot express conditions based on status, severity, and age, so the application sweep handles these records.
Run a retention sweep
Section titled “Run a retention sweep”Core does not run a scheduler. The standalone Task Scheduler calls POST /v1/admin/retention/run on a heartbeat. The endpoint skips work if sweep_enabled is false or the configured interval has not elapsed. In those cases it returns the previous result with skipped: true.
In the dashboard: Platform Admin → System → Data Lifecycle. Select Run sweep now to force a sweep, or call POST /v1/admin/retention/run?force=true. Both require a platform superadmin. See Platform Admin — Running a retention sweep manually for the endpoint reference, including GET /v1/admin/retention/status.
Change retention periods
Section titled “Change retention periods”In the dashboard: Platform Admin → System → Data Lifecycle. To update settings through the API, send a PATCH /v1/admin/settings request:
curl -X PATCH http://localhost:8000/v1/admin/settings \ -H "X-API-Key: <admin-key>" \ -H "Content-Type: application/json" \ -d '{ "retention_audit_days": 1825, "retention_finding_high_critical_days": 1825, "retention_resource_content_days": 30, "retention_feedback_days": 400 }'Set a field to null to clear its override and use the hardcoded default. See Configuration Reference — Platform settings.
What retention does not cover
Section titled “What retention does not cover”Findings whose resources are no longer present in the current changeset state are not automatically marked stale. The severity, status, and age based purge rules described above still apply.
Org offboarding deletes organization data through a separate cascade. See Platform Admin — Deleting an organization.