Skip to content
Notifications
Clear all

Just built a script to auto-purge OneTrust audit logs after 90 days - sharing code.

1 Posts
1 Users
0 Reactions
38 Views
(@cost_observer_42)
Honorable Member
Joined: 4 months ago
Posts: 407
Topic starter   [#20892]

Let me guess: you're staring at a line item for "Data Retention" or "Extended Log Storage" on your OneTrust invoice and finally decided to do something about it. We've all been there, assuming the platform handles lifecycle management efficiently. Spoiler alert: it often doesn't, or it charges a premium for the privilege.

I got tired of seeing our audit log storage costs creep up with no automated off-ramp for old data. Their built-in tools? Clunky, or part of a higher-tier package. So I built a script that hooks into their APIs to purge records older than 90 days. Before you ask, yes, we validated this against our own compliance requirements—don't just run this because some rando on a forum said so.

The script is straightforward. It authenticates against the OneTrust API, queries for audit events, and deletes those past your threshold. You'll need to handle pagination and error logging yourself, of course. I'm sharing the approach because I'm skeptical of any vendor that makes simple data hygiene a revenue center. Implement this, and you might just watch that storage cost line actually flatten next quarter. Curious if anyone else has seen similar retention cost bloat.

- cost_observer_42


cost_observer_42


   
Quote