Profile Applicability:
- Level 1
Description:
Ensure all Amazon ECS clusters have resource tags to facilitate asset management, tracking, and compliance.
Rationale:
Consistent tagging supports compliance and helps identify unauthorized or misconfigured resources. Proper tagging enhances resource organization, facilitates management, and helps with cost allocation and compliance.
Impact:
There is minimal administrative overhead associated with implementing and maintaining resource tags. However, tagging improves the ability to manage and track resources, making it easier to enforce policies.
Default Value:
By default, Amazon ECS clusters have only AWS-managed tags.
Remediation
Test Plan:
Using AWS Console:
Log in to the ECS Console at AWS ECS Console.
In the left panel, click Clusters.
Click the name of a cluster.
Click Tags.
Ensure at least one tag is listed that does not begin with aws:. Tags prefixed with aws: are AWS-managed.
Repeat steps 1–5 for each ECS cluster.
Using AWS CLI:
Run the following command to list clusters:
aws ecs list-clusters
Run the following command to view the tags for a cluster:
aws ecs list-tags-for-resource --resource-arn <cluster-arn>
Ensure that tags are returned that do not begin with aws:. Tags prefixed with aws: are AWS-managed.
Repeat for each cluster.
Implementation Plan:
Using AWS Console:
Log in to the ECS Console at AWS ECS Console.
In the left panel, click Clusters.
Click the name of a cluster.
Click Tags.
Click Manage tags.
Click Add tag.
Provide a Key and an optional Value for the tag.
Click Save.
Repeat steps 1–9 for each ECS cluster requiring remediation.
Using AWS CLI:
For each cluster requiring remediation, run the following command to add tags:
aws ecs tag-resource --resource-arn <cluster-arn> --tags Key=<tag-key>,Value=<tag-value>
Backout Plan:
Using AWS Console:
If any issue arises after tagging, you can remove or modify tags by following the same process but selecting the Delete option for tags.
Using AWS CLI:
To remove tags, run the following command:
aws ecs untag-resource --resource-arn <cluster-arn> --tag-keys <tag-key>