StudyToCert

All certifications / Developer Associate / Lessons

AWS Certified Developer – Associate DVA-C02 · Domain 2: Security

Keeping sensitive data out of code and logs: default credential chain, no hardcoded keys, CloudWatch Logs data protection masking

▶ Watch the overview video

Last reviewed October 6, 2026 · Leer en español

Explain it simpler

Two common ways secrets leak are through code and through logs. Code gets copied, shared and posted online, so a password written in it can travel anywhere. Logs are records your program writes about what it is doing, and if it writes down card numbers or passwords, everyone who can read the logs can see them. The safe habits are simple: programs running in AWS get temporary permissions automatically instead of carrying a permanent key, real secrets live in a secrets service, and logs only record what you need to fix problems. AWS can also blur out sensitive things like card numbers in logs, the way a receipt shows only the last four digits.

At 2 a.m. Lucia, on call for Pinecrest Payments, gets two alerts within ten minutes. The first is from a secret-scanning tool: an AWS access key appeared in a commit to a public repository that a contractor created for a demo. The second comes from a teammate debugging a refund issue, who pastes a CloudWatch log line into the team chat, and Lucia notices it contains a customer's full card number. Neither problem was an attack on AWS itself; both were sensitive data in the wrong place. What should Lucia do first, and how could both have been prevented?

Many real breaches start with a secret in the wrong place: an access key committed to a public repository, a database password baked into a container image, or a customer's card number printed in a debug log. None of these needs a sophisticated attacker, only someone who finds what was left lying around. The DVA-C02 exam checks that you know where sensitive data should and should not go, and which AWS features help you keep it there.

Free account

Keep reading for free

Create a free StudyToCert account to read the rest of this lesson: 7 more sections, 7 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.

Sign up free Log in

Study Developer Associate for free
A week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Open the Developer Associate study plan