Lesson 5 of 5 Secure Deployment and Resource Sharing

Enforcing a Tagging Strategy as a Security Control

This lesson explains why a consistent, enforced tagging strategy is a security control as well as an operational one, since tags underpin grouping, automation, cost allocation and attribute-based access control.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify standard tags and their security uses.
  • Explain how tag policies and SCPs enforce tags.
  • Explain why the tags used for access control must be protected.

Standard tags

A tagging strategy defines a small set of standard tag keys that every resource carries, and several have security uses. Environment separates production from non-production, so stricter controls and monitoring can target production. Owner identifies who to contact when a finding involves the resource. DataClassification records how sensitive the data is, so access control, encryption requirements and monitoring can depend on it, for example through ABAC policies. CostCenter supports cost allocation. The following table summarises these tags.

TagSecurity use
EnvironmentDifferent controls for production and non-production
OwnerWho to contact about a finding
DataClassificationAccess control, encryption and monitoring by sensitivity
CostCenterCost allocation
Match the pairs

Standard tags and their security use

Exam skills 6.2.2

Match each standard tag with its security use.

Log in to try this activity Interactive activities are free with an account.

Enforcing tags

Tags support cost allocation, automation and attribute-based access control (ABAC), but they are useful only if they are present and consistent. Tags applied by convention alone drift quickly: keys are misspelt, values vary and some resources are not tagged at all. Enforcement therefore combines standardisation, prevention at creation and detection of resources that are still missing tags. The following list describes the mechanisms.

  • Tag policies standardise keys and values.
  • SCPs require tags at creation with aws:RequestTag and aws:TagKeys.
  • AWS Config required-tags rules find resources without required tags.

Protecting access-control tags

When tags are used for ABAC, a tag is effectively a permission. If a developer can change the project tag on a resource, or the tag on their own role, they can grant themselves access to another project's resources. Policies must therefore deny TagResource and UntagResource for access-control tag keys, using the aws:TagKeys condition, except for administrators or during resource creation. Once those tags are protected, Resource Groups, Tag Editor, automation and access policies can rely on them safely.

The following diagram shows the allowed values of a data classification tag and how the tag is kept correct.

Standardising the DataClassification tag. A tag policy allows only public, internal, confidential and restricted and is enforced for S3 buckets, so other values are rejected; an AWS Config required-tags rule lists existing buckets without the tag, and only the security team's role may change it afterwards.
The rejected values are illustrative.
True or false

Tags used for access

Exam skills 6.2.2 · 4.2.2

Check how access-control tags must be protected.

Log in to try this activity Interactive activities are free with an account.
Worked example

Requiring a data classification tag

Macie and access policies rely on a DataClassification tag, but many buckets lack it or use inconsistent values. A tag policy standardises the values and rejects non-compliant ones:

{
  "tags": {
    "DataClassification": {
      "tag_key": { "@@assign": "DataClassification" },
      "tag_value": { "@@assign": ["public", "internal", "confidential", "restricted"] },
      "enforced_for": { "@@assign": ["s3:bucket"] }
    }
  }
}

An AWS Config required-tags rule lists existing buckets without the tag for their owners to fix. Only the security team's role may change the tag afterwards, because access policies and monitoring depend on it.

Check yourself

How can a tag be required when resources are created?

Show answer

With an SCP that denies creation unless aws:RequestTag includes it.

Exam Tips

Remember for the exam

  • To standardise tag keys and values across the organisation, use tag policies.
  • Require tags at creation with an SCP on aws:RequestTag.
  • Find untagged resources with the Config required-tags rule.
  • Tags used for ABAC must be protected from changes.
  • A DataClassification tag supports access control and monitoring by sensitivity.