mirror of
https://github.com/floci-io/floci.git
synced 2026-12-04 02:28:08 -05:00
Under enforcement a REST route no vendored model names runs unchecked, and Amazon Connect was among them: any caller could create, describe, update or delete an instance, its attributes or its storage configs. Connect's model routes are vendored (regen_rest_routes.MODELS, signed connect), so each request is checked as its operation's action, and connect joins the generated tables of request resources and tags on create: an instance by the id its path gives, each of Connect's other resources by the members its request names, and the tags a create carries. ConnectStoredResourceArns answers the tags Connect holds on an instance, read in place in the ARN's account and Region, which an aws:ResourceTag condition reads. The table asks for a traffic distribution group or a data table to be found, which Floci does not serve, so there is nothing to find. The table's integer variables now include Connect's customer-managed-view-version ViewVersion, which test_regen_iam_request_resources pins. A namespace the table reads is served on its tag routes only at the ARN its path encodes, so ConnectIntegrationTest's tag calls send the ARN encoded, as the SDKs do, rather than with its '/' raw. IamRestRouteEnforcementIntegrationTest checks that with no grant an instance's read is refused, that a grant on one instance reads it and refuses another, and that an aws:ResourceTag condition reads its tags. ConnectService named an instance by any ARN, reading the text after its first slash, so an ARN of another shape (arn:aws:connect:us-east-1::other/<id>) reached an instance IAM had not checked the request on, past a deny on it. It now takes an instance's own ARN alone, the one IAM checks, refuses an ARN of any other shape, and looks one of another account or Region up as given, which finds nothing; storedTags answers an instance's own ARN alone, so another partition's gets no tags. ConnectStoredResourceArnsTest covers both, IamRestRouteEnforcementIntegrationTest checks that an instance deny holds for each form the path gives it and that a tagged CreateInstance needs connect:TagResource, and docs/services/connect.md says which ARNs are taken.