Sub topic 11
Choosing the right control
This chapter assumes you know how SCPs and RCPs are attached and inherited, and how a request is evaluated. Here you will pick the right tool for a given control.
Four tools, four jobs
Each tool answers a different question.
| Tool | Scope | What it limits | Grants permissions? |
|---|---|---|---|
| SCP | Root, OU, or account | Principals (users and roles) in member accounts | No |
| RCP | Root, OU, or account | Resources in member accounts | No |
| Permission boundary | One IAM user or role | That single principal | No |
| IAM policy | One identity or resource | Whatever it names | Yes |
SCPs and RCPs are guardrails applied to many accounts at once. A permission boundary is a guardrail applied to one principal. Only identity-based and resource-based policies can grant access.
Start from the question you are answering
Ask what you want to control, and then who owns the thing being controlled.
- "No principal in my accounts may do X." Use an SCP. The restriction follows the caller, so it applies wherever that caller acts from your accounts.
- "No one may do X to this kind of resource, whoever they are." Use an RCP. The restriction follows the resource, so it also covers callers from outside your organization.
- "This one role may never exceed these permissions, even if its owner attaches broader policies." Use a permission boundary. This suits delegated administration, where teams create their own roles.
- "This role needs to read this bucket." Use an IAM policy. Guardrails never grant access, so this must be an identity-based or resource-based policy.
Why the caller-versus-resource split matters
An SCP only evaluates requests made by principals in your organization's member accounts. If an outside account's role reads one of your S3 buckets, no SCP in your organization applies to that request. The bucket policy is the only control left, and one mistaken Principal: "*" exposes the data.
An RCP closes that gap. It is evaluated on the resource side for requests from any principal, so it can require TLS or restrict access to your organization even when a bucket policy is too loose.
The reverse also holds. An RCP cannot stop your own principals from calling an action in a Region you want closed. For that you need an SCP, such as the Region-restriction policy from earlier chapters.
Common mistakes
- Using an RCP for a service it does not support. RCPs work only with a limited list of services, so check the current list before designing a control around one.
- Expecting an SCP or RCP to protect the management account. Neither restricts it, so keep workloads out of that account.
- Using a permission boundary where an SCP would do. A boundary must be attached to every role, and any role created without one escapes the control.
- Using an SCP to give a team access. An SCP only sets a ceiling, so the team still needs an identity-based policy.
Quick selection examples
- Block
organizations:LeaveOrganization: SCP, because the caller is a principal. - Require
aws:SecureTransporton S3: RCP, because it must hold for every caller. - Stop developers' self-made roles from using IAM write actions: permission boundary.
- Let an application role write to one queue: IAM policy.
Exercise
Your security team wants every S3 bucket in the organization to reject requests from principals outside the organization, even if a bucket owner writes a permissive bucket policy. Which control do you use, and why can an SCP not do this?
Show answer
Use an RCP. It is evaluated on the resource side for requests from any principal, including those outside the organization. An SCP applies only to principals in your member accounts, so it never evaluates a request from an outside principal.
Exercise
A team creates its own IAM roles and you want each role capped at a fixed set of permissions. Why is a permission boundary a better fit than an SCP if you only need this for that team's roles?
Show answer
A permission boundary attaches to individual roles, so you can cap one team's roles without affecting the rest of the account or OU. An SCP would apply to every principal under its target.