Provides accurate guidance on complex AWS IAM behaviors and edge cases.

Install

mkdir -p .claude/skills/aws-iam && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10557" && unzip -o skill.zip -d .claude/skills/aws-iam && rm skill.zip

Installs to .claude/skills/aws-iam

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Verified corrections for IAM behaviors that AI agents frequently get\
69 charsno explicit “when” trigger
Advanced

Key capabilities

  • Debug IAM policy evaluation
  • Configure trust policies
  • Audit cross-account role assumption
  • Understand STS session limits

How it works

Provides verified edge-case knowledge for IAM policy evaluation and AWS service quirks.

Inputs & outputs

You give it
IAM policy or configuration
You get back
Verified IAM behavior analysis

When to use aws-iam

  • Debug IAM policy evaluation issues
  • Configure trust policies correctly
  • Understand STS session constraints
  • Audit cross-account role assumption

About this skill

AWS IAM — Common Pitfalls

About This Skill

This skill contains verified corrections for things that AI agents frequently get wrong about IAM. It is not a comprehensive IAM guide — for full IAM guidance, search AWS documentation.

When answering IAM questions, verify specific claims (limits, quotas, exact API names, edge-case behaviors) against official AWS documentation rather than relying on pre-training. Prefer fetching known documentation URLs over broad searches. Trust official documentation over memory when they conflict.

Verified Edge Cases

CloudTrail:

  • AcceptHandshake/DeclineHandshake logged in ACTING account ONLY, not management account. Organization trail required for centralization.
  • ConsoleLogin region varies by endpoint/cookies, NOT always us-east-1. ?region= forces specific region.

STS:

  • GetSessionToken restrictions: (1) No IAM APIs unless MFA included (2) No STS except AssumeRole and GetCallerIdentity.
  • Cross-account AssumeRole to opt-in region: TARGET account must enable region, not calling account.
  • Role chaining: max 1-hour session.

Organizations:

  • Suspended/closed accounts CANNOT be removed until permanently closed (~90 days). Remove FIRST, then close.
  • Policy management delegation: use PutResourcePolicy, NOT register-delegated-administrator.
  • AI opt-out policies: management account required by default.
  • Organizations policy types for ListPolicies filter: SERVICE_CONTROL_POLICY, TAG_POLICY, BACKUP_POLICY, AISERVICES_OPT_OUT_POLICY, CHATBOT_POLICY, DECLARATIVE_POLICY_EC2, RESOURCE_CONTROL_POLICY.

SDK Specifics:

  • Organizations: DuplicatePolicyAttachmentException (not PolicyAlreadyAttachedException).
  • Boto3 IAM AccessKey: methods are activate(), deactivate(), delete() — NO update().
  • Instance profiles: waiter + time.sleep(10) pattern.
  • Managed policy max versions: 5.

SAML:

  • Encrypted assertions URL: https://region-code.signin.aws.amazon.com/saml/acs/IdP-ID.
  • Private key from IdP uploaded to IAM in .pem format.

Policy Evaluation:

  • ForAllValues with empty/missing key: evaluates to true (vacuous truth). To avoid that, use a Null condition in addition to the ForAllValues on the same context key to require that key to be present and non-null. For example, when evaluating the aws:TagKeys context key:
{
    "Version": "2012-10-17",
    "Statement": {
        "Effect": "Allow",
        "Action": "ec2:RunInstances",
        "Resource": "*",
        "Condition": {
            "ForAllValues:StringEquals": {
                "aws:TagKeys": ["Alpha", "Beta"]
            },
            "Null": {
                "aws:TagKeys": "false"
            }
        }
    }
}
  • Resource-based policies granting to IAM user ARN bypass permissions boundaries in same account.
  • 8 privilege escalation actions via direct IAM policy manipulation: PutGroupPolicy, PutRolePolicy, PutUserPolicy, CreatePolicy, CreatePolicyVersion, AttachGroupPolicy, AttachRolePolicy, AttachUserPolicy.
  • iam:PassRole with Resource: "*" + create/update on a compute service (EC2 RunInstances, Lambda CreateFunction/UpdateFunctionConfiguration, ECS RegisterTaskDefinition, Glue, SageMaker, CloudFormation, etc.) = privilege escalation to any passable role in the account, including Administrator. Scope Resource to specific role ARNs or an IAM path; optionally constrain with iam:PassedToService / iam:AssociatedResourceArn. See IAM User Guide — Grant a user permissions to pass a role.

MFA:

  • Unassigned virtual MFA devices auto-deleted when adding new ones.
  • MFA resync-only policy NotAction needs exactly: iam:ListMFADevices, iam:ListVirtualMFADevices, iam:ResyncMFADevice.

SigV4:

  • IncompleteSignatureException includes SHA-256 hash of Authorization header for transit modification diagnosis.

Service-Specific Roles:

  • Redshift Serverless trust policy: include BOTH redshift-serverless.amazonaws.com AND redshift.amazonaws.com as service principals (per AWS docs; omitting serverless causes Not authorized to get credentials of role on COPY).
  • IAM OIDC providers: thumbprints no longer required for most providers (AWS verifies via trusted CAs since 2022).

Policy Summary Display:

  • Single statement with multi-service wildcard actions (e.g. codebuild:*, codecommit:*) + service-specific resource ARNs: each resource appears ONLY under its matching service's summary (CodeBuild ARN under CodeBuild, etc.). A resource whose service prefix matches NO action in the statement is the only case where it appears in all action summaries ("mismatched resource").

When not to use it

  • For non-IAM authorization like Cognito user-pool policies

Limitations

  • Not a complete IAM guide

How it compares

Focuses on verified edge cases that AI agents frequently get wrong, rather than general documentation.

Compared to similar skills

aws-iam side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
aws-iam (this skill)03moNo flagsAdvanced
iam17moReviewIntermediate
secrets-management53moReviewAdvanced
equilateral-agents59moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

iam

itsmostafa

AWS Identity and Access Management for users, roles, policies, and permissions. Use when creating IAM policies, configuring cross-account access, setting up service roles, troubleshooting permission errors, or managing access control.

15

secrets-management

wshobson

Implement secure secrets management for CI/CD pipelines using Vault, AWS Secrets Manager, or native platform solutions. Use when handling sensitive credentials, rotating secrets, or securing CI/CD environments.

585

equilateral-agents

Equilateral-AI

22 production-ready AI agents with database-driven orchestration for security reviews, code quality analysis, deployment validation, infrastructure checks, and compliance. Auto-activates for security concerns, deployment tasks, code reviews, quality checks, and compliance questions. Includes upgrade paths to enterprise features (GDPR, HIPAA, multi-account AWS, ML-based optimization).

564

cloud-penetration-testing

davila7

This skill should be used when the user asks to "perform cloud penetration testing", "assess Azure or AWS or GCP security", "enumerate cloud resources", "exploit cloud misconfigurations", "test O365 security", "extract secrets from cloud environments", or "audit cloud infrastructure". It provides comprehensive techniques for security assessment across major cloud platforms.

343

aws-penetration-testing

davila7

This skill should be used when the user asks to "pentest AWS", "test AWS security", "enumerate IAM", "exploit cloud infrastructure", "AWS privilege escalation", "S3 bucket testing", "metadata SSRF", "Lambda exploitation", or needs guidance on Amazon Web Services security assessment.

439

cis-controls

Hack23

Implement CIS Controls v8 critical security controls for effective cyber defense in CIA platform

312

Search skills

Search the agent skills registry