ECS cluster has Container Insights enabled or enhanced
ECS clusters have CloudWatch Container Insights configured via the containerInsights setting, accepting enabled or enhanced values to emit cluster, service, task, and container telemetry.
Risk
Without Container Insights, ECS operations lack telemetry to spot failures and anomalies. Missed CPU/memory/network spikes and restart loops degrade availability and delay response. Absent baselines impede detecting abuse (e.g., cryptomining or data egress bursts), risking confidentiality and unexpected costs.
Run this check with Prowler
Run in Prowler Cloudprowler aws --checks ecs_cluster_container_insights_enabledRecommendation
Enable Container Insights on all clusters-prefer enhanced for deeper visibility. Apply at account level for new clusters and enforce via automation.
Use least privilege for access to metrics/logs, encrypt logs, and set alarms on critical metrics. Correlate with app logs and tracing for defense in depth and faster incident detection.
Remediation
CLI
aws ecs update-cluster-settings --cluster <cluster-name> --settings name=containerInsights,value=enabledTerraform
# Terraform: Enable Container Insights on an ECS cluster
resource "aws_ecs_cluster" "<example_resource_name>" {
name = "<example_resource_name>"
setting {
name = "containerInsights" # Critical: enables CloudWatch Container Insights for the cluster
value = "enabled" # Critical: setting that passes the check
}
}NativeIaC
# CloudFormation: Enable Container Insights on an ECS cluster
Resources:
<example_resource_name>:
Type: AWS::ECS::Cluster
Properties:
ClusterSettings:
- Name: containerInsights # Critical: enables CloudWatch Container Insights for the cluster
Value: enabled # Critical: setting that passes the checkOther
Check Code
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.ecs.ecs_client import ecs_client
class ecs_cluster_container_insights_enabled(Check):
def execute(self):
findings = []
for cluster in ecs_client.clusters.values():
report = Check_Report_AWS(metadata=self.metadata(), resource=cluster)
report.status = "FAIL"
report.status_extended = (
f"ECS cluster {cluster.name} does not have container insights enabled."
)
if cluster.settings:
for setting in cluster.settings:
if setting["name"] == "containerInsights" and (
setting["value"] == "enabled" or setting["value"] == "enhanced"
):
report.status = "PASS"
report.status_extended = f"ECS cluster {cluster.name} has container insights {setting['value']}."
findings.append(report)
return findingsReferences
- https://docs.aws.amazon.com/securityhub/latest/userguide/ecs-controls.html#ecs-12
- https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cloudwatch-container-insights.html
- https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-metrics-ECS.html
- https://docs.aws.amazon.com/config/latest/developerguide/ecs-container-insights-enabled.html
- https://aws.amazon.com/blogs/aws/container-insights-with-enhanced-observability-now-available-in-amazon-ecs/
- https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/deploy-container-insights-ECS-cluster.html
- https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContainerInsights.html