Overview
Curated: · Written: · Reviewed:
Identity & Access Management (IAM) Design
In one line
Design identity, roles and access policies across the whole organization, so every identity has an owner, every grant can be reviewed, and revocation reaches every place access lives. Reach for it when access spans many systems, populations (employees, contractors, partners, customers, workloads) and trust domains.
Key definitions
- Authoritative source: the system that owns a fact. HR owns employment, the CMDB owns service ownership. Ownership decides who an identity is, not the directory.
- Stable subject: an identifier that is never reused and does not change with name or email. Match on it.
- Effective access: what a principal can actually do after nested groups, dynamic rules, inherited policy, delegation and local overrides are evaluated. It is not the grant record.
- Confused deputy: a service uses its own authority on behalf of a caller and lets the caller choose the object.
- Toxic combination: two entitlements that break separation of duties, checked on effective entitlements after nesting is expanded.
Formulas and complexity
Role audit ratio, as the audit rule states it:
Worked example (hypothetical figures): a role granting 24 entitlements with a median use of 6 has a ratio of 4 and fails. The ceiling is 18 granted.
How it works
- The authoritative source emits a change keyed on the stable subject. The connector creates, updates or disables, and never matches on email.
- The relying party keys local accounts on the pair (
iss,sub) and checksaud,nonceandexp. - SCIM pushes users and groups. PATCH filters change only the matching members, and retries are idempotent.
- The enforcement point decides on effective access, with short-lived access tokens. Revocation reaches refresh tokens and sessions, not only the IdP account.
- Reconciliation compares source to target state, and sampled decisions are tested at the enforcement point.
When to use and when not to
| Decision | Use | Avoid |
|---|---|---|
| RBAC or ABAC | RBAC for stable job bundles; ABAC or relationship rules for tenant, project, environment | One role per region x data class x project combination (360 roles in the example) |
| Standing or JIT admin | JIT for production admin, time-boxed, task-scoped, peer-approved by someone other than the requester | Standing admin groups that span every environment |
| SCIM push or connector pull | SCIM where the target's schema and PATCH support are verified | Assuming a target applied a PATCH without reading it back |
| Token lifetime | Short-lived access tokens plus revocable refresh and session state | Relying on access token expiry to end access |
| Central or delegated admin | Delegated by bounded population and entitlement | Administrators able to grant themselves broader roles |
Traps interviewers probe
- Keying accounts on email or username. Email changes with surnames and reissued addresses get reused. Fix: match on the immutable HR ID or (
iss,sub), treat email as an attribute, and scope disables to the HR-sourced population so guests and service accounts are not touched. - Believing an expired token means access ended. A 15-minute JWT is accepted until its
exp, and a refresh token can mint a new one after the user has left. Fix: revoke refresh tokens and sessions on leave, and recheck account state at the refresh endpoint. - Accepting any valid token from the issuer. A token for another audience is still valid. Fix: check that
audequals this API's identifier and that the tenant claim matches the route. - Filters that miscompare.
"logs-acme-corp".startsWith("logs-acme")is true, so a prefix check lets one tenant read another's bucket. Fix: compare the exact name. In SQL,last_used > xis unknown for NULL, so the export needsOR last_used IS NULL; in the 9,600-row example it returns 7,500 rows (5,100 recent plus 2,400 never used). - Treating a retry as a second create. After a 409 with
scimTypeuniquenesson a timed-out POST, the record already exists. Fix: look it up byexternalId, store itsid, and converge with PATCH.
Interview tips
Open with: identity starts at an authoritative source, and access is whatever is effective at the enforcement point. Then name the key, the revocation path and the evidence.
Follow-ups to expect:
- How a mover loses old group memberships without leaving orphans.
- Why a PATCH with a filter path leaves a three-member group at three members.
- How to stop a leaver's refresh tokens within minutes.
- How to block self-approval when the on-call lead must approve peers. Enforce the check in the service, because a direct API call bypasses the UI.
- Which SoD conflicts a static matrix misses: nested groups and service accounts. Revoking one entitlement can clear several violations when they share it.
- Why approval rate is a poor headline metric. Sample reviewer decisions against the evidence instead.
30-second answer outline:
- Source and key (10 s): HR stable ID for employees, (
iss,sub) per provider, email as an attribute. - Enforcement and revocation (10 s): short tokens,
audand tenant checks, refresh and session revocation on leave. - Evidence (10 s): reconcile source to target, sample effective access, and review with metrics that test decisions rather than count approvals.
Feedback on this overview
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.