Feature request: retention / purge policy for `findings` and `compliance_requirements_overviews` in Prowler Local Server
Issue search
- I have searched the existing issues and this bug has not been reported yet
Which component is affected?
Prowler API
Cloud Provider (if applicable)
No response
Steps to Reproduce
Summary
Running Prowler Local Server (self-hosted, Community) with roughly 150 providers scanned daily. The Postgres database grows extremely fast, mainly in the findings and compliance_requirements_overviews tables, and there's currently no supported way to control or reduce this growth over time.
Problem
- Every scan appends new rows to
findings(one per check/resource) and tocompliance_requirements_overviews(one row per framework × requirement × region — confirmed in #12738 to be ~100k rows for a single AWS scan across 19 regions). - With ~150 providers running daily scans, this multiplies extremely fast, and our database disk usage grows continuously with no ceiling in sight.
- There is currently no documented way to:
- disable/reduce which compliance frameworks are computed per provider (this appears to be gated behind the paid "Scan Configuration" feature in Prowler Cloud/Private Cloud);
- delete old scans, findings, or compliance data via the public API (only whole-provider deletion is supported, which wipes ALL history, not just the old part);
- configure a retention window (e.g. "keep only the last N days") at the application level.
- The only current workaround is either (a) accepting unbounded disk growth and continuously resizing storage, or (b) manually deleting rows directly in Postgres, which is risky given the relational structure (foreign keys) and is unsupported.
Proposed solution
A built-in, configurable data retention/purge mechanism for Prowler Local Server, for example:
- An environment variable (e.g.
PROWLER_DATA_RETENTION_DAYS) combined with a periodic Celery beat task that deletes scans (cascading to their findings and compliance_requirements_overviews) older than N days. - And/or a documented, supported API endpoint to delete a Scan (cascading to its findings/compliance rows), so users can build their own retention scripts safely without touching the database directly.
Alternatives considered
- Reducing scanned AWS regions via
PROWLER_AWS_DISALLOWED_REGIONS— helps, but doesn't address findings growth from checks/resources, and there's no equivalent lever for reducing compliance frameworks per provider. - Manual
DELETE/TRUNCATEdirectly in Postgres — risky due to foreign keys and unsupported. - Consolidating/removing redundant providers — a one-time cleanup, not retention, and it deletes ALL history for that provider, not just the old part.
Environment
- Deployment: Prowler Local Server (self-hosted, Community), Docker Compose
- Scale: ~150 providers, daily scheduled scans
- Affected tables:
findings,compliance_requirements_overviews
Related: #12738, #4549
Happy to share more detail on our growth rate / disk usage numbers if that helps with prioritization.
Expected behavior
Proposed solution A built-in, configurable data retention/purge mechanism for Prowler Local Server, for example:
An environment variable (e.g. PROWLER_DATA_RETENTION_DAYS) combined with a periodic Celery beat task that deletes scans (cascading to their findings and compliance_requirements_overviews) older than N days. And/or a documented, supported API endpoint to delete a Scan (cascading to its findings/compliance rows), so users can build their own retention scripts safely without touching the database directly.
Actual Result with Screenshots or Logs
How did you install Prowler?
Docker (docker pull toniblyx/prowler)
Environment Resource
VM on VMWare dedicated datacenter
OS used
Ubuntu 24.04
Prowler version
5.43.0
Python version
3.12.3
Pip version
latest
Context
No response
Source: prowler-cloud/prowler