AWS Certified Security – Specialty — Question 295
A company has a group of Amazon EC2 instances in a single private subnet of a VPC with no internet gateway attached. A security engineer has installed the Amazon CloudWatch agent on all instances in that subnet to capture logs from a specific application. To ensure that the logs flow securely, the company's networking team has created VPC endpoints for CloudWatch monitoring and CloudWatch logs. The networking team has attached the endpoints to the VPC.
The application is generating logs. However, when the security engineer queries CloudWatch, the logs do not appear.
Which combination of steps should the security engineer take to troubleshoot this issue? (Choose three.)
Answer options
- A. Ensure that the EC2 instance profile that is attached to the EC2 instances has permissions to create log streams and write logs.
- B. Create a metric filter on the logs so that they can be viewed in the AWS Management Console.
- C. Check the CloudWatch agent configuration file on each EC2 instance to make sure that the CloudWatch agent is collecting the proper log files.
- D. Check the VPC endpoint policies of both VPC endpoints to ensure that the EC2 instances have permissions to use them.
- E. Create a NAT gateway in the subnet so that the EC2 instances can communicate with CloudWatch.
- F. Ensure that the security groups allow all the EC2 instances to communicate with each other to aggregate logs before sending.
Correct answer: A, C, D
Explanation
To troubleshoot missing CloudWatch logs in this architecture, the security engineer must verify IAM permissions, agent configuration, and VPC endpoint access. First, the EC2 instance profile must grant the instances permission to write logs to CloudWatch. Second, the CloudWatch agent configuration file on each instance must be checked to confirm it is correctly configured to read the expected log files. Finally, because VPC endpoints are used, their endpoint policies must be checked to ensure they do not block the EC2 instances from sending log data. NAT gateways (E) are not needed because VPC endpoints provide private connectivity, metric filters (B) only analyze logs after ingestion, and instances do not need to communicate with each other (F) to send logs.