skip to content

In AWS, compare a permissions boundary, a service control policy (SCP) and a session policy: what does each attach to, who controls it, and can any of them grant a permission?

level: middleimportance: should knowfreq 52%

answer

  1. all three cap, none grants
  2. attachment point tells you which one
  3. one identity, one account tree, one session
  4. who can remove it decides which to use
  5. broker scopes credentials it hands out

basics

~20 s

All three are caps and none grants anything. A permissions boundary attaches to one IAM user or role, an SCP attaches to an organization root, OU or account, and a session policy is passed at AssumeRole time and lives only for that session.

solid answer

~50 s

They differ in attachment point, controller and lifetime, but share one property: each is a filter, and only identity and resource policies actually grant. A **permissions boundary** is a managed policy in a dedicated slot on a single IAM user or role, set by that account's IAM admin, and it caps that one entity for as long as it is attached. An **SCP** attaches to an organization root, an OU or a whole account, is controlled by the organization's management account, and caps every principal in the affected accounts at once. A **session policy** is passed inline to `sts:AssumeRole` through the `Policy` or `PolicyArns` parameters by whatever code mints the credentials, and it caps only that session, disappearing when the session expires. Boundary for delegation, SCP for org guardrails, session policy for scoping down credentials you hand out.

code

bash · 5 lines
bash
aws sts assume-role \
  --role-arn arn:aws:iam::111122223333:role/TenantAccess \
  --role-session-name tenant-42 \
  --duration-seconds 900 \
  --policy '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"s3:GetObject","Resource":"arn:aws:s3:::data/tenant-42/*"}]}'

go deeper

for a junior

Recall the three attachment points — one identity, an account or OU, and a single assumed session — and be ready to say that none of the three grants a permission on its own.

for a middle

Explain the mechanics for each: the boundary slot and its API actions, that an SCP applies to every principal in the affected member accounts, and that a session policy rides on the AssumeRole call.

for a senior

Show that you pick by controller and lifetime, not by shape — a control the restrained party can remove is not a guardrail, and a control that vanishes with a session is not durable.

for a principal

Own the layering argument: decide which risks are handled organizationally versus per-account versus per-credential, and defend the operational cost of each layer you add.

## Three caps, one shared property AWS has several documents that look like IAM policies but behave as ceilings rather than grants. Confusing them is one of the most common IAM interview stumbles, because the JSON is identical — a `Version`, `Statement`, `Effect`, `Action`, `Resource`, `Condition` — and only the attachment point tells you what the document means. The shared property comes first: **none of the three grants a permission.** An `Allow` inside any of them merely means "this may be allowed if something else grants it." Grants come only from identity-based policies attached to a user or role, and from resource-based policies attached to a resource such as an S3 bucket or a KMS key. Everything else narrows. ## Permissions boundary - **Attaches to:** exactly one IAM user or role, in a dedicated slot, as a single managed policy. - **Controlled by:** an IAM administrator in that account. - **Lifetime:** until someone changes or removes it (`iam:PutRolePermissionsBoundary`, `iam:DeleteRolePermissionsBoundary`). - **Scope of effect:** the identity-based permissions of that one entity. Its purpose is delegation *inside* an account. You want a team to author its own roles and policies; you do not want them to author an administrator. Attaching a boundary — and requiring that any role they create carries it — bounds whatever they write, without you reviewing each policy. ## Service control policy - **Attaches to:** an AWS Organizations root, an organizational unit, or an individual account. - **Controlled by:** the organization's management account. - **Lifetime:** as long as the account stays under that OU with the policy attached. - **Scope of effect:** every principal in the affected member accounts — including that account's own administrators and root user. The key structural difference from a boundary is *blast radius and who holds the pen*. An account admin can detach a permissions boundary in their own account; they cannot remove an SCP applied to them from above. That is precisely why SCPs are the tool for guardrails you never want a team to be able to lift — "no one may disable CloudTrail", "no resources outside these Regions". Note that SCPs govern member accounts; the organization's management account is not constrained the same way, which is one reason workloads do not belong there. ## Session policy - **Attaches to:** nothing persistent — it is passed as a parameter to `sts:AssumeRole`, `sts:AssumeRoleWithWebIdentity` or `sts:AssumeRoleWithSAML`, either as inline JSON in `Policy` or as up to a small number of managed policy ARNs in `PolicyArns`. - **Controlled by:** whichever code performs the AssumeRole call. - **Lifetime:** the credentials it produced, and nothing beyond them. - **Scope of effect:** that single session. ```bash aws sts assume-role \ --role-arn arn:aws:iam::111122223333:role/TenantAccess \ --role-session-name tenant-42 \ --policy '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"s3:GetObject","Resource":"arn:aws:s3:::data/tenant-42/*"}]}' ``` This is the classic credential-broker shape. One role is defined broadly enough to serve every tenant, and the broker scopes each minted session down to one tenant's prefix. The role itself never changes; the narrowing travels with the credentials. If the broker's session policy allowed something the role does not, it would still be denied — again, the session policy only intersects. ## How to answer the comparison crisply An interviewer usually wants three axes back: **attachment point, controller, and lifetime**, plus the shared "none of them grants". A useful one-line mapping: - Boundary — *per identity*, set by the account's IAM admin, for safe delegation of policy authorship. - SCP — *per account or OU*, set by the organization, for guardrails teams cannot lift. - Session policy — *per credential set*, set by the caller at assume time, for scoping down what you hand out. ## Why the distinction matters in design Choosing the wrong one produces a control that looks right and is not. A boundary meant as an org guardrail can be detached by the very admin it was supposed to restrain. An SCP used where per-role tailoring was needed becomes a document everyone must edit for every team. A session policy used as a durable control disappears the moment someone assumes the role without passing it. Match the control's lifetime and controller to the threat you actually have: a mistake by a delegated team member (boundary), a team deliberately or accidentally lifting a guardrail (SCP), or credentials leaving your process (session policy).

  • Your account administrator can delete the permissions boundary you attached to their role. Does that make boundaries useless as a control?
    No — it makes them the wrong control for that particular adversary. Boundaries defend against a delegated team writing an over-broad policy, which is a mistake-shaped risk. Against a principal who holds IAM admin and might lift the cap, you need a control they cannot edit, which means an organization-level policy applied to their account from above.
  • If a session policy allows an action the assumed role's own policies do not, what happens?
    The call is denied. A session policy intersects with the role's permissions rather than adding to them, so it can only narrow the session. This is why credential brokers must ensure the underlying role is broad enough to cover every tenant it serves; the session policy carves out a slice, it cannot create one.
  • Where would you put a rule like "no one may create resources outside eu-west-1"?
    At the organization level, applied to the accounts or OU concerned, because it must hold for every principal in those accounts and must not be removable by the account's own admins. Expressing the same rule as a per-role boundary would mean maintaining it on every identity and trusting that no one creates an identity without it.

saying these in an interview costs you the question

  • Says an SCP grants permissions to accounts under it
  • Claims a session policy can add permissions to a role
  • Thinks a permissions boundary applies to a whole account
  • Treats boundary and SCP as interchangeable guardrails
  • Believes a session policy persists on the role after the session

context