AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 347

A DevOps administrator is responsible for managing the security of a company's Amazon CloudWatch Logs log groups. The company's security policy states that employee IDs must not be visible in logs except by authorized personnel. Employee IDs follow the pattern of Emp-XXXXXX, where each X is a digit.

An audit discovered that employee IDs are found in a single log file. The log file is available to engineers, but the engineers are not authorized to view employee IDs. Engineers currently have an AWS IAM Identity Center permission that allows logs:* on all resources in the account.

The administrator must mask the employee ID so that new log entries that contain the employee ID are not visible to unauthorized personnel.

Which solution will meet these requirements with the MOST operational efficiency?

Answer options

Correct answer: A

Explanation

Option A is the most efficient solution because CloudWatch Logs data protection policies allow native masking of sensitive data using custom regex patterns directly inside the log group. By applying an explicit Deny for the logs:Unmask permission to the engineering team's IAM identities, they will only see the masked data, while authorized users can still view the raw IDs. Other options like Lambda processing or Firehose and Macie introduce significant operational overhead and architectural complexity.