Logs Required
Keep personal data out of logs
Never log passwords, tokens, full card numbers or personal details. Log IDs instead.
How to do it
Redact known fields in the logging library, such as authorization, password and email. Log a customer ID instead of a name. Drop query strings from access logs. The security testing playbook shows how to test for leaks.
Example
const log = pino({ redact: ['req.headers.authorization', 'password', 'email', 'card', '*.password', '*.email', '*.card'] });
How to check
Sign in, reset a password and place a test order on staging. Search the logs for the test password, token and email address. None of them appear.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers operations playbook: https://agentwranglers.se/playbook/operations/logs/logs-without-personal-data.