How midPoint audit retention affects your compliance evidence
Auditors reviewing access often ask for the history behind a current entitlement: who granted it, when, and who approved it. In midPoint, that history lives in audit records, closed tasks and other repository entries that cleanup can remove. The default cleanup policy removes audit records older than three months, so midPoint audit retention must be set deliberately before the first review cycle. If your access certification or segregation of duties evidence needs to reach further back than the default window, the default will quietly erase it.
The cleanup process covers more than audit records. It also trims closed tasks and other historical objects, such as completed operation results, according to the retention periods you configure for each type. Teams usually need to change these settings when an audit framework or internal policy requires longer history, when a campaign or investigation spans several quarters, or when a migration or upgrade must keep records for comparison. Before changing anything, confirm with your compliance lead which evidence types must survive, for how long, and whether the retained data is the system of record or a copy. The Evolveum documentation on removing obsolete information describes the settings to review.
Longer retention has a cost. Audit and task tables grow with every change, which affects database size, backup duration and query speed, so retention and storage planning belong together. Decide whether audit records stay in the main repository or move to a separate audit database, and confirm how exports will preserve records once they leave midPoint. Test a restore and a sample evidence request against your chosen settings before an auditor asks for them, because data removed by cleanup cannot be recovered from midPoint itself.
What midPoint cleanup removes and what it leaves in place
midPoint cleanup works on history rather than live identity data, but the categories it touches are not all equal. Audit records, closed tasks and other obsolete information each follow their own retention rule, and some items stay in the repository regardless of age. Confirm each category against your midPoint version and configuration before you set a retention period.
Audit records
Audit records log changes and operations performed in midPoint, and they grow with every provisioning run, login and approval. The default cleanup policy removes audit records older than three months, which may be shorter than your evidence requirements. Confirm the audit retention setting in your configuration and whether audit is written to the repository or to a separate audit database, because the cleanup scope depends on where audit lives.
Native audit docsClosed tasks
Tasks such as reconciliation, import and recompute leave behind completed or closed task objects with their status and error history. These accumulate on busy deployments and can make the task view harder to read during incident work. Confirm which task states your cleanup policy targets and whether tasks that still hold errors or are awaiting follow-up are excluded.
Other obsolete operational information
Beyond audit and tasks, midPoint can accumulate other operational records that no longer serve a purpose, such as certain closed objects and transient data. The exact set depends on the midPoint version and the cleanup options enabled. Ask Evolveum support or review the removing obsolete information docs to list each object type your version can clean up before you enable any removal.
Live identity and role objects
Users, roles, resources, organizational units and their assignments are current configuration and identity data, and cleanup does not treat them as history. Removing them would change who has access, so they must stay in place. Check that your cleanup policy names only the history categories you intend to remove, and that no policy rule can match live objects.
Retained evidence outside midPoint
Cleanup removes records from midPoint, so anything you need for long-term evidence must be exported or stored elsewhere first. Exported audit kept in your own store can outlast the repository copy. Confirm with your compliance team which records must be kept, for how long, and in what format, and test that an export can be read back before cleanup runs.
Removing obsolete informationRetention options and when each fits
This table compares four ways to keep midPoint audit and history: the repository with a retention window, a separate audit database, partitioning, and export to long-term storage before cleanup. Read each row for the operating effort, query needs and evidence custody it implies, then match the option to how long your assessors and investigators need records. The main takeaway is that the default three-month cleanup window is a starting point you set deliberately, not a retention decision.
| Option | Operating effort | Query needs and evidence custody | When it fits |
|---|---|---|---|
| Keep audit in the repository with the cleanup window | Lowest: cleanup runs under the configured policy with no extra store to run | Records are queryable in midPoint, but older records are removed once the window passes, so custody depends on what was exported first | Small deployments with short review cycles and an agreed export of anything you must keep |
| Native audit with a separate audit database | Moderate: a second database to back up, monitor, patch and size | Audit queries stay off the operational repository, and custody is clearer because the audit store has its own backup and access controls | Large volumes of audit or teams that must limit who can read audit data |
| Partitioning the audit store | Higher: partition creation, rotation and dropping need to be scripted and tested | Old partitions can be detached or dropped as a unit, which makes retention periods easier to enforce but needs an export step first | Long-lived audit with high write volume where whole-period removal is simpler than row-level deletion |
| Export to long-term storage before cleanup | Moderate: export jobs, storage, integrity checks and a retrieval procedure to maintain | Evidence leaves midPoint in a format you control, so custody and access must be documented in your own records management | Frameworks or internal policies that require records beyond what midPoint keeps online |
| Keep the cleanup window as the only control | Lowest effort, but no recovery path after cleanup | Anything removed cannot be produced for an investigation or assessment | Rarely appropriate when audit has evidentiary value |
| Shorter window with a longer external copy | Depends on export reliability and storage operations | Online queries stay fast while long-term copies carry the retention burden | When day-to-day investigations need recent data only |
When a separate audit database makes sense on PostgreSQL
A separate audit database is worth planning when audit records stop being a side effect of the main repository and become a dataset with their own size, access and retention needs. midPoint can store audit records natively in its PostgreSQL repository, and the native audit configuration in the Evolveum docs describes how that store is set up. Teams usually move audit out for three reasons: the audit table grows with every change and login, it holds records that auditors and security staff need to read without access to identity objects, and its retention period may need to be longer than the period that governs day-to-day history. Each reason is a decision you should record before go-live, not after the first backup window runs long.
midPoint uses PostgreSQL as its native repository database, and PostgreSQL is released under the PostgreSQL License, a permissive license similar to the BSD and MIT licenses, so a second database instance adds no license cost of its own. The cost is operational: a second cluster needs its own backups, patching schedule, monitoring and restore tests. Before splitting, confirm with your Evolveum contact or the deployment documentation that your midPoint version supports the audit database configuration you plan, and check which PostgreSQL major version your target platform supports on the PostgreSQL versioning policy page.
Backup and restore of the audit database should follow the same disciplines as the repository. The PostgreSQL high availability documentation covers hot standby servers and synchronous and asynchronous replication, while the continuous archiving and point-in-time recovery documentation explains how to restore to a chosen moment. PostgreSQL does not detect a primary failure by itself, so automatic failover requires external tooling that you must select and test. Ask your team to define the recovery point and recovery time they need for audit data separately from the repository, then run a restore of the audit database on its own. Do not assume that restoring the repository also restores audit history.
Setting up a retention policy step by step
This sequence takes a retention requirement from the compliance owner to a tested cleanup policy, with an export of audit records confirmed before any deletion runs in production. Each step closes with a check so the team knows it can move on.
Confirm the midPoint version and runtime versions
The platform team records the midPoint version in use and checks the Java and PostgreSQL versions it requires. midPoint recommends Java 25 for 4.11 and later (Java 21 supported) and Java 21 for 4.10 and older (Java 17 supported), and uses PostgreSQL as its native repository database. Confirm the PostgreSQL major version against the supported list, since cleanup and export behavior should be tested on the exact stack you run. Done when the version matrix is written down and every component is on a supported release.
Record the retention requirement from the compliance owner
The compliance owner, with input from the security and audit teams, states in writing how long audit records, closed tasks and other history must be kept, and which categories fall under each period. Ask for the source of each period, such as a internal policy or a regulatory obligation, and whether any records must be kept in a form that can be produced for an auditor. Done when the signed requirement lists each history category and its retention period, and the team has agreed who approves changes to it.
Configure the cleanup policy in midPoint
The administrator translates the requirement into the cleanup policy described in the Evolveum documentation on removing obsolete information. Note that the default policy removes audit records older than three months, so an unchanged default may delete records the compliance owner expects to keep. Set each cleanup value explicitly, store the configuration in your version-controlled midPoint home, and document the reason for each value. Done when the policy file matches the signed requirement and a reviewer has checked it against that requirement.
Decide between native audit and a separate audit database
The architect chooses where audit records live: in the native repository audit configuration or in a separate audit database. Compare expected record volume, backup scope, restore time objectives and who administers each database, using the Evolveum native audit configuration documentation as the reference. Confirm with your DBA and the vendor whether the chosen layout supports the export method you plan to use. Done when the decision record names the audit store, its owner, its backup job and the retention period it must honor.
Set up export before any deletion
Before cleanup is enabled, the team builds a scheduled export of audit records to long-term storage that you control. The export must capture the fields the compliance owner needs, be readable without midPoint running, and carry integrity controls such as checksums and restricted write access. Run one full export and one incremental export, then compare row counts and sample records against the source. Done when the export has been restored or read back successfully and the reconciliation check shows no missing records.
Confirm exported records before enabling cleanup
Before cleanup is switched on in production, a second reviewer checks that every record eligible for deletion already exists in the export. Pick a date range that is about to be cleaned, query the export for those records, and match counts and identifiers against the repository. Record the check result and the date the cleanup will first run. Done when the reviewer has signed off that no eligible record is missing from the export.
Test a cleanup run in a non-production environment
The team restores a copy of the production repository into a non-production environment, runs the cleanup policy, and compares the results with the expected retention period. Check that closed tasks, audit records and other history outside the window are removed, and that records inside the window remain. Also confirm that PostgreSQL maintenance and backups still run after the cleanup. Done when the test results match the signed requirement and the team has a written rollback plan for the production run.
Enable cleanup in production with monitoring
The operations team enables the approved policy in production during an agreed change window and watches the first runs in the logs and the database. They verify the export job ran before the cleanup, confirm the record counts fall within the expected range, and keep the backup from before the change until the first cleanup cycle has been reviewed. Done when the first production cleanup cycle completes, the export reconciliation is recorded, and the compliance owner has accepted the outcome.
Partitioning and exporting audit for long-term retention
Partitioning and export are the two ways to keep audit history longer than a cleanup policy would allow, and both are design decisions you own rather than settings midPoint provides out of the box. The default cleanup policy removes audit records older than three months, so any retention beyond that has to be deliberate. The idea behind partitioning is to split audit tables by time, for example one partition per month, so that an old period can be detached from the live database and moved to archive storage without a large delete that bloats tables and locks them during cleanup. Whether midPoint's native audit schema can be partitioned in this way, and how partition boundaries interact with its cleanup and indexes, must be confirmed with Evolveum and tested on a copy of your own audit database before you rely on it.
Export is the second route: copying audit records to storage your organization controls before they are removed from midPoint. Here the decisions are the export format, the schedule, where the files live, who can read them, and how you prove that an exported set is complete and unaltered. Typical integrity controls include checksums or signed manifests, write-once or access-restricted storage, and a record of row counts per period that can be reconciled against the database. None of these choices should be settled by the platform team alone. Agree the format, retention period, integrity method and chain of custody with your internal auditor or assessor before the first export, and ask them what evidence they expect to see when they sample a period. PostgreSQL's own continuous archiving and point-in-time recovery documentation covers backups of the database, but it does not decide what an audit archive must contain, so treat it as a separate control.
Security and operational risks of retaining audit data
Audit history is useful for investigations and access reviews, but it is also a concentrated record of who did what, to whom, and when. The controls around the audit database, exported archives and retention period need to be designed together, so that keeping evidence does not create a new exposure.
Access control on the audit database
The audit records live in a database that administrators, reporting users and backup jobs may all reach. Decide which accounts can read, write and delete audit tables, and keep midPoint's own service account separate from reporting and maintenance accounts. PostgreSQL documents several client authentication methods, including password, GSSAPI, SSPI, LDAP, RADIUS, certificate, PAM and OAuth. Treat that list as an input to your access design, and confirm which method your security team can operate and audit.
PostgreSQL auth methodsProtection against tampering
Audit value depends on records being complete and unchanged. A user with delete rights on the audit database could remove evidence, and a cleanup job with a broad grant could do the same by accident. Restrict delete and update privileges on audit tables, log cleanup runs, and compare exported archives against the source before relying on them for an examination.
Encryption and backups of exported audit
Once audit data leaves the live database as an export, it often moves to file shares, object storage or a data warehouse with weaker controls. Encrypt exports at rest and in transit, restrict who can retrieve them, and include archives in your backup scope with tested restores. Confirm where each copy sits and who holds the encryption keys.
Retaining personal data longer than needed
Audit records typically contain user identifiers, account changes and sometimes attribute values that are personal data. Keeping them longer than the purpose requires increases breach impact and can conflict with data protection rules. Write the retention period for each category of audit and history data, and record the legal basis or business reason for any period above the default. Confirm these periods with your privacy and legal teams.
Restoring old history during cleanup
Cleanup is irreversible in the live database, so a wrong retention setting or a mistaken deletion removes evidence permanently. Before enabling a shorter period, export the records that must be kept, test that the export can be read, and document who approved the change. Keep a record of each cleanup run so that gaps in history can be explained later.
Questions teams ask about midPoint audit cleanup
What does it cost to set up midPoint audit retention and cleanup?
The cost depends on the written scope, and a quote follows from that scope. The main cost drivers are how many audit and task histories must be kept, how many retention rules differ by record type, whether audit moves to a separate database, and whether exports for long-term storage are part of the work. Ask for the quote to list each retention rule, each database or storage change, the export format, and the restore test that proves old records can still be read. Ongoing costs usually come from storage growth and periodic review of the policy, so ask whether a retainer covers those checks.
How long does it take to change midPoint audit retention?
The change itself is usually a configuration edit, but the time depends on how much validation surrounds it. A cleanup policy that only shortens or lengthens the default window can be reviewed quickly. Moving audit into a separate database, partitioning tables, or building an export pipeline takes longer because each step needs a test environment, a rollback plan and a change window. Confirm with your team which environments must be updated first and who approves production changes, since those approvals often set the schedule more than the technical work does.
What must our team provide before cleanup work starts?
Your team needs to supply a written retention rule for each category of record, such as audit records, closed tasks and other history, along with the business or regulatory reason for each period. Engineers need database access to the midPoint repository and any planned audit database, a test environment that resembles production, and a storage location for exported records with its own access controls. Ask your compliance lead to confirm whether any retention period is set by a policy outside midPoint, because the cleanup settings must match it.
Can our own team set up midPoint audit cleanup without a partner?
Yes, a team with PostgreSQL and midPoint administration skills can change the cleanup policy and test it. The Evolveum documentation on removing obsolete information and on native audit configuration describes the settings involved. The harder part is deciding what to keep, proving that exported records remain readable, and handling a cleanup that removes more than intended. If your team has no one who has run a midPoint repository through an upgrade or restore, a partner can review the plan or run the work under a fixed scope while your staff learn the steps.
What happens to audit records that cleanup has already deleted?
Records removed by a cleanup run are generally not recoverable from midPoint itself, so retention changes should be planned before the first run. The default cleanup policy removes audit records older than three months, which means records outside the window may already be gone in a deployment that never changed it. Ask your team to check whether a database backup taken before the cleanup still holds the records you need. If not, the gap should be documented as part of your compliance evidence, not discovered during an audit.
Should audit records go to a separate database or a partitioned table?
A separate audit database helps when audit volume competes with live identity operations for the same database resources, or when audit access must be restricted to a different group of administrators. Partitioning helps when you need to drop or archive old periods efficiently. Both add operational work: backups, restores and monitoring must cover each database, and the team needs to test that midPoint still reads and writes audit data correctly. PostgreSQL's documentation on high availability and continuous archiving describes what each database needs for recovery, so review it before deciding the layout.
How do we export midPoint audit for long-term retention?
Export is usually a separate job that copies audit records to storage outside the live repository before cleanup removes them. The format, schedule, encryption and access controls for that storage must be written down. Confirm that exported files can be queried or restored years later, since a file that no one can read is not retention. Also decide who may request exported records and how each request is logged, because the exports will contain the same sensitive activity history as the audit database.
How audit records move from midPoint to long-term storage
The flow starts with midPoint operations writing audit records to the audit store, either the main repository or a separate PostgreSQL database. A cleanup policy then removes records past their retention window, which is why the default policy removes audit records older than three months. Before that happens, records that must be kept longer are exported to organization-controlled archive storage across a marked trust boundary. Check the export completes and the retention period is reviewed on a schedule, so nothing is deleted before it is archived.
Audit records flow from midPoint into organization-controlled archive storage before cleanup.
How DeployOpen scopes and delivers midPoint retention work
DeployOpen plans and delivers midPoint audit retention and repository cleanup inside your own infrastructure, from the retention policy through to a tested, documented setup. Engagements are fixed-scope, with the policy, deliverables and timelines agreed in writing before work starts.
How we scope
- We confirm which history stores are in play: audit records, closed tasks and other repository records.
- We document the retention periods your compliance, legal and operations teams require for each record type.
- The written scope states whether audit moves to a separate database, is exported, or stays in the repository.
How we build
- We configure the cleanup policy in midPoint and test it against a copy of your repository before production.
- We set up the separate audit database, partitioning and export jobs where the approved scope includes them.
- We verify that removed records are the ones intended and that retained audit remains searchable for reviewers.
How we hand over
- We deliver the retention policy, cleanup schedule and export procedure as written documentation for your team.
- We walk your administrators through running, checking and changing the cleanup settings after handover.
- We record evidence of testing so your auditors can review how retention was implemented and verified.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer after handover.
- A retainer can cover checks after midPoint upgrades and PostgreSQL major version changes.
- Your team confirms retention needs with auditors and legal counsel, while we keep the configuration aligned with them.

