Lab 06: IAM Architecture

Time: 50 minutes | Level: Architect | Docker: docker run -it --rm zchencow/innozverse-cybersec:latest bash

Objectives

  • Design enterprise IAM architecture with SAML 2.0 and OAuth 2.0/OIDC

  • Build and validate JWTs with HMAC-SHA256

  • Implement RBAC engine

  • Understand PAM and JIT access patterns


Step 1: Enterprise IAM Architecture

┌─────────────────────────────────────────────────────────┐
│                  IDENTITY FABRIC                         │
│                                                         │
│  HR System ──→ Identity Store (AD/LDAP) ←── SCIM sync  │
│                        │                               │
│              ┌─────────▼──────────┐                    │
│              │   Identity Provider │  (Okta, Azure AD)  │
│              │   - Authentication  │                    │
│              │   - MFA             │                    │
│              │   - Token issuance  │                    │
│              └─────────┬──────────┘                    │
│                        │                               │
│          ┌─────────────┼─────────────┐                 │
│          ▼             ▼             ▼                  │
│      SAML 2.0       OAuth2/OIDC    Kerberos             │
│      (Enterprise    (Modern apps,  (Windows/AD)         │
│       SSO)          APIs, mobile)                       │
└─────────────────────────────────────────────────────────┘

    ┌────▼───────────────────────────────────┐
    │ Applications & Resources               │
    │  Web Apps │ APIs │ Cloud │ On-prem     │
    └────────────────────────────────────────┘

Step 2: SAML 2.0 Flow

Service Provider (SP) initiated SSO:

SAML assertion attributes for RBAC:


Step 3: OAuth 2.0 / OIDC Flows

OAuth 2.0 grant types:

Grant Type
Use Case
Security

Authorization Code + PKCE

Web/mobile apps

✅ Recommended

Client Credentials

Service-to-service

✅ Machine identity

Device Code

CLI tools, TV apps

✅ Headless devices

Implicit

(deprecated)

❌ Do not use

ROPC

Legacy only

⚠️ Avoid if possible

OIDC ID Token (JWT) claims:


Step 4: JWT Builder + RBAC Engine

📸 Verified Output:


Step 5: Access Control Models Comparison

RBAC (Role-Based Access Control):

  • Assign users to roles; roles have permissions

  • Simple to administer; good for stable job functions

  • Example: admin, analyst, viewer roles

ABAC (Attribute-Based Access Control):

  • Policy: IF user.dept == 'finance' AND resource.classification == 'confidential' AND time.hour IN [9,17] THEN allow

  • Flexible, fine-grained; complex to manage at scale

  • XACML standard; used in government/military

ReBAC (Relationship-Based Access Control):

  • Access based on relationships between objects

  • Example: Google Drive — owner → shares with → user

  • Zanzibar (Google) model; used by Airbnb, Slack, GitHub

Model
Best For
Complexity
Flexibility

RBAC

Enterprise apps, clear job roles

Low

Medium

ABAC

Cloud, fine-grained, context-aware

High

High

ReBAC

Collaborative apps, hierarchical data

Medium

High


Step 6: SCIM Provisioning

SCIM 2.0 (System for Cross-domain Identity Management):

  • RESTful API for user/group provisioning between IdP and apps

  • Automates: create user, update attributes, deactivate (joiner/mover/leaver)

SCIM endpoints:

💡 Leaver process automation with SCIM: HR triggers deactivation in IdP → SCIM propagates to all connected apps within minutes, ensuring consistent offboarding across 50+ SaaS platforms.


Step 7: PAM and JIT Access

Privileged Access Management (PAM):

Feature
Description
Example Tool

Credential vault

Store/rotate privileged passwords

CyberArk, HashiCorp Vault

Session recording

Record admin sessions for audit

BeyondTrust, Delinea

Just-in-Time (JIT)

Time-limited privilege elevation

PIM (Azure AD), CyberArk

Approval workflow

Multi-party approval for critical systems

ServiceNow + PAM

Break-glass

Emergency access for DR scenarios

Documented, monitored

JIT access pattern:


Step 8: Capstone — Enterprise IAM Design

Scenario: Global enterprise, 10,000 employees, 200+ applications


Summary

Concept
Key Points

SAML 2.0

XML-based SSO; SP-initiated flow; attributes carry role info

OAuth 2.0

Delegated authorisation; Authorization Code + PKCE preferred

OIDC

Identity layer on OAuth 2.0; ID Token is a JWT

JWT

Header.Payload.Signature; verify signature + expiry

RBAC

Roles → permissions; simple but coarse-grained

ABAC

Policy-based; attributes from user/resource/environment

SCIM

Automated user provisioning/deprovisioning via REST API

PAM

Vault credentials, record sessions, JIT privilege elevation

Last updated