Break-glass grant expiry
MGCWardenBreakGlassExpiryBatch takes the break-glass release privilege away from people once their
grant is older than the configured time-box. It is what makes a break-glass grant temporary.
At a glance
| Batch class | MGCWardenBreakGlassExpiryBatch (RunBaseBatch) |
| Menu item | MGCWardenBreakGlassExpiryMenuItem, label Warden break-glass grant expiry |
| Menu path | System administration → Setup → Warden break-glass grant expiry |
| Who may run it | MGCWardenPolicyAuthorPriv (Update on the menu item) → MGCWardenPolicyAuthoringDuty → Warden guard administrator (MGCWardenGuardAdministrator). The API operation MGCWardenBatchService.runBreakGlassExpiry is granted (Invoke) in the same privilege and re-checks the menu item |
| Feature toggle | None. run() consults no feature class, so it runs with every toggle off |
| Company scope | Mixed. The time-box is read from the session company's MGCWardenParameters; the role assignments it disables (SecurityUserRole) are not per company, and the select has no company filter, so one run acts on every user's assignments. Event-log and exception rows are written in the company the run executes in |
| Scheduled by default | No. Nothing in the product creates a batch job for it |
| Recurrence | You choose. No recurrence is stated anywhere in the code or the docs. The interval adds to the life of every grant (see Configuration) |
| Setup-gap rules | BreakGlassExpiryNotScheduled (code BREAKGLASSEXP) watches the schedule: a security role carries the break-glass release privilege and no job of this class carries a recurrence in any company. BreakGlassGrantNotTimeBoxed watches the parameter |
| Run record | None. One infolog line per run, one governance event-log row per grant it touches |
| Overlap guard | Not in MGCWardenBatchOverlapGuard's population; its writes are one transaction (see Warden batch framework) |
Purpose and business justification
Break-glass access in Warden is privileged, reason-coded, alerted and
time-boxed. The privilege that releases a governance hold without an approval,
MGCWardenBreakGlassReleasePriv, ships on no duty and no role. A customer creates their own break-glass
role and assigns it to a person for an incident. This batch ends that assignment when the time-box runs
out. Without it, an emergency grant stays in force until somebody remembers to remove it.
The batch is one of three pieces that together make break-glass acceptable:
| Piece | Element | What it does | When |
|---|---|---|---|
| The grant | A customer role carrying MGCWardenBreakGlassReleasePriv | Lets its holder press Break-glass release (MGCWardenBreakGlassRelease) on Governance holds | When an administrator assigns the role |
| The grant alert | MGCWardenAuditRoleCapture | Alerts the sensitive-role recipients when the role is granted, once Initialize Warden has put the role on Sensitive roles (MGCWardenBreakGlassSensitiveRoleSeed) | Next role-capture run; see Role event capture |
| The release | MGCWardenBreakGlassReleaseAction → MGCWardenHoldManager::breakGlassRelease | Releases one hold with a mandatory reason, writes the hold, timeline and event-log rows, and alerts Break-glass alert recipients through MGCWardenBreakGlassAlert | Each time the holder uses it |
| The expiry | MGCWardenBreakGlassExpiryBatch (this process) | Disables the role assignment once it is older than BreakGlassGrantHours | Each run of this batch |
The expiry touches no hold and sends no alert. It changes who holds the privilege; the release action is what acts on holds.
How and when it is triggered
- Run now: an authorized user opens the menu item. The class has no dialog fields (
pack()returnsconNull()), so the dialog shows only the standard batch options. - Scheduled: a batch job created by the customer from the same dialog (Run in the background,
then a recurrence).
RunBaseBatch.canGoBatch()returnstrueand the class does not override it. - API:
MGCWardenBatchService.runBreakGlassExpiry, which runs the class'srun()in the caller's session and company. It returns Refused when the grant hours are not configured, Failed when the fail-open handler fired, and Completed otherwise.
Nothing else calls the class. A grant does not trigger an expiry run, and a release does not either.
Configuration and scheduling options
| Setting | Where | Default | Effect |
|---|---|---|---|
BreakGlassGrantHours (Break-glass grant duration (hours)) | System administration → Setup → Warden guard parameters, field group Break-glass (MGCWardenParametersForm) | 4 (MGCWardenParameters.defaultValues) | The time-box. Accepted range 1 to 168 (MGCWardenParameters::breakGlassHoursOutOfBounds); zero and negative values are refused on save and on import (MGCWardenParametersEntity) |
The parameter is per legal entity. Because the role assignments are not, a run in company A measures every grant against company A's figure. If you schedule the batch in several companies with different figures, the shortest figure wins for everybody. Schedule it in one company, or keep the figure the same in every company you schedule it in.
What the recurrence costs. Nothing expires between runs. The parameter's help text says so: the effective grant is the figure plus the batch recurrence. For a grant made through the ordinary Assign users to roles screen the clock starts at the first run that sees it (see step 4 below), so the grant lasts:
grant made ──(up to one interval)──> first run stamps Valid from
──(BreakGlassGrantHours)──> time-box ends
──(up to one interval)──> next run disables it
A short interval keeps the grant close to the figure you set. A long one makes the figure a floor rather than a limit. There is no batch group requirement in the code.
Run as. The run disables SecurityUserRole rows, so the account the batch runs as must be allowed
to update role assignments. The API summary says the same of an API caller.
What it does
run(), in order:
- Reads
MGCWardenParameters::find().BreakGlassGrantHours. If it is zero or less, logs "Warden break-glass expiry: BreakGlassGrantHours is not configured; nothing expired." and returns. - Finds the
SecurityPrivilegerow whoseIdentifierisMGCWardenBreakGlassReleasePriv. If there is none (security not synchronized), logs "... privilege MGCWardenBreakGlassReleasePriv not found; nothing expired." and returns. - Opens one transaction (
ttsbegin) and walks everySecurityUserRolewithAssignmentStatus == Enabledwhose role carries the privilege inSecurityRolePrivilegeExplodedGraph. The exploded graph is kernel-maintained, so a role that reaches the privilege through a customer duty or a sub-role is included. The select has noValidFrompredicate; the two pure methods below decide. - For each assignment:
- Blank Valid from (
clockStarts): setsValidFromto now, writes anOverrideevent-log row ("Break-glass grant time-box started ...") and moves on. The platform's own assignment paths leaveValidFromblank, and the platform reads blank and past dates the same way, so the stamp does not change whether the grant is in force. - Older than the time-box (
grantExpired:ValidFromstrictly before now minusBreakGlassGrantHours): setsAssignmentStatustoDisabled(the row is never deleted) and writes anOverrideevent-log row ("Break-glass grant expired: role ... disabled for user ..."). - Otherwise: left alone. A future-dated
ValidFromis not expired.
- Blank Valid from (
- Commits, then logs "Warden break-glass expiry: N grant(s) disabled; M grant(s) with no Valid from date had their time-box started."
Both event-log rows name the grant holder by subject reference (MGCWardenIdentityVault::refFor,
D11 phase 2a) and carry document key BREAK-GLASS.
Transactions. Every stamp and every disable in a run is inside the one transaction. The try/catch
sits outside it, so the bare catch does run: a failure anywhere rolls back the whole pass and is filed as
one execution exception. No grant is half-processed.
Concurrency. Not guarded by MGCWardenBatchOverlapGuard. The rows are read forupdate inside one
transaction, and MGCWardenBatchService's summary records that a concurrent loser rolls back rather than
writing twice, and may then read as Failed.
Idempotency. A second run straight after the first changes nothing: stamped grants are measured from their stamp, and disabled assignments are no longer selected.
Dependencies and prerequisites
BreakGlassGrantHoursmust be between 1 and 168. Estates whose parameter row was created by an earlier build can hold zero; Initialize Warden runsMGCWardenBreakGlassGrantFill, which sets the shipped 4 hours in every legal entity holding a non-positive value and leaves any positive value alone.- Security metadata must be synchronized, so that the privilege and the exploded graph exist.
- A customer role carrying
MGCWardenBreakGlassReleasePriv. On a fresh install there is none, and the batch disables nothing because nothing qualifies. - A batch job, which you create (see Warden batch framework).
Inputs and outputs
| Direction | Element | Detail |
|---|---|---|
| Reads | MGCWardenParameters | BreakGlassGrantHours, session company |
| Reads | SecurityPrivilege, SecurityRolePrivilegeExplodedGraph, SecurityRole | Which roles carry the privilege; role names for the event text |
| Reads and writes | SecurityUserRole | ValidFrom stamped; AssignmentStatus set to Disabled |
| Writes | MGCWardenEventLog (through MGCWardenEventLogWriter) | One Override row per stamped or disabled grant, document key BREAK-GLASS |
| Writes on failure | MGCWardenExecutionException | Area Other, reason Other, severity Error, document key BREAK-GLASS, no retry handler |
| Infolog | The summary line, or one of the two "nothing expired" lines |
No hold, work item, business event or run record is written by this class.
Logging and monitoring
-
Governance event log (System administration → Setup → Governance event log,
MGCWardenEventLogInquiry): filter on document keyBREAK-GLASSto see every time-box start and every expiry. Guard ingestion forwardsOverriderows to the audit store; see Guard event ingestion. -
Execution exceptions (
MGCWardenExceptionWorkbench): a failed run leaves one row with document keyBREAK-GLASSand the text "Break-glass grant expiry batch failed." -
Batch job history: the infolog summary line is the run's only count.
-
Warden setup gaps (
MGCWardenSetupGaps):BreakGlassGrantNotTimeBoxedappears, under area codeGUARDPARAMS, when the parameter is outside 1 to 168. Its text: "A non-positive value expires nothing, so every emergency privilege grant on this estate is permanent." -
Warden setup gaps:
BreakGlassExpiryNotScheduledappears, under area codeBREAKGLASSEXP, when a security role carriesMGCWardenBreakGlassReleasePriv, directly or inherited, and the batch has no recurrence in any company. It appears before the first grant, because break-glass is granted in an emergency, when nobody reads the page. The row counts the enabled user assignments of such roles, so you can see whether a grant is already live. It shows whatever the grant duration is.
The rule sees only whether a recurrence exists. It does not see a run that failed; check the execution exceptions for that.
Errors, recovery and troubleshooting
| Symptom | Cause | What to do |
|---|---|---|
| "BreakGlassGrantHours is not configured; nothing expired." | Parameter is zero or negative in the run's company | Set 1 to 168 on Warden guard parameters, or run Initialize Warden |
| "privilege MGCWardenBreakGlassReleasePriv not found" | Security metadata not synchronized | Synchronize, then run again |
| Exception row "Break-glass grant expiry batch failed" | Anything thrown inside the pass, including a subject reference that could not be issued | Read the batch log for the underlying error, fix it, run again. Nothing from the failed pass was kept. Retry on the workbench reports "no retry handler", because the row carries none; close the row once a run succeeds |
| A grant expired sooner than expected | It had an explicit, older Valid from date, or a run in another company with a shorter figure reached it | Check Valid from on the assignment and the companies the batch is scheduled in |
| A grant has not expired | The batch is not scheduled (the setup gaps page shows BreakGlassExpiryNotScheduled), or the last run failed, or the grant's clock only started at the last run | Check the batch job and the event log for a time-box started row |
| A re-enabled assignment is disabled again at once | Re-enabling keeps the old stamped Valid from, which is already past the time-box | Remove the assignment and assign the role again (a new row starts a fresh clock), or set Valid from to now |
Re-running is always safe: the run has no parameters and no partial state.
Known boundary. The batch only reaches roles whose exploded graph names the privilege. The System
administrator role reaches every entry point without any privilege naming it (stated in
MGCWardenDeprovisioningClaim::canDispose), so a System administrator assignment is not time-boxed by
this batch. Not confirmed: this has not been observed on a running environment; a run with a
System administrator assignment present would settle it.
Impact on other functionality
- Once an assignment is disabled, the holder can no longer press Break-glass release, and the API
equivalent
MGCWardenGuardOperationsService.releaseHoldis denied, because itscanRun()check on the menu item fails. - Holds already released through break-glass stay released. The expiry does not reverse anything the holder did.
- The run locks the
SecurityUserRolerows it reads for update until it commits. The pass is small (only assignments carrying the privilege), so the lock window is short. Not confirmed: no measurement of lock duration exists. - Role capture reads only enabled assignments, so a disabled one drops out of its snapshot and the next
role-capture run records a role event with Granted = No for it (
MGCWardenAuditRoleCapture).
Related documentation
- Break-glass holder
- 5. Initialize and 7. Assign roles
- Warden batch framework for scheduling, the batch API and the setup-gap rules
- Role event capture for the grant alert