Sub topic 3
Permission Boundaries and the Full IAM Evaluation Flow
Assume you can read JSON and understand IAM roles, AWS API actions, and ARNs. This chapter focuses on policies that limit an already requested permission.
Permission boundaries: a ceiling on identity policies
A permission boundary is a managed policy attached to an IAM user or role. It sets the maximum permissions that identity-based policies can provide. It does not grant permissions by itself.
Effective permissions are the intersection of the identity policy and the boundary:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:PutObject"],
"Resource": "arn:aws:s3:::example-reports-bucket/*"
}]
}If the role policy allows s3:*, but the boundary allows only these two actions on this bucket, the role cannot delete objects or access another bucket.
Session policies for temporary credentials
A session policy is an additional policy supplied when you create temporary credentials, such as credentials from AssumeRole. It limits the permissions available to that session. Like a boundary, it does not grant new permissions. The session can use only actions allowed by the role and by the session policy.
Service control policies in AWS Organizations
A service control policy (SCP) sets the maximum permissions for accounts, organizational units, or the organization root. It does not grant access. An account still needs an applicable identity-based or resource-based Allow. An SCP Deny, including a conditional Deny, prevents the request even when other policies allow it.
Resource control policies and VPC endpoint policies
A resource control policy (RCP) is an Organizations guardrail for supported resources. It limits what principals can do to those resources and cannot grant access.
A VPC endpoint policy is another resource-side gate. It controls which principals and actions may pass through a particular endpoint. A request must satisfy it as well as IAM and other applicable policies.
The full evaluation flow
AWS starts with an implicit deny. It then checks applicable policies. Any explicit Deny wins. Otherwise, the request needs an Allow, while boundaries, session policies, SCPs, RCPs, and endpoint policies must not exclude it. Cross-account access generally requires an Allow in both the caller's account and the resource owner's policy.
Debugging `AccessDenied`
Check the principal, action, resource ARN, account, region, and request context first. Then look for explicit Deny statements and restrictive conditions. Use the IAM policy simulator to test identity policies and boundaries:
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.csvCloudTrail records the failed API call and its context. Compare that context with condition keys such as aws:SecureTransport, and inspect SCP, RCP, endpoint, resource, session, and boundary policies.
Exercise
A role policy allows s3:PutObject, but its boundary allows only s3:GetObject. What happens?
Show answer
The PutObject request is denied because the boundary removes that permission.