| name | cis-aws-compute-3.1 |
| description | Ensure Amazon ECS task definitions using 'host' network mode do not allow privileged or root user access to the host |
| category | cis-compute |
| version | 1.1.0 |
| author | cyberstrike-official |
| tags | ["cis","aws","compute","ecs","containers","task-definitions","networking","privilege-escalation","host-network"] |
| cis_id | 3.1 |
| cis_benchmark | CIS AWS Compute Services Benchmark v1.1.0 |
| tech_stack | ["aws"] |
| cwe_ids | [] |
| chains_with | ["cis-aws-compute-3.3","cis-aws-compute-3.4"] |
| prerequisites | [] |
| severity_boost | {} |
Ensure Amazon ECS task definitions using 'host' network mode do not allow privileged or root user access to the host
Description
Ensure that Amazon ECS task definitions using host network mode do not allow privileged or root user access. This protects the host container instance from unauthorized access and privilege escalation.
Note: This recommendation assumes that only the latest active revision of a task definition is in use. If older revisions are in use, apply the audit and remediation procedures to those revisions as needed.
Rationale
Combining host networking mode with privileged or root user access significantly increases the risk of container breakout, where a compromised container can gain control of the host system.
Impact
There may be some administrative effort required to ensure Amazon ECS applications function as expected without privileged or root user access.
Audit Procedure
Using AWS Console
- Login to the ECS console using https://console.aws.amazon.com/ecs/.
- In the left panel, click
Task definitions.
- Click the name of a task definition.
- Click on the latest active revision of the task definition.
- If
Network mode is set to host, click JSON.
- For each element under
containerDefinitions, ensure that privileged is set to false or is absent, and ensure that user is not set to root or is absent.
- Repeat steps 1-6 for each task definition.
Using AWS CLI
Run the following command to list task definitions:
aws ecs list-task-definitions
For the latest revision of a task definition, run the following command:
aws ecs describe-task-definition --task-definition <task-definition-arn>
If networkMode is set to host, ensure that for each element under containerDefinitions, privileged is set to false or is absent, and ensure that user is not set to root or is absent.
Repeat for each task definition.
Expected Result
For task definitions using host network mode, privileged should be or absent, and should not be or should be absent in all .