AWS in 1 Min · Episode 29

IAM permissions boundaries explained

A ceiling on what a role can do. Watch the one-minute video, then read the details.

David Gomez1:16 video · 3 min read

"Whoever can create roles is basically an admin." Without guardrails, that's true: a developer allowed to create a role and attach policies could create one with administrator access and then use it. That's privilege escalation, and it's why many teams funnel every role request through one overloaded platform team. A permissions boundary breaks the dilemma: people can create roles themselves, and those roles still can't go beyond a ceiling you define.

What a permissions boundary is

A permissions boundary (AWS's official name; often called a "permission boundary") is a managed policy that you set on an IAM user or role as its boundary. It defines the maximum permissions that identity-based policies can grant to that user or role. It can be an AWS managed policy or one you write.

Two things to remember:

  • A boundary grants nothing by itself. A role with a boundary and no permissions policy can do nothing.
  • A boundary applies to users and roles, not to groups.

Think of it as a ceiling, not a key.

How effective permissions are calculated

For an identity with a boundary, an action is allowed only if it is allowed by both:

  • the identity-based policies attached to it, and
  • the permissions boundary.

The effective permissions are the overlap of the two. If the boundary allows only S3, CloudWatch and EC2, then attaching AdministratorAccess to the role still gives it only S3, CloudWatch and EC2. As always, an explicit Deny in either one wins.

Boundaries are one layer among several. Service control policies in AWS Organizations cap whole accounts, and session policies cap a single session; a request has to pass every layer that applies. One subtlety worth knowing: in the same account, a resource-based policy that grants access directly to an IAM user or to a role session isn't limited by the boundary's implicit deny, so boundaries are not a substitute for reviewing bucket and key policies.

Delegating role creation safely

This is the use case boundaries were built for. You let developers create and manage roles, on one condition: every role they create must carry your boundary.

The delegation policy does three things:

  1. Allows iam:CreateRole, iam:AttachRolePolicy and similar actions only when the request includes your boundary, using the condition key iam:PermissionsBoundary.
  2. Denies removing the boundary (iam:DeleteRolePermissionsBoundary) from any role.
  3. Denies editing the boundary policy itself, so nobody can quietly raise the ceiling.

A common mistake is doing step 1 and forgetting steps 2 and 3. Then a developer can create a compliant role and simply delete its boundary afterwards. Also make sure the boundary doesn't allow broad IAM actions, or the new role could create further roles with no ceiling.

Where AI fits

More and more IAM roles are not written by people. AI coding assistants generate infrastructure code, agents open pull requests, and pipelines apply them. Generated policies tend to be broader than needed, with wildcards that "make it work".

A permissions boundary is a control that doesn't depend on reviewing every generated line. Give the pipeline or agent's role a delegation policy that only allows creating roles with your boundary attached. Whatever the tool writes, the roles it creates can never exceed the ceiling: a role that asks for administrator access just ends up with the overlap.

Start with a boundary that covers the services your workloads really use, and test it in a non-production account first, because a boundary that is too tight fails in confusing ways: the policy says Allow and the request is still denied.

Quick recap

  • A boundary is a ceiling, not a grant: it limits, it never adds.
  • An action must be allowed by the policy and the boundary.
  • Require the boundary on every role that other people, pipelines or AI tools create, and deny removing it.
AWS in 1 Min #29 · 1:16

Need an AWS expert on your team?

I'm David, an AWS expert and fractional cloud consultant. I work alongside your team to run your cloud and infrastructure: architecture, security, cost and day-to-day operations. You get senior AWS experience when you need it, without the cost of a full-time hire.

  • Architecture reviews and a clear plan for what to fix first
  • Security hardening: IAM, networking, audits
  • Lower AWS bills without slowing your team down
  • Hands-on help with AI workloads on AWS