ECS task definitions should configure non-administrator users in Windows container definitions
Checks that every container in the task definition family's latest active revision sets user to an account other than ContainerAdministrator or Administrator, when the revision declares a Windows runtimePlatform; an empty user fails. Running as an administrator raises the risk of a container escape reaching the host.
- service
- ECS
- severity
- Medium
- scope
- evaluated in every region
How to fix it
- Can break clients: An image whose entrypoint needs administrator rights, such as the ASP.NET image's ServiceMonitor for IIS, fails as containeruser, so confirm the image works as that user first.
In the console
ECS → Task definitions → the family → the latest revision → Create new revision with JSON
- user
- containeruser, or another non-administrator account, in every container
- Task definition
- The new revision, on each service's Update page and in each scheduled task; running tasks keep the old one
With Terraform
resource "aws_ecs_task_definition" "this" {
family = "example"
runtime_platform {
operating_system_family = "WINDOWS_SERVER_2022_CORE"
}
container_definitions = jsonencode([{
name = "app"
image = var.container_image
user = "containeruser"
}])
}
See which of your accounts this check is failing on.
Book a live scan