A data minimization review is a structured pass over a live system to
prove that every personal data field still earns its place. Collection
creeps over time. A field added for one launch stays for ten more, a
debug log starts capturing full payloads, and an analytics event quietly
adds a device identifier. This sub-skill turns that drift into a
repeatable audit with decisions, owners, and recheck dates, rather than
a vague recommendation to collect less.
Quick Workflow
- Scope the review to one feature, service, or dataset, and list every
collection point it owns, including forms, APIs, SDKs, logs, and
analytics events.
- Inventory every personal data field at each point, with its purpose,
legal basis, and retention rule.
- Challenge each field with one question - what breaks, concretely, if
we stop collecting it.
- Decide per field - keep, drop, make optional, mask, or shorten
retention - and record the owner and deadline for each change.
- Verify retention and deletion actually run, by querying for rows
past their window instead of trusting the policy document.
- Scrub logs, error reports, and analytics for accidental personal
data, and add a guard so it cannot creep back.
- File the review record and set the recheck date, tied to the next
feature change or at most one year out.
1. Inventory every collection point
Start from what the system really sends, not what the design doc says
it sends. API schemas, form markup, and SDK manifests are the evidence.
# List API routes from an OpenAPI document and look for personal data shapes
curl -s https://app.example/api/openapi.json -o /tmp/openapi.json
python3 -c "import json; d = json.load(open('/tmp/openapi.json')); print('\n'.join(sorted(d['paths'].keys())))"
# Then inspect each route's request schema for fields like email, phone,
# location, device id, or free text that may carry personal data
#!/usr/bin/env python3
"""Field inventory - one row per field, with purpose and retention."""
FIELDS = [
# (field, collection point, purpose, retention rule)
("email", "signup form", "account identity", "life of account"),
("phone", "signup form", "account recovery", "life of account"),
("date_of_birth", "signup form", "NOT DOCUMENTED", "NOT SET"),
("ip_address", "access log", "abuse prevention", "30 days"),
("gps_latitude", "check-in event", "nearby results", "24 hours"),
]
for field, point, purpose, retention in FIELDS:
flag = "REVIEW" if "NOT" in purpose or "NOT" in retention else "ok"
print(f"{flag:6s} {field:15s} via {point:15s} purpose: {purpose} retention: {retention}")
2. Challenge each field and record the decision
A field survives only with a purpose tied to a user-visible function or
a legal duty. "Might be useful later" is not a purpose, and "the
product team asked" is not a legal basis. Record the decision in a
form the next reviewer can audit.
# Minimization decision record - template
| Field | Purpose | Decision | Rationale | Owner | Due |
| --- | --- | --- | --- | --- | --- |
| date_of_birth | none documented | DROP | Age gate uses a boolean flag instead | backend lead | 2026-11-10 |
| gps_latitude | nearby results | COARSEN | City level gives the same results | mobile lead | 2026-11-17 |
| ip_address | abuse prevention | SHORTEN | 30 days to 7 days, hashed after 24h | platform lead | 2026-11-17 |
| device_model | debugging | KEEP | Needed to reproduce crash reports | mobile lead | n/a |
Decisions allowed - KEEP, DROP, OPTIONAL, MASK, COARSEN, SHORTEN.
Every non-KEEP row needs an owner and a due date.
3. Verify retention and deletion actually run
Policies lie and cron jobs silently fail. Query the store for rows
older than the retention window, and check that deletion removes the
row from backups and replicas on their own schedule, not just from the
primary table.
#!/usr/bin/env python3
"""Retention check - report rows older than the allowed window."""
import sqlite3
from datetime import date, timedelta
db = sqlite3.connect("/tmp/review-example.db")
cutoff = (date.today() - timedelta(days=30)).isoformat()
rows = db.execute(
"SELECT COUNT(*) FROM access_log WHERE created_at < ?", (cutoff,)
).fetchone()[0]
print(f"Rows older than 30 days: {rows} (must be 0 if retention is enforced)")
# A nonzero count means the deletion job is broken, disabled, or never existed.
# Fix the job first, then backfill the deletion, then re-run this check.
4. Scrub logs and analytics for accidental personal data
Logs are the most common minimization failure. A single debug statement
can copy an email address, token, or full request body into a log that
is kept far longer than the source data and read by far more people.
# Scan recent logs for common personal data patterns (tune for your stack)
grep -RInE "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}" /var/log/app/ | head -20
grep -RInE "Authorization: Bearer |password=|ssn=|card_number=" /var/log/app/ | head -20
# For each hit - remove the logging call or redact at the source, then
# rotate the affected logs. Redacting at query time is not a fix.
Edge cases
- Free text fields (support tickets, feedback forms, search boxes) almost
always contain personal data users were never asked for. Treat them
as personal data by default, shorten their retention, and restrict
who can read them.
- Backups and archives inherit the retention problem. A deletion that
skips backups is incomplete, so record the backup expiry alongside
the primary retention rule.
- Aggregated analytics can still identify people when a segment is
tiny. Suppress or generalize segments below a threshold (for
example, fewer than 10 users) before publishing a dashboard.
- Legal holds and fraud investigations can justify longer retention,
but only for the specific records in scope, with a documented hold
and an expiry. A hold is not a reason to keep everything forever.
- Third party SDKs collect on your behalf. If an SDK sends device
identifiers or location you did not ask for, disabling or replacing
it is part of the review, not someone else's problem.
Key references
- GDPR Article 5(1)(c) - data minimisation principle
- GDPR Article 5(1)(e) - storage limitation principle
- GDPR Article 25 - data protection by design and by default
- Parent skill data-minimization - field audits, pseudonyms, precision reduction
- OWASP guidance on logging sensitive data and log retention
1---2name: data-minimization-review3description: "Use when reviewing an existing system, feature, or dataset for excess personal data. Covers field level collection audits, retention review, log and analytics scrubbing, and turning findings into drop, mask, or shorten decisions. Use when a product ships new fields, when a privacy review flags overcollection, or when preparing evidence that only necessary data is kept."4version: "1.0.0"5domain: privacy6lifecycle: stable7last_verified: "2026-10-27"8parent: data-minimization9requires: [data-minimization]10extends: []11relates: [gdpr-engineering, privacy-threat-model, anonymization-techniques]12tools:13 - name: Python14 version: "3.12"15 - name: curl16 version: "8.5"17metadata:18 source: https://skillmd.com/skills/mizazhaider-ceh/data-minimization-review19---2021A data minimization review is a structured pass over a live system to22prove that every personal data field still earns its place. Collection23creeps over time. A field added for one launch stays for ten more, a24debug log starts capturing full payloads, and an analytics event quietly25adds a device identifier. This sub-skill turns that drift into a26repeatable audit with decisions, owners, and recheck dates, rather than27a vague recommendation to collect less.2829## Quick Workflow30311. Scope the review to one feature, service, or dataset, and list every32 collection point it owns, including forms, APIs, SDKs, logs, and33 analytics events.342. Inventory every personal data field at each point, with its purpose,35 legal basis, and retention rule.363. Challenge each field with one question - what breaks, concretely, if37 we stop collecting it.384. Decide per field - keep, drop, make optional, mask, or shorten39 retention - and record the owner and deadline for each change.405. Verify retention and deletion actually run, by querying for rows41 past their window instead of trusting the policy document.426. Scrub logs, error reports, and analytics for accidental personal43 data, and add a guard so it cannot creep back.447. File the review record and set the recheck date, tied to the next45 feature change or at most one year out.4647## 1. Inventory every collection point4849Start from what the system really sends, not what the design doc says50it sends. API schemas, form markup, and SDK manifests are the evidence.5152```bash53# List API routes from an OpenAPI document and look for personal data shapes54curl -s https://app.example/api/openapi.json -o /tmp/openapi.json55python3 -c "import json; d = json.load(open('/tmp/openapi.json')); print('\n'.join(sorted(d['paths'].keys())))"56# Then inspect each route's request schema for fields like email, phone,57# location, device id, or free text that may carry personal data58```5960```python61#!/usr/bin/env python362"""Field inventory - one row per field, with purpose and retention."""63FIELDS = [64 # (field, collection point, purpose, retention rule)65 ("email", "signup form", "account identity", "life of account"),66 ("phone", "signup form", "account recovery", "life of account"),67 ("date_of_birth", "signup form", "NOT DOCUMENTED", "NOT SET"),68 ("ip_address", "access log", "abuse prevention", "30 days"),69 ("gps_latitude", "check-in event", "nearby results", "24 hours"),70]71for field, point, purpose, retention in FIELDS:72 flag = "REVIEW" if "NOT" in purpose or "NOT" in retention else "ok"73 print(f"{flag:6s} {field:15s} via {point:15s} purpose: {purpose} retention: {retention}")74```7576## 2. Challenge each field and record the decision7778A field survives only with a purpose tied to a user-visible function or79a legal duty. "Might be useful later" is not a purpose, and "the80product team asked" is not a legal basis. Record the decision in a81form the next reviewer can audit.8283```markdown84# Minimization decision record - template8586| Field | Purpose | Decision | Rationale | Owner | Due |87| --- | --- | --- | --- | --- | --- |88| date_of_birth | none documented | DROP | Age gate uses a boolean flag instead | backend lead | 2026-11-10 |89| gps_latitude | nearby results | COARSEN | City level gives the same results | mobile lead | 2026-11-17 |90| ip_address | abuse prevention | SHORTEN | 30 days to 7 days, hashed after 24h | platform lead | 2026-11-17 |91| device_model | debugging | KEEP | Needed to reproduce crash reports | mobile lead | n/a |9293Decisions allowed - KEEP, DROP, OPTIONAL, MASK, COARSEN, SHORTEN.94Every non-KEEP row needs an owner and a due date.95```9697## 3. Verify retention and deletion actually run9899Policies lie and cron jobs silently fail. Query the store for rows100older than the retention window, and check that deletion removes the101row from backups and replicas on their own schedule, not just from the102primary table.103104```python105#!/usr/bin/env python3106"""Retention check - report rows older than the allowed window."""107import sqlite3108from datetime import date, timedelta109110db = sqlite3.connect("/tmp/review-example.db")111cutoff = (date.today() - timedelta(days=30)).isoformat()112rows = db.execute(113 "SELECT COUNT(*) FROM access_log WHERE created_at < ?", (cutoff,)114).fetchone()[0]115print(f"Rows older than 30 days: {rows} (must be 0 if retention is enforced)")116# A nonzero count means the deletion job is broken, disabled, or never existed.117# Fix the job first, then backfill the deletion, then re-run this check.118```119120## 4. Scrub logs and analytics for accidental personal data121122Logs are the most common minimization failure. A single debug statement123can copy an email address, token, or full request body into a log that124is kept far longer than the source data and read by far more people.125126```bash127# Scan recent logs for common personal data patterns (tune for your stack)128grep -RInE "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}" /var/log/app/ | head -20129grep -RInE "Authorization: Bearer |password=|ssn=|card_number=" /var/log/app/ | head -20130# For each hit - remove the logging call or redact at the source, then131# rotate the affected logs. Redacting at query time is not a fix.132```133134## Edge cases135136- Free text fields (support tickets, feedback forms, search boxes) almost137 always contain personal data users were never asked for. Treat them138 as personal data by default, shorten their retention, and restrict139 who can read them.140- Backups and archives inherit the retention problem. A deletion that141 skips backups is incomplete, so record the backup expiry alongside142 the primary retention rule.143- Aggregated analytics can still identify people when a segment is144 tiny. Suppress or generalize segments below a threshold (for145 example, fewer than 10 users) before publishing a dashboard.146- Legal holds and fraud investigations can justify longer retention,147 but only for the specific records in scope, with a documented hold148 and an expiry. A hold is not a reason to keep everything forever.149- Third party SDKs collect on your behalf. If an SDK sends device150 identifiers or location you did not ask for, disabling or replacing151 it is part of the review, not someone else's problem.152153## Key references154155- GDPR Article 5(1)(c) - data minimisation principle156- GDPR Article 5(1)(e) - storage limitation principle157- GDPR Article 25 - data protection by design and by default158- Parent skill data-minimization - field audits, pseudonyms, precision reduction159- OWASP guidance on logging sensitive data and log retention