Two administrator accounts at the insurer perform the same action on the same morning: admin.grant, the kind of change that can add someone to a group or rotate a service account. One is u-admin-legacy, an account that has been an administrator for as long as anyone remembers. The other is u-admin-1, the platform administrator of the running example, who has no administrator rights at all until asked for.
Thirty days later a security analyst reads the log. For u-admin-legacy it shows two entries, both admin.action, both "standing privilege". Nothing says why the account acted, who agreed, or whether it should still be able to act today. It can: the same action is allowed again 30 days later, with no approval and no expiry. For u-admin-1 the log shows a denial, a request with a reason, a refused self-approval, an approval by a second person, one action, and an automatic expiry. Same power, used once. One account is a permanent target; the other was dangerous for 30 minutes.
The governance page kept the directory true. This page is about the accounts that can change the directory, the policy and the keys themselves, and about holding that power only while it is needed.
Privileged access, in plain words#
Privileged access is any access that can change who may do what: administer accounts and groups, change authorization policy, read or rotate keys and secrets, bypass normal checks, or act on many records at once. A tiny example: the underwriter u-uw-w1 deciding SUB-1004 is sensitive but not privileged; u-admin-1 adding a person to grp-uw-deciders is privileged, because it changes who may decide everything in a unit.
Privileged access management (PAM) is the practice and tooling that controls such access: who is eligible, how they get it, for how long, with whose approval, and what record is left. Some products call the identity-provider side of it privileged identity management (PIM). The core idea fits in one sentence: no one holds privileged access by default; they activate it for a reason, for a short time, and the activation is recorded.
Before AI. Every operations team has known the pre-AI shapes: sudo with a logged reason instead of logging in as root; the root password in a sealed envelope in a safe; the "Domain Admins" group that nobody dares to empty; the change ticket that must be approved before a production login. PAM tools automate the envelope and the ticket. The principle has not changed.
There are three models for giving an administrator power, and the example implements all three in examples/uw-auth/pam.py:
- Standing privilege: the account always has the power. Every use is allowed; nothing expires.
- Just-in-time elevation: the account is eligible, requests the power with a reason, a second person approves, the power is active for a fixed time, and it expires by itself.
- Break-glass: in an emergency the power is granted at once, without waiting for approval, for a short fixed time; a security alert and a mandatory review open at the same moment.
Diagram: Three ways to hold admin power · where the control sits, and when the power ends
Rows are the three models; columns are how the power is obtained, how long it lasts, and what happens after use. Standing privilege skips every control. Just-in-time puts the control before use: a second person approves and the power expires by itself. Break-glass moves the control after use: access at once, a fixed short lifetime, an alert in the same second and a review the user cannot close. In all three the PDP decides each admin action with rule R-AZ-11.
- Standing
- always held: The account is an administrator all the time; no request, no approval.
- never expires: The same action is allowed 30 days later with no new decision.
- who acted, never why: Two admin.action records; nothing says why or who agreed.
- Just-in-time
- request + reason, second person approves: An eligible account asks with a reason and a lifetime; self-approval is refused; a second person approves.
- 30 min requested, 1 h at most: The elevation is active until expires_at; the example caps any request at 3600 s.
- seven records: Request, refused self-approval, approval, action and expiry are all in the trail.
- Break-glass
- at once, no approval: For an emergency in which the approver cannot be reached, for example an identity provider outage.
- 30 min, fixed: BREAK_GLASS_TTL_S = 1800; the user cannot ask for longer.
- alert at once, review by another: A security alert fires in the same second and a mandatory review opens; the user of break-glass cannot review it.
Read the diagram by column. Standing privilege skips every control: no approval, no expiry, no review. Just-in-time puts the control before the use. Break-glass moves it after the use, because an emergency cannot wait, and compensates with an alert at once and a review that must close. What none of them does is decide the action itself: that stays with the policy decision point.
The smallest primitive: an elevation and the rule that reads it#
The smallest privileged-access mechanism has two parts. One is a record that an elevation exists: who, which kind, approved by whom, until when. The other is a rule in the policy decision point that allows an admin action only while such a record is active. The PAM state machine never decides the action; it only records which elevation exists. The decision is made by the policy decision point, rule R-AZ-11, on the elevation the subject holds now.
This is the rule as it appears in pdp.py decide() (an excerpt from inside the function, shown as text because it is not runnable on its own):
# admin.grant
el = subject.get("elevation") or {}
if el.get("role") == "admin" and isinstance(el.get("expires_at"), int) and now < el["expires_at"]:
obl = [AUDIT]
if el.get("kind") == "break_glass":
obl = [AUDIT, "raise security alert", "open mandatory post-use review"]
return _d(True, 200, "R-AZ-11", "active " + str(el.get("kind")) + " elevation until " + str(el["expires_at"]), v, obl)
return _d(False, 403, "R-AZ-11", "admin actions need an active elevation; there is no standing admin access", v)
Three details carry the whole page. The check compares now with expires_at on every request, so an elevation ends the moment it expires, not when a token or session happens to end. A missing elevation is a 403: deny by default. And a break-glass elevation comes with obligations, things the enforcement point must also do when it allows: write the audit record, raise a security alert, open a review. An allow that arrives with obligations the caller cannot fulfil should be treated as a deny.
Under the hood. The example deliberately does not put anadminrole in the administrator's access token. If it did, the role would live until the token'sexp, and expiring the elevation at 09:30 would not stop a token issued at 09:29. Reading the elevation from the PAM state at decision time is what makes "30 minutes" mean 30 minutes. The token side of that trade is on Tokens.
The insurance example: rotating a service account at 09:00#
u-admin-1 needs to "rotate the retrieval index service account", a privileged change. Here is the just-in-time run, this site's own case UW-A18, played by pam.run("jit") in a scratch copy of the example on 2026-11-18. The agent in the example is a scripted stand-in, so these results show how the access controls work, not how good any model is. The snippet demonstrates the order of the controls; it does not demonstrate a real PAM product.
import sys
import pam
from clock import iso
mode = sys.argv[1] if len(sys.argv) > 1 else "jit"
out = pam.run(mode)
for i, e in enumerate(out["events"], 1):
r = e["result"]
print(f"{i} {iso(r['now'])[5:16]} {e['event']['type']:<11} {r['message']}")
print("audit trail:")
for a in out["final"]["audit"]:
print(f" {a['seq']} {iso(a['t'])[11:16]} {a['kind']:<26} {a['user']:<14} {a['detail']}")
1 11-18T09:00 use denied: admin actions need an active elevation; there is no standing admin access
2 11-18T09:00 request_jit u-admin-1 requests admin for 1800 s: rotate the retrieval index service account
3 11-18T09:00 approve refused: a second person must approve (dual control)
4 11-18T09:00 approve u-secops-1 approves ELV-1; active until 1794994200
5 11-18T09:00 use allowed: active jit elevation until 1794994200
6 11-18T09:30 tick time advances 1800 s
7 11-18T09:30 use denied: admin actions need an active elevation; there is no standing admin access
audit trail:
1 09:00 admin.denied u-admin-1 admin actions need an active elevation; there is no standing admin access
2 09:00 elevation.requested u-admin-1 ELV-1 ttl 1800 s
3 09:00 elevation.approval_refused u-admin-1 self-approval of ELV-1
4 09:00 elevation.approved u-secops-1 ELV-1 for u-admin-1
5 09:00 admin.action u-admin-1 active jit elevation until 1794994200
6 09:30 elevation.expired u-admin-1 ELV-1 expired automatically
7 09:30 admin.denied u-admin-1 admin actions need an active elevation; there is no standing admin access
Walk through it as the analyst would. At 09:00 u-admin-1 has nothing (step 1), which is the normal state of a platform administrator in this design. The request names a reason and a lifetime; the example caps any request at one hour (JIT_MAX_TTL_S = 3600) and this one asks for 30 minutes. u-admin-1 tries to approve its own request and is refused (step 3). A second person approves (step 4); the elevation is active until 09:30 (epoch 1794994200), the one action succeeds, and at 09:30 the elevation expires on its own and the next attempt is denied. No one had to remember to remove anything.
Diagram: One just-in-time elevation · request, approval, one action, expiry
Time runs down the page. The platform administrator has no admin rights at first and is denied. A request with a reason goes to PAM; self-approval is refused; a second person approves. The service asks the PDP on each admin action, and the PDP reads the elevation's expiry at that moment. At 09:30 the elevation expires by itself and the next action is denied. No one has to remember to remove anything.
- Platform administrator to PDP: admin.grant (no elevation). The first attempt, before any request.
- PDP to Platform administrator: 403: no standing admin access. Deny by default: no active elevation, no admin action.
- Platform administrator to PAM state: request ELV-1, 1800 s, reason. The request names a reason and a lifetime, capped at one hour.
- Platform administrator to PAM state: approve ELV-1 (self). The requester tries to approve its own request.
- Second person to PAM state: approve ELV-1. A second person approves; the elevation is active until 09:30.
- Platform administrator to PDP: admin.grant. The one privileged action, inside the window.
- PDP to Platform administrator: 200: active elevation. Allowed with the obligation to write an audit record.
- Platform administrator to PDP: admin.grant at 09:30. The same action after the elevation's lifetime.
- PDP to Platform administrator: 403: expired. The PDP compares now with expires_at on every request, so expiry takes effect at once.
The sequence shows who talks to whom. The PAM state and the policy decision point are separate actors on purpose: PAM records that an elevation exists, and the policy decision point decides each action by reading it at that moment.
Production pitfall. The second person must be a designated approver who is neither the requester nor the later reviewer. In the example the approver isu-secops-1, a security operations lead who exists only inpam.py; the auditoru-auditor-1never approves anything and only closes the independent review of a break-glass use. Letting the person who approved an elevation also review its use turns two controls into one.
The standing run, for comparison (pam.run("standing")):
1 11-18T09:00 use allowed: standing privilege (always on, never expires)
2 12-18T09:00 tick time advances 2592000 s
3 12-18T09:00 use allowed: standing privilege (always on, never expires)
Thirty days apart, identical answers. The two audit entries record that u-admin-legacy acted, never why or who agreed.
Break-glass: when the approver cannot be reached#
The identity provider is down. Underwriters cannot sign in to the cockpit, and the approval workflow, which itself needs a sign-in, is down with it. Waiting for a second person is not an option. This is what break-glass exists for: an emergency path that grants access at once and makes the use impossible to hide. It is case UW-A19.
1 11-18T09:00 break_glass u-admin-1 breaks glass: active at once for 1800 s; alert raised; review opened
2 11-18T09:00 use allowed: active break_glass elevation until 1794994200
3 11-18T09:30 tick time advances 1800 s
4 11-18T09:30 use denied: admin actions need an active elevation; there is no standing admin access
5 11-18T09:30 review refused: the user of break-glass cannot review it
6 11-18T09:30 review u-auditor-1 closes the review of BG-1
audit trail:
1 09:00 breakglass.activated u-admin-1 BG-1: identity provider outage; restore cockpit access
2 09:00 security.alert u-admin-1 break-glass BG-1
3 09:00 admin.action u-admin-1 active break_glass elevation until 1794994200
4 09:30 elevation.expired u-admin-1 BG-1 expired automatically
5 09:30 admin.denied u-admin-1 admin actions need an active elevation; there is no standing admin access
6 09:30 breakglass.reviewed u-auditor-1 BG-1: use matched the incident ticket
Notice what break-glass does not skip. It skips the approval, and nothing else. The lifetime is fixed and short (BREAK_GLASS_TTL_S = 1800, not chosen by the user). A security alert fires in the same second, so security operations knows while the access is live. A review opens at once and cannot be closed by the person who used it. And the reason ("identity provider outage; restore cockpit access") is in the first record, where the reviewer compares it with the incident ticket.
Security note. Break-glass must be time-bound, alerted and reviewed, never a secret permanent administrator bypass. An emergency account whose password sits in a wiki, that nobody monitors and that never expires, is standing privilege with a dramatic name.
The privileged-access lab#
The lab plays the three models and a free-play mode where you press the buttons yourself: request, self-approve, approve, break glass, act, advance 15 minutes, review. Each step names who acts and shows the PDP's obligations, the elevations, alerts, reviews and the audit trail.
The same lab opened on the other two models:
The recorded runs, for a reader without JavaScript:
| Model | Approval | Lifetime | Alert and review | Audit trail records |
|---|---|---|---|---|
| Standing admin | none | never expires (allowed again after 30 days) | none | 2: admin.action twice; who acted, never why or who agreed |
| Just-in-time | a second person (self-approval refused) | 30 min requested, at most 1 h; expired automatically | none | 7: denied, requested, approval_refused, approved, action, expired, denied |
| Break-glass | none up front | 30 min, fixed | alert at once; review opened, self-review refused, closed by u-auditor-1 | 6: activated, security.alert, action, expired, denied, reviewed |
Approval chains and dual control#
Dual control means a privileged action needs two people: one who asks and one who agrees. The example enforces the simplest form, event["approver"] == e["user"] refused, and the break-glass equivalent, the user cannot review their own use. Real organizations often need more than one approver, or the right approver for the system: an approval chain. A rotation of the retrieval service account might need the platform team's on-call and the owner of the retrieval service; a change to authorization policy might need the policy owner.
Two design choices decide whether dual control works or only looks as if it does.
Approve the action, not only the person. "Give u-admin-1 admin for 30 minutes" is a broad grant. "Allow u-admin-1 to rotate the credential of the retrieval service account" is narrow, and the approver can judge it. The example's request carries a reason; a production system can go further and scope the elevation to a resource. The narrower the grant, the more the approval means.
Make the approver independent. Two administrators who approve each other's requests every morning have reinvented standing privilege with an extra click. Rotate approvers, alert on reciprocal approval patterns, and keep the approver out of the review of the same elevation.
Common confusion. Dual control is not the same as separation of duties, though they are related. Separation of duties keeps incompatible permissions in different hands over time (the requester never approves their own group membership; the agent never records a decision). Dual control requires two people at the moment of one privileged action. Both are on this site: separation of duties on Governance, dual control here.
Privileged operations between services#
Not every privileged actor is a person. A service that rotates keys, exports data in bulk or changes another service's configuration holds privileged access too, and it cannot click "approve". svc-legacy-export from the governance page is the cautionary case: a standing service account with export power and an owner who has left.
The same three models apply. Standing: a service account with permanent broad rights, the default in many older systems. Just-in-time for machines: the workload holds a narrow identity and obtains a short-lived, scoped credential when it needs one. Product (HashiCorp Vault, as documented on 2026-11-18): the database secrets engine "generates database credentials dynamically based on configured roles", with leases that revoke them; "By default, TTL is 1 hour and max TTL is 24 hours". Approval for machines: a privileged batch job runs only from a reviewed pipeline, so the human approval happens at merge time and the job's own identity carries only what that job needs.
This site's recommendation: a privileged service-to-service operation gets its own workload identity, used only for that operation, with a short-lived credential and an owning team. Never reuse a broad service account because it happens to have the rights. How services prove identity to each other is on Workload identity.
Session recording and post-use audit#
For some privileged access, the audit trail of decisions is not enough: you also want to know what was done during the session. Session recording captures the privileged session itself, typically a remote shell or desktop connection, for later review.
It is narrower than it sounds. Product (Microsoft Entra Privileged Identity Management, as documented on 2026-11-18): PIM's preview capabilities include reviewing "session activity and recordings"; session analytics "show PIM role lifecycle and Azure Bastion connection activity, not commands run inside a virtual machine", and recordings of supported connections need Azure Bastion Premium with recording configured. In other words, recording depends on the access path. An administrator who changes authorization policy through an API leaves no recording, only the records the API writes. That is why the example's post-use audit is built from decisions, not screens.
The questions a post-use review must be able to answer from the records alone:
| Question | Where the answer is in the example |
|---|---|
| Who activated the power, and why? | elevation.requested or breakglass.activated, with the reason |
| Who agreed? | elevation.approved names the approver; break-glass has none, by design |
| What was done while it was active? | each admin.action, with the PDP's reason and rule R-AZ-11 |
| When did it end, and did anything happen after? | elevation.expired, then admin.denied |
| Who reviewed it, and what did they find? | breakglass.reviewed with the finding |
Correlating these records with request, trace and run ids, and protecting their integrity with a hash chain, is the subject of Audit.
Failure mode: the administrator account that is always on#
Return to u-admin-legacy. An attacker who phishes its password, or steals a session, gets full administrative power at once, at any hour, with no second person to fool and no expiry to wait out. Every action looks like the account's normal work: two admin.action records, "standing privilege". The analyst cannot tell the attack from the job.
With just-in-time elevation the same theft gives the attacker an eligible account with no rights. To act, they must file a request with a reason, convince a second person, and finish within the elevation's lifetime, while every step is recorded. The control does not make theft impossible; it makes theft noisy and short.
Architecture choice: how to hold administrative power#
| Situation | Simplest credible choice | Grow when | Alternatives |
|---|---|---|---|
| A small team, one system | Separate admin accounts from daily accounts; phishing-resistant authentication for admin accounts; a written list of who holds them | more than a handful of administrators, or an auditor asks who approved a change | shared admin password (do not) |
| Several systems, a platform team | Eligible roles with just-in-time activation, a maximum lifetime, a second-person approval, and one break-glass path that alerts | approval fatigue; many privileged machine identities | ticket approval checked by hand before a manual grant |
| Regulated or large estate | A PAM product: eligibility, approval chains, time-bound roles, session recording where the access path supports it, reviews of eligibility | agents need privileged actions | home-grown elevation service on top of the policy decision point |
| Privileged service operations | A dedicated workload identity per operation with short-lived credentials from a secrets engine; approval at merge time | operations need human judgment each time | a scheduled job with standing rights (the orphan risk) |
The trigger to grow is the count of people and machines that can change who may do what, and whether you can still answer "who agreed?" for each change.
Products and standards for this chapter#
Product (Microsoft Entra Privileged Identity Management, as documented on 2026-11-18): PIM "is a service in Microsoft Entra ID that enables you to manage, control, and monitor access to important resources in your organization". Its listed features include just-in-time access, time-bound access "using start and end dates", approval to activate, multifactor authentication to activate, justification, notifications, access reviews and audit history. It separates an eligible assignment ("requires a user to perform one or more actions to use the role") from an active one; the documentation is explicit that "There's no difference in the access given to someone with a permanent versus an eligible role assignment. The only difference is that some people don't need that access all the time." PIM requires licenses (Microsoft Entra ID Governance licensing). Other PAM products exist; this site describes only what it read today.
Guideline (OWASP Authorization Cheat Sheet, read 2026-11-18): "Enforce Least Privileges" and "Deny by Default". Privileged access is where both principles cost the most to ignore.
Standard: no IETF or OpenID standard read for this page defines privileged access management or break-glass. They are practices and product features. Where an elevation is carried in a token, the token rules on Tokens apply.
In a coding agent. A coding agent's routine runs never carry production powers. It works in a sandbox with no production database credential, proposes a pull request, and a person with merge rights merges it. A production action, such as a data migration, runs from a reviewed pipeline whose deployment identity is federated to the cloud for that job only, or by a person through just-in-time elevation. The agent may draft the migration; it does not hold the key to run it. Depth on Coding agents; the shipping workflow on diff-to-deploy.
What this is not. This page does not cover how an agent acting for an underwriter gets a narrowed, task-scoped token, which is delegation, not elevation; that is on Agents. Nor does it cover recovering a whole system after an outage; that is on Operations and, system-wide, on reliable.sammuthu.com.
Security notes#
- No account holds administrative rights by default; the platform administrator in the example starts every day with none.
- Elevations are read at decision time, not baked into long-lived tokens.
- The requester never approves, and the user of break-glass never reviews; check both in code.
- Break-glass is tested regularly, alerts on every use, has a fixed short lifetime, and every use is reviewed.
- Admin accounts use phishing-resistant authentication (see Authenticators).
- Privileged service accounts have an owning team, a single purpose and short-lived credentials.
Monday checklist#
- List every account and service account with standing administrative rights. For each, write who would approve it if it had to be requested.
- Pick one administrative action and make it require an active elevation; add a negative test that the action is denied without one, and one that it is denied after expiry.
- Write a test that self-approval of an elevation is refused.
- Find your break-glass path. When was it last used, who reviewed it, and does using it raise an alert today?
- Check that an elevation's end takes effect at decision time, even for a token issued a minute before it ended.
- For each privileged service account, name the owning team and the one operation it exists for.
Exercises#
Exercise 1. An administrator's access token carries "roles": ["admin"] for 60 minutes. The elevation was approved for 15 minutes. What happens at minute 20, and how does the example avoid it?
AnswerThe token outlives the elevation; read elevation at decision time
A service that trusts the token's role allows admin actions until minute 60. The example never puts the role in the token: rule R-AZ-11 reads the active elevation and its expires_at from the PAM state on every request, so minute 20 is denied.
Exercise 2. The team proposes that two administrators approve each other's elevation requests "to keep things moving". What is wrong, and what would you add?
AnswerReciprocal approval is standing privilege with an extra click
The approval no longer represents an independent judgment. Rotate approvers, route approvals to the owner of the system being changed, and alert on reciprocal approval patterns.
Exercise 3. Break-glass was used during an identity provider outage, and the review is still open a week later. What should happen?
AnswerEscalate; an open review is an open incident
An unreviewed break-glass use is an unexplained privileged action. Escalate to security operations, compare every action in the elevation window with the incident ticket, and treat the review deadline as part of the break-glass control.
Advanced perspective#
Designing a break-glass account that works on the worst dayIt must not depend on the thing that broke
Break-glass exists for the day the normal path is down, so it must not depend on that path. If the identity provider is down, a break-glass account that signs in through the identity provider does not help. This site's recommendation: a small number of emergency accounts whose authentication does not depend on the failed component, protected by a phishing-resistant authenticator kept under dual custody; an alert on every sign-in, not only every action; a fixed short lifetime enforced by the system that grants the power; and a scheduled test, because an emergency path that was never tried tends to fail on the day it is needed. The example's break-glass is granted by the PAM state machine and decided by the policy decision point, which presumes both are up; a real design writes down which components break-glass still needs and keeps that list short.
Elevation for agentsA non-human identity asking for more power needs a human answer
Products are starting to offer eligible roles to agents. Product (Microsoft Entra PIM, as documented on 2026-11-18): a preview capability assigns "eligible Azure resource roles to agents and agent identities so they can activate access when needed". The policy question is who approves. An agent that can request its own elevation and have it approved automatically holds standing privilege in practice. This site's recommendation follows the series refrain, the model suggests an action; deterministic code decides whether it may run: an agent may draft a privileged change or file a request with its reason, a person approves it, and the elevation, if granted, is scoped to the one operation and expires on its own. The underwriting agent in the example never holds administrative rights at all; its maximum authority is uw.read uw.recommend (see Agents).
Scoping elevations: role, resource and action"Admin for 30 minutes" is still too much
The example's elevation is a role for a time: {"kind": "jit", "role": "admin", "expires_at": ...}. A tighter design adds the resource and the action: admin on the retrieval service's credentials, for rotation only. Entra PIM's assignments, as documented, carry a scope that "limits the assigned role to a particular set of resources", and its preview offers activating a lower-privileged role when the policy allows it. The trade is the usual one: narrow elevations need more role definitions and more requests, and too many requests produce approval fatigue. Start with time-bound broad roles, measure which actions administrators actually perform, then split the busiest role into narrower ones. Every split makes approvals more meaningful and audit records easier to read.
Reviewing eligibility, not only activationsThe eligible list is the new standing privilege
Just-in-time elevation moves risk from "who is an administrator" to "who may become one". The eligible list in the example is one name, u-admin-1. In a real organization it grows as people join teams and rarely shrinks as they leave them. Review it like a privileged group: every cycle, by the system owner, with evidence of when each person last activated. An eligible person who has not activated in a year probably does not need to be eligible. The governance machinery from Governance applies to eligibility as it does to membership.
In one breath#
Privileged access is the power to change who may do what, and the safest default is that nobody holds it. Just-in-time elevation grants it for a reason, for a short time, with a second person's approval and an automatic end; break-glass grants it at once in an emergency, and pays with a fixed lifetime, an immediate alert and a review the user cannot close. The policy decision point reads the elevation at decision time, so the end of an elevation means the end of the power. The audit trail must answer who activated, why, who agreed, what was done and who reviewed it.
The platform administrator can now rotate the retrieval service account for 30 minutes without being a permanent target. That rotation, and every call between services, rests on credentials of another kind: the certificates that prove a server is the quote API and a client is the cockpit backend. TLS, PKI and certificates explains what a certificate proves, how it expires, and why an established mTLS connection still grants nothing on its own.