Files
floci/docs/services
Priamo Germosen 1b5c862c2f fix(iam): read the stored tags of ElastiCache resources (#9839)
The request-resources table gives resource-tag keys to ElastiCache's user, user group, replication group, cluster,
snapshot, subnet group, parameter group and serverless cache types, but ElastiCache gave IAM none of the tags it
stores, so an aws:ResourceTag condition on one of its actions never matched: an Allow scoped to a tag never applied
and a Deny scoped to one never refused.

ElastiCacheStoredResourceArns reads ElastiCacheService.storedTags, and ElastiCacheServerlessService.storedTags for a
serverless cache. A resource stored with its ARN is matched on its kind and id, as the handlers find it: those that change or delete
a user, user group, replication group, cluster or snapshot find it by its id whatever Region a request is signed
for, so IAM checks the one they act on; a subnet group,
stored by name alone, only in the request's Region, where ListTagsForResource reads it; a parameter group in the
ARN's Region. A user group's id and a serverless cache's name are read in lower case, as the handlers find them,
so a request spelling one in another case is checked with its tags. Each is read in place (AccountAwareStorageBackend.readInAccount): the handlers' lookups move a
pre-multi-account entry into the caller's account, which a read made before the request is allowed must not do. Each
kind's tags change in place under its own lock, so the read copies them under that lock, taken
only once the resource is found (an ARN naming nothing leaves no lock behind) and finding it again under it. A
serverless cache's tags are replaced whole on each change, so its copy needs no lock.

ElastiCacheResourceTagIamIntegrationTest checks a caller allowed elasticache:DeleteUser and
elasticache:DeleteCacheParameterGroup only on resources tagged team=blue deletes the blue one and is refused the red
one, and the same for elasticache:DeleteUserGroup with the group's id in upper case, and that a Deny on
team=red refuses a delete of the red user signed for another Region; ElastiCacheServiceTest and ElastiCacheServerlessServiceTest check the reads, their copies, the ARNs that name
nothing, that reading those leaves the lock count as it was, and that a legacy user is read where it is.
2026-11-30 10:30:23 -04:00
..