More Info:

This rule verifies the PID (Process Identifier) mode configuration in ECS Task Definitions. The PID mode determines how processes within the container interact with the host system’s process namespace. Properly configuring the PID mode can enhance security and resource isolation within ECS tasks. Ensure that the PID mode is set appropriately based on your application’s requirements and security considerations

Risk Level

Medium

Address

Security

Compliance Standards

CBP

Triage and Remediation

Remediation

To remediate the misconfiguration of ECS tasks having PidMode as host in AWS Kubernetes using the AWS console, follow these steps:

  1. Access the AWS Management Console: Go to the AWS Management Console (https://console.aws.amazon.com/).

  2. Navigate to Amazon ECS: Click on the “Services” dropdown menu at the top left corner of the console, then select “ECS” under the “Compute” section.

  3. Select the Cluster: From the ECS dashboard, select the cluster where the ECS tasks with PidMode as host are running.

  4. Select the Task Definition: In the cluster, click on the task definition that includes the ECS tasks with PidMode as host.

  5. Edit Task Definition: In the task definition details page, click on the “Create new revision” button to create a new revision of the task definition.

  6. Update Container Configuration:

    • In the container definitions section, find the container that has PidMode set to “host”.
    • Click on the container to edit its configuration.
    • Locate the “PidMode” parameter and change its value from “host” to “task”.
  7. Save Changes: After updating the container configuration, click on the “Update” button to save the changes to the task definition.

  8. Update Service: If the ECS tasks are part of a service, you will need to update the service to use the new task definition revision.

    • Go back to the cluster dashboard and click on the service that is using the task definition with PidMode as host.
    • Click on the “Update” button to update the service to use the new task definition revision.
  9. Verify Changes: Once the service is updated, verify that the ECS tasks are now using the corrected task definition with PidMode set to “task” instead of “host”.

By following these steps, you have successfully remediated the misconfiguration of ECS tasks having PidMode as host in AWS Kubernetes using the AWS console.