New to Claude Skills? Learn how to install them →

mukul975 on GitHub

AWS IAM Permission Boundaries

Free

Enforce least-privilege access in AWS IAM.

Get this skill

Free · Opens the source repo

What AWS IAM Permission Boundaries does

Implementing AWS IAM Permission Boundaries is a skill designed to help security teams manage permissions effectively within AWS environments. By defining permission boundaries, organizations can ensure that even if a user or role has an identity-based policy that grants extensive permissions, the effective permissions are limited to what is allowed by the boundary. This is crucial for maintaining a least-privilege security posture, especially when developers are given the autonomy to create IAM roles and policies.

The skill provides a structured approach to configure permission boundaries, allowing security teams to delegate IAM role creation to developers without compromising security. It includes practical workflows and example policies that illustrate how to set up the boundaries and the necessary permissions for developers. This ensures that developers can operate within a defined scope, preventing privilege escalation while still enabling them to perform their tasks efficiently.

This skill is particularly useful for organizations that are adopting cloud security best practices and need to comply with regulatory requirements. It enables teams to establish a robust security architecture and conduct security assessments with confidence, knowing that the permissions granted to users are controlled and monitored.

Overall, this skill is a valuable resource for any organization looking to implement AWS IAM permission boundaries effectively, ensuring that security and operational efficiency go hand in hand.

When to use it

Use this skill when you need to enforce least-privilege access in AWS IAM while allowing developers to create roles and policies.

When not to use it

This skill may not be suitable for environments where IAM delegation is not required or where a simpler permission model suffices.

What you can build with it

Developer Role Creation

Allow developers to create IAM roles while ensuring their permissions are limited by the defined permission boundary.

Compliance with Security Standards

Implement permission boundaries to meet compliance requirements and enhance overall cloud security.

Sandbox Environment Management

Use permission boundaries to restrict actions in development or sandbox environments, preventing unintended access to production resources.

How to install AWS IAM Permission Boundaries

View source

1. Install with the skills CLI

npx skills add mukul975/anthropic-cybersecurity-skills/implementing-aws-iam-permission-boundaries --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mukul975

Implementing AWS IAM Permission Boundaries

Overview

IAM permission boundaries are an advanced AWS feature that sets the maximum permissions an identity-based policy can grant to an IAM entity (user or role). They enable centralized security teams to safely delegate IAM role and policy creation to application developers without risking privilege escalation. The effective permissions of an entity are the intersection of its identity-based policies and its permission boundary -- even if an identity policy grants AdministratorAccess, the permission boundary restricts it to only the allowed actions.

When to Use

  • When deploying or configuring implementing aws iam permission boundaries capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation

Prerequisites

  • AWS account with IAM administrative access
  • Understanding of AWS IAM policy language (JSON)
  • AWS CLI v2 configured with appropriate credentials
  • Terraform or CloudFormation for infrastructure-as-code deployment

Core Concepts

How Permission Boundaries Work

Identity-Based Policy          Permission Boundary
(What the role CAN do)    ∩    (What the role MAY do)
        │                              │
        └──────────┬───────────────────┘
                   │
          Effective Permissions
    (Only actions in BOTH policies)

Policy Evaluation Logic

AWS evaluates permissions in this order:

  1. Explicit Deny in any policy - always wins
  2. Organizations SCP - sets org-wide maximum
  3. Permission Boundary - sets entity-level maximum
  4. Identity-Based Policy - grants actual permissions
  5. Resource-Based Policy - cross-account access (evaluated separately)

The entity can only perform an action if ALL applicable policy types allow it.

Key Use Cases

Use CaseDescription
Developer DelegationAllow devs to create IAM roles without escalating beyond their boundary
Sandbox IsolationLimit what roles can do in sandbox/dev accounts
Multi-Tenant WorkloadsEnsure tenant-specific roles cannot access other tenants' resources
CI/CD Pipeline RolesRestrict automation roles to specific services

Workflow

Step 1: Define the Permission Boundary Policy

Create a managed policy that defines the maximum allowed permissions:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowedServices",
            "Effect": "Allow",
            "Action": [
                "s3:*",
                "dynamodb:*",
                "lambda:*",
                "logs:*",
                "cloudwatch:*",
                "sqs:*",
                "sns:*",
                "events:*",
                "states:*",
                "xray:*",
                "ec2:Describe*",
                "ec2:CreateTags",
                "sts:AssumeRole",
                "kms:Decrypt",
                "kms:GenerateDataKey",
                "kms:DescribeKey",
                "secretsmanager:GetSecretValue"
            ],
            "Resource": "*"
        },
        {
            "Sid": "AllowIAMPassRole",
            "Effect": "Allow",
            "Action": "iam:PassRole",
            "Resource": "arn:aws:iam::*:role/app-*",
            "Condition": {
                "StringEquals": {
                    "iam:PassedToService": [
                        "lambda.amazonaws.com",
                        "states.amazonaws.com"
                    ]
                }
            }
        },
        {
            "Sid": "DenyBoundaryDeletion",
            "Effect": "Deny",
            "Action": [
                "iam:DeletePolicy",
                "iam:DeletePolicyVersion",
                "iam:CreatePolicyVersion"
            ],
            "Resource": "arn:aws:iam::*:policy/DeveloperBoundary"
        },
        {
            "Sid": "DenyBoundaryRemoval",
            "Effect": "Deny",
            "Action": [
                "iam:DeleteUserPermissionsBoundary",
                "iam:DeleteRolePermissionsBoundary"
            ],
            "Resource": "*"
        }
    ]
}

Step 2: Create the Developer Delegation Policy

Grant developers the ability to create IAM roles, but only with the boundary attached:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowCreateRoleWithBoundary",
            "Effect": "Allow",
            "Action": [
                "iam:CreateRole",
                "iam:AttachRolePolicy",
                "iam:DetachRolePolicy",
                "iam:PutRolePolicy",
                "iam:DeleteRolePolicy"
            ],
            "Resource": "arn:aws:iam::*:role/app-*",
            "Condition": {
                "StringEquals": {
                    "iam:PermissionsBoundary": "arn:aws:iam::*:policy/DeveloperBoundary"
                }
            }
        },
        {
            "Sid": "AllowCreatePolicyScoped",
            "Effect": "Allow",
            "Action": [
                "iam:CreatePolicy",
                "iam:DeletePolicy",
                "iam:CreatePolicyVersion",
                "iam:DeletePolicyVersion"
            ],
            "Resource": "arn:aws:iam::*:policy/app-*"
        },
        {
            "Sid": "AllowViewIAM",
            "Effect": "Allow",
            "Action": [
                "iam:Get*",
                "iam:List*"
            ],
            "Resource": "*"
        }
    ]
}

Step 3: Attach the Boundary

# Create the boundary policy
aws iam create-policy \
    --policy-name DeveloperBoundary \
    --policy-document file://developer-boundary.json

# Attach boundary to an existing role
aws iam put-role-permissions-boundary \
    --role-name developer-role \
    --permissions-boundary arn:aws:iam::123456789012:policy/DeveloperBoundary

# Create a new role with boundary
aws iam create-role \
    --role-name app-lambda-executor \
    --assume-role-policy-document file://trust-policy.json \
    --permissions-boundary arn:aws:iam::123456789012:policy/DeveloperBoundary

Step 4: Prevent Privilege Escalation

The boundary must include deny statements to prevent developers from:

  • Removing the boundary from their own roles
  • Modifying the boundary policy itself
  • Creating roles without the boundary attached
  • Accessing IAM services to escalate privileges

Step 5: Deploy with Terraform

resource "aws_iam_policy" "developer_boundary" {
  name   = "DeveloperBoundary"
  path   = "/"
  policy = file("${path.module}/policies/developer-boundary.json")
}

resource "aws_iam_role" "app_role" {
  name                 = "app-lambda-executor"
  assume_role_policy   = data.aws_iam_policy_document.lambda_trust.json
  permissions_boundary = aws_iam_policy.developer_boundary.arn
}

Validation Checklist

  • Permission boundary policy created and reviewed by security team
  • Boundary includes deny statements preventing self-modification
  • Developer delegation policy requires boundary on all new roles
  • Role naming convention enforced (e.g., app-* prefix)
  • Developers tested creating roles with and without boundary (should fail without)
  • Privilege escalation paths tested and blocked
  • CloudTrail logging enabled for IAM API calls
  • Boundary policy versioned in source control
  • Automated tests validate boundary effectiveness
  • Documentation provided to development teams

References

Frequently asked questions about AWS IAM Permission Boundaries

Similar skills