Check ID:
Provider: AWS
Service:
Severity: HIGH
Categories:
Resource type:
ecs_task_definitions_host_networking_mode_usersProvider: AWS
Service:
ecsSeverity: HIGH
Categories:
container-security, trust-boundariesResource type:
AwsEcsTaskDefinitionWhat this check verifies
Amazon ECS task definitions inhost network mode are assessed for containers where privileged=false and the container user is root or unset.
Risk
Sharing the host network lets containers reach host interfaces directly. Running as root (or with no user set) increases the chance to bind low ports, sniff traffic, or impersonate services, and makes kernel flaws more exploitable-enabling data exfiltration, tampering, and outages, impacting confidentiality, integrity, and availability.Recommendation
Preferawsvpc for isolation. If host is required, enforce least privilege:
- Run as a non-root
user - Avoid
privilegedunless strictly justified - Limit capabilities and exposed ports
Remediation
- Terraform
- Native IaC
- Dashboard steps
References
- https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html
- https://docs.aws.amazon.com/securityhub/latest/userguide/ecs-controls.html#ecs-6
- https://docs.aws.amazon.com/config/latest/developerguide/ecs-task-definition-user-for-host-mode-check.html
- https://docs.aws.amazon.com/securityhub/latest/userguide/ecs-controls.html
- https://docs.aws.amazon.com/AmazonECS/latest/developerguide/update-task-definition-console-v2.html
Where this check fires
This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable byCheck ID = ecs_task_definitions_host_networking_mode_users. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to AWS checks