Skip to content

ec2,iam: the second ec2:CreateTags authorization pass for a resource-creating action that carries tags #691

Closed

Description

@scttfrdmn

Scoped out of #674. When a resource-creating action carries a TagSpecification, real AWS performs a second authorization pass for ec2:CreateTags, distinguished from a direct tagging call by the ec2:CreateAction condition key — which is how AWS's own documented "may create a resource only if it is tagged" policies are written:

{"Effect":"Allow","Action":"ec2:CreateTags","Resource":"*",
 "Condition":{"StringEquals":{"ec2:CreateAction":"RunInstances"}}}

Substrate models neither the second pass nor the condition key, so such a policy has no effect: a RunInstances carrying tags is authorized once, as ec2:RunInstances. A consumer who copies AWS's documented policy gets a false allow on the tagging half.

ec2:CreateAction would be substrate's second ec2:-prefixed condition key, after the one #673's follow-up adds.

Acceptance criteria

  • Exactly which actions trigger the second pass is verified against the API reference (and the SAR's CreateAction rows), not assumed.
  • A tagged resource-creating call is decided twice, and a denial on the tagging pass names ec2:CreateTags in its message so a caller can tell the two apart.
  • ec2:CreateAction is populated with the creating operation's name and evaluated by the existing condition machinery.
  • AWS's documented policy above is reproduced as a test: the call is allowed when tagged and denied when not.
  • DeleteTags is unaffected — it does not carry ec2:CreateAction (established in ec2:CreateTags is authorized against one ARN regardless of how many resources it names #674).

Activity

  1. added this to the v0.106.0 milestone on Aug 20, 2026
  2. added
    type: feature
    area: iam
    on Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ec2area: iamarea: taggingtype: feature

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions