KatInterview

Design a Scalable IAM Platform for Users and Services

System DesignModel answer
HardModel answerSystem Designsystem-designsecurityiam

Last updated

Design a multi-tenant Identity and Access Management system with SPIFFE-style workload attestation, dynamic RBAC/ABAC policy evaluation, local enforcement, and tamper-evident auditing.

Design an enterprise-grade Identity and Access Management (IAM) platform serving multi-tenant SaaS environments and internal microservice infrastructure.

The platform must manage authentication (verifying who an entity is) and authorization (verifying what an entity can do) across human operators and automated workload instances.

Core Requirements

  1. Multi-Tenant & Resource Hierarchy: Support nested structures (e.g., Organization $\rightarrow$ Folder $\rightarrow$ Project $\rightarrow$ Resource) where policies defined on parent containers naturally apply to downstream resources.
  2. Hybrid RBAC + ABAC Access Control: Support role-based permission grouping alongside dynamic attribute conditions (e.g., origin network, environment tag, time window).
  3. Short-Lived Workload Credentials: Issue identity tokens to microservices using cryptographic attestation, eliminating long-lived static API secrets. Avoid embedding permission lists in tokens.
  4. Sub-Millisecond Enforcement Latency: Execute runtime access checks with extreme performance ($p99 < 1\text{ ms}$) at high throughput ($1\text{M+ checks/sec}$).
  5. Auditing & Rapid Revocation: Maintain an immutable, tamper-evident record of security events and propagate identity revocations across the global fleet within 60 seconds.

Expected Technical Scope

  • High-level architecture separating control plane operations from data plane execution.
  • Entity data model, resource URN schema, and JWT token payload design.
  • End-to-end authentication and delegation flows (human OIDC, workload attestation, on-behalf-of delegation).
  • Policy evaluation algorithm and real-time policy cache propagation strategy.
  • Failure modes, operational trade-offs, and key rotation lifecycle.

Hints

Hint 1

Decouple identity verification (AuthN) from access permission evaluation (AuthZ). Avoid placing mutable authorization permissions directly inside signed identity tokens.

Hint 2

Distinguish the control plane (persisting policies with strong consistency) from the data plane (evaluating authorization with local snapshot caches).

Hint 3

Use a hierarchical resource model where policies bound to parent nodes propagate down to child resources unless explicitly overrode by a deny rule.