Back to controls

Ensure Amazon ECS task definitions include secure networking modes and user definitions

Amazon Elastic Container Service (ECS) [task definitions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) are JSON files that describe how a Docker container should be launched within an ECS cluster.

Category

Controls

High

Applies to

AWS

Coverage

1 queries

Asset types

1 covered

Overview

Amazon Elastic Container Service (ECS) task definitions are JSON files that describe how a Docker container should be launched within an ECS cluster.

This control only evaluates the in-use (RUNNING Task) revision of an Amazon ECS task definition, configured with the host network mode, exhibits unexpected privilege escalation on the host container.

If the privileged parameter is set to true or the user parameter is set to root or any other highly privileged user, it can lead to security concerns. These containers have elevated privileges, enabling them to access resources and perform operations that are typically restricted.

Remediation guidance

To remediate this issue, identify the task definitions with the host network mode and elevated privileges, and update their parameters accordingly. You can achieve this by creating a new task definition revision using the following steps:

  1. Open the Amazon ECS classic console.
  2. Choose the region that contains your task definition.
  3. In the navigation pane, select "task definitions."
  4. On the task definitions page, select the checkbox next to the task definition that needs revision, and choose Create new revision.
  5. Update the privileged parameter to false and/or change the user parameter to a low-privileged user.
  6. If your task definition is used in a service, update your service with the updated task definition. For more information, refer to the AWS documentation.

Service-wide remediation

Recommended when many resources are affected: fix the platform baseline first so new resources inherit the secure setting, then remediate the existing flagged resources in batches.

AWS

Use AWS Organizations guardrails, AWS Config rules or conformance packs where they fit, approved account baselines, and IaC modules so new resources inherit the secure setting.

Operational rollout

  1. Fix the baseline first at the account, subscription, project, cluster, or tenant scope that owns this control.
  2. Remediate the currently affected resources in batches, starting with internet-exposed and production assets.
  3. Re-scan and track approved exceptions with an owner and expiry date.

Query logic

These are the stored checks tied to this control.

Check if Amazon ECS task definitions should have secure networking modes and user definitions

Connectors

AWS

Covered asset types

ECSTaskDefinition

Expected check: eq []

{
  ecsTaskDefinitions(
    where: { 
      networkMode: "host", task_NOT: null, 
      OR:[
        {containerSpecs_SOME: { privileged: true }},
        {containerSpecs_SOME: { user_CONTAINS: "root" }}
     ] }
  ) {...AssetFragment}
}
Cyscale Logo
Cyscale is an agentless cloud-native application protection platform (CNAPP) that automates the contextual analysis of cloud misconfigurations, vulnerabilities, access, and data, to provide an accurate and actionable assessment of risk.

Stay connected

Receive new blog posts and product updates from Cyscale

By clicking Subscribe, I agree to Cyscale’s Privacy Policy


© 2026 Cyscale Limited

LinkedIn icon
Twitter icon
Facebook icon
crunch base icon
angel icon