AWS Bedrock AgentCore Resource Created with IAM Execution Role
Description
Detects the creation of an AWS Bedrock AgentCore resource (code interpreter, agent runtime, browser, or harness) with an IAM execution role attached. When an attacker with iam:PassRole permission creates an AgentCore resource and attaches a privileged role, subsequent invocations inside that resource execute as the attached role — enabling privilege escalation to roles that trust bedrock-agentcore.amazonaws.com.
Query · kuery
event.dataset: "aws.cloudtrail" and
event.provider: "bedrock-agentcore.amazonaws.com" and
event.action: (
"CreateCodeInterpreter" or
"CreateAgentRuntime" or
"CreateBrowser" or
"CreateHarness"
) and
event.outcome: "success" and
aws.cloudtrail.request_parameters: (*executionRoleArn* or *roleArn*) and
not aws.cloudtrail.user_identity.invoked_by: ("bedrock-agentcore.amazonaws.com" or "cloudformation.amazonaws.com")
Known false positives
- Legitimate provisioning of Bedrock AgentCore resources by CI/CD pipelines or platform engineers. Validate the caller identity against expected provisioning principals and verify the attached role is commensurate with the workload's documented requirements.
Analyst notes
Investigating AWS Bedrock AgentCore Resource Created with IAM Execution Role
AWS Bedrock AgentCore services (code interpreters, agent runtimes, browsers, harnesses) run user workloads inside isolated MicroVMs. When an IAM role is attached at creation time, all code executing inside the resource assumes that role's identity. An attacker with iam:PassRole and bedrock-agentcore:Create* permissions can attach a privileged role and then invoke the resource to operate as that role.
The four Create* events covered here are management-plane events logged to CloudTrail by default. The subsequent Start*/Invoke* data-plane events are NOT captured by the default management events trail and cannot be detected without enabling data-plane logging.
Possible investigation steps
- Check the caller identity (
aws.cloudtrail.user_identity.arn) against expected provisioning principals. Unexpected users or roles creating AgentCore resources should be investigated. - Examine
aws.cloudtrail.request_parametersfor the attached role ARN (executionRoleArnorroleArn) and evaluate whether that role has permissions beyond what the AgentCore workload legitimately requires. - Check for subsequent
StartCodeInterpreterSession,StartBrowserSession, orInvokeAgentRuntimeevents from the same caller against the newly created resource (requires data-plane logging to be enabled). - Review the IAM PassRole permission of the calling identity and whether it is constrained by
iam:PassedToServiceconditions.
False positive analysis
- Automated provisioning by CDK/CloudFormation/Terraform with a known service account.
- Platform engineering pipelines deploying Bedrock-based AI workloads.
- Filter on
user_agent.originalfor known IaC tools.
Response and remediation
- Suspend the calling identity's iam:PassRole permission while investigating.
- Delete the newly created AgentCore resource to stop active sessions.
- Rotate the attached execution role's credentials if exploitation is confirmed.
- Enable data-plane logging for bedrock-agentcore to detect subsequent session invocations.