Check provider logo

ECS task definition has logging configured for all containers

ecs_task_definitions_logging_enabled

Severityhigh
Serviceecs
by Prowler

Amazon ECS task definition containers specify a logging configuration with a non-null logDriver for every container in the latest active revision.

Risk

Absent container logs erode visibility, letting intrusions, data exfiltration, and configuration tampering go undetected.

Missing audit trails weaken confidentiality and integrity, hinder forensics, and increase MTTR during outages, impacting availability and compliance evidence.

Run this check with Prowler CLI

prowler aws --checks ecs_task_definitions_logging_enabled

Recommendation

Implement centralized, tamper-resistant container logging for all tasks. Define a logDriver per container and ship logs to a managed destination with restricted access. Apply least privilege, encryption, and retention. Monitor and alert on anomalies. If using external collectors, ensure equivalent coverage and durability.

Remediation

CLI

aws ecs register-task-definition --family <task-family> --container-definitions '[{"name":"<container-name>","image":"<image>","logConfiguration":{"logDriver":"awslogs","options":{"awslogs-group":"<log-group>","awslogs-region":"<region>"}}}]'

Native IaC
Terraform
Other
  1. In the AWS Console, go to Amazon ECS > Task Definitions
  2. Select your task definition and click Create new revision
  3. For each container, open Edit and set Log configuration to awslogs
  4. Set Log group to the desired CloudWatch Logs group and select the Region
  5. Save and Create to register the new revision (ensure all containers have logging)

Source Code

Resource Type

AwsEcsTaskDefinition

References