AWS Certified Security – Specialty (SCS-C02) — Question 289
A company runs an application that sends logs to a log group in Amazon CloudWatch Logs. The email addresses of the application users are in the logs.
The company’s developers need to view the logs in CloudWatch Logs. A security engineer must ensure that the developers who access the log group cannot see the user email addresses.
Which solution will meet this requirement?
Answer options
- A. Use Amazon Macie to scan the log group. Configure Macie to use a custom data identifier that uses a regular expression to identify an email address pattern. Activate automated data discovery in Macie.
- B. Create an AWS Key Management Service (AWS KMS) key. Configure the log group to use the key to encrypt the logs. Configure the key policy to deny access to the IAM role that the developers assume to use CloudWatch Logs.
- C. Create a subscription filter for the log group. Configure the log subscription to send the log data to an AWS Lambda function. Program the Lambda function to parse the log entries and to mask values that are email addresses.
- D. Configure a data protection policy for the log group. Specify the AWS managed data identifier of EmailAddress for the type of data to mask. Activate data protection for the log group.
Correct answer: D
Explanation
Amazon CloudWatch Logs data protection policies allow native, in-place masking of sensitive data (such as email addresses) using AWS managed data identifiers like EmailAddress. Restricting KMS key access as suggested in Option B would prevent developers from viewing the logs entirely. Options A and C are incorrect because they introduce unnecessary complexity and external services (Amazon Macie or AWS Lambda) instead of leveraging the built-in masking capabilities of CloudWatch Logs.