Ensures ECS clusters are configured with Container Insights for advanced monitoring and performance analytics.
Rule | ECS clusters should use Container Insights |
Framework | AWS Foundational Security Best Practices |
Severity | ✔ Medium |
Rule Description:
ECS clusters should use Container Insights for AWS Foundational Security Best Practices to monitor, analyze, and troubleshoot the performance of containerized applications in Amazon ECS. Container Insights provides detailed insights into resource utilization, operational performance, and logs for containers running on ECS clusters.
Troubleshooting Steps:
If Container Insights is not enabled for an ECS cluster, follow the steps below for remediation:
Check Container Insights Status: Run the following AWS CLI command to check if Container Insights is enabled for the ECS cluster:
aws ecs describe-container-instances --cluster <cluster-name> --container-instances <instance-id>
Enable Container Insights: If Container Insights is not enabled, use the AWS CLI to enable it for the ECS cluster:
aws ecs put-account-setting --name containerInsights --value enabled --region <region>
Verify Configuration: Validate that Container Insights is successfully enabled by checking the configuration details:
aws ecs describe-account-settings --name containerInsights --region <region>
Restart Container Instances: Restart the ECS container instances to apply the changes and start collecting metrics and logs:
aws ecs update-container-agent --cluster <cluster-name> --container-instance <instance-id>
Monitor Container Insights: Once enabled, monitor Container Insights metrics and logs through the AWS Management Console or CloudWatch.
Remediation Steps:
To enable Container Insights for an ECS cluster, follow the steps below:
Enable Container Insights via AWS Management Console:
Enable Container Insights via AWS CLI: Use the AWS CLI to enable Container Insights for the ECS cluster:
aws ecs put-account-setting --name containerInsights --value enabled --region <region>
Restart Container Instances: Restart the ECS container instances to apply the changes:
aws ecs update-container-agent --cluster <cluster-name> --container-instance <instance-id>
Monitor Container Insights: Utilize the Amazon CloudWatch console to monitor and analyze Container Insights metrics and logs for the ECS cluster.