Repository navigation
Description
What
TagUser, UntagUser, TagRole and UntagRole (emulator/iam_plugin.go:2190-2549) enforce none
of the tag rules AWS documents, and emit none of the error codes AWS documents for them.
Absent today:
- No 50-tag cap. AWS:
Tagsis "Array Members: Maximum number of 50 items" on every IAM
tagging request, andCreateUsersays "If any one of the tags is invalid or if you exceed the
allowed maximum number of tags, then the entire request fails and the resource is not created"
(https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateUser.html). - No
aws:prefix rejection. "You cannot create a tag key or value that begins with the text
aws:" (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html). - No empty-key rejection. Same page: "You can create a tag with an empty value such as
phoneNumber =. You cannot create an empty tag key."iamMemberTags
(emulator/iam_query.go:328-345) silently drops a member with neither key nor value. - No character-set check. "Tag keys and values can include any combination of letters, numbers,
spaces, and_ . : / = + - @symbols." - Case sensitivity is backwards for users and roles. The merge in
tagUser/tagRole
(iam_plugin.go:2226-2239) compares keys case-sensitively, but the User Guide says "Tag key
values for IAM users and roles are not case sensitive, but case is preserved. This means that you
cannot have separateDepartmentanddepartmenttag keys." Keys are case-sensitive for
customer managed policies, instance profiles, OIDC providers, SAML providers, server certificates
and virtual MFA devices — so the rule differs by entity type and cannot be applied uniformly.
Error codes: substrate answers ValidationError/400 for a missing name and NoSuchEntity/404 for an
absent entity. AWS's TagUser documents ConcurrentModification/409, InvalidInput/400,
LimitExceeded/409, NoSuchEntity/404 and ServiceFailure/500
(https://docs.aws.amazon.com/IAM/latest/APIReference/API_TagUser.html); substrate emits neither
InvalidInput nor LimitExceeded.
Why this is its own issue
Every item above turns a request substrate accepts today into one it refuses, so a consumer whose
test tags 60 keys, or uses an aws:-prefixed key, or relies on Department and department being
distinct, changes behaviour on upgrade. That earns its own release note rather than riding along
inside #796, which is about what a read reports and what can be tagged.
Deliberately split out of #796 while planning v0.112.0, with the user's confirmation.
Acceptance criteria
- The 50-tag cap is enforced on
CreateUser,CreateRole,TagUserandTagRole, with the
error code AWS documents rather than a substituted one - An
aws:-prefixed key or value, an empty key, and a character outside the documented set are
each refused with a cited code - Tag keys are treated case-insensitively for users and roles and case-sensitively for the
entity types AWS lists as sensitive — one rule per entity type, cited - Whichever of
ConcurrentModification/ServiceFailuresubstrate cannot reach is stated as
out of scope with the reason, rather than left unmentioned -
docs/services.mdrecords what is validated and what is not
Activity
feat(iam): validate a tag against the rules AWS publishes (#806) (#822)