Skip to content

[New Rule] AWS Bedrock AgentCore Resource Created with IAM Execution Role - #6697

Open
bryans3c wants to merge 2 commits into
mainfrom
detection/aws-bedrock-agentcore-privesc
Open

[New Rule] AWS Bedrock AgentCore Resource Created with IAM Execution Role#6697
bryans3c wants to merge 2 commits into
mainfrom
detection/aws-bedrock-agentcore-privesc

Conversation

@bryans3c

Copy link
Copy Markdown
Contributor

Pull Request

Issue link(s):

Summary - What I changed

Added a KQL query rule that detects the creation of an AWS Bedrock AgentCore resource (code interpreter, agent runtime, browser, or harness) with an IAM execution role attached via iam:PassRole.

Why it matters

AWS Bedrock AgentCore resources 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 to a new AgentCore resource and then invoke it to operate as that role, escalating privileges to any role that trusts bedrock-agentcore.amazonaws.com as a service principal.

How To Test

Query to verify in our TRaDE stack:

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 user_agent.original: (*Terraform* or *Pulumi*)

Checklist

  • Added a label for the type of pr: Rule: New
  • Secret and sensitive material has been managed correctly
  • Automated testing was updated or added to match the
  • Documentation and comments were added for features that require explanation

Contributor checklist

  • Have you signed the contributor license agreement?
  • Have you followed the contributor guidelines?

@bryans3c bryans3c self-assigned this Aug 25, 2026
Copilot AI lite review requested due to automatic review settings August 25, 2026 09:38
@bryans3c bryans3c added Integration: AWS AWS related rules Rule: New Proposal for new rule Domain: Cloud labels Aug 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new AWS CloudTrail KQL detection rule aimed at identifying potential privilege escalation via AWS Bedrock AgentCore resource creation when an IAM execution role is attached at creation time.

Changes:

  • Introduces a new query rule targeting bedrock-agentcore.amazonaws.com Create* actions where executionRoleArn/roleArn appears in request parameters.
  • Adds an investigation guide describing triage, false positives, and response/remediation guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@terrancedejesus terrancedejesus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, added a suggestion.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants