IAM Policy Evaluation for the Security Specialty Exam: SCPs, RCPs and Permissions Boundaries
Many Security Specialty questions come down to one skill: working out why a request is allowed or denied. This page collects the evaluation rules AWS documents for identity-based policies, resource-based policies, permissions boundaries and organization policies (SCPs and RCPs).
An explicit Deny always overrides any Allow. Within the same account, effective permissions are the union of the identity-based and resource-based policies: it is enough that one allows, unless one of them explicitly denies.
A permissions boundary never grants permissions: effective permissions are the INTERSECTION of the identity-based policy and the boundary. Adding a boundary to a user can reduce what they can do; removing it can increase it.
In a member account with no resource-based policy, an action must be allowed by the identity-based policy, the SCPs and the RCPs at the same time. An explicit Deny in any of the three overrides the Allow.
Organizations (SCP) · SCPs don't grant permissions
An SCP never grants permissions: it sets the maximum available. Even with an SCP that allows everything, a user with no IAM policy has no access. Effective permissions are the intersection of SCPs/RCPs and IAM policies.
SCPs do not affect the management account or service-linked roles. They do affect member accounts, including their root user and delegated administrators.
Organizations (SCP) · SCPs don't apply to external accounts
SCPs only affect users and roles managed by accounts in the organization. If a bucket in your organization grants access through a bucket policy to account B (outside the organization), the SCP does not apply to those external users.
Do not remove the FullAWSAccess policy without replacing it with one that allows actions: otherwise every action in member accounts fails. AWS recommends testing on an OU, not on the organization root.
If you disable the SCP policy type in a root, all SCPs are detached, and when you re-enable it only FullAWSAccess remains. Previous attachments are lost and must be reattached manually.
Organizations (SCP) · Improve SCPs with usage data
Use IAM 'service last accessed data' (or CloudTrail) to see which services allowed by an SCP are never used and refine the SCP toward least privilege. If a permissions boundary and an SCP both exist, both must allow the action.