ECS task definition mounts the host's container runtime socket
- Severity
- High
- Service
- ECS
- Check ID
- ECS_DOCKER_SOCKET_MOUNTED
What this check finds
A container that mounts the host's Docker or containerd socket can ask the daemon to start a privileged container on the host, which makes it root on the EC2 instance and on every other task the instance runs. Mounting the socket read-only does not help: the socket is a request channel, and the API needs no write access to the file.
Passing looks like: No ECS task mounts the host's container runtime socket.
How to fix it
Remove the host volume whose sourcePath is /var/run/docker.sock (or containerd.sock) and the mount point that uses it. If the container needs task metadata or to manage containers, use the ECS task metadata endpoint or the ECS API with a scoped task role instead. Register a new task definition revision and redeploy.
AWS console
ECS → Task Definitions → select definition → Create new revision → Storage → remove the volume.
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
| Framework | Controls |
|---|---|
| NIST SP 800-53 Rev5 (Moderate) |
|
| NIST Cybersecurity Framework 2.0 |
|
| ISO/IEC 27001:2022 Annex A |
|
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