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

null controls, 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.

Multiple Remediation Paths

AWS

SERVICE-WIDE (RECOMMENDED when many resources are affected): Deploy centralized guardrails and remediation using AWS Config Conformance Packs and (if applicable) AWS Organizations SCPs.

aws configservice put-organization-conformance-pack --organization-conformance-pack-name <pack-name> --template-s3-uri s3://<bucket>/<template>.yaml

ASSET-LEVEL: Apply the resource-specific remediation steps above to only the affected assets.

PREVENTIVE: Add CI/CD policy checks (CloudFormation/Terraform validation) before deployment to prevent recurrence.

References for Service-Wide Patterns

  • AWS Config Conformance Packs: https://docs.aws.amazon.com/config/latest/developerguide/conformance-packs.html
  • AWS Organizations SCP examples: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_examples.html

Operational Rollout Workflow

Use this sequence to reduce risk and avoid repeated drift.

1. Contain at Service-Wide Scope First (Recommended)

  • AWS: deploy/adjust organization conformance packs and policy guardrails.
aws configservice put-organization-conformance-pack --organization-conformance-pack-name <pack-name> --template-s3-uri s3://<bucket>/<template>.yaml

2. Remediate Existing Affected Assets

  • Execute the control-specific Console/CLI steps documented above for each flagged resource.
  • Prioritize internet-exposed and production assets first.

3. Validate and Prevent Recurrence

  • Re-scan after each remediation batch.
  • Track exceptions with owner and expiry date.
  • Add preventive checks in IaC/CI pipelines.

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