42 Scripted JIT admin elevation
draft
Standing admin privilege is privilege an attacker can steal at any moment. JIT elevation strips the standing grant and hands the role out on request from a script that starts a timer and revokes unconditionally when it fires — a Directory API role assignment plus an Apps Script trigger or GAM under cron. What is handed out is a narrow custom role, never Super Admin, and any role assignment that did not come from the JIT service account is itself an alert.
Documentation: Manage roles
Caveats
- Google has no native TTL on role assignments — the timer is your code, and its failure mode is silent standing access, so a failed revoke must page loudly rather than retry quietly.
- An already-issued admin session survives role revocation until it expires — pair JIT with cloud and web session control (№40, №12) or the elevation window is longer than the timer claims.
- The JIT service account becomes the crown jewel — it holds the power to grant roles permanently, so it needs the same custody treatment as the break-glass credential.
Setup steps
- open ↗
https://admin.google.com/ac/list/roles · captured 2026-07-15
Custom role, e.g. 'JIT-UserMgmt' with Users > Update + Read only
- open ↗
https://admin.google.com/ac/users · captured 2026-07-15
gam print admins user <admin> # note the roleAssignmentId gam delete admin <roleAssignmentId> -
Directory API roleAssignments.insert → sleep(TTL) → roleAssignments.delete; TTL = 60 min, started only once the grant is confirmed active — a new role typically applies within minutes but can take up to 24 hours
-
on revoke failure → page the security mailbox
- open ↗
https://admin.google.com/ac/sc/investigation · captured 2026-07-15
Reporting › Audit and investigation › Admin log eventsFilter: Event = Assign role; Actor ≠ jit-service-account (advanced/negative filter conditions in activity rules need Enterprise Standard+, Education Plus, Frontline Plus, Cloud Identity Premium or Chrome Enterprise Premium)
Ongoing maintenance
- automatable: AI agent Weekly: review the elevation log — every grant should map to a ticket.
- requires a human Quarterly: drill the elevation script end to end so it still works when needed.
How to verify
-
Confirm no standing grants beyond the floor, then run one elevation cycle end to end (grant, use, auto-revoke) as a drill.
gam print admins
draft v0.1.3 Prevent policy #29 · #4, #32 ↗