DOP-C02 Practice Question 89: CloudWatch Logs Data Protection Policy
AWS Certified DevOps Engineer – Professional (DOP-C02) · Test 9 · question 9 of 10
An application log group occasionally receives log lines that include customer social security numbers and credit card numbers because of an upstream logging defect that the team has not yet fixed. Operators need to keep querying the log group with CloudWatch Logs Insights and viewing events in the console for troubleshooting, but the raw sensitive values must never be visible to most operators, only to a small group with an explicit unmasking permission, and the masking must apply automatically as new log events arrive without changing the application. What should the team configure?
Show answer and explanation
Answer:
A data protection policy scans incoming events against selected managed data identifiers (PII and financial categories cover SSNs and credit card numbers), masks matches automatically at egress points including Logs Insights queries and the console, and restricts viewing the unmasked value to principals holding the logs:Unmask permission, exactly meeting the requirement without any application change.
A is wrong because it requires building and maintaining custom redaction logic and a parallel log group, which duplicates a native capability and still leaves the original log group's raw events unmasked. B is wrong because denying GetLogEvents entirely blocks operators from troubleshooting at all, it does not selectively mask sensitive fields while preserving the rest of the log. D is wrong for the same reason: blocking FilterLogEvents for most principals removes their ability to search logs rather than protecting only the sensitive portions of each event.
Reference: Help protect sensitive log data with masking