PII in Logs
Overview
Logging PII (email addresses, phone numbers, names, SSNs, credit card numbers) creates compliance risks under GDPR, CCPA, HIPAA, and PCI-DSS. Log files:
- May be stored indefinitely beyond data retention requirements
- Are often shipped to third-party aggregators (Datadog, Splunk, ELK)
- May have broader access than production databases
- Can be subpoenaed in legal proceedings
Remediation
- Implement a log sanitizer/redactor for all PII fields
- Use structured logging and explicitly list safe fields
- Mask PII in logs:
user@ex*****.com,+1-xxx-xxx-1234 - Audit log destinations for GDPR data transfer compliance