agentcore-iam-audit 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentcore_iam_audit-0.1.1/.gitattributes +2 -0
- agentcore_iam_audit-0.1.1/.github/dependabot.yml +10 -0
- agentcore_iam_audit-0.1.1/.github/workflows/ci.yml +33 -0
- agentcore_iam_audit-0.1.1/.github/workflows/release.yml +63 -0
- agentcore_iam_audit-0.1.1/.gitignore +10 -0
- agentcore_iam_audit-0.1.1/CHANGELOG.md +17 -0
- agentcore_iam_audit-0.1.1/LICENSE +21 -0
- agentcore_iam_audit-0.1.1/PKG-INFO +113 -0
- agentcore_iam_audit-0.1.1/README.md +88 -0
- agentcore_iam_audit-0.1.1/SECURITY.md +5 -0
- agentcore_iam_audit-0.1.1/docs/demo.svg +195 -0
- agentcore_iam_audit-0.1.1/pyproject.toml +49 -0
- agentcore_iam_audit-0.1.1/src/agentcore_iam_audit/__init__.py +3 -0
- agentcore_iam_audit-0.1.1/src/agentcore_iam_audit/__main__.py +3 -0
- agentcore_iam_audit-0.1.1/src/agentcore_iam_audit/checks.py +269 -0
- agentcore_iam_audit-0.1.1/src/agentcore_iam_audit/cli.py +135 -0
- agentcore_iam_audit-0.1.1/src/agentcore_iam_audit/iam.py +113 -0
- agentcore_iam_audit-0.1.1/src/agentcore_iam_audit/live.py +64 -0
- agentcore_iam_audit-0.1.1/src/agentcore_iam_audit/policy.py +88 -0
- agentcore_iam_audit-0.1.1/tests/build_fixture.py +159 -0
- agentcore_iam_audit-0.1.1/tests/fixtures/account_gaad.json +1297 -0
- agentcore_iam_audit-0.1.1/tests/fixtures/aws_managed_BedrockAgentCoreFullAccess.json +489 -0
- agentcore_iam_audit-0.1.1/tests/fixtures/toolkit_policy_2025_12_03.json +230 -0
- agentcore_iam_audit-0.1.1/tests/fixtures/toolkit_policy_current.json +182 -0
- agentcore_iam_audit-0.1.1/tests/fixtures/toolkit_trust_policy.json +21 -0
- agentcore_iam_audit-0.1.1/tests/test_audit.py +317 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
name: test (${{ matrix.os }}, py${{ matrix.python }})
|
|
14
|
+
runs-on: ${{ matrix.os }}
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
19
|
+
python: ["3.11", "3.12", "3.13", "3.14"]
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
22
|
+
with:
|
|
23
|
+
persist-credentials: false
|
|
24
|
+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
25
|
+
with:
|
|
26
|
+
python-version: ${{ matrix.python }}
|
|
27
|
+
- run: python -m pip install -e ".[dev]"
|
|
28
|
+
- run: ruff check .
|
|
29
|
+
- run: ruff format --check .
|
|
30
|
+
- run: pytest -q
|
|
31
|
+
- name: Fixture is reproducible from the real policy documents
|
|
32
|
+
run: python tests/build_fixture.py && git diff --exit-code tests/fixtures/account_gaad.json
|
|
33
|
+
shell: bash
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
15
|
+
with:
|
|
16
|
+
persist-credentials: false
|
|
17
|
+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
18
|
+
with:
|
|
19
|
+
python-version: "3.13"
|
|
20
|
+
- run: python -m pip install build && python -m build
|
|
21
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
22
|
+
with:
|
|
23
|
+
name: dist
|
|
24
|
+
path: dist/
|
|
25
|
+
|
|
26
|
+
github-release:
|
|
27
|
+
needs: build
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
permissions:
|
|
30
|
+
contents: write
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
33
|
+
with:
|
|
34
|
+
persist-credentials: false
|
|
35
|
+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
36
|
+
with:
|
|
37
|
+
name: dist
|
|
38
|
+
path: dist/
|
|
39
|
+
- name: Extract changelog section
|
|
40
|
+
env:
|
|
41
|
+
TAG: ${{ github.ref_name }}
|
|
42
|
+
run: |
|
|
43
|
+
awk -v h="## [${TAG#v}]" 'index($0, h) == 1 {f=1; next} /^## / && f {exit} f' CHANGELOG.md > notes.md
|
|
44
|
+
cat notes.md
|
|
45
|
+
- uses: softprops/action-gh-release@8a0cd651e5b2365bd640854a3fa5dfc70e4875f3 # v3.0.4
|
|
46
|
+
with:
|
|
47
|
+
body_path: notes.md
|
|
48
|
+
files: dist/*
|
|
49
|
+
|
|
50
|
+
pypi:
|
|
51
|
+
# Enable by creating a PyPI trusted publisher for this repo and setting repo variable PYPI_PUBLISH=true.
|
|
52
|
+
if: ${{ vars.PYPI_PUBLISH == 'true' }}
|
|
53
|
+
needs: build
|
|
54
|
+
runs-on: ubuntu-latest
|
|
55
|
+
environment: pypi
|
|
56
|
+
permissions:
|
|
57
|
+
id-token: write
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
60
|
+
with:
|
|
61
|
+
name: dist
|
|
62
|
+
path: dist/
|
|
63
|
+
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), versioning: [SemVer](https://semver.org/).
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [0.1.1] - 2026-11-21
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Published to PyPI.
|
|
11
|
+
|
|
12
|
+
## [0.1.0] - 2026-11-21
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- IAM evaluator (Allow/Deny, NotAction/NotResource, wildcards, permission boundaries, `iam:PassedToService`) with probe ARNs for resources a principal does not own.
|
|
16
|
+
- Checks ACIA-001..005 (cross-agent memory, runtime, code interpreter, image and identity-secret access), ACIA-010/011 (code-interpreter privilege escalation), ACIA-020 (starter-toolkit default roles), ACIA-021 (confused-deputy trust), ACIA-030 (live: PUBLIC-network code interpreters with roles).
|
|
17
|
+
- Offline (`--gaad`), live (`--live`, boto3) and single-policy (`--policy`) modes; text and JSON output.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Murat Bekgi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: agentcore-iam-audit
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Find Amazon Bedrock AgentCore IAM paths: agents reaching other agents' memory, runtimes, code interpreters and secrets, and code-interpreter privilege escalation.
|
|
5
|
+
Project-URL: Homepage, https://github.com/garag0l/agentcore-iam-audit
|
|
6
|
+
Project-URL: Issues, https://github.com/garag0l/agentcore-iam-audit/issues
|
|
7
|
+
Project-URL: Changelog, https://github.com/garag0l/agentcore-iam-audit/blob/main/CHANGELOG.md
|
|
8
|
+
Author: Murat Bekgi
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agentcore,ai-security,aws,bedrock,cloud-security,iam,privilege-escalation,security
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Information Technology
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Security
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
|
+
Provides-Extra: dev
|
|
19
|
+
Requires-Dist: boto3>=1.40; extra == 'dev'
|
|
20
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
21
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
22
|
+
Provides-Extra: live
|
|
23
|
+
Requires-Dist: boto3>=1.40; extra == 'live'
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# agentcore-iam-audit
|
|
27
|
+
|
|
28
|
+
**Find the IAM paths that let one Amazon Bedrock AgentCore agent read or poison another agent's memory, invoke other agents, use their code interpreters, or let a developer run code as a more powerful role.**
|
|
29
|
+
|
|
30
|
+
[](https://github.com/garag0l/agentcore-iam-audit/actions/workflows/ci.yml)
|
|
31
|
+
[](LICENSE)
|
|
32
|
+

|
|
33
|
+

|
|
34
|
+
|
|
35
|
+

|
|
36
|
+
|
|
37
|
+
## Why this exists
|
|
38
|
+
|
|
39
|
+
- **Agent "God Mode" (Unit 42, April 2026).** Execution roles auto-created by the AgentCore starter toolkit granted access to `memory/*`, `runtime/*`, `code-interpreter/*` and `repository/*`. Any agent could pull another agent's image, find its memory ID, then dump or poison that agent's memory, and invoke any other agent. AWS's answer: the default roles are for development and testing and "should never be used in a production system". The toolkit template was scoped down on 2025-12-09, but roles created before that still exist in accounts. ([Unit 42](https://unit42.paloaltonetworks.com/exploit-of-aws-agentcore-iam-god-mode/))
|
|
40
|
+
- **Code-interpreter privilege escalation (Sonrai, 2025).** A principal with `iam:PassRole` + `CreateCodeInterpreter` + `InvokeCodeInterpreter` runs code as the interpreter's role, and CloudTrail attributes the calls to the interpreter, not to the person. ([Sonrai](https://sonraisecurity.com/blog/aws-agentcore-privilege-escalation-bedrock-scp-fix/), [CSA](https://labs.cloudsecurityalliance.org/research/csa-research-note-bedrock-agentcore-enterprise-attack-surfac/))
|
|
41
|
+
- **AWS's own managed policy feeds that path.** `BedrockAgentCoreFullAccess` (v21) grants `bedrock-agentcore:*` and `iam:PassRole` on every role whose name contains `BedrockAgentCore`. That includes the toolkit's default roles and any admin role someone named `...BedrockAgentCore...`.
|
|
42
|
+
|
|
43
|
+
General IAM scanners don't model AgentCore resources. This tool asks the concrete question for each role: *can it reach a resource belonging to a **different** agent?* It evaluates Allow, Deny, NotAction/NotResource and permission boundaries against probe ARNs.
|
|
44
|
+
|
|
45
|
+
## Install
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pipx install agentcore-iam-audit # offline mode, zero dependencies
|
|
49
|
+
pipx install "agentcore-iam-audit[live]" # + live mode (boto3)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Usage
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Offline: no credentials on the machine running the audit
|
|
56
|
+
aws iam get-account-authorization-details > gaad.json
|
|
57
|
+
agentcore-iam-audit --gaad gaad.json
|
|
58
|
+
|
|
59
|
+
# Live, read-only: IAM + AgentCore inventory (code interpreters, runtimes, browsers)
|
|
60
|
+
agentcore-iam-audit --live --profile audit --region us-east-1 --region us-west-2
|
|
61
|
+
|
|
62
|
+
# Before deploying: check one execution-role policy (e.g. from CDK/Terraform output)
|
|
63
|
+
agentcore-iam-audit --policy role-policy.json --trust trust-policy.json --role-name my-agent-role
|
|
64
|
+
|
|
65
|
+
agentcore-iam-audit --gaad gaad.json -f json --fail-on medium
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Live mode needs `iam:GetAccountAuthorizationDetails` plus `bedrock-agentcore:List*`/`Get*` on code interpreters, runtimes and browsers. The AWS managed `SecurityAudit` policy covers the IAM part. Exit code `1` when anything is at or above `--fail-on` (default `high`).
|
|
69
|
+
|
|
70
|
+
## Checks
|
|
71
|
+
|
|
72
|
+
| ID | Severity | Who | Finding |
|
|
73
|
+
|---|---|---|---|
|
|
74
|
+
| ACIA-001 | high | agent role | Read or write memory not owned by this agent (memory dump / poisoning) |
|
|
75
|
+
| ACIA-002 | high | agent role | `InvokeAgentRuntime` on other agents |
|
|
76
|
+
| ACIA-003 | high | agent role | Invoke other code interpreters in the account (code runs as *their* roles) |
|
|
77
|
+
| ACIA-004 | medium | agent role | Pull other agents' container images (memory IDs and config inside) |
|
|
78
|
+
| ACIA-005 | medium | agent role | `GetSecretValue` on **all** AgentCore Identity credential-provider secrets (`bedrock-agentcore-identity!default/oauth2/*`, `/apikey/*`) |
|
|
79
|
+
| ACIA-010 | high / medium | any principal | Privilege escalation: PassRole an AgentCore role + Create/InvokeCodeInterpreter. High when a passable role is admin-equivalent |
|
|
80
|
+
| ACIA-011 | medium | any principal | Run code in existing custom code interpreters as their execution roles |
|
|
81
|
+
| ACIA-020 | low | agent role | Starter-toolkit default role (`AmazonBedrockAgentCoreSDKRuntime-*`, `...SDKCodeBuild-*`, `AgentCoreEvalsSDK-*`) |
|
|
82
|
+
| ACIA-021 | medium | agent role | Trust policy for `bedrock-agentcore.amazonaws.com` without `aws:SourceAccount`/`aws:SourceArn` (confused deputy) |
|
|
83
|
+
| ACIA-030 | medium | live | Custom code interpreter with an execution role in `PUBLIC` network mode (credential exfiltration path) |
|
|
84
|
+
|
|
85
|
+
"Agent role" means a role that `bedrock-agentcore.amazonaws.com` can assume. Findings marked `(conditional)` came from a statement with a Condition the tool didn't evaluate; check it by hand.
|
|
86
|
+
|
|
87
|
+
## How it was tested
|
|
88
|
+
|
|
89
|
+
- **Real policy documents, not invented ones:**
|
|
90
|
+
- the starter toolkit's execution-role template from just before the 2025-12-09 scoping fix, and the current version, both rendered with Jinja2 as the toolkit does;
|
|
91
|
+
- its trust policy;
|
|
92
|
+
- AWS's managed `BedrockAgentCoreFullAccess` (v21, from the [MAMIP](https://github.com/z0ph/MAMIP) archive).
|
|
93
|
+
- **Results:**
|
|
94
|
+
- The pre-fix role produces every Unit 42 path.
|
|
95
|
+
- The current role produces only ACIA-005 and the default-role notice.
|
|
96
|
+
- A user holding only `BedrockAgentCoreFullAccess` is flagged for escalation to an admin role named `MyBedrockAgentCoreDeployRole`, but not to `prod-admin`.
|
|
97
|
+
- **Negative cases:** explicit `Deny` + `NotResource`, a read-only permission boundary, PassRole limited to another service (`iam:PassedToService`), region-scoped policies, and admin principals (nothing to escalate to).
|
|
98
|
+
- **Live mode:** tested with botocore's `Stubber`, so every request and response is validated against AWS's real API model for `bedrock-agentcore-control`.
|
|
99
|
+
- **CI:** Linux/macOS/Windows × Python 3.11–3.14. CI also rebuilds the account fixture from the source documents and fails if it drifts.
|
|
100
|
+
|
|
101
|
+
## Limits
|
|
102
|
+
|
|
103
|
+
- SCPs, resource-based policies and session policies aren't evaluated. A finding means "identity policy allows it". An SCP may still block it, as Sonrai and CSA recommend.
|
|
104
|
+
- Conditions other than `iam:PassedToService` are reported, not evaluated.
|
|
105
|
+
- "Admin-equivalent" means the role can modify IAM role policies or create user access keys.
|
|
106
|
+
|
|
107
|
+
## Responsible use
|
|
108
|
+
|
|
109
|
+
For accounts you own or are authorized to assess. The tool is read-only: offline mode reads a JSON file, and live mode calls only `Get*`/`List*` APIs.
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# agentcore-iam-audit
|
|
2
|
+
|
|
3
|
+
**Find the IAM paths that let one Amazon Bedrock AgentCore agent read or poison another agent's memory, invoke other agents, use their code interpreters, or let a developer run code as a more powerful role.**
|
|
4
|
+
|
|
5
|
+
[](https://github.com/garag0l/agentcore-iam-audit/actions/workflows/ci.yml)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
## Why this exists
|
|
13
|
+
|
|
14
|
+
- **Agent "God Mode" (Unit 42, April 2026).** Execution roles auto-created by the AgentCore starter toolkit granted access to `memory/*`, `runtime/*`, `code-interpreter/*` and `repository/*`. Any agent could pull another agent's image, find its memory ID, then dump or poison that agent's memory, and invoke any other agent. AWS's answer: the default roles are for development and testing and "should never be used in a production system". The toolkit template was scoped down on 2025-12-09, but roles created before that still exist in accounts. ([Unit 42](https://unit42.paloaltonetworks.com/exploit-of-aws-agentcore-iam-god-mode/))
|
|
15
|
+
- **Code-interpreter privilege escalation (Sonrai, 2025).** A principal with `iam:PassRole` + `CreateCodeInterpreter` + `InvokeCodeInterpreter` runs code as the interpreter's role, and CloudTrail attributes the calls to the interpreter, not to the person. ([Sonrai](https://sonraisecurity.com/blog/aws-agentcore-privilege-escalation-bedrock-scp-fix/), [CSA](https://labs.cloudsecurityalliance.org/research/csa-research-note-bedrock-agentcore-enterprise-attack-surfac/))
|
|
16
|
+
- **AWS's own managed policy feeds that path.** `BedrockAgentCoreFullAccess` (v21) grants `bedrock-agentcore:*` and `iam:PassRole` on every role whose name contains `BedrockAgentCore`. That includes the toolkit's default roles and any admin role someone named `...BedrockAgentCore...`.
|
|
17
|
+
|
|
18
|
+
General IAM scanners don't model AgentCore resources. This tool asks the concrete question for each role: *can it reach a resource belonging to a **different** agent?* It evaluates Allow, Deny, NotAction/NotResource and permission boundaries against probe ARNs.
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pipx install agentcore-iam-audit # offline mode, zero dependencies
|
|
24
|
+
pipx install "agentcore-iam-audit[live]" # + live mode (boto3)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Offline: no credentials on the machine running the audit
|
|
31
|
+
aws iam get-account-authorization-details > gaad.json
|
|
32
|
+
agentcore-iam-audit --gaad gaad.json
|
|
33
|
+
|
|
34
|
+
# Live, read-only: IAM + AgentCore inventory (code interpreters, runtimes, browsers)
|
|
35
|
+
agentcore-iam-audit --live --profile audit --region us-east-1 --region us-west-2
|
|
36
|
+
|
|
37
|
+
# Before deploying: check one execution-role policy (e.g. from CDK/Terraform output)
|
|
38
|
+
agentcore-iam-audit --policy role-policy.json --trust trust-policy.json --role-name my-agent-role
|
|
39
|
+
|
|
40
|
+
agentcore-iam-audit --gaad gaad.json -f json --fail-on medium
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Live mode needs `iam:GetAccountAuthorizationDetails` plus `bedrock-agentcore:List*`/`Get*` on code interpreters, runtimes and browsers. The AWS managed `SecurityAudit` policy covers the IAM part. Exit code `1` when anything is at or above `--fail-on` (default `high`).
|
|
44
|
+
|
|
45
|
+
## Checks
|
|
46
|
+
|
|
47
|
+
| ID | Severity | Who | Finding |
|
|
48
|
+
|---|---|---|---|
|
|
49
|
+
| ACIA-001 | high | agent role | Read or write memory not owned by this agent (memory dump / poisoning) |
|
|
50
|
+
| ACIA-002 | high | agent role | `InvokeAgentRuntime` on other agents |
|
|
51
|
+
| ACIA-003 | high | agent role | Invoke other code interpreters in the account (code runs as *their* roles) |
|
|
52
|
+
| ACIA-004 | medium | agent role | Pull other agents' container images (memory IDs and config inside) |
|
|
53
|
+
| ACIA-005 | medium | agent role | `GetSecretValue` on **all** AgentCore Identity credential-provider secrets (`bedrock-agentcore-identity!default/oauth2/*`, `/apikey/*`) |
|
|
54
|
+
| ACIA-010 | high / medium | any principal | Privilege escalation: PassRole an AgentCore role + Create/InvokeCodeInterpreter. High when a passable role is admin-equivalent |
|
|
55
|
+
| ACIA-011 | medium | any principal | Run code in existing custom code interpreters as their execution roles |
|
|
56
|
+
| ACIA-020 | low | agent role | Starter-toolkit default role (`AmazonBedrockAgentCoreSDKRuntime-*`, `...SDKCodeBuild-*`, `AgentCoreEvalsSDK-*`) |
|
|
57
|
+
| ACIA-021 | medium | agent role | Trust policy for `bedrock-agentcore.amazonaws.com` without `aws:SourceAccount`/`aws:SourceArn` (confused deputy) |
|
|
58
|
+
| ACIA-030 | medium | live | Custom code interpreter with an execution role in `PUBLIC` network mode (credential exfiltration path) |
|
|
59
|
+
|
|
60
|
+
"Agent role" means a role that `bedrock-agentcore.amazonaws.com` can assume. Findings marked `(conditional)` came from a statement with a Condition the tool didn't evaluate; check it by hand.
|
|
61
|
+
|
|
62
|
+
## How it was tested
|
|
63
|
+
|
|
64
|
+
- **Real policy documents, not invented ones:**
|
|
65
|
+
- the starter toolkit's execution-role template from just before the 2025-12-09 scoping fix, and the current version, both rendered with Jinja2 as the toolkit does;
|
|
66
|
+
- its trust policy;
|
|
67
|
+
- AWS's managed `BedrockAgentCoreFullAccess` (v21, from the [MAMIP](https://github.com/z0ph/MAMIP) archive).
|
|
68
|
+
- **Results:**
|
|
69
|
+
- The pre-fix role produces every Unit 42 path.
|
|
70
|
+
- The current role produces only ACIA-005 and the default-role notice.
|
|
71
|
+
- A user holding only `BedrockAgentCoreFullAccess` is flagged for escalation to an admin role named `MyBedrockAgentCoreDeployRole`, but not to `prod-admin`.
|
|
72
|
+
- **Negative cases:** explicit `Deny` + `NotResource`, a read-only permission boundary, PassRole limited to another service (`iam:PassedToService`), region-scoped policies, and admin principals (nothing to escalate to).
|
|
73
|
+
- **Live mode:** tested with botocore's `Stubber`, so every request and response is validated against AWS's real API model for `bedrock-agentcore-control`.
|
|
74
|
+
- **CI:** Linux/macOS/Windows × Python 3.11–3.14. CI also rebuilds the account fixture from the source documents and fails if it drifts.
|
|
75
|
+
|
|
76
|
+
## Limits
|
|
77
|
+
|
|
78
|
+
- SCPs, resource-based policies and session policies aren't evaluated. A finding means "identity policy allows it". An SCP may still block it, as Sonrai and CSA recommend.
|
|
79
|
+
- Conditions other than `iam:PassedToService` are reported, not evaluated.
|
|
80
|
+
- "Admin-equivalent" means the role can modify IAM role policies or create user access keys.
|
|
81
|
+
|
|
82
|
+
## Responsible use
|
|
83
|
+
|
|
84
|
+
For accounts you own or are authorized to assess. The tool is read-only: offline mode reads a JSON file, and live mode calls only `Get*`/`List*` APIs.
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
Report vulnerabilities in agentcore-iam-audit privately via
|
|
4
|
+
[private vulnerability reporting](https://github.com/garag0l/agentcore-iam-audit/security/advisories/new).
|
|
5
|
+
AWS service issues belong to AWS: https://aws.amazon.com/security/vulnerability-reporting/
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
<svg class="rich-terminal" viewBox="0 0 1531 879.5999999999999" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<!-- Generated with Rich https://www.textualize.io -->
|
|
3
|
+
<style>
|
|
4
|
+
|
|
5
|
+
@font-face {
|
|
6
|
+
font-family: "Fira Code";
|
|
7
|
+
src: local("FiraCode-Regular"),
|
|
8
|
+
url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Regular.woff2") format("woff2"),
|
|
9
|
+
url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Regular.woff") format("woff");
|
|
10
|
+
font-style: normal;
|
|
11
|
+
font-weight: 400;
|
|
12
|
+
}
|
|
13
|
+
@font-face {
|
|
14
|
+
font-family: "Fira Code";
|
|
15
|
+
src: local("FiraCode-Bold"),
|
|
16
|
+
url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Bold.woff2") format("woff2"),
|
|
17
|
+
url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Bold.woff") format("woff");
|
|
18
|
+
font-style: bold;
|
|
19
|
+
font-weight: 700;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.terminal-3578232636-matrix {
|
|
23
|
+
font-family: Fira Code, monospace;
|
|
24
|
+
font-size: 20px;
|
|
25
|
+
line-height: 24.4px;
|
|
26
|
+
font-variant-east-asian: full-width;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.terminal-3578232636-title {
|
|
30
|
+
font-size: 18px;
|
|
31
|
+
font-weight: bold;
|
|
32
|
+
font-family: arial;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.terminal-3578232636-r1 { fill: #98a84b;font-weight: bold }
|
|
36
|
+
.terminal-3578232636-r2 { fill: #c5c8c6 }
|
|
37
|
+
.terminal-3578232636-r3 { fill: #c5c8c6;font-weight: bold }
|
|
38
|
+
.terminal-3578232636-r4 { fill: #cc555a }
|
|
39
|
+
.terminal-3578232636-r5 { fill: #868887 }
|
|
40
|
+
.terminal-3578232636-r6 { fill: #d0b344 }
|
|
41
|
+
</style>
|
|
42
|
+
|
|
43
|
+
<defs>
|
|
44
|
+
<clipPath id="terminal-3578232636-clip-terminal">
|
|
45
|
+
<rect x="0" y="0" width="1511.8" height="828.5999999999999" />
|
|
46
|
+
</clipPath>
|
|
47
|
+
<clipPath id="terminal-3578232636-line-0">
|
|
48
|
+
<rect x="0" y="1.5" width="1512.8" height="24.65"/>
|
|
49
|
+
</clipPath>
|
|
50
|
+
<clipPath id="terminal-3578232636-line-1">
|
|
51
|
+
<rect x="0" y="25.9" width="1512.8" height="24.65"/>
|
|
52
|
+
</clipPath>
|
|
53
|
+
<clipPath id="terminal-3578232636-line-2">
|
|
54
|
+
<rect x="0" y="50.3" width="1512.8" height="24.65"/>
|
|
55
|
+
</clipPath>
|
|
56
|
+
<clipPath id="terminal-3578232636-line-3">
|
|
57
|
+
<rect x="0" y="74.7" width="1512.8" height="24.65"/>
|
|
58
|
+
</clipPath>
|
|
59
|
+
<clipPath id="terminal-3578232636-line-4">
|
|
60
|
+
<rect x="0" y="99.1" width="1512.8" height="24.65"/>
|
|
61
|
+
</clipPath>
|
|
62
|
+
<clipPath id="terminal-3578232636-line-5">
|
|
63
|
+
<rect x="0" y="123.5" width="1512.8" height="24.65"/>
|
|
64
|
+
</clipPath>
|
|
65
|
+
<clipPath id="terminal-3578232636-line-6">
|
|
66
|
+
<rect x="0" y="147.9" width="1512.8" height="24.65"/>
|
|
67
|
+
</clipPath>
|
|
68
|
+
<clipPath id="terminal-3578232636-line-7">
|
|
69
|
+
<rect x="0" y="172.3" width="1512.8" height="24.65"/>
|
|
70
|
+
</clipPath>
|
|
71
|
+
<clipPath id="terminal-3578232636-line-8">
|
|
72
|
+
<rect x="0" y="196.7" width="1512.8" height="24.65"/>
|
|
73
|
+
</clipPath>
|
|
74
|
+
<clipPath id="terminal-3578232636-line-9">
|
|
75
|
+
<rect x="0" y="221.1" width="1512.8" height="24.65"/>
|
|
76
|
+
</clipPath>
|
|
77
|
+
<clipPath id="terminal-3578232636-line-10">
|
|
78
|
+
<rect x="0" y="245.5" width="1512.8" height="24.65"/>
|
|
79
|
+
</clipPath>
|
|
80
|
+
<clipPath id="terminal-3578232636-line-11">
|
|
81
|
+
<rect x="0" y="269.9" width="1512.8" height="24.65"/>
|
|
82
|
+
</clipPath>
|
|
83
|
+
<clipPath id="terminal-3578232636-line-12">
|
|
84
|
+
<rect x="0" y="294.3" width="1512.8" height="24.65"/>
|
|
85
|
+
</clipPath>
|
|
86
|
+
<clipPath id="terminal-3578232636-line-13">
|
|
87
|
+
<rect x="0" y="318.7" width="1512.8" height="24.65"/>
|
|
88
|
+
</clipPath>
|
|
89
|
+
<clipPath id="terminal-3578232636-line-14">
|
|
90
|
+
<rect x="0" y="343.1" width="1512.8" height="24.65"/>
|
|
91
|
+
</clipPath>
|
|
92
|
+
<clipPath id="terminal-3578232636-line-15">
|
|
93
|
+
<rect x="0" y="367.5" width="1512.8" height="24.65"/>
|
|
94
|
+
</clipPath>
|
|
95
|
+
<clipPath id="terminal-3578232636-line-16">
|
|
96
|
+
<rect x="0" y="391.9" width="1512.8" height="24.65"/>
|
|
97
|
+
</clipPath>
|
|
98
|
+
<clipPath id="terminal-3578232636-line-17">
|
|
99
|
+
<rect x="0" y="416.3" width="1512.8" height="24.65"/>
|
|
100
|
+
</clipPath>
|
|
101
|
+
<clipPath id="terminal-3578232636-line-18">
|
|
102
|
+
<rect x="0" y="440.7" width="1512.8" height="24.65"/>
|
|
103
|
+
</clipPath>
|
|
104
|
+
<clipPath id="terminal-3578232636-line-19">
|
|
105
|
+
<rect x="0" y="465.1" width="1512.8" height="24.65"/>
|
|
106
|
+
</clipPath>
|
|
107
|
+
<clipPath id="terminal-3578232636-line-20">
|
|
108
|
+
<rect x="0" y="489.5" width="1512.8" height="24.65"/>
|
|
109
|
+
</clipPath>
|
|
110
|
+
<clipPath id="terminal-3578232636-line-21">
|
|
111
|
+
<rect x="0" y="513.9" width="1512.8" height="24.65"/>
|
|
112
|
+
</clipPath>
|
|
113
|
+
<clipPath id="terminal-3578232636-line-22">
|
|
114
|
+
<rect x="0" y="538.3" width="1512.8" height="24.65"/>
|
|
115
|
+
</clipPath>
|
|
116
|
+
<clipPath id="terminal-3578232636-line-23">
|
|
117
|
+
<rect x="0" y="562.7" width="1512.8" height="24.65"/>
|
|
118
|
+
</clipPath>
|
|
119
|
+
<clipPath id="terminal-3578232636-line-24">
|
|
120
|
+
<rect x="0" y="587.1" width="1512.8" height="24.65"/>
|
|
121
|
+
</clipPath>
|
|
122
|
+
<clipPath id="terminal-3578232636-line-25">
|
|
123
|
+
<rect x="0" y="611.5" width="1512.8" height="24.65"/>
|
|
124
|
+
</clipPath>
|
|
125
|
+
<clipPath id="terminal-3578232636-line-26">
|
|
126
|
+
<rect x="0" y="635.9" width="1512.8" height="24.65"/>
|
|
127
|
+
</clipPath>
|
|
128
|
+
<clipPath id="terminal-3578232636-line-27">
|
|
129
|
+
<rect x="0" y="660.3" width="1512.8" height="24.65"/>
|
|
130
|
+
</clipPath>
|
|
131
|
+
<clipPath id="terminal-3578232636-line-28">
|
|
132
|
+
<rect x="0" y="684.7" width="1512.8" height="24.65"/>
|
|
133
|
+
</clipPath>
|
|
134
|
+
<clipPath id="terminal-3578232636-line-29">
|
|
135
|
+
<rect x="0" y="709.1" width="1512.8" height="24.65"/>
|
|
136
|
+
</clipPath>
|
|
137
|
+
<clipPath id="terminal-3578232636-line-30">
|
|
138
|
+
<rect x="0" y="733.5" width="1512.8" height="24.65"/>
|
|
139
|
+
</clipPath>
|
|
140
|
+
<clipPath id="terminal-3578232636-line-31">
|
|
141
|
+
<rect x="0" y="757.9" width="1512.8" height="24.65"/>
|
|
142
|
+
</clipPath>
|
|
143
|
+
<clipPath id="terminal-3578232636-line-32">
|
|
144
|
+
<rect x="0" y="782.3" width="1512.8" height="24.65"/>
|
|
145
|
+
</clipPath>
|
|
146
|
+
</defs>
|
|
147
|
+
|
|
148
|
+
<rect fill="#292929" stroke="rgba(255,255,255,0.35)" stroke-width="1" x="1" y="1" width="1529" height="877.6" rx="8"/><text class="terminal-3578232636-title" fill="#c5c8c6" text-anchor="middle" x="764" y="27">agentcore-iam-audit</text>
|
|
149
|
+
<g transform="translate(26,22)">
|
|
150
|
+
<circle cx="0" cy="0" r="7" fill="#ff5f57"/>
|
|
151
|
+
<circle cx="22" cy="0" r="7" fill="#febc2e"/>
|
|
152
|
+
<circle cx="44" cy="0" r="7" fill="#28c840"/>
|
|
153
|
+
</g>
|
|
154
|
+
|
|
155
|
+
<g transform="translate(9, 41)" clip-path="url(#terminal-3578232636-clip-terminal)">
|
|
156
|
+
|
|
157
|
+
<g class="terminal-3578232636-matrix">
|
|
158
|
+
<text class="terminal-3578232636-r1" x="0" y="20" textLength="1378.6" clip-path="url(#terminal-3578232636-line-0)">$ aws iam get-account-authorization-details > gaad.json && agentcore-iam-audit --gaad gaad.json   # demo account </text><text class="terminal-3578232636-r2" x="1512.8" y="20" textLength="12.2" clip-path="url(#terminal-3578232636-line-0)">
|
|
159
|
+
</text><text class="terminal-3578232636-r1" x="0" y="44.4" textLength="12.2" clip-path="url(#terminal-3578232636-line-1)">(</text><text class="terminal-3578232636-r1" x="12.2" y="44.4" textLength="170.8" clip-path="url(#terminal-3578232636-line-1)">tests/fixtures</text><text class="terminal-3578232636-r1" x="183" y="44.4" textLength="12.2" clip-path="url(#terminal-3578232636-line-1)">)</text><text class="terminal-3578232636-r2" x="1512.8" y="44.4" textLength="12.2" clip-path="url(#terminal-3578232636-line-1)">
|
|
160
|
+
</text><text class="terminal-3578232636-r3" x="0" y="68.8" textLength="305" clip-path="url(#terminal-3578232636-line-2)">agentcore-iam-audit 0.1.0</text><text class="terminal-3578232636-r2" x="1512.8" y="68.8" textLength="12.2" clip-path="url(#terminal-3578232636-line-2)">
|
|
161
|
+
</text><text class="terminal-3578232636-r2" x="1512.8" y="93.2" textLength="12.2" clip-path="url(#terminal-3578232636-line-3)">
|
|
162
|
+
</text><text class="terminal-3578232636-r4" x="0" y="117.6" textLength="73.2" clip-path="url(#terminal-3578232636-line-4)">[HIGH]</text><text class="terminal-3578232636-r2" x="73.2" y="117.6" textLength="122" clip-path="url(#terminal-3578232636-line-4)"> ACIA-001 </text><text class="terminal-3578232636-r3" x="195.2" y="117.6" textLength="707.6" clip-path="url(#terminal-3578232636-line-4)">role/AmazonBedrockAgentCoreSDKRuntime-us-east-1-0a1b2c3d4e</text><text class="terminal-3578232636-r2" x="902.8" y="117.6" textLength="524.6" clip-path="url(#terminal-3578232636-line-4)">  Agent role can reach other agents' memory</text><text class="terminal-3578232636-r2" x="1512.8" y="117.6" textLength="12.2" clip-path="url(#terminal-3578232636-line-4)">
|
|
163
|
+
</text><text class="terminal-3578232636-r2" x="0" y="142" textLength="1451.8" clip-path="url(#terminal-3578232636-line-5)">       read: GetMemory, RetrieveMemoryRecords, ListEvents, GetEvent, ListMemoryRecords, GetMemoryRecord; write/poison: </text><text class="terminal-3578232636-r2" x="1512.8" y="142" textLength="12.2" clip-path="url(#terminal-3578232636-line-5)">
|
|
164
|
+
</text><text class="terminal-3578232636-r2" x="0" y="166.4" textLength="1476.2" clip-path="url(#terminal-3578232636-line-6)">CreateEvent, DeleteMemoryRecord on memory not owned by this agent (memory/* or *). Scope Resource to this agent's memory </text><text class="terminal-3578232636-r2" x="1512.8" y="166.4" textLength="12.2" clip-path="url(#terminal-3578232636-line-6)">
|
|
165
|
+
</text><text class="terminal-3578232636-r2" x="0" y="190.8" textLength="48.8" clip-path="url(#terminal-3578232636-line-7)">ARN.</text><text class="terminal-3578232636-r2" x="1512.8" y="190.8" textLength="12.2" clip-path="url(#terminal-3578232636-line-7)">
|
|
166
|
+
</text><text class="terminal-3578232636-r5" x="0" y="215.2" textLength="1049.2" clip-path="url(#terminal-3578232636-line-8)">       ref: https://unit42.paloaltonetworks.com/exploit-of-aws-agentcore-iam-god-mode/</text><text class="terminal-3578232636-r2" x="1512.8" y="215.2" textLength="12.2" clip-path="url(#terminal-3578232636-line-8)">
|
|
167
|
+
</text><text class="terminal-3578232636-r4" x="0" y="239.6" textLength="73.2" clip-path="url(#terminal-3578232636-line-9)">[HIGH]</text><text class="terminal-3578232636-r2" x="73.2" y="239.6" textLength="122" clip-path="url(#terminal-3578232636-line-9)"> ACIA-002 </text><text class="terminal-3578232636-r3" x="195.2" y="239.6" textLength="707.6" clip-path="url(#terminal-3578232636-line-9)">role/AmazonBedrockAgentCoreSDKRuntime-us-east-1-0a1b2c3d4e</text><text class="terminal-3578232636-r2" x="902.8" y="239.6" textLength="439.2" clip-path="url(#terminal-3578232636-line-9)">  Agent role can invoke other agents</text><text class="terminal-3578232636-r2" x="1512.8" y="239.6" textLength="12.2" clip-path="url(#terminal-3578232636-line-9)">
|
|
168
|
+
</text><text class="terminal-3578232636-r2" x="0" y="264" textLength="1488.4" clip-path="url(#terminal-3578232636-line-10)">       InvokeAgentRuntime on runtimes not owned by this agent (runtime/* or *). A compromised agent can drive every other </text><text class="terminal-3578232636-r2" x="1512.8" y="264" textLength="12.2" clip-path="url(#terminal-3578232636-line-10)">
|
|
169
|
+
</text><text class="terminal-3578232636-r2" x="0" y="288.4" textLength="256.2" clip-path="url(#terminal-3578232636-line-11)">agent in the account.</text><text class="terminal-3578232636-r2" x="1512.8" y="288.4" textLength="12.2" clip-path="url(#terminal-3578232636-line-11)">
|
|
170
|
+
</text><text class="terminal-3578232636-r5" x="0" y="312.8" textLength="1049.2" clip-path="url(#terminal-3578232636-line-12)">       ref: https://unit42.paloaltonetworks.com/exploit-of-aws-agentcore-iam-god-mode/</text><text class="terminal-3578232636-r2" x="1512.8" y="312.8" textLength="12.2" clip-path="url(#terminal-3578232636-line-12)">
|
|
171
|
+
</text><text class="terminal-3578232636-r4" x="0" y="337.2" textLength="73.2" clip-path="url(#terminal-3578232636-line-13)">[HIGH]</text><text class="terminal-3578232636-r2" x="73.2" y="337.2" textLength="122" clip-path="url(#terminal-3578232636-line-13)"> ACIA-003 </text><text class="terminal-3578232636-r3" x="195.2" y="337.2" textLength="707.6" clip-path="url(#terminal-3578232636-line-13)">role/AmazonBedrockAgentCoreSDKRuntime-us-east-1-0a1b2c3d4e</text><text class="terminal-3578232636-r2" x="902.8" y="337.2" textLength="585.6" clip-path="url(#terminal-3578232636-line-13)">  Agent role can use other code interpreters in </text><text class="terminal-3578232636-r2" x="1512.8" y="337.2" textLength="12.2" clip-path="url(#terminal-3578232636-line-13)">
|
|
172
|
+
</text><text class="terminal-3578232636-r2" x="0" y="361.6" textLength="134.2" clip-path="url(#terminal-3578232636-line-14)">the account</text><text class="terminal-3578232636-r2" x="1512.8" y="361.6" textLength="12.2" clip-path="url(#terminal-3578232636-line-14)">
|
|
173
|
+
</text><text class="terminal-3578232636-r2" x="0" y="386" textLength="1512.8" clip-path="url(#terminal-3578232636-line-15)">       InvokeCodeInterpreter, StartCodeInterpreterSession on account code interpreters (code-interpreter/* or *). Code runs </text><text class="terminal-3578232636-r2" x="1512.8" y="386" textLength="12.2" clip-path="url(#terminal-3578232636-line-15)">
|
|
174
|
+
</text><text class="terminal-3578232636-r2" x="0" y="410.4" textLength="1342" clip-path="url(#terminal-3578232636-line-16)">with each interpreter's execution role, not this agent's. Scope to aws.codeinterpreter.v1 or this agent's own.</text><text class="terminal-3578232636-r2" x="1512.8" y="410.4" textLength="12.2" clip-path="url(#terminal-3578232636-line-16)">
|
|
175
|
+
</text><text class="terminal-3578232636-r5" x="0" y="434.8" textLength="1049.2" clip-path="url(#terminal-3578232636-line-17)">       ref: https://unit42.paloaltonetworks.com/exploit-of-aws-agentcore-iam-god-mode/</text><text class="terminal-3578232636-r2" x="1512.8" y="434.8" textLength="12.2" clip-path="url(#terminal-3578232636-line-17)">
|
|
176
|
+
</text><text class="terminal-3578232636-r4" x="0" y="459.2" textLength="73.2" clip-path="url(#terminal-3578232636-line-18)">[HIGH]</text><text class="terminal-3578232636-r2" x="73.2" y="459.2" textLength="122" clip-path="url(#terminal-3578232636-line-18)"> ACIA-010 </text><text class="terminal-3578232636-r3" x="195.2" y="459.2" textLength="170.8" clip-path="url(#terminal-3578232636-line-18)">user/dev-alice</text><text class="terminal-3578232636-r2" x="366" y="459.2" textLength="1037" clip-path="url(#terminal-3578232636-line-18)">  Privilege escalation via code interpreter (PassRole + Create/InvokeCodeInterpreter)</text><text class="terminal-3578232636-r2" x="1512.8" y="459.2" textLength="12.2" clip-path="url(#terminal-3578232636-line-18)">
|
|
177
|
+
</text><text class="terminal-3578232636-r2" x="0" y="483.6" textLength="1207.8" clip-path="url(#terminal-3578232636-line-19)">       Can create a code interpreter with an AgentCore role it can pass and run code as that role: </text><text class="terminal-3578232636-r2" x="1512.8" y="483.6" textLength="12.2" clip-path="url(#terminal-3578232636-line-19)">
|
|
178
|
+
</text><text class="terminal-3578232636-r2" x="0" y="508" textLength="1342" clip-path="url(#terminal-3578232636-line-20)">AmazonBedrockAgentCoreSDKRuntime-us-east-1-0a1b2c3d4e, AmazonBedrockAgentCoreSDKRuntime-us-east-1-9f8e7d6c5b, </text><text class="terminal-3578232636-r2" x="1512.8" y="508" textLength="12.2" clip-path="url(#terminal-3578232636-line-20)">
|
|
179
|
+
</text><text class="terminal-3578232636-r2" x="0" y="532.4" textLength="939.4" clip-path="url(#terminal-3578232636-line-21)">MyBedrockAgentCoreDeployRole. Admin-equivalent: MyBedrockAgentCoreDeployRole.</text><text class="terminal-3578232636-r2" x="1512.8" y="532.4" textLength="12.2" clip-path="url(#terminal-3578232636-line-21)">
|
|
180
|
+
</text><text class="terminal-3578232636-r5" x="0" y="556.8" textLength="1159" clip-path="url(#terminal-3578232636-line-22)">       ref: https://sonraisecurity.com/blog/aws-agentcore-privilege-escalation-bedrock-scp-fix/</text><text class="terminal-3578232636-r2" x="1512.8" y="556.8" textLength="12.2" clip-path="url(#terminal-3578232636-line-22)">
|
|
181
|
+
</text><text class="terminal-3578232636-r6" x="0" y="581.2" textLength="97.6" clip-path="url(#terminal-3578232636-line-23)">[MEDIUM]</text><text class="terminal-3578232636-r2" x="97.6" y="581.2" textLength="122" clip-path="url(#terminal-3578232636-line-23)"> ACIA-005 </text><text class="terminal-3578232636-r3" x="219.6" y="581.2" textLength="707.6" clip-path="url(#terminal-3578232636-line-23)">role/AmazonBedrockAgentCoreSDKRuntime-us-east-1-9f8e7d6c5b</text><text class="terminal-3578232636-r2" x="927.2" y="581.2" textLength="573.4" clip-path="url(#terminal-3578232636-line-23)">  Agent role can read every AgentCore Identity </text><text class="terminal-3578232636-r2" x="1512.8" y="581.2" textLength="12.2" clip-path="url(#terminal-3578232636-line-23)">
|
|
182
|
+
</text><text class="terminal-3578232636-r2" x="0" y="605.6" textLength="207.4" clip-path="url(#terminal-3578232636-line-24)">credential secret</text><text class="terminal-3578232636-r2" x="1512.8" y="605.6" textLength="12.2" clip-path="url(#terminal-3578232636-line-24)">
|
|
183
|
+
</text><text class="terminal-3578232636-r2" x="0" y="630" textLength="1500.6" clip-path="url(#terminal-3578232636-line-25)">       secretsmanager:GetSecretValue on bedrock-agentcore-identity!default/oauth2/* or /apikey/*: the OAuth client secrets </text><text class="terminal-3578232636-r2" x="1512.8" y="630" textLength="12.2" clip-path="url(#terminal-3578232636-line-25)">
|
|
184
|
+
</text><text class="terminal-3578232636-r2" x="0" y="654.4" textLength="1500.6" clip-path="url(#terminal-3578232636-line-26)">and API keys of all credential providers in the account's default token vault, not just the ones this agent uses (unless a </text><text class="terminal-3578232636-r2" x="1512.8" y="654.4" textLength="12.2" clip-path="url(#terminal-3578232636-line-26)">
|
|
185
|
+
</text><text class="terminal-3578232636-r2" x="0" y="678.8" textLength="927.2" clip-path="url(#terminal-3578232636-line-27)">resource policy on each secret denies it, which IAM data alone cannot show).</text><text class="terminal-3578232636-r2" x="1512.8" y="678.8" textLength="12.2" clip-path="url(#terminal-3578232636-line-27)">
|
|
186
|
+
</text><text class="terminal-3578232636-r6" x="0" y="703.2" textLength="97.6" clip-path="url(#terminal-3578232636-line-28)">[MEDIUM]</text><text class="terminal-3578232636-r2" x="97.6" y="703.2" textLength="122" clip-path="url(#terminal-3578232636-line-28)"> ACIA-021 </text><text class="terminal-3578232636-r3" x="219.6" y="703.2" textLength="280.6" clip-path="url(#terminal-3578232636-line-28)">role/support-agent-prod</text><text class="terminal-3578232636-r2" x="500.2" y="703.2" textLength="573.4" clip-path="url(#terminal-3578232636-line-28)">  Trust policy lacks confused-deputy protection</text><text class="terminal-3578232636-r2" x="1512.8" y="703.2" textLength="12.2" clip-path="url(#terminal-3578232636-line-28)">
|
|
187
|
+
</text><text class="terminal-3578232636-r2" x="0" y="727.6" textLength="1415.2" clip-path="url(#terminal-3578232636-line-29)">       bedrock-agentcore.amazonaws.com can assume this role with no aws:SourceAccount / aws:SourceArn condition, so </text><text class="terminal-3578232636-r2" x="1512.8" y="727.6" textLength="12.2" clip-path="url(#terminal-3578232636-line-29)">
|
|
188
|
+
</text><text class="terminal-3578232636-r2" x="0" y="752" textLength="829.6" clip-path="url(#terminal-3578232636-line-30)">AgentCore resources in other accounts could be configured to use it.</text><text class="terminal-3578232636-r2" x="1512.8" y="752" textLength="12.2" clip-path="url(#terminal-3578232636-line-30)">
|
|
189
|
+
</text><text class="terminal-3578232636-r5" x="0" y="776.4" textLength="988.2" clip-path="url(#terminal-3578232636-line-31)">       ref: https://docs.aws.amazon.com/IAM/latest/UserGuide/confused-deputy.html</text><text class="terminal-3578232636-r2" x="1512.8" y="776.4" textLength="12.2" clip-path="url(#terminal-3578232636-line-31)">
|
|
190
|
+
</text><text class="terminal-3578232636-r2" x="1512.8" y="800.8" textLength="12.2" clip-path="url(#terminal-3578232636-line-32)">
|
|
191
|
+
</text><text class="terminal-3578232636-r3" x="0" y="825.2" textLength="451.4" clip-path="url(#terminal-3578232636-line-33)">6 finding(s): 4 high, 2 medium, 0 low</text><text class="terminal-3578232636-r2" x="1512.8" y="825.2" textLength="12.2" clip-path="url(#terminal-3578232636-line-33)">
|
|
192
|
+
</text>
|
|
193
|
+
</g>
|
|
194
|
+
</g>
|
|
195
|
+
</svg>
|