More Info:

This rule verifies if the readonlyRootFilesystem attribute is set to ‘true’ for containers within ECS Task Definitions. Enabling readonly access to the root filesystem enhances security by preventing unauthorized modifications or tampering with critical system files.

Risk Level

Medium

Address

Security

Compliance Standards

CBP

Triage and Remediation

Remediation

To remediate the misconfiguration of ECS not having read-only access for containers in AWS Kubernetes using the AWS console, follow these steps:

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

  2. Navigate to ECS Cluster: Navigate to the ECS Cluster that you want to remediate the misconfiguration for.

  3. Select Task Definition: Select the Task Definition that is associated with the ECS service where you want to enforce read-only access for containers.

  4. Edit Task Definition: Click on the “Actions” dropdown menu and select “Create new revision” to create a new revision of the Task Definition.

  5. Update Container Definitions: In the Task Definition editor, locate the container definition for which you want to enforce read-only access.

  6. Update Container Configuration: In the container configuration section, add the following configuration to enforce read-only access:

    {
        "name": "containerName",
        "readonlyRootFilesystem": true
    }
    

    Replace containerName with the name of your container.

  7. Save Changes: After adding the readonlyRootFilesystem configuration, save the changes to the Task Definition.

  8. Update ECS Service: Go back to the ECS Cluster dashboard and navigate to the ECS Service associated with the Task Definition you just updated.

  9. Update Service: Click on the service and then click on the “Update” button to force the service to use the latest Task Definition revision.

  10. Verify Changes: Once the service has been updated, verify that the containers now have read-only access to the filesystem by checking the container logs or running commands inside the container.

By following these steps, you will be able to remediate the misconfiguration of ECS not having read-only access for containers in AWS Kubernetes using the AWS console.