Skip to main content

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 classMGCWardenBreakGlassExpiryBatch (RunBaseBatch)
Menu itemMGCWardenBreakGlassExpiryMenuItem, label Warden break-glass grant expiry
Menu pathSystem administration → Setup → Warden break-glass grant expiry
Who may run itMGCWardenPolicyAuthorPriv (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 toggleNone. run() consults no feature class, so it runs with every toggle off
Company scopeMixed. 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 defaultNo. Nothing in the product creates a batch job for it
RecurrenceYou 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 rulesBreakGlassExpiryNotScheduled (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 recordNone. One infolog line per run, one governance event-log row per grant it touches
Overlap guardNot 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:

PieceElementWhat it doesWhen
The grantA customer role carrying MGCWardenBreakGlassReleasePrivLets its holder press Break-glass release (MGCWardenBreakGlassRelease) on Governance holdsWhen an administrator assigns the role
The grant alertMGCWardenAuditRoleCaptureAlerts 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 releaseMGCWardenBreakGlassReleaseAction → MGCWardenHoldManager::breakGlassReleaseReleases one hold with a mandatory reason, writes the hold, timeline and event-log rows, and alerts Break-glass alert recipients through MGCWardenBreakGlassAlertEach time the holder uses it
The expiryMGCWardenBreakGlassExpiryBatch (this process)Disables the role assignment once it is older than BreakGlassGrantHoursEach 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() returns conNull()), 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() returns true and the class does not override it.
  • API: MGCWardenBatchService.runBreakGlassExpiry, which runs the class's run() 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​

SettingWhereDefaultEffect
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:

  1. Reads MGCWardenParameters::find().BreakGlassGrantHours. If it is zero or less, logs "Warden break-glass expiry: BreakGlassGrantHours is not configured; nothing expired." and returns.
  2. Finds the SecurityPrivilege row whose Identifier is MGCWardenBreakGlassReleasePriv. If there is none (security not synchronized), logs "... privilege MGCWardenBreakGlassReleasePriv not found; nothing expired." and returns.
  3. Opens one transaction (ttsbegin) and walks every SecurityUserRole with AssignmentStatus == Enabled whose role carries the privilege in SecurityRolePrivilegeExplodedGraph. 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 no ValidFrom predicate; the two pure methods below decide.
  4. For each assignment:
    • Blank Valid from (clockStarts): sets ValidFrom to now, writes an Override event-log row ("Break-glass grant time-box started ...") and moves on. The platform's own assignment paths leave ValidFrom blank, 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: ValidFrom strictly before now minus BreakGlassGrantHours): sets AssignmentStatus to Disabled (the row is never deleted) and writes an Override event-log row ("Break-glass grant expired: role ... disabled for user ...").
    • Otherwise: left alone. A future-dated ValidFrom is not expired.
  5. 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​

  • BreakGlassGrantHours must be between 1 and 168. Estates whose parameter row was created by an earlier build can hold zero; Initialize Warden runs MGCWardenBreakGlassGrantFill, 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​

DirectionElementDetail
ReadsMGCWardenParametersBreakGlassGrantHours, session company
ReadsSecurityPrivilege, SecurityRolePrivilegeExplodedGraph, SecurityRoleWhich roles carry the privilege; role names for the event text
Reads and writesSecurityUserRoleValidFrom stamped; AssignmentStatus set to Disabled
WritesMGCWardenEventLog (through MGCWardenEventLogWriter)One Override row per stamped or disabled grant, document key BREAK-GLASS
Writes on failureMGCWardenExecutionExceptionArea Other, reason Other, severity Error, document key BREAK-GLASS, no retry handler
InfologThe 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 key BREAK-GLASS to see every time-box start and every expiry. Guard ingestion forwards Override rows to the audit store; see Guard event ingestion.

  • Execution exceptions (MGCWardenExceptionWorkbench): a failed run leaves one row with document key BREAK-GLASS and 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): BreakGlassGrantNotTimeBoxed appears, under area code GUARDPARAMS, 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: BreakGlassExpiryNotScheduled appears, under area code BREAKGLASSEXP, when a security role carries MGCWardenBreakGlassReleasePriv, 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​

SymptomCauseWhat to do
"BreakGlassGrantHours is not configured; nothing expired."Parameter is zero or negative in the run's companySet 1 to 168 on Warden guard parameters, or run Initialize Warden
"privilege MGCWardenBreakGlassReleasePriv not found"Security metadata not synchronizedSynchronize, then run again
Exception row "Break-glass grant expiry batch failed"Anything thrown inside the pass, including a subject reference that could not be issuedRead 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 expectedIt had an explicit, older Valid from date, or a run in another company with a shorter figure reached itCheck Valid from on the assignment and the companies the batch is scheduled in
A grant has not expiredThe 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 runCheck the batch job and the event log for a time-box started row
A re-enabled assignment is disabled again at onceRe-enabling keeps the old stamped Valid from, which is already past the time-boxRemove 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.releaseHold is denied, because its canRun() 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 SecurityUserRole rows 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).