LawlietRequest demo ↗

23. Compliance: schedules and drift

This guide describes Lawliet 1.6.3.b (the current release, a beta: earlier releases are beta. The first stable release will be 2.0.0). Screens, commands and procedures may change in later versions; the usage guide is updated with each release. Check the version your server runs under Settings > Platform or with ./lawliet version, and see the Releases page for what changed.

A schedule runs a compliance scan on a cadence, so the posture is measured without anyone remembering to do it. Drift is what changed between two scans of the same framework: a control that was passing and now fails, a new failure, an improvement.

Permissions:

TaskPermissionFour-eyes
See schedules and driftView compliance-
Create, edit, enable, disable, delete, run a schedule nowRun scansno
Compare two scans on demandRun scansno
Re-apply an enforced control that driftedRun hardeningthe re-apply is a hardening run: approving it is "Execute remediation"; a risky control needs someone other than the requester
Request, approve, disable or withdraw an auto-fix policy; resume a stopped hostRun hardeningapproving needs an administrator other than the requester (also "Execute remediation" when it is on); requesting, disabling and resuming do not

Schedules start read-only scans and drift is a record. Only Re-apply (23.3) changes a host, through a hardening run that waits for approval - and an auto-fix policy (23.4), which two administrators turned on in advance.


23.1 The Schedules tab#

Path: Compliance > Schedules.

"The background scheduler checks every 60 seconds." A schedule that is due starts a scan at the next check. Drift detection runs shortly after each scheduled scan completes.

What you see:

  • Tiles: Enabled, Due soon, Overdue, With errors.
  • Table: Name, Framework, Scope, Recurrence, Status, Next run, Last run, Last scan, Actions.
  • Actions per row: Run now (play), Enable / Disable (toggle), Edit (pencil), Delete (bin; asks Yes to confirm).
  • View drift at the bottom opens the Drift tab.

Procedure: create a schedule#

  1. Open Compliance > Schedules and press New schedule.
  2. Fill the form Create new schedule:
FieldMeaning
Schedule name *For example "Nightly CIS Scan"
DescriptionOptional notes
Framework *The framework to scan
Recurrence *Hourly, Daily, Weekly or Monthly
Custom interval (minutes)Optional. Overrides the recurrence; 5 to 10080 minutes
Target scope *All agents, Specific agent (then Agent ID *, for example 42) or Platform (then Platform *, for example linux or windows)

A Specific agent or Platform of another OS than the framework is for is refused when you save (create or edit), naming the host and its OS. An All agents schedule scans only the hosts of the framework's OS on each run. | Enable schedule immediately | Leave ticked to start at once; untick to create it switched off |

  1. Press Save schedule.

What you see: the schedule in the table with its Next run.

If it fails: the form shows the field in error (for example an interval outside 5-10080, or a missing agent ID). An Agent ID is the number shown for the host in Environment > Hosts.

Procedure: run a schedule now, pause it, change it, delete it#

Permission: Run scans. Four-eyes: no. Risk: none to hosts (scans only read). Rollback: a paused schedule is resumed with Enable; a deleted schedule is created again (23.1).

Each row of the table has four buttons under Actions: Run now (play), Disable or Enable (toggle), Edit (pencil) and Delete (bin).

To run it now:

  1. Open Compliance > Schedules and press Run now on the row.
  2. What you see: the scan starts at once and appears under Compliance > Overview > Active scans. The next run is counted from now.

To pause or resume it:

  1. Press Disable on the row. Future runs stop; nothing is lost.
  2. To resume, press Enable on the same row. Next run is filled in again.

To change it:

  1. Press Edit on the row. The form "Edit: <name>" opens with the current values.
  2. Change the fields (the same fields as in "Create a schedule" above).
  3. Press Save schedule. Cancel closes the form without a change.

To delete it:

  1. Press Delete on the row.
  2. Press Yes to confirm (No keeps it).
  3. What you see: the row disappears. Past scans stay in Scan history and their drift records stay in Drift.

If it fails: a red line under the row names the error (for example a permission refusal); the close mark on it dismisses it.

A schedule With errors shows its last error under its name in the table. Read it, fix the cause (for example a scope with no online agent), then Run now to confirm.


23.2 The Drift tab#

Path: Compliance > Drift. "Drift is read-only - it does not change control status."

What you see:

  • Tiles: Regressions, New failures, Improvements, Total records.
  • Filters: Search control ID, name, framework..., type (All types, Regressed, New failure, Improved, Changed, Not assessed change), severity, framework, Schedule ID, Clear x.
  • Table: Severity, Type, Control, Framework, the change (previous -> current), Scan, Detected, Schedule.
TypeMeaningWhat to do
RegressedWas passing, now failsRe-run a scan to confirm, then create a hardening plan
New failureWas not assessed, now failsInvestigate the cause, then harden
ImprovedNow compliantNothing; confirm with the next scheduled scan
ChangedStatus changed in another wayCompare both scans
Not assessed changeMoved from not assessed to a new stateRead the scan findings

Click a row for the drift detail: Previous -> Current, the recommended action, Operator action required with a link to the linked review item (when one was created), Related context (Control ID, Control name, Framework, Current scan, Previous scan, Schedule, Detected) and Evidence.

Procedure: compare two scans on demand#

Use this to see what changed between any two completed scans of the same framework, for example before and after a maintenance window.

  1. Open Compliance > Drift and expand Compare scans on-demand.
  2. Enter Current scan ID * (the newer scan) and Previous scan ID * (the older scan). Scan IDs are in the scan page address and in Scan history.
  3. Tick Overwrite existing drift records for this scan pair only if you compared this pair before and want the records rebuilt.
  4. Press Compare.

What you see: a summary - Controls compared, Drift created, Regressions, New failures, Improvements, Changed, Unchanged, Not-Assessed - and "Refresh the drift list below to see the newly created records."

If it fails: the scans must both be completed and of the same framework; the message says which condition failed.

To fix a regression, open the scan and use its Fix plan (chapter 22).


23.3 Enforced controls that drifted#

At the top of Compliance > Drift, Enforced controls that drifted (N) lists controls that Lawliet applied and validated through hardening and that now fail again on their host - "Settings Lawliet applied and validated that now fail again on their host. Controls covered by an exception are not listed here." "No enforced control has drifted." when there are none.

Each entry shows the severity, the control, the host, Second administrator when re-applying it is risky (a lockout risk, or a staged control in the catalog), and:

LineContent
Was (before)The finding before Lawliet's fix
ExpectedThe validated value ("validated <time>")
NowWhat the host reports now
First seenWhen the drift appeared, and the last time it was seen
Who"Changed by <account> (reported by the host's event log, event <id>)" with the time and the program; "SYSTEM (likely Group Policy, a service or an installer)" and "Group Policy refresh" when a policy refresh changed it; or "N policy change event(s) in the window, none naming this setting", "No change event recorded for this setting in the window", "No events collected from this host in the window", "Log store unavailable"

The account is the one the host's own event log names in the record's actor field; Lawliet never takes it from free text and does not verify it. Attribution needs agent 2.1.10.s and the audit setup on the host (45.3).

Each drift opens one review item; repeats update the same record, and it closes when the control passes again.

Procedure: re-apply a drifted control#

Permission: Run hardening. Four-eyes: the re-apply creates a hardening run that waits for approval ("Execute remediation"); a risky control also needs an approver other than the requester.

Risk: the setting is changed back on the host; whoever changed it may have had a reason. Find out first (the Who line). Rollback: Rollback on the run (26.3), or request an exception if the drift is intended (25.2).

  1. Press Re-apply on the entry (also on the drift's review item, 21).
  2. If the control can lock you out, the browser shows its risk and asks "Issue the recovery artifact for this host first. Re-apply anyway?". Issue it first (26.5), then press OK.
  3. Approve the run on Hardening (26.2).

What you see: "Re-apply queued as hardening execution N.", "Held for approval: approve execution N on the hardening page." or "Held for a second administrator (<reason>). Approve execution N on the hardening page." The entry links Execution #N.

If it fails:

MessageFix
"Re-apply execution N is <status>."A re-apply is already pending or running; approve or cancel it
"Exception N accepts this risk on this host until <date>. Revoke it before re-applying."The control is under an exception
"The failing result this drift was raised from no longer exists; re-scan the host"Scan the host again
"This drift is already resolved"Nothing to do

23.4 Auto-fix drift (opt-in)#

Since 1.5.16.s an enforced control can be put back automatically when it drifts. It is off by default, per control and per host or host group. Turning it on is a four-eyes decision taken once, on the policy: from then on every drift it covers is re-applied through the same hardening run as Re-apply (queued, run, validated, rollback available), with no further signature. Turning it off takes one administrator.

A policy never fixes, and the entry says "Not fixed automatically: <reason>.":

Reason shownWhy
"an exception accepts this risk on this host"Accepted risk is a decision to leave the setting (25.2)
"a risky control: every re-apply needs a second administrator"Lockout-risk and staged controls; such a policy cannot be requested at all
"the host is in a live Under Attack activation; it owns the host's posture"While an activation (confirm window or active) has the host in scope (48); a drill does not stop it
"a re-apply was already started from this drift; a person takes it from here"One automatic attempt per drift: a re-apply that did not validate is never retried in a loop
"auto-fix stopped: the control keeps drifting on this host"The flapping guard (below)
"the hardening guards refused the re-apply"The planner's guards still apply (41)
"sandbox host: nothing is sent to it"Sandbox hosts are never sent commands
"the host is no longer in the policy's host group, or the group was removed"A group policy covers only the hosts it was approved for that are still listed in the group
"the policy is paused: its requester or approver is no longer active; approve it again"See Paused policies below

Flapping guard. When the control drifts again after 3 automatic re-applies in 24 hours on one host, auto-fix stops for that host and control, the entry shows Auto-fix stopped, and a review item "Keeps drifting - something reverts it: <control> on <host>" is raised (21): a Group Policy, a configuration manager, a script or a person keeps changing it back, and the two must not fight. Find and fix that, then Resume; resuming closes that review item.

The guard counts per host. A Group Policy (or a configuration manager) that reverts the setting across a whole group makes every covered host drift in the same scan, and each is re-applied once - one hardening run per host - before each host's own guard stops it; there is no fleet-wide brake, so disable the policy first when you know a fleet-wide revert is coming.

Paused policies. Automatic re-applies always have two active administrators behind them. When the requester or the approver of an active policy is deleted or deactivated, the policy shows Paused with "Paused: <reason>. It changes nothing until approved again.", and a review item "Auto-fix policy #N paused: approve it again ..." is raised. Another administrator presses Approve again; if the requester is the one who left, that administrator becomes the requester and the policy waits for a second administrator once more. Approving or disabling it closes the review item.

What you see on Compliance > Drift, in Enforced controls that drifted:

  • Auto-fixed on an entry being re-applied automatically, Auto-fix stopped or Auto-fix skipped (hover for the reason), and Auto-fix... to request a policy (not on risky controls);
  • Fixed automatically (N): drifts closed by an automatic re-apply, with the time and the Who line (who changed the setting before Lawliet put it back);
  • Auto-fix policies: each policy with Waiting for a second administrator, On or Paused or Off, the scope, "Hosts: <host>, <host> ... +N more" for a group (the first 10 hosts it was approved for), "Requested by <user>, approved by <user>. Stops after 3 automatic re-applies in 24 h.", and "Stopped on <host>: keeps drifting - something reverts it." with Resume (also under a policy that replaced the one that stopped).

Every automatic re-apply is in the audit trail (the drift, the hardening run, the policy, and both administrators), on the drift's review item ("Auto-fixed by policy #N ...") and on Hardening as a run requested by the policy's requester and approved by its approver. A drift it fixes closes as auto-fixed.

Procedure: request auto-fix for a control#

Permission: Run hardening. Four-eyes: the request does nothing until another administrator approves it.

Risk: none until approved. Rollback: Withdraw.

  1. On an entry, press Auto-fix....
  2. Scope: "This host (<host>)" or "Group <name> (N hosts)" - the host groups that list this host. A group policy covers the hosts listed in the group when you request it, and only while they stay listed: a host removed from the group, or a group that is deleted, gets no more automatic changes (no signature needed for that). Hosts added later, or matched only by a tag, need a new policy.
  3. Reason: at least 10 characters; the approver reads it.
  4. Press Request auto-fix.

What you see: "Auto-fix requested (policy #N). It stays off until a second administrator approves it." and the policy under Auto-fix policies as Waiting for a second administrator.

If it fails:

MessageFix
"<control> cannot be fixed automatically (<reason>): every re-apply of it needs a second administrator. Use the one-click re-apply instead."A risky control; use Re-apply (23.3)
"Auto-fix policy #N already covers this control and scope"Approve or withdraw that one
"This host group lists no hosts. ..."List hosts in the group (42) or pick the host

Procedure: approve an auto-fix policy#

Permission: Run hardening. Four-eyes: you must not be the requester; with "Execute remediation" on in the dual-control policy, the approval itself is also sent for a signature (15).

Risk: from now on Lawliet changes the covered hosts by itself whenever the control drifts. Rollback: Disable.

  1. Under Auto-fix policies, read the control, the scope, the hosts and the reason. The approval request in Approvals names the hosts too ("<host>, <host> +N more").
  2. Press Approve (shown only on someone else's request), or Approve again on a paused policy.
  3. If asked for a reason, type it and press Send for approval; once signed, run it from Approvals.

What you see: "Auto-fix policy #N is on." (or "approved again.") and the policy On; the policy Waiting for a second administrator with you as requester when you approved a paused policy whose requester left; or "Sent for a second signature: run it from Approvals once signed."

If it fails:

MessageFix
"An auto-fix policy cannot be approved by the person who requested it: ..."Another administrator approves it
"Only a pending or paused policy can be approved (this one is <status>)"Nothing to do

Procedure: disable or withdraw an auto-fix policy#

Permission: Run hardening. Four-eyes: no - stopping automatic changes is always allowed.

Risk: drift on the covered hosts waits for a person again. Rollback: request it again (two administrators).

  1. Press Disable on an active policy, or Withdraw on a pending one.

What you see: "Auto-fix policy #N is off." and the policy Off. A re-apply already queued finishes.

Procedure: resume auto-fix after a flapping stop#

Permission: Run hardening. Four-eyes: no (the policy was approved by two administrators).

Risk: if whatever reverts the setting is still there, the guard stops again after 3 more re-applies. Fix the cause first.

  1. Under the policy, on "Stopped on <host>: keeps drifting - something reverts it.", press Resume.

What you see: "Auto-fix resumed on <host>." The guard counts afresh from now, the next drift is re-applied, and the "Keeps drifting" review item is closed.

If it fails:

MessageFix
"Auto-fix is not stopped for this host"Nothing to do
"Only an active policy can be resumed"The policy is off; request a new one