ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 286 - SCS-C02 discussion

Report
Export

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.)

A.
Ensure that the EC2 instance profile that is attached to the EC2 instances has permissions to create log streams and write logs.
Answers
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.
Answers
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.
Answers
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.
Answers
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.
Answers
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.
Answers
F.
Ensure that the security groups allow all the EC2 instances to communicate with each other to aggregate logs before sending.
Suggested answer: A, C, D

Explanation:

The possible steps to troubleshoot this issue are:

A) Ensure that the EC2 instance profile that is attached to the EC2 instances has permissions to create log streams and write logs. This is a necessary step because the CloudWatch agent uses the credentials from the instance profile to communicate with CloudWatch1.

C) Check the CloudWatch agent configuration file on each EC2 instance to make sure that the CloudWatch agent is collecting the proper log files. This is a necessary step because the CloudWatch agent needs to know which log files to monitor and send to CloudWatch2.

D) Check the VPC endpoint policies of both VPC endpoints to ensure that the EC2 instances have permissions to use them. This is a necessary step because the VPC endpoint policies control which principals can access the AWS services through the endpoints3.

The other options are incorrect because:

B) Creating a metric filter on the logs is not a troubleshooting step, but a way to extract metric data from the logs. Metric filters do not affect the visibility of the logs in the AWS Management Console.

E) Creating a NAT gateway in the subnet is not a solution, because the EC2 instances do not need internet access to communicate with CloudWatch through the VPC endpoints. A NAT gateway would also incur additional costs.

F) Ensuring that the security groups allow all the EC2 instances to communicate with each other is not a necessary step, because the CloudWatch agent does not require log aggregation before sending. Each EC2 instance can send its own logs independently to CloudWatch.

1: IAM Roles for Amazon EC2 2: CloudWatch Agent Configuration File: Logs Section 3: Using Amazon VPC Endpoints : Metric Filters : NAT Gateways : CloudWatch Agent

Reference: Log Aggregation

asked 16/09/2024
Matias Cordero Ochoa
35 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first