Lesson 1 of 13 · 12m
You Can't Leak What You Never Stored
Every record you keep multiplies the next breach — minimization starts with an inventory of every copy, not a policy.
The breach that shouldn't have existed
In October 2020, an attacker calling himself ransom_man started emailing patients of Vastaamo, a Finnish psychotherapy center. The emails demanded Bitcoin and attached the patient's own therapy session notes — diagnoses, session transcripts, full names, national ID numbers. About 33,000 patients. Vastaamo had kept every record, forever, in an internet-reachable system. The attacker didn't break clever crypto. There wasn't much crypto to break. The data was simply there, in full, years after the sessions ended.
The company went bankrupt in 2021. Its CEO was fired after the board learned he'd known about the intrusion for over a year. The Finnish DPA fined the company €608,000 for the security failures, but the fine isn't the lesson. The lesson is the inventory: nothing in that database was required to exist at the moment it leaked.
Run the same exercise on your own schema. For every column, two questions: who reads it, and when does it expire. If a field has no reader, it has no purpose. If it has no expiry, it has no excuse.
Data has a blast radius
The mental model most teams carry is backwards: the database is the asset, and protecting it is the cost. Flip it. The database is the liability, and every record you hold adds expected loss.
The math isn't subtle. Marriott disclosed in November 2018 that attackers had lived inside Starwood's reservation database since 2014. Roughly 339 million guest records leaked, including 5.25 million unencrypted passport numbers. Four years of dwell time only worked because the records stretching back years were all still there, reachable through the same compromised layer. The ICO fined Marriott £18.4 million. Retention had made the breach bigger.
Ashley Madison is worse. Avid Life Media charged users $19 for a "full delete" of their profile. When Impact Team dumped the database in August 2015 — ~32 million accounts — the deleted users were in it. The data had never been deleted. The FTC settlement cost $1.66 million and a court-ordered privacy program, but the users paid more. Their data was out permanently, for a service that had charged extra to not keep it.
OPM's 2015 breach — 21.5 million people's SF-86 security clearance files, including 5.6 million fingerprint sets and fields for drug use and mental health — is the purest example of hoarding-as-architecture. Most of that data described people who never got the job.
Where copies live
You cannot minimize what you haven't enumerated. Personal data doesn't sit in one table; it replicates into places with no owner:
- Logs. Access logs carry IPs (personal data — the CJEU said so in Breyer v. Germany, C-582/14), and request lines carry whatever you put in URLs.
- Backups. Every row you keep exists again on every backup tier, on its own schedule.
- Error trackers. Sentry and friends can capture request bodies, cookies, and headers unless you tell them not to.
- Analytics and warehouses. Row-level events land in Segment, BigQuery, or a parquet lake and outlive the product decision that put them there.
- Support tools. Zendesk, Intercom, your CRM — each holds a copy of whatever your team pasted in.
- Exports. The CSV on a laptop. Nobody's inventory includes it.
Copies outlive intent. The purpose that justified the row in Postgres doesn't travel with the parquet file.
The inventory that works
GDPR Article 30 already demands a record of processing activities. Treat it as an engineering artifact, not compliance paperwork: one table — field, system, purpose, reader, retention, legal basis. If purpose is "maybe useful later," delete the field. GDPR Article 5(1)(c) calls this data minimization, and unlike most legal text it states the correct architecture directly: adequate, relevant, limited to what is necessary.
Minimization has a real cost: optionality. You cannot retro-analyze data you never stored. That tradeoff is the point — price it honestly, per field, instead of paying for it all at once during the breach.
The practice
Before any new column ships, its spec needs a reader and an expiry. Write them in the migration or the ticket:
ALTER TABLE users ADD COLUMN locale_guess varchar(8);
-- reader: i18n middleware basis: legitimate interest (UX)
-- expires: derived per-request, never persisted → drop the columnHalf the fields you spec this way won't survive the exercise. That is the exercise working.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
Healthcare Ransomware: Why Hospitals Can't Patch Fast Enough
The criminals behind the attack claim to have shared 400GB of patient data. The NHS stated it is working swiftly to confirm the validity of these files. The ransomware attack on the UK's National Health Service (NHS) continues to disrupt health services in London, with a significant amount of…
RSA Is Simple. Deploying RSA Correctly Almost Never Is.
The capstone to our RSA series. The math checks out. Shipping it as written gets you breached. This is the nineteen-year-old attack that proves it, and what belongs in production instead.
RSA in JavaScript Part 2: The JWT Is Where You'll Actually Meet It
Most JavaScript developers never call an RSA function directly. They verify an RS256 token, and two classic attacks turn that into an authentication bypass — both demonstrated here, both fixed by one line.