Remediation
Update the ECS Task Definition to Read-Only Root Filesystemβ
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.json -
Edit
task-def.jsonFor every container in the
containerDefinitionslist, setreadonlyRootFilesystemto true."containerDefinitions": [
{
"name": "my-app",
"image": "my-image",
"readonlyRootFilesystem": true,
...
}
] -
Register the updated task definition
aws ecs register-task-definition --cli-input-json file://task-def.json -
Update your ECS service to use the new task definition revision