π‘οΈ AWS ECS Task Definition shares the host's process namespaceπ’
- Contextual name: π‘οΈ Task Definition shares the host's process namespaceπ’
- ID:
/ce/ca/aws/ecs/task-definition-pid-mode - Tags:
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
SECURITY
Logicβ
- π§ prod.logic.yamlπ’
Similar Policiesβ
Descriptionβ
Descriptionβ
This policy identifies AWS ECS Task Definitions where the
pidModeparameter is configured as host.When
pidModeis set tohost, containers within the task share the process ID (PID) namespace of the underlying EC2 host instance. This effectively allows containerized processes to behave as though they are running directly on the host instead of within an isolated container environment.Rationaleβ
Process isolation is a core security feature of containerized workloads. Under normal operation, containers have their own dedicated PID namespace, limiting visibility to processes running solely within that container.
Enabling host PID mode removes this isolation and allows containerized processes to:
- View all processes running on the host system, including system daemons and processes from other containers.
- Interact with host-level processes, potentially sending signals (e.g.,
kill) to critical system components if elevated privileges are present.- Access sensitive information that may be exposed through process listings, such as command-line arguments or environment variables.
... see more
Remediationβ
Remediationβ
Update the ECS Task Definition to Set PID Modeβ
Using the AWS CLIβ
Retrieve the existing task definition JSON
aws ecs describe-task-definition \
--task-definition {{family-or-full-arn}} \
--query 'taskDefinition' > task-def.jsonEdit
task-def.jsonLocate the pidMode key and remove it, or set it to task.
{
"family": "{{my-task}}",
...
"pidMode": "task",
...
}Register the updated task definition
aws ecs register-task-definition --cli-input-json file://task-def.jsonUpdate your ECS service to use the new task definition revision
policy.yamlβ
Linked Framework Sectionsβ
| Section | Sub Sections | Internal Rules | Policies | Flags | Compliance |
|---|---|---|---|---|---|
| πΌ AWS Foundational Security Best Practices v1.0.0 β πΌ [ECS.3] ECS task definitions should not share the host's process namespace | 1 | no data | |||
| πΌ Cloudaware Framework β πΌ Secure Access | 74 | no data | |||
| πΌ FedRAMP High Security Controls β πΌ CM-2 Baseline Configuration (L)(M)(H) | 3 | 1 | 47 | no data | |
| πΌ FedRAMP Low Security Controls β πΌ CM-2 Baseline Configuration (L)(M)(H) | 45 | no data | |||
| πΌ FedRAMP Moderate Security Controls β πΌ CM-2 Baseline Configuration (L)(M)(H) | 3 | 47 | no data | ||
| πΌ NIST SP 800-53 Revision 5 β πΌ CA-9(1) Internal System Connections _ Compliance Checks | 54 | no data | |||
| πΌ NIST SP 800-53 Revision 5 β πΌ CM-2 Baseline Configuration | 7 | 46 | no data |