WEB-212Required
Keep only what you need and delete it on time
Collect only the data a task needs. Keep it only for its set retention period, and delete it on schedule and on request.
How to do it
List each field you collect and why, and drop the rest. Keep access and debug logs without IP addresses or query strings. Default formats, such as nginx's combined, log both. Dynamic IP addresses are personal data, as the EU Court of Justice held in Breyer (C-582/14). Where a law or a payment dispute needs one, keep it in that record only. Give that record its own purpose and period in the retention schedule. Fraud evidence for a card payment keeps the address for about 18 months, which covers 365 days plus the dispute window. Tax evidence stores the country, not the address. An audit event stores a shortened address or a place. Delete records automatically after a fixed time, and delete on request. Keep passwords and tokens out of logs too, as in keep private data out of logs.
Examples
nginx example
# Access log without IP addresses
log_format noip '$time_iso8601 "$request_method $uri" $status $body_bytes_sent';
access_log /var/log/nginx/access.log noip;
Shell example
# crontab: every night at 03:00, delete enquiries older than 12 months
0 3 * * * sqlite3 /var/lib/app/data.db "DELETE FROM enquiries WHERE created_at < date('now', '-12 months')"
How to check
A test stores a record older than its retention period, runs the scheduled delete job, and the record is gone. A search of a day's access log finds no IP address.
Sources
Related rules
- CMP-11 Keep one retention schedule in Compliance and governance
- APS-79 Keep private data out of logs and addresses in Application security
- DAT-30 Store only the personal data you need in Data and databases
- PAY-40 Answer every dispute before its deadline in Payments and billing
- PAY-47 Keep evidence of where the customer is in Payments and billing
- ACC-1 Ask only for what the first task needs in Accounts and identity
- ACC-31 Show people their own security log in Accounts and identity
- CMP-26 Write an audit event for every sensitive action in Compliance and governance
- SEO-84 Read crawler visits in the server logs and verify each bot in SEO
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/website/privacy/data-minimization">Agent Wranglers website playbook</a>. In code you write, add a comment next to it with the same link.