Sensitive data in logs
On This Lesson 4 topics
The content for this lesson is written and waiting for review. The outline below shows what it covers. It will be published once it is approved.
In this lesson
keep secrets and personal data out of logs.
Planned topics
- Logs are copied, stored, and read by many people.
- Never log passwords, tokens, API keys, full card numbers, or national IDs.
- Mask what you must show:
**** **** **** 1111. - Be careful with
toString()of objects: it may include secrets. - Review log statements in code review.
Draft outline details
Demonstration
log.info("Charging card {}", mask(cardNumber)); // **** **** **** 1111Check your understanding
May you log a password "just for debugging"?
Show answer
No, never.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.