[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AD80JBVJHJD66DWJYFSPSD":3,"skill-same:01M7AD80JBVJHJD66DWJYFSPSD":147},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":6,"ownerHtmlUrl":44,"ownerBlogUrl":6,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M7AD80JBVJHJD66DWJYFSPSD","sts-cross-account-role-auditor",null,"Audits IAM role trust policies (AssumeRolePolicyDocument) for cross-account exposure, wildcard Principal grants, confused-deputy service-principal vectors, and condition-strength weaknesses. Emits a deterministic EXTERNAL_TRUST | WILDCARD_TRUST | CONDITIONAL | OK verdict per role with severity and remediation. Use when reviewing IAM role trust policies, checking who can assume a role, auditing cross-account access, validating ExternalId or SourceArn guards, or hardening role trust before production. Triggers: STS, AssumeRole, trust policy, AssumeRolePolicyDocument, cross-account, ExternalId, confused deputy, Principal AWS root, Principal Service, Principal star, SAML federated, SourceArn, SourceAccount, NotPrincipal, role trust audit, role assumption exposure.","jhkchan\u002Faws-agent-skills","jhkchan","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1083902?v=4","01M7A2SVQYP9GQTPTDXP5JKYQ4","Jacky Chan","01M7A2SVS117YWCTZABB75HZR1",4,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: sts-cross-account-role-auditor\ndescription: 'Audits IAM role trust policies (AssumeRolePolicyDocument) for cross-account exposure, wildcard Principal grants, confused-deputy service-principal vectors, and condition-strength weaknesses. Emits a deterministic EXTERNAL_TRUST | WILDCARD_TRUST | CONDITIONAL | OK verdict per role with severity and remediation. Use when reviewing IAM role trust policies, checking who can assume a role, auditing cross-account access, validating ExternalId or SourceArn guards, or hardening role trust before production. Triggers: STS, AssumeRole, trust policy, AssumeRolePolicyDocument, cross-account, ExternalId, confused deputy, Principal AWS root, Principal Service, Principal star, SAML federated, SourceArn, SourceAccount, NotPrincipal, role trust audit, role assumption exposure.'\nlicense: Apache-2.0\ncompatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline trust-policy classification. Live account audits use aws iam get-role --query Role.AssumeRolePolicyDocument and aws iam list-roles (AWS CLI v2, SSO or key-based credentials).\nmetadata:\n  domain: aws-cloudops\n  complexity: high\n  requires_llm: 'true'\n  phase: '2'\n  supports_pipeline: 'true'\n  entry_point: 'false'\n  family: Security\n  verdict_shape: EXTERNAL_TRUST | WILDCARD_TRUST | CONDITIONAL | OK\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  tags: sts, iam, security, trust-policy, cross-account, external-id, confused-deputy, role-audit\n  dependencies: aws-orchestrator\n  keywords: STS, trust policy, AssumeRole, AssumeRolePolicyDocument, cross-account, ExternalId, confused deputy, Principal, wildcard principal, role trust, SAML, OIDC, federated, SourceArn, SourceAccount, NotPrincipal, role assumption, IAM audit, security\n  when_to_use: Reviewing an IAM role trust policy (AssumeRolePolicyDocument), auditing who can assume a role, checking cross-account or external access exposure, validating ExternalId \u002F SourceArn \u002F SourceAccount guards, hardening a service-role trust before production, or investigating confused-deputy attack surface.\n---\n\n# STS Cross-Account Role Auditor\n\n## Mindset\n\n> Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#mindset).\n> One-line: classify WHO can assume the role (trust policy, not permissions policy); catch wildcard `\"*\"`, unguarded cross-account root, and unguarded confused-deputy service principals; grade condition strength.\n\n## What this skill is NOT\n\n> Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#what-this-skill-is-not).\n> Scope: trust policy only — permissions-policy audits belong to iam-least-privilege-advisor; run both when the permissions policy is available.\n\n## Quick reference\n\nIf the trust policy has `Principal: \"*\"` or `{\"AWS\": \"*\"}` with no strong\ncondition, it is WILDCARD_TRUST. If it grants to a cross-account ARN without\n`sts:ExternalId`, it is EXTERNAL_TRUST. If it grants to a confused-deputy-risk\nservice without `aws:SourceArn`\u002F`aws:SourceAccount`, it is EXTERNAL_TRUST. If\nit has an external surface but a strong guarding condition, it is CONDITIONAL.\nIf it only allows same-account principals or properly guarded service links,\nit is OK. See the steps below for edge cases (NotPrincipal, SAML\u002FOIDC,\nweak conditions, session tags).\n\n**Condition strength at a glance** (see full matrix below):\n- STRONG (→ CONDITIONAL): `sts:ExternalId` (StringEquals),\n  `aws:SourceAccount` (StringEquals), `aws:SourceArn` (ArnLike),\n  `aws:sourceVpce`\u002F`aws:sourceVpc`, `SAML:sub`\u002F`SAML:aud`, `oidc:sub`\u002F`oidc:aud`.\n- WEAK (→ still WILDCARD_TRUST\u002FEXTERNAL_TRUST): `aws:SourceIp` with\n  `0.0.0.0\u002F0`, `aws:Referer`, `aws:UserAgent`, `sts:ExternalId` with\n  `StringLike` + wildcard.\n- TRAP: `ForAllValues:StringEquals` on `aws:SourceArn` evaluates TRUE when\n  the key is absent — use `ForAnyValue` or `ArnLike` instead.\n\n## The confused-deputy problem (core concept)\n\n> Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#the-confused-deputy-problem-core-concept).\n> Core: Principal.Service trusts the SERVICE, not your resources — any AWS customer can trigger it; fix with aws:SourceAccount (StringEquals, minimum) or aws:SourceArn (ArnLike, strongest).\n\n## Process — Classification logic (apply in order)\n\n### Step 0: Validate input and extract owning account\n\nIf the trust policy document is not valid JSON, output:\n\n```text\nROLE: \u003Cname>\nVERDICT: ERROR\nREASON: Trust policy document is not valid JSON — cannot parse statements.\nREMEDIATION: Validate with aws iam get-role --role-name \u003Cname> --query Role.AssumeRolePolicyDocument.\n```\n\nDo not attempt classification on malformed input.\n\n**Extract the owning account ID** from the role ARN (e.g.,\n`arn:aws:iam::123456789012:role\u002Fmy-role` → owning account is\n`123456789012`). If the role ARN is not provided, extract from context or\nflag that same-account verification cannot be performed and treat all\naccount-root principals as potentially cross-account.\n\nCheck the `Version` field: `\"2008-10-17\"` is legacy and causes policy\nvariables (`${aws:username}`) and some condition operators to fail silently.\nThe correct version is `\"2012-10-17\"`.\n\n### Step 1: NotPrincipal \u002F NotAction inverse wildcards\n\nIf ANY statement uses `NotPrincipal` or `NotAction`, classify as\n**WILDCARD_TRUST** with **CRITICAL** risk.\n\n`NotPrincipal` in a trust policy grants the AssumeRole action to EVERY\nprincipal EXCEPT the listed ones — this is effectively an open role and is\nalmost always a misconfiguration. `NotAction` grants every STS action\n(`sts:AssumeRole`, `sts:AssumeRoleWithSAML`,\n`sts:AssumeRoleWithWebIdentity`, `sts:DecodeAuthorizationMessage`) except\nthe listed ones, broadening the attack surface unpredictably.\n\nCite \"Step 1: inverse wildcard (NotPrincipal\u002FNotAction)\".\n\n### Step 2: Unrestricted wildcard Principal\n\nIf ANY Allow statement has `Principal` of `\"*\"`, `{\"AWS\": \"*\"}`, or any\nprincipal element that resolves to all principals, evaluate the condition:\n\n- **No `Condition` block at all** → **WILDCARD_TRUST**, **CRITICAL**. Anyone\n  with AWS credentials (which anyone can obtain via the free tier) can assume\n  the role. This grants the role's entire permission set to the public\n  internet.\n\n- **Condition present** → proceed to the **Condition strength matrix** below.\n  If the condition contains ONLY weak keys (Referer, UserAgent, SourceIp\n  `0.0.0.0\u002F0`) → still **WILDCARD_TRUST**, **CRITICAL**. The condition\n  provides no real restriction.\n\n- **Condition contains at least one STRONG key** (sourceVpce, sourceVpc,\n  SourceAccount, SourceArn) → **CONDITIONAL**, **MODERATE**. The wildcard\n  principal is narrowed by a real guard, but a policy edit or condition\n  removal could expose it.\n\nCite \"Step 2: wildcard Principal\" with the condition evaluation result.\n\n### Step 3: Cross-account Principal without ExternalId\n\nIf ANY Allow statement has a `Principal.AWS` that is an account-root ARN\n(`arn:aws:iam::\u003CACCOUNT>:root`), role ARN, or user ARN where `\u003CACCOUNT>` ≠\nthe role's owning account, evaluate the ExternalId guard:\n\n- **No `sts:ExternalId` condition** → **EXTERNAL_TRUST**, **HIGH**. The\n  trusting account has no verification that the assuming principal is the\n  intended third party. The third party's account administrator can grant\n  `sts:AssumeRole` on this role's ARN to ANY principal in their account\n  (including new users, new roles, or compromised credentials).\n\n- **`sts:ExternalId` present in `StringEquals`** → **CONDITIONAL**,\n  **MODERATE**. The ExternalId is a shared secret that the trusting account\n  sets and the third party must provide. It prevents the third party's\n  account admin from unilaterally granting access — without the ExternalId,\n  even root in the third-party account cannot assume the role.\n\n- **`sts:ExternalId` with `StringLike` and a wildcard pattern** (e.g.,\n  `\"*-prod\"`) → still **EXTERNAL_TRUST**, **HIGH**. `StringLike` with\n  wildcards weakens the guard — an attacker who knows or guesses the pattern\n  suffix can bypass it. ExternalId must be an opaque, unguessable string\n  matched with `StringEquals`.\n\nCite \"Step 3: cross-account without ExternalId\" or \"Step 3: cross-account\nwith ExternalId (CONDITIONAL)\".\n\n\n> Expert note moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#expert-note--the-root-arn-expansion-rule).\n> Root ARN expansion: `arn:aws:iam::ACCOUNT:root` = EVERY authenticated principal in that account, not just root — name the specific role ARN.\n\n### Step 4: Confused-deputy service Principal without source guard\n\nIf ANY Allow statement has `Principal.Service` set to a\n**confused-deputy-risk service** (see list below) and the `Condition` block\ndoes NOT contain `aws:SourceAccount` or `aws:SourceArn`, classify as\n**EXTERNAL_TRUST**, **HIGH**.\n\n\n> Service catalogs moved to [references\u002Ftrust-policy-hardening-guide.md](references\u002Ftrust-policy-hardening-guide.md#confused-deputy-risk-service-principal-catalogs-moved-from-skillmd).\n> High-risk: lambda, ec2, cloudformation, eks\u002Fecs, states, events\u002Fpipes, sns\u002Fsqs, codebuild\u002Fcodepipeline, apigateway, backup, cloudtrail, config, controltower, security services, waf, firehose\u002Fes\u002Faoss, bedrock. Lower-risk: awslambda (legacy), dynamodb, ds, ssm, transfer, quicksight.\n\nFor any service principal NOT on either list above, classify as CONDITIONAL\nwith a note to manually verify the service's confused-deputy posture via the\nAWS documentation for that service.\n\n**Expert note — `aws:SourceArn` vs `aws:SourceAccount`:**\n`aws:SourceArn` is stronger because it identifies the exact resource making\nthe call (e.g., a specific Lambda function ARN). `aws:SourceAccount`\nidentifies only the account. If the source account has many principals, any\nof them can trigger the service to assume the role. Use `ArnLike` for\n`aws:SourceArn` (allows wildcard in the resource path) and `StringEquals`\nfor `aws:SourceAccount`. For maximum precision, use BOTH:\n`aws:SourceArn` for resource-level scope AND `aws:SourceAccount` as a\ndefense-in-depth guard.\n\nIf the service principal IS on the risk list and `aws:SourceAccount` or\n`aws:SourceArn` IS present → proceed to Step 5.\n\nIf the service principal is NOT on the risk list above (e.g., a rare or\ninternal service), classify as **CONDITIONAL** with a note to verify the\nservice's confused-deputy posture manually.\n\n### Step 5: Confused-deputy service Principal WITH source guard\n\nIf a confused-deputy-risk service principal has `aws:SourceAccount` or\n`aws:SourceArn` in the `Condition` block (with `StringEquals`, `StringLike`,\n`ArnLike`, or `ArnEquals`), classify as **CONDITIONAL**, **MODERATE**.\n\nThe source guard narrows the trust to a specific account or resource, but\nthe role is still assumable via a service that operates outside the owning\naccount's direct control. A condition removal or service-principal change\ncould expose it.\n\nCite \"Step 5: confused-deputy with source guard (CONDITIONAL)\".\n\n### Step 6: SAML \u002F OIDC federated Principal\n\nIf ANY Allow statement has `Principal.Federated` (SAML or OIDC identity\nprovider), evaluate the condition:\n\n- **`Principal.Federated` is an account-specific IdP ARN**\n  (e.g., `arn:aws:iam::123456789012:saml-provider\u002FCorporateIdP`) AND the\n  `Condition` constrains `SAML:sub` (subject), `SAML:aud` (audience), or\n  `SAML:sub_type` → **CONDITIONAL**, **MODERATE**. The IdP controls who can\n  assume the role; the condition narrows which assertions are accepted.\n\n- **Same as above but NO `Condition` block** → **EXTERNAL_TRUST**, **HIGH**.\n  Any assertion from the IdP that matches the provider ARN is accepted —\n  the IdP admin (or anyone who compromises the IdP) controls access to\n  your AWS role.\n\n- **`Principal.Federated` is `cognito-identity.amazonaws.com`** (Cognito) →\n  **CONDITIONAL**, **MODERATE** if `Condition` has\n  `cognito-identity.amazonaws.com:aud` (user-pool\u002Fclient ID) and\n  `cognito-identity.amazonaws.com:amr` (authenticated\u002Funauthenticated).\n  Without these → **EXTERNAL_TRUST**, **HIGH**.\n\n- **`Principal.Federated` is `\"*\"`, `{\"AWS\": \"*\"}`, or a wildcard OIDC URL**\n  (e.g., `accounts.google.com` without audience constraint) →\n  **WILDCARD_TRUST**, **CRITICAL**. Any federated identity can assume.\n\n**Action field check for federated statements:** the `Action` must be\n`sts:AssumeRoleWithSAML` (for SAML) or `sts:AssumeRoleWithWebIdentity` (for\nOIDC). If the Action is `sts:AssumeRole` with a Federated principal, flag\nas a misconfiguration — the combination is invalid and the statement will\nsilently fail at runtime.\n\nCite \"Step 6: federated trust — \u003CSAML|OIDC|Cognito>\".\n\n### Step 7: Session tag injection risk\n\nIf ANY Allow statement in the trust policy grants `sts:TagSession` (or the\nbroader `sts:AssumeRole` which implicitly allows tag propagation), check\nfor `sts:TransitiveTagKeys`:\n\n- **`sts:TagSession` allowed with no `sts:TransitiveTagKeys` limit** → append\n  a **TAG_INJECTION_FLAG** to the REMEDIATION field. The assuming principal\n  can set arbitrary session tags, which may propagate to downstream ABAC\n  (attribute-based access control) evaluations and bypass resource-level\n  tag conditions.\n\n- **`sts:TransitiveTagKeys` present** → the tag-propagation surface is\n  bounded. Note the allowed tag keys in the REMEDIATION field for review.\n\nThis does not change the verdict but appends a warning. Session-tag\ninjection is a privilege-escalation vector when downstream policies trust\nsession-set tags for authorization decisions.\n\n### Step 8: Same-account principals — OK\n\nIf ALL Allow statements have:\n\n- `Principal.AWS` with ARNs in the **same account** as the role (the account\n  ID in the ARN matches the owning account), OR\n- `Principal.Service` for a non-confused-deputy-risk service, OR\n- No wildcard principals, no `NotPrincipal`, no cross-account ARNs\n\nthen classify as **OK**, **LOW**.\n\n\n> Expert note moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#expert-note--same-account-root-arn).\n> Same-account `:root` is safe externally but grants EVERY principal in the account — prefer naming the specific role ARN for privileged roles.\n\n### Step 9: Aggregation\n\nWhen a trust policy contains multiple statements, the role-level verdict is\nthe **worst** verdict across all Allow statements, where:\n\n```\nWILDCARD_TRUST > EXTERNAL_TRUST > CONDITIONAL > OK\n```\n\nA single WILDCARD_TRUST statement makes the entire role WILDCARD_TRUST,\neven if all other statements are OK.\n\n## Condition strength matrix\n\nWhen evaluating a condition block on a wildcard or external Principal,\nclassify each condition key to determine if it provides real protection:\n\n**STRONG condition keys (→ CONDITIONAL):**\n\n| Key | Operator | Why it is strong |\n|---|---|---|\n| `sts:ExternalId` | `StringEquals` | Shared secret set by the trusting account; the third party cannot guess or bypass it. The canonical cross-account guard. |\n| `aws:SourceAccount` | `StringEquals` | Restricts the calling service to act only on behalf of a specific AWS account. Prevents confused-deputy exploitation. |\n| `aws:SourceArn` | `ArnLike` \u002F `ArnEquals` | Restricts to a specific resource ARN — the strongest source-scoping option. Identifies the exact resource making the call. |\n| `aws:sourceVpce` | `StringEquals` | VPC Endpoint ID — request must traverse the named endpoint. Not forgeable by the caller. |\n| `aws:sourceVpc` | `StringEquals` | VPC ID — request must originate in the named VPC. |\n| `SAML:sub` | `StringEquals` | SAML subject — identifies the specific federated user. |\n| `SAML:aud` | `StringEquals` | SAML audience — restricts to a specific relying-party trust. |\n| `oidc:sub` | `StringEquals` | OIDC subject — identifies the specific federated identity. |\n| `oidc:aud` | `StringEquals` | OIDC audience — restricts to a specific client ID. |\n\n**WEAK condition keys (→ still WILDCARD_TRUST or EXTERNAL_TRUST):**\n\n| Key | Operator | Why it is weak |\n|---|---|---|\n| `aws:SourceIp` | `IpAddress` with `0.0.0.0\u002F0` | The CIDR for the entire internet — zero restriction. Treat as no condition. |\n| `aws:SourceIp` | `IpAddress` with public CIDR | Restrictive in theory but bypassable via proxy, VPN, or a compromised host in the CIDR range. |\n| `aws:Referer` | `StringLike` \u002F `StringEquals` | HTTP Referer header — trivially forgeable by any HTTP client. Provides NO real access control. |\n| `aws:UserAgent` | `StringLike` \u002F `StringEquals` | HTTP User-Agent header — trivially forgeable. Same weakness as Referer. |\n| `sts:ExternalId` | `StringLike` with wildcard | Pattern matching weakens the shared secret — if the pattern is guessable, the guard is bypassable. Must use `StringEquals` with an opaque value. |\n\n**MIXED condition blocks:** If a statement has BOTH strong and weak keys\n(e.g., `aws:SourceIp` + `aws:SourceAccount`), the strong key dominates —\nclassify as CONDITIONAL. The weak key is redundant but does not weaken the\nstrong key.\n\n**ForAllValues \u002F ForAnyValue trap:** `ForAllValues:StringEquals` evaluates\nto TRUE when the request contains ZERO matching values. If the tested key is\nabsent from the request, the condition passes — a known bypass. Use\n`ForAnyValue:StringEquals` instead, or add an explicit existence check.\nThis is especially dangerous with `aws:SourceArn` — if the service does not\npopulate `aws:SourceArn` for certain call paths, `ForAllValues:aws:SourceArn`\nwill pass and grant access unexpectedly.\n\n## Risk \u002F severity matrix\n\nThe RISK field is derived from the VERDICT and the specific pattern:\n\n| Verdict | Pattern | Risk |\n|---|---|---|\n| WILDCARD_TRUST | `Principal: \"*\"` no condition | CRITICAL |\n| WILDCARD_TRUST | `Principal: \"*\"` weak condition only | CRITICAL |\n| WILDCARD_TRUST | `NotPrincipal` or `NotAction` | CRITICAL |\n| WILDCARD_TRUST | `Principal: \"*\"` with strong condition | MODERATE (→ CONDITIONAL) |\n| EXTERNAL_TRUST | Cross-account root\u002Frole without ExternalId | HIGH |\n| EXTERNAL_TRUST | Confused-deputy service without source guard | HIGH |\n| EXTERNAL_TRUST | SAML\u002FOIDC without condition | HIGH |\n| CONDITIONAL | Cross-account with ExternalId | MODERATE |\n| CONDITIONAL | Confused-deputy with SourceAccount\u002FSourceArn | MODERATE |\n| CONDITIONAL | SAML\u002FOIDC with constrained assertion | MODERATE |\n| OK | Same-account scoped | LOW |\n\n**Severity escalation to CRITICAL:** If the role's permissions policy (when\nknown) grants privileged actions (`iam:*`, `sts:*`, `AdministrativeAccess`),\nescalate any EXTERNAL_TRUST or WILDCARD_TRUST finding by one level (HIGH →\nCRITICAL, or CRITICAL stays CRITICAL). A role with `Principal: \"*\"` that\nalso has `iam:PassRole` permissions is a full account-takeover vector.\n\n## Multi-statement and malformed input handling\n\n> Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#multi-statement-and-malformed-input-handling).\n> Rules: worst statement wins; Deny statements narrow (exclude from verdict); evaluate EACH Principal entry; missing Action = inert; non-STS Action = misplaced; unparseable → VERDICT: ERROR.\n\n## Edge case walkthroughs\n\n> Moved to [references\u002Fworked-examples.md](references\u002Fworked-examples.md#edge-case-walkthroughs).\n> Six worked edges: ForAllValues trap on aws:SourceArn, mixed strong+weak keys, multi-statement aggregation, aws:PrincipalTag role-chaining bypass, SAML valid vs missing condition, Action-principal mismatch.\n\n## Output format (per role)\n\n```text\nROLE: \u003Cname>\nVERDICT: EXTERNAL_TRUST | WILDCARD_TRUST | CONDITIONAL | OK\nREASON: \u003C1-2 sentences citing the specific statement, the Principal type, and the guard status>\nRISK: CRITICAL | HIGH | MODERATE | LOW\nREMEDIATION: \u003Cspecific action, or \"None required\" if OK>\n```\n\n### Multi-statement aggregation example\n\n> Moved to [references\u002Fworked-examples.md](references\u002Fworked-examples.md#multi-statement-aggregation-example).\n> Full WILDCARD_TRUST \u002F CRITICAL report for a mixed three-statement trust policy (Step 9 aggregation).\n\n## Anti-Patterns — NEVER\n\n- NEVER classify a trust policy as OK when `Principal: \"*\"` or\n  `{\"AWS\": \"*\"}` appears in any Allow statement without a strong condition.\n  This grants the role's entire permission set to any AWS credential holder.\n  Cite Step 2.\n\n- NEVER classify `Principal: \"*\"` with a WEAK condition\n  (`aws:SourceIp`, `aws:Referer`, `aws:UserAgent`) as CONDITIONAL. These\n  keys are forgeable and provide no real restriction — the verdict is\n  WILDCARD_TRUST. This is the inverse mistake of treating every condition\n  as protective.\n\n- NEVER assume `arn:aws:iam::ACCOUNT:root` means \"only the root user\".\n  The root ARN expands to EVERY authenticated principal in that account —\n  every IAM user, every role, every session. If the intent is a specific\n  principal, name it explicitly. This is the most common misunderstanding\n  in trust-policy review.\n\n- NEVER classify a confused-deputy-risk service principal\n  (`lambda.amazonaws.com`, `ec2.amazonaws.com`, `cloudformation.amazonaws.com`,\n  `events.amazonaws.com`, etc.) without `aws:SourceAccount` or\n  `aws:SourceArn` as OK. The service can be invoked by ANY AWS customer —\n  the correct verdict is EXTERNAL_TRUST. Cite Step 4 and the confused-deputy\n  problem above.\n\n- NEVER treat `NotPrincipal` as a scoped grant. `NotPrincipal` is an inverse\n  wildcard — it grants access to everyone EXCEPT the listed principal(s).\n  In a trust policy this is almost always a catastrophic misconfiguration.\n  Classify as WILDCARD_TRUST.\n\n- NEVER treat `ForAllValues:StringEquals` on `aws:SourceArn` as a reliable\n  guard. `ForAllValues` evaluates TRUE when the key is absent from the\n  request — if the calling service does not populate `aws:SourceArn` on\n  certain code paths, the condition passes and grants access. Use\n  `ForAnyValue` or an explicit `ArnLike` condition instead.\n\n- NEVER classify a cross-account principal with `sts:ExternalId` in\n  `StringLike` with a wildcard pattern (e.g., `\"*-prod\"`) as CONDITIONAL.\n  The wildcard weakens the shared secret — an attacker who guesses the\n  suffix bypasses the guard. ExternalId must be opaque and matched with\n  `StringEquals`.\n\n- NEVER classify `sts:AssumeRole` with a `Principal.Federated` as valid.\n  The Action must be `sts:AssumeRoleWithSAML` (SAML) or\n  `sts:AssumeRoleWithWebIdentity` (OIDC). The `sts:AssumeRole` +\n  Federated combination silently fails at runtime — flag as a\n  misconfiguration.\n\n- NEVER assume the permissions policy is safe just because the trust policy\n  is OK. The trust policy controls WHO assumes the role; the permissions\n  policy controls WHAT the role can do. Both must be audited. Recommend\n  running `iam-least-privilege-advisor` on the role's permissions policy.\n\n- NEVER recommend deleting a trust policy statement without first capturing\n  the current policy. Use `aws iam get-role --role-name \u003Cname> --query\n  Role.AssumeRolePolicyDocument > \u002Ftmp\u002F\u003Cname>-trust-backup-$(date +%s).json`\n  before any modification. Some trust relationships are load-bearing for\n  CI\u002FCD pipelines or cross-account monitoring.\n\n- NEVER conflate `aws:SourceAccount` with the trusting (role-owning)\n  account. `aws:SourceAccount` identifies the account that the calling\n  service is acting ON BEHALF OF — it is the source of the request, not\n  the destination. A role in account A with `Principal: {\"Service\":\n  \"lambda.amazonaws.com\"}` and `aws:SourceAccount: \"B\"` means \"Lambda may\n  assume this role only when invoked from account B\" — which is a\n  cross-account delegation, not a same-account trust.\n\n- NEVER ignore session-tag injection when `sts:TagSession` is allowed\n  without `sts:TransitiveTagKeys`. The assuming principal can inject\n  arbitrary session tags that propagate to downstream ABAC evaluations,\n  potentially bypassing tag-based authorization on resources.\n\n- NEVER trust `aws:PrincipalTag` conditions in a trust policy without\n  tracing the tag origin. `aws:PrincipalTag` reads the tags of the\n  assuming principal — but if those tags were set by a prior\n  `sts:TagSession` call on a different role in the chain (role chaining),\n  the tag values are attacker-controlled. ABAC trust policies that gate on\n  `aws:PrincipalTag` without verifying that the tag is admin-set (not\n  session-injected) are bypassable via role chaining: an attacker assumes\n  an intermediate role, sets the expected tag via `sts:TagSession`, then\n  assumes the target role with the injected tag satisfying the condition.\n\n- NEVER assume a session policy narrows the trust boundary. The session\n  policy (passed during `sts:AssumeRole`) narrows the role's effective\n  **permissions**, not its **trust surface**. The trust policy alone\n  determines who can attempt assumption. A broad trust policy with\n  \"the caller will pass a restrictive session policy\" is not a security\n  control — the caller controls the session policy and can pass an empty\n  or permissive one.\n\n- NEVER attempt to remediate a service-linked role's trust policy. Roles\n  whose name starts with `AWSServiceRoleFor...` have trust policies\n  managed by AWS and cannot be modified via `update-assume-role-policy`.\n  Flagging them as remediable wastes the operator's time and may cause\n  the remediation CLI to fail silently.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n> Moved to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md#pre-flight-safety-checks-run-before-any-remediation-cli).\n> Gates: back up the trust policy (get-role), service-linked-role check, CloudTrail AssumeRole lookup before restricting trust, prefer additive remediation, treat WILDCARD_TRUST as incident response.\n\n## Remediation guidance\n\n> Moved to [references\u002Ftrust-policy-hardening-guide.md](references\u002Ftrust-policy-hardening-guide.md#remediation-guidance-moved-from-skillmd).\n> Per-verdict playbooks: WILDCARD_TRUST (contain → audit CloudTrail → rotate), EXTERNAL_TRUST (add opaque ExternalId \u002F SourceArn+SourceAccount, tighten Principal), CONDITIONAL (verify ExternalId opacity + rotation, verify ARN still correct), OK (recommend iam-least-privilege-advisor).\n\n## Effective trust boundary (expert note)\n\n> Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#effective-trust-boundary-expert-note).\n> Full evaluation order (trust policy → identity policy → SCP → session policy), role chaining + session-tag ABAC bypass, maxSessionDuration blast radius, and permissions-boundary containment.\n\n## Recent AWS features (2024-2026)\n\n> Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#recent-aws-features-2024-2026).\n> STS session tagging, ExternalId enforcement guidance, Access Analyzer cross-referencing, role-chaining CloudTrail detection.\n\n## References\n\nSee `references\u002Ftrust-policy-hardening-guide.md` for the confused-deputy\nservice-principal reference table, the ExternalId generation snippet,\nthe `aws:SourceArn` vs `aws:SourceAccount` decision tree, and\ncopy-pasteable remediation commands for each verdict.\n\n## Section taxonomy (CloudOps auditor pattern)\n\n> Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#section-taxonomy-cloudops-auditor-pattern).\n> The 13-section canonical CloudOps auditor layout this skill follows.\n\n\n## References (load on demand)\n\n- [advanced-patterns](references\u002Fadvanced-patterns.md) — Mindset, scope note, the confused-deputy concept, root-ARN expansion, multi-statement\u002Fmalformed handling, effective trust boundary + role chaining, Recent AWS features, and section taxonomy moved from SKILL.md\n- [worked-examples](references\u002Fworked-examples.md) — the six edge-case walkthroughs and the multi-statement aggregation example moved from SKILL.md\n- [diagnostic-commands](references\u002Fdiagnostic-commands.md) — pre-flight safety checks (trust-policy backup, service-linked-role check, CloudTrail lookup) moved from SKILL.md\n- [trust-policy-hardening-guide](references\u002Ftrust-policy-hardening-guide.md) — now also holds the confused-deputy service-principal catalogs and the per-verdict remediation guidance moved from SKILL.md\n\n## Domain\n\nAWS CloudOps \u002F STS & IAM Trust-Policy Security.\n\n## AWS documentation\n\n- **AWS STS User Guide (temporary security credentials)** — https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fid_credentials_temp.html\n- **IAM Security Best Practices** — https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fbest-practices.html\n- **STS API Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002FSTS\u002Flatest\u002FAPIReference\u002F\n- **AWS CLI STS Command Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fsts\u002F\n- **Confused deputy problem** — https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fconfused-deputy.html\n- **Session tags** — https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fid_session-tags.html\n","# STS Cross-Account Role Auditor\n\n## Mindset\n\n> Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#mindset).\n> One-line: classify WHO can assume the role (trust policy, not permissions policy); catch wildcard `\"*\"`, unguarded cross-account root, and unguarded confused-deputy service principals; grade condition strength.\n\n## What this skill is NOT\n\n> Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#what-this-skill-is-not).\n> Scope: trust policy only — permissions-policy audits belong to iam-least-privilege-advisor; run both when the permissions policy is available.\n\n## Quick reference\n\nIf the trust policy has `Principal: \"*\"` or `{\"AWS\": \"*\"}` with no strong\ncondition, it is WILDCARD_TRUST. If it grants to a cross-account ARN without\n`sts:ExternalId`, it is EXTERNAL_TRUST. If it grants to a confused-deputy-risk\nservice without `aws:SourceArn`\u002F`aws:SourceAccount`, it is EXTERNAL_TRUST. If\nit has an external surface but a strong guarding condition, it is CONDITIONAL.\nIf it only allows same-account principals or properly guarded service links,\nit is OK. See the steps below for edge cases (NotPrincipal, SAML\u002FOIDC,\nweak conditions, session tags).\n\n**Condition strength at a glance** (see full matrix below):\n- STRONG (→ CONDITIONAL): `sts:ExternalId` (StringEquals),\n  `aws:SourceAccount` (StringEquals), `aws:SourceArn` (ArnLike),\n  `aws:sourceVpce`\u002F`aws:sourceVpc`, `SAML:sub`\u002F`SAML:aud`, `oidc:sub`\u002F`oidc:aud`.\n- WEAK (→ still WILDCARD_TRUST\u002FEXTERNAL_TRUST): `aws:SourceIp` with\n  `0.0.0.0\u002F0`, `aws:Referer`, `aws:UserAgent`, `sts:ExternalId` with\n  `StringLike` + wildcard.\n- TRAP: `ForAllValues:StringEquals` on `aws:SourceArn` evaluates TRUE when\n  the key is absent — use `ForAnyValue` or `ArnLike` instead.\n\n## The confused-deputy problem (core concept)\n\n> Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#the-confused-deputy-problem-core-concept).\n> Core: Principal.Service trusts the SERVICE, not your resources — any AWS customer can trigger it; fix with aws:SourceAccount (StringEquals, minimum) or aws:SourceArn (ArnLike, strongest).\n\n## Process — Classification logic (apply in order)\n\n### Step 0: Validate input and extract owning account\n\nIf the trust policy document is not valid JSON, output:\n\n```text\nROLE: \u003Cname>\nVERDICT: ERROR\nREASON: Trust policy document is not valid JSON — cannot parse statements.\nREMEDIATION: Validate with aws iam get-role --role-name \u003Cname> --query Role.AssumeRolePolicyDocument.\n```\n\nDo not attempt classification on malformed input.\n\n**Extract the owning account ID** from the role ARN (e.g.,\n`arn:aws:iam::123456789012:role\u002Fmy-role` → owning account is\n`123456789012`). If the role ARN is not provided, extract from context or\nflag that same-account verification cannot be performed and treat all\naccount-root principals as potentially cross-account.\n\nCheck the `Version` field: `\"2008-10-17\"` is legacy and causes policy\nvariables (`${aws:username}`) and some condition operators to fail silently.\nThe correct version is `\"2012-10-17\"`.\n\n### Step 1: NotPrincipal \u002F NotAction inverse wildcards\n\nIf ANY statement uses `NotPrincipal` or `NotAction`, classify as\n**WILDCARD_TRUST** with **CRITICAL** risk.\n\n`NotPrincipal` in a trust policy grants the AssumeRole action to EVERY\nprincipal EXCEPT the listed ones — this is effectively an open role and is\nalmost always a misconfiguration. `NotAction` grants every STS action\n(`sts:AssumeRole`, `sts:AssumeRoleWithSAML`,\n`sts:AssumeRoleWithWebIdentity`, `sts:DecodeAuthorizationMessage`) except\nthe listed ones, broadening the attack surface unpredictably.\n\nCite \"Step 1: inverse wildcard (NotPrincipal\u002FNotAction)\".\n\n### Step 2: Unrestricted wildcard Principal\n\nIf ANY Allow statement has `Principal` of `\"*\"`, `{\"AWS\": \"*\"}`, or any\nprincipal element that resolves to all principals, evaluate the condition:\n\n- **No `Condition` block at all** → **WILDCARD_TRUST**, **CRITICAL**. Anyone\n  with AWS credentials (which anyone can obtain via the free tier) can assume\n  the role. This grants the role's entire permission set to the public\n  internet.\n\n- **Condition present** → proceed to the **Condition strength matrix** below.\n  If the condition contains ONLY weak keys (Referer, UserAgent, SourceIp\n  `0.0.0.0\u002F0`) → still **WILDCARD_TRUST**, **CRITICAL**. The condition\n  provides no real restriction.\n\n- **Condition contains at least one STRONG key** (sourceVpce, sourceVpc,\n  SourceAccount, SourceArn) → **CONDITIONAL**, **MODERATE**. The wildcard\n  principal is narrowed by a real guard, but a policy edit or condition\n  removal could expose it.\n\nCite \"Step 2: wildcard Principal\" with the condition evaluation result.\n\n### Step 3: Cross-account Principal without ExternalId\n\nIf ANY Allow statement has a `Principal.AWS` that is an account-root ARN\n(`arn:aws:iam::\u003CACCOUNT>:root`), role ARN, or user ARN where `\u003CACCOUNT>` ≠\nthe role's owning account, evaluate the ExternalId guard:\n\n- **No `sts:ExternalId` condition** → **EXTERNAL_TRUST**, **HIGH**. The\n  trusting account has no verification that the assuming principal is the\n  intended third party. The third party's account administrator can grant\n  `sts:AssumeRole` on this role's ARN to ANY principal in their account\n  (including new users, new roles, or compromised credentials).\n\n- **`sts:ExternalId` present in `StringEquals`** → **CONDITIONAL**,\n  **MODERATE**. The ExternalId is a shared secret that the trusting account\n  sets and the third party must provide. It prevents the third party's\n  account admin from unilaterally granting access — without the ExternalId,\n  even root in the third-party account cannot assume the role.\n\n- **`sts:ExternalId` with `StringLike` and a wildcard pattern** (e.g.,\n  `\"*-prod\"`) → still **EXTERNAL_TRUST**, **HIGH**. `StringLike` with\n  wildcards weakens the guard — an attacker who knows or guesses the pattern\n  suffix can bypass it. ExternalId must be an opaque, unguessable string\n  matched with `StringEquals`.\n\nCite \"Step 3: cross-account without ExternalId\" or \"Step 3: cross-account\nwith ExternalId (CONDITIONAL)\".\n\n\n> Expert note moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#expert-note--the-root-arn-expansion-rule).\n> Root ARN expansion: `arn:aws:iam::ACCOUNT:root` = EVERY authenticated principal in that account, not just root — name the specific role ARN.\n\n### Step 4: Confused-deputy service Principal without source guard\n\nIf ANY Allow statement has `Principal.Service` set to a\n**confused-deputy-risk service** (see list below) and the `Condition` block\ndoes NOT contain `aws:SourceAccount` or `aws:SourceArn`, classify as\n**EXTERNAL_TRUST**, **HIGH**.\n\n\n> Service catalogs moved to [references\u002Ftrust-policy-hardening-guide.md](references\u002Ftrust-policy-hardening-guide.md#confused-deputy-risk-service-principal-catalogs-moved-from-skillmd).\n> High-risk: lambda, ec2, cloudformation, eks\u002Fecs, states, events\u002Fpipes, sns\u002Fsqs, codebuild\u002Fcodepipeline, apigateway, backup, cloudtrail, config, controltower, security services, waf, firehose\u002Fes\u002Faoss, bedrock. Lower-risk: awslambda (legacy), dynamodb, ds, ssm, transfer, quicksight.\n\nFor any service principal NOT on either list above, classify as CONDITIONAL\nwith a note to manually verify the service's confused-deputy posture via the\nAWS documentation for that service.\n\n**Expert note — `aws:SourceArn` vs `aws:SourceAccount`:**\n`aws:SourceArn` is stronger because it identifies the exact resource making\nthe call (e.g., a specific Lambda function ARN). `aws:SourceAccount`\nidentifies only the account. If the source account has many principals, any\nof them can trigger the service to assume the role. Use `ArnLike` for\n`aws:SourceArn` (allows wildcard in the resource path) and `StringEquals`\nfor `aws:SourceAccount`. For maximum precision, use BOTH:\n`aws:SourceArn` for resource-level scope AND `aws:SourceAccount` as a\ndefense-in-depth guard.\n\nIf the service principal IS on the risk list and `aws:SourceAccount` or\n`aws:SourceArn` IS present → proceed to Step 5.\n\nIf the service principal is NOT on the risk list above (e.g., a rare or\ninternal service), classify as **CONDITIONAL** with a note to verify the\nservice's confused-deputy posture manually.\n\n### Step 5: Confused-deputy service Principal WITH source guard\n\nIf a confused-deputy-risk service principal has `aws:SourceAccount` or\n`aws:SourceArn` in the `Condition` block (with `StringEquals`, `StringLike`,\n`ArnLike`, or `ArnEquals`), classify as **CONDITIONAL**, **MODERATE**.\n\nThe source guard narrows the trust to a specific account or resource, but\nthe role is still assumable via a service that operates outside the owning\naccount's direct control. A condition removal or service-principal change\ncould expose it.\n\nCite \"Step 5: confused-deputy with source guard (CONDITIONAL)\".\n\n### Step 6: SAML \u002F OIDC federated Principal\n\nIf ANY Allow statement has `Principal.Federated` (SAML or OIDC identity\nprovider), evaluate the condition:\n\n- **`Principal.Federated` is an account-specific IdP ARN**\n  (e.g., `arn:aws:iam::123456789012:saml-provider\u002FCorporateIdP`) AND the\n  `Condition` constrains `SAML:sub` (subject), `SAML:aud` (audience), or\n  `SAML:sub_type` → **CONDITIONAL**, **MODERATE**. The IdP controls who can\n  assume the role; the condition narrows which assertions are accepted.\n\n- **Same as above but NO `Condition` block** → **EXTERNAL_TRUST**, **HIGH**.\n  Any assertion from the IdP that matches the provider ARN is accepted —\n  the IdP admin (or anyone who compromises the IdP) controls access to\n  your AWS role.\n\n- **`Principal.Federated` is `cognito-identity.amazonaws.com`** (Cognito) →\n  **CONDITIONAL**, **MODERATE** if `Condition` has\n  `cognito-identity.amazonaws.com:aud` (user-pool\u002Fclient ID) and\n  `cognito-identity.amazonaws.com:amr` (authenticated\u002Funauthenticated).\n  Without these → **EXTERNAL_TRUST**, **HIGH**.\n\n- **`Principal.Federated` is `\"*\"`, `{\"AWS\": \"*\"}`, or a wildcard OIDC URL**\n  (e.g., `accounts.google.com` without audience constraint) →\n  **WILDCARD_TRUST**, **CRITICAL**. Any federated identity can assume.\n\n**Action field check for federated statements:** the `Action` must be\n`sts:AssumeRoleWithSAML` (for SAML) or `sts:AssumeRoleWithWebIdentity` (for\nOIDC). If the Action is `sts:AssumeRole` with a Federated principal, flag\nas a misconfiguration — the combination is invalid and the statement will\nsilently fail at runtime.\n\nCite \"Step 6: federated trust — \u003CSAML|OIDC|Cognito>\".\n\n### Step 7: Session tag injection risk\n\nIf ANY Allow statement in the trust policy grants `sts:TagSession` (or the\nbroader `sts:AssumeRole` which implicitly allows tag propagation), check\nfor `sts:TransitiveTagKeys`:\n\n- **`sts:TagSession` allowed with no `sts:TransitiveTagKeys` limit** → append\n  a **TAG_INJECTION_FLAG** to the REMEDIATION field. The assuming principal\n  can set arbitrary session tags, which may propagate to downstream ABAC\n  (attribute-based access control) evaluations and bypass resource-level\n  tag conditions.\n\n- **`sts:TransitiveTagKeys` present** → the tag-propagation surface is\n  bounded. Note the allowed tag keys in the REMEDIATION field for review.\n\nThis does not change the verdict but appends a warning. Session-tag\ninjection is a privilege-escalation vector when downstream policies trust\nsession-set tags for authorization decisions.\n\n### Step 8: Same-account principals — OK\n\nIf ALL Allow statements have:\n\n- `Principal.AWS` with ARNs in the **same account** as the role (the account\n  ID in the ARN matches the owning account), OR\n- `Principal.Service` for a non-confused-deputy-risk service, OR\n- No wildcard principals, no `NotPrincipal`, no cross-account ARNs\n\nthen classify as **OK**, **LOW**.\n\n\n> Expert note moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#expert-note--same-account-root-arn).\n> Same-account `:root` is safe externally but grants EVERY principal in the account — prefer naming the specific role ARN for privileged roles.\n\n### Step 9: Aggregation\n\nWhen a trust policy contains multiple statements, the role-level verdict is\nthe **worst** verdict across all Allow statements, where:\n\n```\nWILDCARD_TRUST > EXTERNAL_TRUST > CONDITIONAL > OK\n```\n\nA single WILDCARD_TRUST statement makes the entire role WILDCARD_TRUST,\neven if all other statements are OK.\n\n## Condition strength matrix\n\nWhen evaluating a condition block on a wildcard or external Principal,\nclassify each condition key to determine if it provides real protection:\n\n**STRONG condition keys (→ CONDITIONAL):**\n\n| Key | Operator | Why it is strong |\n|---|---|---|\n| `sts:ExternalId` | `StringEquals` | Shared secret set by the trusting account; the third party cannot guess or bypass it. The canonical cross-account guard. |\n| `aws:SourceAccount` | `StringEquals` | Restricts the calling service to act only on behalf of a specific AWS account. Prevents confused-deputy exploitation. |\n| `aws:SourceArn` | `ArnLike` \u002F `ArnEquals` | Restricts to a specific resource ARN — the strongest source-scoping option. Identifies the exact resource making the call. |\n| `aws:sourceVpce` | `StringEquals` | VPC Endpoint ID — request must traverse the named endpoint. Not forgeable by the caller. |\n| `aws:sourceVpc` | `StringEquals` | VPC ID — request must originate in the named VPC. |\n| `SAML:sub` | `StringEquals` | SAML subject — identifies the specific federated user. |\n| `SAML:aud` | `StringEquals` | SAML audience — restricts to a specific relying-party trust. |\n| `oidc:sub` | `StringEquals` | OIDC subject — identifies the specific federated identity. |\n| `oidc:aud` | `StringEquals` | OIDC audience — restricts to a specific client ID. |\n\n**WEAK condition keys (→ still WILDCARD_TRUST or EXTERNAL_TRUST):**\n\n| Key | Operator | Why it is weak |\n|---|---|---|\n| `aws:SourceIp` | `IpAddress` with `0.0.0.0\u002F0` | The CIDR for the entire internet — zero restriction. Treat as no condition. |\n| `aws:SourceIp` | `IpAddress` with public CIDR | Restrictive in theory but bypassable via proxy, VPN, or a compromised host in the CIDR range. |\n| `aws:Referer` | `StringLike` \u002F `StringEquals` | HTTP Referer header — trivially forgeable by any HTTP client. Provides NO real access control. |\n| `aws:UserAgent` | `StringLike` \u002F `StringEquals` | HTTP User-Agent header — trivially forgeable. Same weakness as Referer. |\n| `sts:ExternalId` | `StringLike` with wildcard | Pattern matching weakens the shared secret — if the pattern is guessable, the guard is bypassable. Must use `StringEquals` with an opaque value. |\n\n**MIXED condition blocks:** If a statement has BOTH strong and weak keys\n(e.g., `aws:SourceIp` + `aws:SourceAccount`), the strong key dominates —\nclassify as CONDITIONAL. The weak key is redundant but does not weaken the\nstrong key.\n\n**ForAllValues \u002F ForAnyValue trap:** `ForAllValues:StringEquals` evaluates\nto TRUE when the request contains ZERO matching values. If the tested key is\nabsent from the request, the condition passes — a known bypass. Use\n`ForAnyValue:StringEquals` instead, or add an explicit existence check.\nThis is especially dangerous with `aws:SourceArn` — if the service does not\npopulate `aws:SourceArn` for certain call paths, `ForAllValues:aws:SourceArn`\nwill pass and grant access unexpectedly.\n\n## Risk \u002F severity matrix\n\nThe RISK field is derived from the VERDICT and the specific pattern:\n\n| Verdict | Pattern | Risk |\n|---|---|---|\n| WILDCARD_TRUST | `Principal: \"*\"` no condition | CRITICAL |\n| WILDCARD_TRUST | `Principal: \"*\"` weak condition only | CRITICAL |\n| WILDCARD_TRUST | `NotPrincipal` or `NotAction` | CRITICAL |\n| WILDCARD_TRUST | `Principal: \"*\"` with strong condition | MODERATE (→ CONDITIONAL) |\n| EXTERNAL_TRUST | Cross-account root\u002Frole without ExternalId | HIGH |\n| EXTERNAL_TRUST | Confused-deputy service without source guard | HIGH |\n| EXTERNAL_TRUST | SAML\u002FOIDC without condition | HIGH |\n| CONDITIONAL | Cross-account with ExternalId | MODERATE |\n| CONDITIONAL | Confused-deputy with SourceAccount\u002FSourceArn | MODERATE |\n| CONDITIONAL | SAML\u002FOIDC with constrained assertion | MODERATE |\n| OK | Same-account scoped | LOW |\n\n**Severity escalation to CRITICAL:** If the role's permissions policy (when\nknown) grants privileged actions (`iam:*`, `sts:*`, `AdministrativeAccess`),\nescalate any EXTERNAL_TRUST or WILDCARD_TRUST finding by one level (HIGH →\nCRITICAL, or CRITICAL stays CRITICAL). A role with `Principal: \"*\"` that\nalso has `iam:PassRole` permissions is a full account-takeover vector.\n\n## Multi-statement and malformed input handling\n\n> Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#multi-statement-and-malformed-input-handling).\n> Rules: worst statement wins; Deny statements narrow (exclude from verdict); evaluate EACH Principal entry; missing Action = inert; non-STS Action = misplaced; unparseable → VERDICT: ERROR.\n\n## Edge case walkthroughs\n\n> Moved to [references\u002Fworked-examples.md](references\u002Fworked-examples.md#edge-case-walkthroughs).\n> Six worked edges: ForAllValues trap on aws:SourceArn, mixed strong+weak keys, multi-statement aggregation, aws:PrincipalTag role-chaining bypass, SAML valid vs missing condition, Action-principal mismatch.\n\n## Output format (per role)\n\n```text\nROLE: \u003Cname>\nVERDICT: EXTERNAL_TRUST | WILDCARD_TRUST | CONDITIONAL | OK\nREASON: \u003C1-2 sentences citing the specific statement, the Principal type, and the guard status>\nRISK: CRITICAL | HIGH | MODERATE | LOW\nREMEDIATION: \u003Cspecific action, or \"None required\" if OK>\n```\n\n### Multi-statement aggregation example\n\n> Moved to [references\u002Fworked-examples.md](references\u002Fworked-examples.md#multi-statement-aggregation-example).\n> Full WILDCARD_TRUST \u002F CRITICAL report for a mixed three-statement trust policy (Step 9 aggregation).\n\n## Anti-Patterns — NEVER\n\n- NEVER classify a trust policy as OK when `Principal: \"*\"` or\n  `{\"AWS\": \"*\"}` appears in any Allow statement without a strong condition.\n  This grants the role's entire permission set to any AWS credential holder.\n  Cite Step 2.\n\n- NEVER classify `Principal: \"*\"` with a WEAK condition\n  (`aws:SourceIp`, `aws:Referer`, `aws:UserAgent`) as CONDITIONAL. These\n  keys are forgeable and provide no real restriction — the verdict is\n  WILDCARD_TRUST. This is the inverse mistake of treating every condition\n  as protective.\n\n- NEVER assume `arn:aws:iam::ACCOUNT:root` means \"only the root user\".\n  The root ARN expands to EVERY authenticated principal in that account —\n  every IAM user, every role, every session. If the intent is a specific\n  principal, name it explicitly. This is the most common misunderstanding\n  in trust-policy review.\n\n- NEVER classify a confused-deputy-risk service principal\n  (`lambda.amazonaws.com`, `ec2.amazonaws.com`, `cloudformation.amazonaws.com`,\n  `events.amazonaws.com`, etc.) without `aws:SourceAccount` or\n  `aws:SourceArn` as OK. The service can be invoked by ANY AWS customer —\n  the correct verdict is EXTERNAL_TRUST. Cite Step 4 and the confused-deputy\n  problem above.\n\n- NEVER treat `NotPrincipal` as a scoped grant. `NotPrincipal` is an inverse\n  wildcard — it grants access to everyone EXCEPT the listed principal(s).\n  In a trust policy this is almost always a catastrophic misconfiguration.\n  Classify as WILDCARD_TRUST.\n\n- NEVER treat `ForAllValues:StringEquals` on `aws:SourceArn` as a reliable\n  guard. `ForAllValues` evaluates TRUE when the key is absent from the\n  request — if the calling service does not populate `aws:SourceArn` on\n  certain code paths, the condition passes and grants access. Use\n  `ForAnyValue` or an explicit `ArnLike` condition instead.\n\n- NEVER classify a cross-account principal with `sts:ExternalId` in\n  `StringLike` with a wildcard pattern (e.g., `\"*-prod\"`) as CONDITIONAL.\n  The wildcard weakens the shared secret — an attacker who guesses the\n  suffix bypasses the guard. ExternalId must be opaque and matched with\n  `StringEquals`.\n\n- NEVER classify `sts:AssumeRole` with a `Principal.Federated` as valid.\n  The Action must be `sts:AssumeRoleWithSAML` (SAML) or\n  `sts:AssumeRoleWithWebIdentity` (OIDC). The `sts:AssumeRole` +\n  Federated combination silently fails at runtime — flag as a\n  misconfiguration.\n\n- NEVER assume the permissions policy is safe just because the trust policy\n  is OK. The trust policy controls WHO assumes the role; the permissions\n  policy controls WHAT the role can do. Both must be audited. Recommend\n  running `iam-least-privilege-advisor` on the role's permissions policy.\n\n- NEVER recommend deleting a trust policy statement without first capturing\n  the current policy. Use `aws iam get-role --role-name \u003Cname> --query\n  Role.AssumeRolePolicyDocument > \u002Ftmp\u002F\u003Cname>-trust-backup-$(date +%s).json`\n  before any modification. Some trust relationships are load-bearing for\n  CI\u002FCD pipelines or cross-account monitoring.\n\n- NEVER conflate `aws:SourceAccount` with the trusting (role-owning)\n  account. `aws:SourceAccount` identifies the account that the calling\n  service is acting ON BEHALF OF — it is the source of the request, not\n  the destination. A role in account A with `Principal: {\"Service\":\n  \"lambda.amazonaws.com\"}` and `aws:SourceAccount: \"B\"` means \"Lambda may\n  assume this role only when invoked from account B\" — which is a\n  cross-account delegation, not a same-account trust.\n\n- NEVER ignore session-tag injection when `sts:TagSession` is allowed\n  without `sts:TransitiveTagKeys`. The assuming principal can inject\n  arbitrary session tags that propagate to downstream ABAC evaluations,\n  potentially bypassing tag-based authorization on resources.\n\n- NEVER trust `aws:PrincipalTag` conditions in a trust policy without\n  tracing the tag origin. `aws:PrincipalTag` reads the tags of the\n  assuming principal — but if those tags were set by a prior\n  `sts:TagSession` call on a different role in the chain (role chaining),\n  the tag values are attacker-controlled. ABAC trust policies that gate on\n  `aws:PrincipalTag` without verifying that the tag is admin-set (not\n  session-injected) are bypassable via role chaining: an attacker assumes\n  an intermediate role, sets the expected tag via `sts:TagSession`, then\n  assumes the target role with the injected tag satisfying the condition.\n\n- NEVER assume a session policy narrows the trust boundary. The session\n  policy (passed during `sts:AssumeRole`) narrows the role's effective\n  **permissions**, not its **trust surface**. The trust policy alone\n  determines who can attempt assumption. A broad trust policy with\n  \"the caller will pass a restrictive session policy\" is not a security\n  control — the caller controls the session policy and can pass an empty\n  or permissive one.\n\n- NEVER attempt to remediate a service-linked role's trust policy. Roles\n  whose name starts with `AWSServiceRoleFor...` have trust policies\n  managed by AWS and cannot be modified via `update-assume-role-policy`.\n  Flagging them as remediable wastes the operator's time and may cause\n  the remediation CLI to fail silently.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n> Moved to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md#pre-flight-safety-checks-run-before-any-remediation-cli).\n> Gates: back up the trust policy (get-role), service-linked-role check, CloudTrail AssumeRole lookup before restricting trust, prefer additive remediation, treat WILDCARD_TRUST as incident response.\n\n## Remediation guidance\n\n> Moved to [references\u002Ftrust-policy-hardening-guide.md](references\u002Ftrust-policy-hardening-guide.md#remediation-guidance-moved-from-skillmd).\n> Per-verdict playbooks: WILDCARD_TRUST (contain → audit CloudTrail → rotate), EXTERNAL_TRUST (add opaque ExternalId \u002F SourceArn+SourceAccount, tighten Principal), CONDITIONAL (verify ExternalId opacity + rotation, verify ARN still correct), OK (recommend iam-least-privilege-advisor).\n\n## Effective trust boundary (expert note)\n\n> Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#effective-trust-boundary-expert-note).\n> Full evaluation order (trust policy → identity policy → SCP → session policy), role chaining + session-tag ABAC bypass, maxSessionDuration blast radius, and permissions-boundary containment.\n\n## Recent AWS features (2024-2026)\n\n> Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#recent-aws-features-2024-2026).\n> STS session tagging, ExternalId enforcement guidance, Access Analyzer cross-referencing, role-chaining CloudTrail detection.\n\n## References\n\nSee `references\u002Ftrust-policy-hardening-guide.md` for the confused-deputy\nservice-principal reference table, the ExternalId generation snippet,\nthe `aws:SourceArn` vs `aws:SourceAccount` decision tree, and\ncopy-pasteable remediation commands for each verdict.\n\n## Section taxonomy (CloudOps auditor pattern)\n\n> Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md#section-taxonomy-cloudops-auditor-pattern).\n> The 13-section canonical CloudOps auditor layout this skill follows.\n\n\n## References (load on demand)\n\n- [advanced-patterns](references\u002Fadvanced-patterns.md) — Mindset, scope note, the confused-deputy concept, root-ARN expansion, multi-statement\u002Fmalformed handling, effective trust boundary + role chaining, Recent AWS features, and section taxonomy moved from SKILL.md\n- [worked-examples](references\u002Fworked-examples.md) — the six edge-case walkthroughs and the multi-statement aggregation example moved from SKILL.md\n- [diagnostic-commands](references\u002Fdiagnostic-commands.md) — pre-flight safety checks (trust-policy backup, service-linked-role check, CloudTrail lookup) moved from SKILL.md\n- [trust-policy-hardening-guide](references\u002Ftrust-policy-hardening-guide.md) — now also holds the confused-deputy service-principal catalogs and the per-verdict remediation guidance moved from SKILL.md\n\n## Domain\n\nAWS CloudOps \u002F STS & IAM Trust-Policy Security.\n\n## AWS documentation\n\n- **AWS STS User Guide (temporary security credentials)** — https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fid_credentials_temp.html\n- **IAM Security Best Practices** — https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fbest-practices.html\n- **STS API Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002FSTS\u002Flatest\u002FAPIReference\u002F\n- **AWS CLI STS Command Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fsts\u002F\n- **Confused deputy problem** — https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fconfused-deputy.html\n- **Session tags** — https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fid_session-tags.html\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":38},{"tags":25,"phase":26,"author":27,"domain":28,"family":29,"version":30,"keywords":31,"complexity":32,"entry_point":33,"when_to_use":34,"dependencies":35,"requires_llm":36,"verdict_shape":37,"supports_pipeline":36},"sts, iam, security, trust-policy, cross-account, external-id, confused-deputy, role-audit","2","Jacky Chan — AWS Community Builder","aws-cloudops","Security","0.1.0","STS, trust policy, AssumeRole, AssumeRolePolicyDocument, cross-account, ExternalId, confused deputy, Principal, wildcard principal, role trust, SAML, OIDC, federated, SourceArn, SourceAccount, NotPrincipal, role assumption, IAM audit, security","high","false","Reviewing an IAM role trust policy (AssumeRolePolicyDocument), auditing who can assume a role, checking cross-account or external access exposure, validating ExternalId \u002F SourceArn \u002F SourceAccount guards, hardening a service-role trust before production, or investigating confused-deputy attack surface.","aws-orchestrator","true","EXTERNAL_TRUST | WILDCARD_TRUST | CONDITIONAL | OK","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline trust-policy classification. Live account audits use aws iam get-role --query Role.AssumeRolePolicyDocument and aws iam list-roles (AWS CLI v2, SSO or key-based credentials).","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fsts-cross-account-role-auditor",0,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills","https:\u002F\u002Fgithub.com\u002Fjhkchan","CTO & Co-Founder @Beever-AI  & @votee. CAISP. AWS Community Builder. Organizer@GDGCloudHK. MongoDB Champion. Technopreneur + Infornographer.","2026-09-24 08:54:10",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add jhkchan\u002Faws-agent-skills --skill sts-cross-account-role-auditor",{"tool":53,"command":54},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill sts-cross-account-role-auditor",{"tool":56,"command":57},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill sts-cross-account-role-auditor","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002FSKILL.md",true,[61,67,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127,131,135,139,143],{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",6550,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Feval\u002Ftest-cases.yaml",{"path":68,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":69,"sourceHtmlUrl":70},"evals\u002Fbaselines\u002Fconfused-deputy-no-source.md",708,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fevals\u002Fbaselines\u002Fconfused-deputy-no-source.md",{"path":72,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":73,"sourceHtmlUrl":74},"evals\u002Fbaselines\u002Fconfused-deputy-with-source-arn.md",647,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fevals\u002Fbaselines\u002Fconfused-deputy-with-source-arn.md",{"path":76,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":77,"sourceHtmlUrl":78},"evals\u002Fbaselines\u002Fcross-account-root-no-externalid.md",775,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fevals\u002Fbaselines\u002Fcross-account-root-no-externalid.md",{"path":80,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":81,"sourceHtmlUrl":82},"evals\u002Fbaselines\u002Fcross-account-with-externalid.md",726,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fevals\u002Fbaselines\u002Fcross-account-with-externalid.md",{"path":84,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":85,"sourceHtmlUrl":86},"evals\u002Fbaselines\u002Fsame-account-scoped-ok.md",658,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fevals\u002Fbaselines\u002Fsame-account-scoped-ok.md",{"path":88,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":89,"sourceHtmlUrl":90},"evals\u002Fbaselines\u002Fwildcard-principal-open.md",635,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fevals\u002Fbaselines\u002Fwildcard-principal-open.md",{"path":92,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":93,"sourceHtmlUrl":94},"evals\u002Feval_config.yaml",2132,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fevals\u002Feval_config.yaml",{"path":96,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":97,"sourceHtmlUrl":98},"evals\u002Fevals.json",5294,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fevals\u002Fevals.json",{"path":100,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":101,"sourceHtmlUrl":102},"evals\u002Fprompts\u002Fconfused-deputy-no-source.md",705,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fevals\u002Fprompts\u002Fconfused-deputy-no-source.md",{"path":104,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":105,"sourceHtmlUrl":106},"evals\u002Fprompts\u002Fconfused-deputy-with-source-arn.md",968,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fevals\u002Fprompts\u002Fconfused-deputy-with-source-arn.md",{"path":108,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":109,"sourceHtmlUrl":110},"evals\u002Fprompts\u002Fcross-account-root-no-externalid.md",749,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fevals\u002Fprompts\u002Fcross-account-root-no-externalid.md",{"path":112,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":113,"sourceHtmlUrl":114},"evals\u002Fprompts\u002Fcross-account-with-externalid.md",922,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fevals\u002Fprompts\u002Fcross-account-with-externalid.md",{"path":116,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":117,"sourceHtmlUrl":118},"evals\u002Fprompts\u002Fsame-account-scoped-ok.md",721,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fevals\u002Fprompts\u002Fsame-account-scoped-ok.md",{"path":120,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":121,"sourceHtmlUrl":122},"evals\u002Fprompts\u002Fwildcard-principal-open.md",559,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fevals\u002Fprompts\u002Fwildcard-principal-open.md",{"path":124,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":125,"sourceHtmlUrl":126},"examples\u002Fend-to-end.md",4901,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fexamples\u002Fend-to-end.md",{"path":128,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":129,"sourceHtmlUrl":130},"references\u002Fadvanced-patterns.md",11823,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Freferences\u002Fadvanced-patterns.md",{"path":132,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":133,"sourceHtmlUrl":134},"references\u002Fdiagnostic-commands.md",1666,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Freferences\u002Fdiagnostic-commands.md",{"path":136,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":137,"sourceHtmlUrl":138},"references\u002Ftrust-policy-hardening-guide.md",13874,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Freferences\u002Ftrust-policy-hardening-guide.md",{"path":140,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":141,"sourceHtmlUrl":142},"references\u002Fworked-examples.md",6131,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Freferences\u002Fworked-examples.md",{"path":144,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":145,"sourceHtmlUrl":146},"skill.usf.yaml",4052,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsts-cross-account-role-auditor\u002Fskill.usf.yaml",[148,155,162,169,176,183],{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":154,"publishedAt":19},"01M7ADVD60X4PCAPKSE58P9NDC","xray-tracing-deployer","Deploys AWS X-Ray distributed tracing with production-grade configuration: X-Ray daemon deployment (EC2 systemd, ECS sidecar, EKS DaemonSet, Lambda built-in), SDK instrumentation (Java, Python, Node.js, Go, .NET) with annotations and metadata, sampling rules (default reservoir + rate vs custom rules with URL \u002F method \u002F service-name predicates), service map generation, trace query and retrieval, groups and insights, CloudWatch ServiceLens integration, IAM permissions (PutTraceSegments, GetSamplingRules), and latest features (Lambda Powertools tracing, OpenTelemetry \u002F ADOT Collector support, W3C trace context). Emits a READY_TO_DEPLOY checklist with every configuration item verified. Use when enabling X-Ray on a new application, adding tracing to ECS \u002F EKS \u002F Lambda, validating a sampling configuration, or generating daemon deployment CLI and IaC templates. Triggers: X-Ray, distributed tracing, X-Ray daemon, sampling rules, service map, X-Ray SDK, OpenTelemetry, ADOT, Lambda Powertools, CloudWatch ServiceLens.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxray-tracing-deployer\u002FSKILL.md",[],[],{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":19},"01M7ADTVJ7DCBM9CB1FY51GH7J","wellarchitected-workload-auditor","Audits AWS Well-Architected Tool workloads for review staleness, per-pillar high-risk issue counts, milestone tracking gaps, and remediation plan completeness. Emits a deterministic verdict (STALE_REVIEW | HIGH_RISK | CONFIG_GAP | OK) per workload with per-pillar risk breakdown, milestone trend analysis, and specific remediation. Use when reviewing Well-Architected workloads, checking WA review freshness, auditing high-risk issues per pillar, validating milestone coverage, or tracking remediation plans.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-workload-auditor\u002FSKILL.md",[],[],{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"publishedAt":19},"01M7ADT59G6FTTNZYHT2QRPNNP","wellarchitected-review-operator","Operates AWS Well-Architected Tool reviews end-to-end — creates workloads, runs pillar reviews (operational excellence, security, reliability, performance, cost optimization, sustainability, Prosperity), answers questions with risk-tier rationale, generates reports and improvement plans, creates milestones, and integrates with Trusted Advisor and Well-Architected Labs. Runs deterministic pre-checks (workload existence, lens availability, pillar coverage), emits the exact update-answer \u002F get-consolidated-report CLI behind a CONFIRM gate, and verifies risk-tier transitions. Emits READY | BLOCKED | COMPLETED. Use when creating a workload, answering pillar questions, generating an improvement plan, creating a milestone, or integrating with Trusted Advisor. Triggers: well-architected tool, well architected review, workload review, pillar, operational excellence, security, reliability, performance, cost optimization, sustainability, prosperity, improvement plan, milestone, trusted advisor.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-review-operator\u002FSKILL.md",[],[],{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":19},"01M7ADSH5JA9QHNPPHQCD7EVA7","wafv2-web-acl-deployer","Provisions AWS WAFv2 Web ACLs with correct production defaults: scope selection (CLOUDFRONT vs REGIONAL), managed rule groups (AWSManagedRulesCommonRuleSet, SQLiRuleSet, LinuxRuleSet, WindowsRuleSet, IPReputationList, BotControlRuleSet, AmazonIpReputationList, ATP), custom rules (byte match, IP set, regex pattern, geo match, size constraint, rate-based), rule priority ordering, logging destinations (Kinesis Firehose, CloudWatch Logs, S3), resource association (ALB, API Gateway, CloudFront), rate-based rules with aggregate keys (IP, forwarded IP), Challenge and CAPTCHA actions, and account takeover prevention. Emits a READY_TO_DEPLOY checklist. Use when creating a Web ACL, attaching managed rules, configuring rate limiting, enabling WAF logging, associating a Web ACL with an ALB\u002FAPI Gateway\u002FCloudFront, or configuring CAPTCHA\u002FChallenge actions. Triggers: create WAF Web ACL, WAFv2, managed rule groups, WAF rate limiting, WAF logging, WAF CAPTCHA, WAF Challenge action, bot control, ATP managed rules.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-deployer\u002FSKILL.md",[],[],{"skillNo":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":180,"categories":181,"keywords":182,"publishedAt":19},"01M7ADRYFAT8R73FBNCHRC573X","wafv2-web-acl-auditor","Audits AWS WAFv2 Web ACL configurations to determine whether the ACL provides effective protection: default-action posture (Allow vs Block), managed-rule-group coverage gaps, rule effectiveness (BLOCK vs COUNT, shadow\u002Fbypass rules, stale exclusions), rate-based rule correctness, logging and visibility configuration, and text-transformation bypass vectors. Emits a deterministic verdict per Web ACL. Use when reviewing a WAFv2 Web ACL for security posture, checking managed-rule coverage, validating rate-limit configuration, auditing WAF logging, or hardening a WAF before production deployment. Triggers: WAF, WAFv2, Web ACL, managed rule group, AWSManagedRules, rate-based rule, CAPTCHA, Challenge, OverrideAction, Count mode, forwarded IP, Bot Control, ATP, text transformation, WAF logging, WAF visibility, OWASP, SQLi, XSS, RFI.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-auditor\u002FSKILL.md",[],[],{"skillNo":184,"name":185,"nameZh":6,"description":186,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":187,"categories":188,"keywords":189,"publishedAt":19},"01M7ADR8W7G72JX4KFGN03QK8Q","waf-rule-deployer","Provisions AWS WAFv2 rule sets with production defaults: Web ACL creation (CloudFront scope in us-east-1 vs Regional scope), rule groups (managed vs custom) with capacity planning in WCU (Web ACL Capacity Units, 1500 default per ACL), managed rule groups (AWSManagedRulesCommonRuleSet, AWSManagedRulesSQLiRuleSet, AWSManagedRulesAmazonIpReputationList, AWSManagedRulesLinuxRuleSet, AWSManagedRulesWindowsRuleSet, AWSManagedRulesUnixRuleSet), custom rules (byte-match, regex pattern set, geo-match, rate-based), IP set and regex pattern set resources, rule priority ordering (lowest number evaluated first), action types (allow, block, count, CAPTCHA, Challenge), bot control managed rule group, account takeover. Triggers: create WAF rule, WAF managed rule group, WAF custom rule, WAF byte match, WAF geo match, WAF rate based rule, WAF IP set, WAF regex pattern set, WAF WCU budget, WAF CloudFront ACL, WAF logging Kinesis Firehose, WAF bot control, WAF ATP, WAF label matching, WAF Challenge action, WAF CAPTCHA.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwaf-rule-deployer\u002FSKILL.md",[],[]]