Identity, Authentication, and Access Management Questions
Designing and operating identity and access control systems. Covers authentication protocols and standards (OAuth, SAML, OIDC, MFA), authorization models (RBAC, ABAC), identity lifecycle and privilege management, IAM architecture and automation, and access control across cloud and on-premises environments. The 'who can do what' control plane, distinct from cryptographic key management.
Design a secure break-glass process for emergency privileged access that minimizes risk of abuse. Include required approvals, ephemeral credential issuance, session brokering/recording, forced post-usage attestation, cryptographic one-time tokens, and integration with SSO and PAM while maintaining forensic-grade audit trails.
Sample Answer
Direct answer
Break-glass design has to resolve one paradox: the access must be fast enough to be actually usable during a real emergency, yet harder to abuse than the normal privileged-access path it bypasses. The way to resolve it is to stop trying to control abuse at the moment of the request (which is inherently time-pressured and cannot bear much friction) and instead concentrate every control on what happens when the access is used: required approval that runs in parallel with issuance rather than blocking it, a single-use ephemeral credential, a fully brokered and recorded session, and a mandatory after-the-fact accounting that the requester cannot skip.
Structured elaboration
Trigger and required approvals. A requester invokes emergency access through the normal single sign-on (SSO, one login trusted across many applications) portal, authenticated with multi-factor authentication (MFA, proving identity with more than one independent factor, such as a password plus a hardware token). Two approval shapes are common and can be combined: a fast-track that grants access immediately for genuinely time-critical cases but requires a secondary on-call approver to be notified in parallel (their approval is recorded even though it did not gate the grant), and a gated path for less time-critical emergencies that waits for that approval within a short SLA (for example 5 minutes) before falling back automatically to a named secondary approver group so the request is never blocked by one unavailable person.
Ephemeral credential issuance. The credential minted for the session is scoped to exactly the target system and action needed, valid for a short fixed window (commonly 15-60 minutes), and never handed to the user directly: it is held by the session broker (below) and used on the requester's behalf. This bounds the blast radius of a stolen or leaked credential to a window that has almost certainly already closed by the time anyone could misuse it.
Cryptographic one-time tokens. The approval step produces a signed, single-use token, conceptually a JSON Web Token (JWT)-style structure: a payload naming the requester, the target, the approval chain, and an expiry, plus a cryptographic signature over that payload. Because it is single-use and bound to the specific session (via a nonce, a random value used exactly once to prevent replay) and ideally to the requesting device's own attested identity, a captured token cannot be replayed to open a second, unauthorized session.
Session brokering and recording. All privileged access flows through a broker (a jump host or proxy) rather than directly to the target system. The broker holds the actual ephemeral credential, enforces command filtering (blocking or flagging destructive commands outside the stated emergency scope), and records the session (keystrokes and, where feasible, screen video). This is what converts "trust the engineer" into "verify what the engineer did," and it is what makes the subsequent audit trail forensic-grade rather than a self-reported summary.
Forced post-usage attestation. When the session ends, the requester must submit a short structured attestation (what was done, why, and the outcome) within a fixed SLA (for example, 4 hours). Missing that deadline is not a soft reminder: it should automatically disable the account and open a security incident, because an emergency real enough to justify bypassing normal access controls is also real enough to justify a mandatory accounting of what happened.
Integration with SSO and PAM. SSO supplies the identity and MFA at the front door; privileged access management (PAM, the system that vaults, brokers, and rotates privileged credentials) supplies the actual credential vaulting, session brokering, and rotation. Break-glass is best understood as a specific, heavily-instrumented mode of the same PAM infrastructure used for routine privileged access, not a separate system with its own credential store to keep in sync.
Forensic-grade audit trails. Every event (request, approval decision, token issuance, session start and every recorded action, attestation submission or its absence) is written to an append-only store, ideally with per-event cryptographic signing or a periodically-published hash chain, so a tampering attempt after the fact is detectable rather than merely against policy. This is shipped to the security information and event management (SIEM) platform so it feeds both real-time alerting and later incident review from the same source of truth.
Worked example
sequenceDiagram
participant U as On-call Engineer
participant S as SSO with MFA
participant G as Gating Policy Engine
participant AP as Approver
participant PAM as PAM Credential Vault
participant B as Session Broker
participant L as Immutable Audit Log
U->>S: Authenticate with MFA
U->>G: Request emergency access plus reason
G->>AP: Notify for approval, SLA timer running
AP-->>G: Approve
G->>PAM: Mint one-time cryptographic token
PAM-->>U: Ephemeral credential, held by broker only
U->>B: Connect via broker using token
B->>L: Stream session recording and command log
Note over U,B: Session ends
U->>B: Submit post-usage attestation
B->>L: Attestation recorded, or auto-disable if missed
Concretely: at 02:14 an on-call site reliability engineer (SRE) invokes break-glass on an internal administrative portal during a production outage, authenticating with MFA. The gating engine notifies the secondary on-call as required approver; the fast-track path grants the SRE a session immediately (the outage is actively causing customer impact) while the approval request runs in parallel with a 5-minute SLA. At 02:16 the secondary on-call approves from their phone; this approval is logged even though it did not block the grant. The PAM vault mints a token scoped to the one affected production host, valid until 02:44 (30 minutes). All commands the SRE runs are proxied and recorded by the broker. At 02:41 the outage is resolved and the session is closed. By 06:41 (a 4-hour attestation SLA), the SRE must have submitted what was done and why; if that has not happened, the account is automatically disabled and a security incident is opened, independent of whether the emergency access itself was legitimate.
Trade-offs and pitfalls
The core trade-off is exactly the paradox in the direct answer: a fully gated approval (wait for a human before any access) is more resistant to abuse but can fail the emergency it exists to serve if the approver is asleep or unreachable, while a fully ungranted "trust and record" fast-track is more available but leans entirely on after-the-fact detection. Most mature designs use the fast-track for genuinely time-critical categories and the gated path with an automatic fallback approver group for everything else, rather than picking one mode for all emergencies.
A common pitfall is treating the frequency of break-glass invocations as noise instead of a signal: if a team invokes it every week, that is not an emergency-access system working correctly, it is a sign that the normal just-in-time elevation process is too slow or too narrow, and every invocation should be reviewed with that question in mind, not just for individual abuse.
A second pitfall is a soft attestation SLA: "please fill this out when you get a chance" reliably decays to never, at which point the forensic trail has a hole exactly where it matters most. The auto-disable consequence has to be real and automatic, not a manager follow-up email, or the control exists on paper only.
A third pitfall is issuing the ephemeral credential directly to the user instead of keeping it broker-held: a credential the user can see and copy can be exfiltrated even if it is short-lived and single-use, defeating the point of not persisting long-lived secrets. The broker-held pattern (the user authenticates to the broker, the broker authenticates to the target) is what actually prevents this, and it is worth calling out explicitly because it is easy to design a "correct-looking" flow that quietly hands the secret to the wrong party.
Explain AWS IAM policy evaluation order and components: identity policies, resource policies, permission boundaries, service control policies (SCPs), and session policies. Provide a concise debugging checklist you would use when a user or role is unexpectedly denied an action.
Sample Answer
Direct answer
IAM (Identity and Access Management) evaluates a request by checking every applicable policy type against a strict order, and an explicit deny in any of them wins immediately, before anything else is considered. After the deny check, the remaining layers narrow the decision: the account's service control policies (SCPs) must allow the action at all, then, for a resource that supports one, a resource-based policy may itself supply the allow, then the identity-based policy attached to the calling user or role must allow it, and finally, if the principal has a permission boundary, or the credentials came from an assumed-role or federated session with a session policy attached, those must also allow it. Nothing is granted by default: if a layer that applies to the request doesn't say allow, the request is denied.
Structured elaboration
- Identity-based policies. Attached to a user, group, or role, this is the policy that actually grants permissions to that principal. If none of the principal's identity-based policies allow the action, the request is denied, barring the resource-based policy exception below.
- Resource-based policies. Attached to the resource itself, an object storage bucket policy, a key management service (KMS) key policy, or an IAM role's trust policy. For most resource types, an allow from either the identity-based policy or the resource-based policy is enough; IAM role trust policies and KMS key policies are the two well-known exceptions that require their own explicit allow regardless of the identity policy. One subtlety worth knowing: who the resource-based policy names changes what else applies. If it names the role or user directly, a permission boundary or session policy elsewhere still caps the grant; if it names the actual assumed-role session, not the role itself, or a federated-user session created through the security token service (STS), the resource-based policy grants that session directly, and a permission boundary or session policy does not additionally restrict it, only an explicit deny would.
- Permission boundaries. Attached to a user or role to cap the maximum permissions its identity-based policies can ever grant it. The effective permission is the intersection of the identity-based policy and the boundary; the boundary never grants anything by itself.
- Service control policies (SCPs). Applied at the organization level to an account or organizational unit, capping the maximum permissions available to every principal in scope, again by intersection, never by granting.
- Session policies. Passed only when a role is assumed or a federated user session is created, for example via STS, further capping that one session's permissions to the intersection with the role's own identity-based policy, for the life of that session only.
- Order, put together. An explicit deny anywhere ends things immediately. Otherwise: the SCP must allow, then a resource-based policy may itself resolve the decision (see the subtlety above), then, if not already resolved, the identity-based policy must allow, then a permission boundary, if attached, must allow, then a session policy, if present, must allow. Missing an allow at any layer that applies to the request produces a denial, because the baseline, with no applicable policy at all, is implicit deny.
Worked example
A concise debugging checklist for an unexpected access-denied result, applied to a scenario where a role that should be able to write to an object storage bucket gets denied:
- Confirm the exact API call, the resource's Amazon Resource Name (ARN), and the error from the account's request-logging service; some deny messages name the specific policy type that produced the deny, which shortcuts the rest of this list.
- Search every applicable layer, identity-based policy, resource-based policy if any, permission boundary if any, SCPs on the account or organizational unit, and session policy if the credentials are a role or federated session, for an explicit deny statement matching this action or resource. An explicit deny anywhere decides the outcome immediately; find and resolve it before looking anywhere else.
- If there's no explicit deny, check the account or organizational unit's SCPs: does an applicable SCP restrict this action? SCPs only restrict, so if none apply, this layer is a non-issue.
- Check whether the target resource has a resource-based policy, and if so, whether it independently allows the action, paying attention to who it names, the role or user itself versus the specific assumed-role session or federated-user session, since that changes whether a boundary or session policy downstream still applies.
- If the decision isn't already resolved by step 4, confirm the identity-based policy attached to the calling principal actually includes this action and resource, watching for an ARN or condition-key mismatch, a wrong path prefix, a missing wildcard, a condition requiring MFA or a specific source network this call doesn't satisfy, as the single most common root cause once denies and SCPs are ruled out.
- If the principal has a permission boundary attached, confirm the boundary itself includes an explicit allow for this action; it caps the identity policy and can never widen it.
- If the credentials came from an assumed role or federated-user session with a session policy attached, confirm the session policy also allows the action.
- If the manual walk-through is still ambiguous, run the account's policy simulator against the exact principal, action, and resource for a layer-by-layer allow-or-deny readout rather than reasoning through it further by hand.
Trade-offs and pitfalls
The most common debugging mistake is jumping straight to the identity-based policy because it's the most familiar layer, and missing an SCP or permission boundary that's silently capping things underneath it; the checklist works because it forces the layers people forget to be checked in the order that actually decides the outcome. A resource-based policy that grants cross-account or session-scoped access is easy to forget when debugging purely from the calling principal's own policies, since nothing in the principal's own policies would explain why access does or doesn't work; the checklist has to include the resource side, not just the caller's side, and specifically who the resource policy names. Permission boundaries and SCPs are easy to conflate, since both only restrict and never grant, but they operate at different scope, one principal versus an entire account or organizational unit, and mixing them up when explaining the model is a common tell the difference isn't fully internalized. A plausible-looking but wrong condition key, or an ARN with the wrong resource-type segment, fails silently as "no match" rather than raising an error, so a debugging session can stall on a policy that looks correct at a glance; verifying the exact identifier, not just its plausibility, matters.
Explain the core concepts of Identity and Access Management (IAM) at a cloud provider: principals, roles/policies, groups, resource-based policies, and the principle of least privilege. As a Solutions Architect, outline a basic IAM strategy for a new client with 3 engineering teams and 1 finance team.
Sample Answer
Direct answer
Cloud identity and access management (IAM) rests on five ideas: a principal is whatever is making a request (a human, a workload, or a federated identity); a role or policy is how permissions actually get granted, a role being an identity that can be temporarily assumed rather than a permanent set of credentials, and a policy being the actual rule set of what's allowed; a group bundles principals together so permissions can be managed once instead of per person; a resource-based policy is attached to the resource itself rather than to the requester, which is what allows controlled access from outside your own identity store; and the principle of least privilege means granting only the specific access a task actually requires, nothing broader, and treating every grant as something to periodically re-justify. A basic strategy for a new client with three engineering teams and one finance team applies all five: separate groups per team, tightly scoped policies reflecting what each team actually touches, no standing broad access anywhere, and a small number of deliberately chosen resource-based policies for the handful of things genuinely shared across teams.
Structured elaboration
Principals. A principal is any entity the cloud provider can identify as the source of a request: a human user, a workload or service identity acting without a person present, or an identity federated in from an external identity provider. Every access decision starts by establishing which principal is asking, since everything else (which role it can assume, which policies apply) is evaluated relative to that identity.
Roles and policies. A role is an identity a principal can temporarily assume to gain a specific set of permissions, rather than a permanent credential tied to one person or service; assuming a role typically issues short-lived, expiring credentials instead of a long-lived key. A policy is the actual document describing what is and is not permitted, a set of allow or deny statements over specific actions and specific resources, attached to a principal, a role, or a group. The distinction matters operationally: roles are about who can temporarily become what, policies are about what that role, once assumed, is actually allowed to do.
Groups. A group is a way to bundle principals, almost always human users, so a policy can be attached once to the group rather than repeated on every individual member. Adding or removing someone from a group immediately changes their effective permissions without touching a single policy document, which is what makes access reviews and onboarding or offboarding tractable at any real headcount.
Resource-based policies. An identity-based policy is attached to the principal, describing what that principal can do across resources it's allowed to touch. A resource-based policy inverts this: it's attached to the resource itself, a storage bucket, a queue, a secret, and specifies which principals may access that specific resource, including principals that live entirely outside your own identity store. This is the mechanism that allows a specific external partner or a specific service in a different account to reach one particular resource without you having to create an internal identity for them at all.
Principle of least privilege. Grant only the specific actions on the specific resources a task genuinely requires, and prefer narrow, explicit grants over broad or wildcard ones, even when a wider grant would be more convenient to set up. Least privilege is not a one-time design decision made at rollout; it is a standing discipline, since real usage patterns only become clear after a team has been operating for a while, and permissions that were narrow on day one tend to widen quietly over time unless something forces a periodic review.
Worked example
A new client, "Fern Robotics," has three engineering teams, Platform, Mobile, and Data, and one Finance team. A basic strategy applying all five concepts above:
- Groups. Create four groups:
Eng-Platform,Eng-Mobile,Eng-Data, andFinance. Every employee is added to exactly the group matching their team; nobody accumulates access by being in more than one. - Least-privilege identity policies per group. Each engineering group's policy is scoped to only that team's own resources:
Eng-Platformcan read and write only Platform's compute and storage resources,Eng-Mobileonly Mobile's,Eng-Dataonly Data's.Financegets read access to billing and cost-management data and nothing in any engineering team's resources at all, reflecting that finance's job is cost oversight, not infrastructure access. - Roles instead of standing credentials for automation. Any automated process (a deployment pipeline, a scheduled job) assumes a role scoped to exactly what that process does, rather than running under a person's own credentials or a shared static key; assumed-role sessions are short-lived and individually logged.
- Resource-based policies for the genuinely shared resources. Fern Robotics has one shared artifact registry all three engineering teams pull from. Rather than widening each team's identity policy to reach it, the registry itself carries a resource-based policy naming
Eng-Platform,Eng-Mobile, andEng-Dataas allowed readers, illustrated here in simplified, provider-neutral form:
{
"resource": "artifact-registry/fern-shared",
"allow": [
{ "principal_group": "Eng-Platform", "actions": ["read"] },
{ "principal_group": "Eng-Mobile", "actions": ["read"] },
{ "principal_group": "Eng-Data", "actions": ["read"] }
]
}
- A recurring review, not a one-time setup. Thirty and ninety days after rollout, actual usage logs are reviewed against each group's granted permissions, and anything granted but never used is removed; this is when least privilege stops being a design intention and becomes an operating fact.
Trade-offs and pitfalls
A common early mistake is giving the finance team broad administrative access on the reasoning that finance is small and trusted, which breaks least privilege for no operational benefit and blurs a separation of duties that regulated clients often need later even if they don't ask for it on day one. Sharing a single role or credential across an entire engineering team, instead of individual role assumptions, is a second common shortcut: it's faster to set up but destroys the per-person audit trail the moment something goes wrong and nobody can tell which team member's session actually made a given change. On the resource-based-policy side, the equivalent mistake is naming an overly broad principal, such as any authenticated identity, on a shared resource just to stop access requests from coming in, which defeats least privilege exactly as thoroughly as an overly broad identity policy would, just from the other direction. Finally, treating the initial policy design as finished work rather than a living document is the most common long-term failure: individual permissions get widened ad hoc to unblock someone quickly under time pressure, and without a scheduled review, those one-off exceptions are what a real least-privilege audit finds accumulated a year later, not the original design.
That is every published Identity, Authentication, and Access Management question for Site Reliability Engineer (SRE) so far. Browse the other topics in this category, or practice this one interactively.