Files
floci/docs/services
Priamo Germosen cf50025eaa fix(iam): check Amazon MQ by its generated routes, resources and tags (#10172)
Under enforcement a REST route no vendored model names runs unchecked, and Amazon MQ was among them: any caller could
list, create, describe, reboot or delete a broker with no permission at all. MQ's model is vendored now
(regen_rest_routes.MODELS: mq), so each request is checked as its operation's action, and mq joins the generated
tables of request resources, passed roles and tags on create: a broker by the id its path gives, a configuration by
its id, and the tags a create carries, which need mq:CreateTags on the broker of the name it gives. The Service
Reference passes a role to mq.amazonaws.com on CreateBroker and UpdateBroker, which the rule reads from
LdapServerMetadata's roleName and userRoleName by their names. AWS gives LDAP metadata to ActiveMQ brokers alone, which
Floci does not create, and Floci serves no UpdateBroker, so the reading reaches no request Floci serves.

A broker's ARN is broker:${BrokerName}:${BrokerId}, and MQ's requests name a broker by its id alone, so the table
fills only BrokerId, and the reader asks the namespace's service for the resource of the one variable a request fills,
as it does for any type. AmazonMqStoredResourceArns answers it with the caller's broker of the id in the Region, so the
request is checked on the broker's whole ARN rather than broker:*:<id>, which no policy naming a broker matches. It also
answers the tags MQ holds on the broker an ARN names, read in the ARN's account and Region by the id it ends in and
matched on the whole ARN, neither read moving a stored broker.

The table also takes the Service Reference's change to SES since main's sync: TagResource, UntagResource and
ListTagsForResource now act on a multi-region-endpoint too, which the drift check of a change to the table requires.

IamRestRouteEnforcementIntegrationTest checks that with no grant a broker's read is refused, that a grant on one
broker's ARN reads it and refuses another, that a deny on one broker's ARN refuses it and leaves another, that an
aws:ResourceTag condition reads a broker's tags, and that a create carrying tags needs mq:CreateTags on the broker of
its name.
2026-12-04 15:20:38 -04:00
..