Skip to main content

πŸ›‘οΈ 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 Type: COMPLIANCE_POLICY
  • Policy Categories: SECURITY

Logic​

Similar Policies​

Description​

Open File

Description​

This policy identifies AWS ECS Task Definitions where the pidMode parameter is configured as host.

When pidMode is set to host, 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:

  1. View all processes running on the host system, including system daemons and processes from other containers.
  2. Interact with host-level processes, potentially sending signals (e.g., kill) to critical system components if elevated privileges are present.
  3. Access sensitive information that may be exposed through process listings, such as command-line arguments or environment variables.

... see more

Remediation​

Open File

Remediation​

Update the ECS Task Definition to Set PID Mode​

Using the AWS CLI​
  1. Retrieve the existing task definition JSON

    aws ecs describe-task-definition \
    --task-definition {{family-or-full-arn}} \
    --query 'taskDefinition' > task-def.json
  2. Edit task-def.json

    Locate the pidMode key and remove it, or set it to task.

    {
    "family": "{{my-task}}",
    ...
    "pidMode": "task",
    ...
    }
  3. Register the updated task definition

    aws ecs register-task-definition --cli-input-json file://task-def.json
  4. Update your ECS service to use the new task definition revision

policy.yaml​

Open File

Linked Framework Sections​

SectionSub SectionsInternal RulesPoliciesFlagsCompliance
πŸ’Ό AWS Foundational Security Best Practices v1.0.0 β†’ πŸ’Ό [ECS.3] ECS task definitions should not share the host's process namespace1no data
πŸ’Ό Cloudaware Framework β†’ πŸ’Ό Secure Access74no data
πŸ’Ό FedRAMP High Security Controls β†’ πŸ’Ό CM-2 Baseline Configuration (L)(M)(H)3147no data
πŸ’Ό FedRAMP Low Security Controls β†’ πŸ’Ό CM-2 Baseline Configuration (L)(M)(H)45no data
πŸ’Ό FedRAMP Moderate Security Controls β†’ πŸ’Ό CM-2 Baseline Configuration (L)(M)(H)347no data
πŸ’Ό NIST SP 800-53 Revision 5 β†’ πŸ’Ό CA-9(1) Internal System Connections _ Compliance Checks54no data
πŸ’Ό NIST SP 800-53 Revision 5 β†’ πŸ’Ό CM-2 Baseline Configuration746no data