Files
floci/.github
Priamo Germosen ebdb9c6615 fix(iam): check Bedrock AgentCore by its generated routes, resources, passed roles and tags (#10153)
Under enforcement a REST route no vendored model names runs unchecked, and Bedrock AgentCore was among them: any caller
could create, read, update or delete its runtimes, runtime endpoints, gateways, gateway targets and rules, memories,
harnesses, browsers, code interpreters, workload identities and credential providers, put a resource policy, write and
read memory events and invoke a runtime, with no permission at all. AgentCore's two models are vendored now
(regen_rest_routes.MODELS: bedrock-agentcore and bedrock-agentcore-control, both signed bedrock-agentcore), so each
request is checked as its operation's action, and bedrock-agentcore joins the generated tables of request resources,
passed roles and tags on create: a resource by the id its path gives, the role each create or update passes, and the
tags a create carries.

The Service Reference passes CreateCapacityProvider's roles to bedrock-agentcore and ec2 without saying which member's
goes where. fetch_bedrock_agentcore_roles.py vendors what AWS says of each into
tools/aws/sources/bedrock-agentcore-roles.json, a ROLE_SOURCES entry as Batch's is: the operator role is "the IAM role
that AgentCore assumes to manage the capacity provider" (Control API reference), which AgentCore's capacity provider
sample says must trust bedrock-agentcore.amazonaws.com, and launchParameters.instanceProfileArn is "the IAM instance
profile to associate with launched instances", whose role the IAM User Guide's trust policy for an EC2 instance's role
gives to ec2.amazonaws.com. That member names an instance profile, which the rule does not read by its name, so the
source lists it in roleMembers, and the check that every vendored role is read now counts such members as the table
does.

BedrockAgentCoreStoredResourceArns answers the tags AgentCore holds on the resource an ARN reaches, in its account and
Region, which an aws:ResourceTag condition reads: a runtime, a runtime endpoint, a gateway, a memory or a harness as
the tag routes read the same ARN (a qualified runtime ARN answers the runtime's), and a custom browser, a custom code
interpreter or a browser profile from the tool. The table asks for a consent portal, a code interpreter by its name or
a configuration bundle to be found, which Floci does not serve, and for the memory an event is in, which the path of
GetEvent and DeleteEvent already names. A runtime endpoint's routes are checked on its runtime and a credential
provider's on *, as the generated table reads them: their ARNs end in a ${Name} beside another variable, which no
reading fills.

The tag routes no longer take the agent/<uuid> and agentEndpoint/<uuid> forms Floci wrote before #8088. They name no
AWS resource, so IAM could only check them as named, past a deny on the runtime or endpoint they reached; they now get
a ValidationException, and a legacy agent/ ARN names no runtime on invoke. A CloudFormation stack that holds an
agentEndpoint/<uuid> physical id still updates and deletes that endpoint.

A namespace the table reads is served on its tag routes only at the ARN its path encodes, as Connect's, MSK's and
MWAA's are, so AgentCore's and CloudFormation's AgentCore tests send the ARN encoded, as the SDKs do, and
docs/services/bedrock-agentcore.md says so.

IamRestRouteEnforcementIntegrationTest checks that with no grant a gateway's read is refused, that a grant on one
gateway reads it and refuses another, and that an aws:ResourceTag condition reads its tags; that a gateway create needs
iam:PassRole on its role and bedrock-agentcore:TagResource for the tags it carries; that a data plane event write is
checked on the memory its path names; that an aws:ResourceTag grant reads a browser's tags; and that a deny on a
runtime's tags holds for its ARN and its qualified ARN while the legacy endpoint form is refused.
2026-12-04 10:30:49 -04:00
..