Profile Applicability:

  • Level 2

Description:
Detailed monitoring provides additional granularity of monitoring data for your Amazon EC2 instances. Enabling detailed monitoring allows you to collect metrics at a 1-minute frequency instead of the default 5-minute intervals. This helps improve visibility into the performance of EC2 instances, which is essential for maintaining reliability, availability, and performance in production environments.

Rationale:
 Enabling detailed monitoring is crucial for production instances because it provides more timely data that can be used to identify and resolve issues faster. With more frequent metric updates, such as CPU utilization, disk I/O, and network traffic, you can ensure that critical resources are performing optimally. However, it does come with additional costs, as you are charged per metric sent to CloudWatch.

Impact:
 Pros:

  • Improved performance monitoring: Provides real-time data (1-minute granularity) for better decision-making.

  • Helps detect performance issues early, minimizing downtime.

  • Essential for production environments where high availability and quick incident response are critical.

Cons:

  • Increased costs: Detailed monitoring incurs additional charges for each metric sent to CloudWatch. It's recommended to only enable it for critical instances.

  • Requires active monitoring and management to ensure cost-effective utilization of detailed monitoring.

Default Value:
 By default, basic monitoring (5-minute granularity) is enabled for EC2 instances, and detailed monitoring is disabled. It must be manually enabled.

Pre-requisites:

  • AWS IAM permissions to view and manage EC2 instances and CloudWatch metrics:
     ec2:DescribeInstances, ec2:MonitorInstances, cloudwatch:PutMetricData

Remediation:

Test Plan:

Using AWS Console:

  1. Log in to the EC2 Console at AWS EC2 Console.

  2. On the left, click Instances, then select Instances from the drop-down.

  3. Select an EC2 instance from the list that you want to review.

  4. In the Description tab, check the Monitoring attribute.

    • If the value is Basic, it indicates that detailed monitoring is not enabled.

  5. Repeat steps 3–4 for other EC2 instances to verify the monitoring level.

  6. Review instances across other AWS regions to ensure compliance.

Using AWS CLI:

  1. Run the following AWS CLI command to list EC2 instances with detailed monitoring disabled:

    aws ec2 describe-instances --region us-east-1 --output json --filters "Name=monitoring-state,Values=disabled" --query "Reservations[*].Instances[*].{Instance:InstanceId}"

  2. Review the output to identify instances where detailed monitoring is disabled.

Implementation Plan:

Using AWS Console:

  1. Log in to the EC2 Console at AWS EC2 Console.

  2. On the left, click Instances, then select Instances.

  3. Select an EC2 instance that needs detailed monitoring enabled.

  4. Click on the Monitoring tab.

  5. Click Enable Detailed Monitoring.

  6. Click Yes, Enable to confirm.

  7. Repeat steps 3–6 for other instances that require detailed monitoring.

Using AWS CLI:

  1. To enable detailed monitoring for a list of instances, run the following command:

    aws ec2 monitor-instances --instance-ids <instance-id-1> <instance-id-2>

  2. The output will show state: pending while the monitoring is being enabled.

  3. Wait for a few minutes, then run the command again to verify that the state has changed to enabled:

    aws ec2 describe-instances --instance-ids <instance-id-1> --query "Reservations[*].Instances[*].Monitoring"

Backout Plan:

Using AWS Console:

  1. If enabling detailed monitoring causes issues, log in to the EC2 Console.

  2. Select the EC2 instance where detailed monitoring was enabled.

  3. Under the Monitoring tab, click Disable Detailed Monitoring to revert the changes.

Using AWS CLI:

  1. To disable detailed monitoring for an instance, run:

    aws ec2 unmonitor-instances --instance-ids <instance-id-1> <instance-id-2>

  2. Verify that the detailed monitoring has been disabled by checking the monitoring status again:

    aws ec2 describe-instances --instance-ids <instance-id-1> --query "Reservations[*].Instances[*].Monitoring"

References:

  1. AWS EC2: Monitoring

  2. AWS CLI: describe-instances

  3. AWS CLI: monitor-instances

  4. AWS CLI: unmonitor-instances

CIS Controls:

Version

Control ID

Control Description

v8

8.2

Collect audit logs for EC2 instances using CloudWatch detailed monitoring to track metrics and improve incident response times.

v7

6.2

Activate audit logging for EC2 instances to capture detailed performance metrics, helping identify potential security and operational issues.