| name | cis-aws-compute-3.7 |
| description | Ensure logging is configured for Amazon ECS task definitions |
| category | cis-compute |
| version | 1.1.0 |
| author | cyberstrike-official |
| tags | ["cis","aws","compute","ecs","containers","task-definitions","logging","monitoring"] |
| cis_id | 3.7 |
| cis_benchmark | CIS AWS Compute Services Benchmark v1.1.0 |
| tech_stack | ["aws"] |
| cwe_ids | [] |
| chains_with | ["cis-aws-compute-3.9"] |
| prerequisites | [] |
| severity_boost | {} |
Ensure logging is configured for Amazon ECS task definitions
Description
Configure logging for Amazon ECS task definitions to capture detailed application and container activity.
Note: This recommendation assumes that only the latest active revision of a task definition is in use. If older revisions are in use, apply the audit and remediation procedures to those revisions as needed.
Rationale
Logging facilitates effective monitoring, troubleshooting, and incident response, improving security and enabling rapid threat detection.
Impact
Logging can incur costs for storage and processing, along with initial configuration and ongoing management.
Audit Procedure
Using AWS Console
- Login to the ECS console using https://console.aws.amazon.com/ecs/.
- In the left panel, click
Task definitions.
- Click the name of a task definition.
- Click on the latest active revision of the task definition.
- Click
JSON.
- Ensure that at least one element under
containerDefinitions has a logConfiguration property defined, and that the value for logDriver is not null.
- Repeat steps 1-6 for each task definition.
Using AWS CLI
Run the following command to list task definitions:
aws ecs list-task-definitions
For the latest revision of a task definition, run the following command:
aws ecs describe-task-definition --task-definition <task-definition-arn> --query 'taskDefinition.containerDefinitions[*].logConfiguration'
Ensure that the command returns at least one logConfiguration object, and that the value for logDriver is not null.
Repeat for each task definition.
Expected Result
At least one container in each task definition should have a logConfiguration with a valid logDriver configured.
Remediation
Using AWS Console
- Login to the ECS console using https://console.aws.amazon.com/ecs/.
- In the left panel, click
Task definitions.
- Click the name of a task definition.
- Click on the latest active revision of the task definition.
- Click .