ECS task definition uses host network mode

Severity
Medium
Service
ECS
Check ID
ECS_HOST_NETWORK_MODE

What this check finds

With networkMode host, the task shares the EC2 instance's network namespace. It reaches the instance metadata service and the instance role's credentials whatever the metadata hop limit, can bind any host port, and sees traffic of the host's other processes. Security groups apply to the instance, not the task.

Passing looks like: No ECS task uses host network mode.

How to fix it

Use the awsvpc network mode (its own network interface and security group) and set ECS_AWSVPC_BLOCK_IMDS=true in the ECS agent configuration, or the bridge mode with the metadata hop limit at 1. Register a new task definition revision and redeploy.

AWS console

ECS → Task Definitions → select definition → Create new revision → Network mode.

Compliance controls it is evidence for

A failing result counts against these controls in KloudLytics; a passing one is evidence towards them. How compliance mapping works

Compliance controls mapped to ECS task definition uses host network mode
FrameworkControls
NIST SP 800-53 Rev5 (Moderate)
  • AC-6 Least Privilege
  • SC-7 Boundary Protection
NIST Cybersecurity Framework 2.0
  • PR.AA-05 Access permissions and authorizations are enforced with least privilege
  • PR.IR-01 Networks and environments are protected from unauthorized logical access and usage
ISO/IEC 27001:2022 Annex A
  • A.8.2 Privileged access rights
  • A.8.20 Networks security

Checked on every scan

KloudLytics runs this check each time it scans a connected AWS account, through a read-only role, and lists every affected resource with its region. On Pro and Business a fix is written for the specific resource rather than the general case above. The exact access it needs

More ECS checks

All ECS checks

Find out what is actually exposed in your AWS environment.

Connect one AWS account and run your first security assessment.

No credit card · Agentless · Read-only