$ run as a normal user# run as root (or with sudo)
Skills in this chapter
- Privacy — P1152–P1161
Data map: collect, store, share, delete
You cannot delete what you never mapped.
A data map is not a diagram for the wall. It is the list of places a record goes, and the reason you can answer a deletion request without guessing.
- Collect: Web form, API payload, Batch import
- Store: Primary database, Object store, Search index
- Share: Analytics warehouse, Partner API, CSV exports
- Delete: TTL expiry, Erasure job, Backup rotation
Classifying data without a committee
Classification projects stall because they ask for consensus. Every department has an opinion about which data is sensitive, and the meeting repeats until the project is quietly dropped and the spreadsheet keeps moving.
- One owner: Accountable for the class, not for the meeting.
- Four classes: Public, Internal, Confidential, Restricted, each with a rule.
- Fail closed: Unlabelled data is Restricted until someone says otherwise.
- Enforce at the gate: Schema tag, policy check, access review, deletion job.
Full note: P1153 — Classifying data without a committee
Five places PII hides in plain sight
Personal data rarely leaks from the table you designed. It leaks from the copies nobody classified.
- Application logs, where a debug line prints the whole request body.
- Analytics events, carrying an email in a free-text property.
- Backups and snapshots, kept long after the source row was deleted.
- Spreadsheet exports, downloaded to a laptop and forgotten.
Full note: P1154 — Five places PII hides in plain sight
Answering a data subject request
A request is a route through your data map.
A data subject request is a test of your data map, run by someone else, on a clock.
- Find every copy, not the table: search every store for the subject; match on identifiers, not names; read the free-text fields.
- Take the data with its context: export rows with column names; record source, date and purpose; keep a chain-of-custody note.
- Remove other people's data: redact third-party names and notes; check exemptions with counsel; get a second pair of eyes.
- Answer, log, then delete the copy: send by an approved channel; log the request, date and outcome; delete the working files on a date.
Full note: P1155 — Answering a data subject request
Retention that deletes itself
Retention schedules fail in a predictable way: the policy says five years, the database says 2014, and nobody can explain the gap.
- Rule as data: Class, trigger, clock and action in a table a job can read.
- Bulk by default: Partitions, prefixes and TTLs, not row-by-row loops.
- Bound the backups: Rotation or key destruction, stated in plain words.
- Keep the receipt: Counts before and after, stored with the run.
Full note: P1156 — Retention that deletes itself
Four privacy numbers worth writing down
Privacy work becomes arguable until you put numbers on it. Four are enough to start.
- Retention: the age of the oldest personal record you still hold.
- Access: the number of people who can read it without asking.
- Requests: days from a subject request to a complete answer.
- Breaches: hours from detection to the regulator, and to the people at risk.
Encryption layers: at rest, in transit, in use
A key in the same account is a lock taped to the door.
Encryption is usually described as a switch. In practice it is a stack, and the stack is only as strong as its lowest layer.
- Key custody: Who can unwrap the data key, and where the root lives.
- At rest: Disk, database, object store; stolen media stays unreadable.
- In transit: TLS between services, verified, with no plaintext fallback.
- In use: Enclaves and memory hygiene; the layer most teams skip.
Full note: P1158 — Encryption layers: at rest, in transit, in use
Access logs that survive an audit
An access log is evidence only if it can answer a simple question: who read this record, when, from where, and whether they were allowed.
- Six fields: Subject, resource, time, decision, reason and source.
- Every layer: IdP, application, database, object store and control plane.
- Append-only: Separate account, object lock and synced clocks.
- A rerunnable query: Saved with parameters, result and policy version.
Full note: P1159 — Access logs that survive an audit
Five questions before you share a dataset
Sharing a dataset feels like sending a file. It is closer to handing over a copy of a system you no longer control.
- Who is the data about, and did they agree to this use?
- Which columns become personal once they are combined?
- Does every row need to travel, or only the aggregate?
- Where will the copy live, and who can read it there?
Full note: P1160 — Five questions before you share a dataset
Data discovery and deletion commands
Discovery without deletion is just inventory.
Discovery and deletion are the same skill pointed in two directions. You cannot delete what you cannot find, and a discovery tool that never deletes is just an inventory.
- Discover:
rg -n 'email|phone' --glob '*.json' - Scan:
rg -c '@[a-z0-9.-]+' exports/ - Delete:
shred -u -z exports/customers.csv - Verify:
psql -c 'select count(*) from customers'
Full note: P1161 — Data discovery and deletion commands