Overview
ECS containers should run as non-privileged. . The control fails if the privileged parameter in the container definition of Amazon ECS Task Definitions is set to true.
When the privilege parameter is true, the container is given elevated privileges on the host container instance (similar to the root user).
This control only evaluates the in-use (RUNNING Task) revision of an Amazon ECS task definition.
Remediation guidance
To configure the privileged parameter on a task definition, see Advanced container definition parameters in the Amazon Elastic Container Service Developer Guide.
-
Open the console at https://console.aws.amazon.com/ecs/v2.
-
In the navigation pane, choose Task definitions.
-
Choose Create new revision, Create new revision with JSON.
-
In the JSON editor box, edit your JSON file and set
privilegedparameter to false. -
Choose Create.
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
- Fix the baseline first at the account, subscription, project, cluster, or tenant scope that owns this control.
- Remediate the currently affected resources in batches, starting with internet-exposed and production assets.
- Re-scan and track approved exceptions with an owner and expiry date.
Query logic
These are the stored checks tied to this control.
ECS containers should run as non-privileged
Connectors
Covered asset types
Expected check: eq []
{
ecsTaskDefinitions(where: {AND: [
{
task_NOT: null
},
{
containerSpecs_SOME: {
privileged: true
}
}
]}) {...AssetFragment}
}
AWS