Course contentsShow
← Security
Lesson 1732 of 3,05235. Cloud Security - IAMFree lesson

Role Chaining and Session Policies

Using roles to assume other roles and applying additional permission constraints through session policies.

Role Chaining and Session Policies

What You'll Learn

You'll learn how to assume roles from within other roles and apply additional runtime permission constraints using session policies.

The Core Idea

Role chaining occurs when you assume a role (Role B) while already operating under another assumed role (Role A). Instead of returning to your original identity, you chain directly from one role to another. This is useful for multi-account architectures or workflows where different stages require different permissions.

Session policies are inline policies you pass during role assumption that further restrict the permissions available in that session. Think of them as temporary permission filters—they can only narrow permissions, never expand them beyond what the role itself allows.

How They Work Together

When you assume a role, you can optionally provide a session policy document. The effective permissions become the intersection of:

  1. The role's identity-based policies
  2. The session policy you provide (if any)

Analogy: If the role gives you a master key to multiple rooms, a session policy is like saying "for this visit, I only want access to Room 3." You voluntarily limit yourself.

Role chaining works similarly—each time you assume a new role in the chain, you can apply new session policies, further constraining what that specific session can do.

Practical Use Cases

  • Least privilege workflows: Grant broad role permissions but narrow them per-session based on the specific task
  • Cross-account access: Chain roles across accounts while restricting what actions are allowed in downstream accounts
  • Delegation: Allow users to assume roles but limit what they can do through session policies

Key Takeaway: Role chaining lets you assume roles from within roles, while session policies provide runtime permission constraints that further restrict (never expand) what an assumed role session can actually do.