Sub topic 9
Permission boundaries: a ceiling on identity policies
This chapter assumes you know how default deny, explicit deny, and allow work, and that you can read an identity-based policy. A permission boundary builds on those ideas.
What a boundary is
A permission boundary is a managed policy that you set on an IAM user or role. It sets the maximum permissions that the identity-based policies of that user or role can grant. The boundary grants nothing by itself. It only removes permissions that fall outside it.
The effective permissions of the identity are the overlap of two sets:
- What the identity-based policies allow.
- What the permission boundary allows.
An action must be allowed in both. If either one is silent about the action, the implicit deny applies.
Worked example
Suppose the role ReportWriter has this identity policy. It allows all S3 actions and one EC2 action.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BroadIdentityAccess",
"Effect": "Allow",
"Action": ["s3:*", "ec2:DescribeInstances"],
"Resource": "*"
}
]
}The role also has this permission boundary.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BoundaryCeiling",
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:PutObject"],
"Resource": "arn:aws:s3:::example-reports-bucket/*"
}
]
}The next table shows the result for four requests.
| Request | Identity policy | Boundary | Result |
|---|---|---|---|
| `s3:GetObject` on `example-reports-bucket/a.csv` | Allow | Allow | Allowed |
| `s3:PutObject` on `example-reports-bucket/a.csv` | Allow | Allow | Allowed |
| `s3:DeleteObject` on `example-reports-bucket/a.csv` | Allow | Not listed | Denied |
| `ec2:DescribeInstances` | Allow | Not listed | Denied |
The effective permissions are s3:GetObject and s3:PutObject on objects in that bucket. The s3:* grant and the EC2 grant are cut off by the ceiling.
Where boundaries do and do not apply
Boundaries apply to identity-based permissions. This has some consequences.
- A boundary can be set on users and roles. It cannot be set on groups.
- A boundary does not limit a resource-based policy that names the user or role directly as the principal. In the same account, such an Allow can still grant access even when the boundary does not include the action. This does not hold when the resource policy names a role session or assumed-role session ARN. In that case the boundary still applies.
- An explicit Deny in the boundary still wins, like any explicit deny.
Common errors
- Expecting the boundary to grant access. Attaching a boundary without an identity policy gives the principal no permissions. Both must allow the action.
- Forgetting the boundary when debugging. An identity policy that looks correct can still produce AccessDenied because the boundary is silent about the action.
- Widening only the identity policy. When you add a new action to an identity policy, check that the boundary also allows it.
- Mixing up boundaries and SCPs. A boundary attaches to one user or role. An SCP attaches to an Organizations account or organizational unit.
Why use boundaries
Boundaries are mostly used for delegation. A central team lets developers create roles, but requires that every new role carries a specific boundary. Whatever policies the developers attach, the new role cannot exceed the ceiling. You enforce this by allowing iam:CreateRole only when the request includes the iam:PermissionsBoundary condition key with the approved boundary ARN.
Checking the result
The IAM policy simulator takes the boundary into account. This command evaluates two actions for the role above.
aws iam simulate-principal-policy \
--policy-source-arn arn:aws:iam::111122223333:role/ReportWriter \
--action-names s3:GetObject s3:PutObject \
--resource-arns arn:aws:s3:::example-reports-bucket/2026/summary.csvIn the output, check EvalDecision for each action. If an action you expect is denied, look at the boundary information in the result. It shows whether the boundary caused the denial.
Exercise
A role has an identity policy that allows dynamodb:* on all resources and s3:GetObject on one bucket. Its permission boundary allows only s3:GetObject and s3:PutObject on that bucket. What can the role do?
Show answer
It can only call s3:GetObject on that bucket. The dynamodb:* grant is outside the boundary, so it is denied. s3:PutObject is allowed by the boundary but not by the identity policy, so it is also denied by default. Effective permissions are the overlap of the two.
Exercise
You attach a permission boundary to a new role but attach no identity policy. Can the role access the S3 actions listed in the boundary?
Show answer
No. A boundary grants nothing by itself. Without an identity policy that allows the actions (or a resource policy that does), the implicit deny applies.