37. Playbooks
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 playbook is an automatic response: "When an alert, a DLP incident or a hunt hit arrives, run these steps. Containment waits for a second signature." It opens a case, collects evidence, adds a review item or sends a notification on its own, and files containment (block, isolate, kill) as an approval request for a person to sign.
Permissions:
| Task | Permission | Four-eyes |
|---|---|---|
| See playbooks and their runs | View the review queue | - |
| Create, edit, enable, dry-run a playbook; ask again for a step's approval | Manage playbooks | no |
| A containment step | - | always, whatever the dual-control policy says |
37.1 How a playbook runs#
- Trigger: one of
| Trigger | Fires on | Filters |
|---|---|---|
| Detection alert | A detection rule raised an alert | Rule (one rule or Any rule), Minimum severity |
| DLP incident | An agent reported a DLP incident | Minimum severity, Only incidents the agent blocked |
| IOC hunt hit | A hunt found indicators on a host | Minimum hits |
- Steps ("Do, in order"):
| Step | What it does | Second signature |
|---|---|---|
| Open an investigation | A forensic case for the trigger, with the trigger as its first timeline event; with a priority | no |
| Collect live-response evidence | Asks the host's agent for the chosen collectors; opens a case first if none is open | no |
| Block the source address | Blocks the trigger's source address on the host | yes |
| Isolate the host | Cuts the host off the network except for Lawliet | yes |
| Kill the process | Kills the process the trigger names | yes |
| Add a review-queue item | An item in the shared work list, linked to the run; with a severity | no |
| Send a notification | To the configured webhook and mail recipients, and the console's bell; with a severity | no |
A step whose module is not licensed is skipped and says why.
Containment steps and their approval#
A containment step never runs by itself. It files an ordinary approval request in the name of the playbook's owner (whoever last saved or enabled it), with the exact command it will send. So:
- the owner's approver pairing applies, and the owner can never approve it;
- approvers see it in Approvals like any request typed in the console;
- once approved, it runs automatically; the owner must still hold Execute containment at that moment;
- the resulting action appears in Defense and can be undone there.
Steps after a waiting one do not wait for it: evidence is collected while an approver is found. Each step commits on its own.
Containment while Under Attack (1.5.14.s)#
While an Under Attack activation is live, its plan has SIEM max on, and the host is in the activation's scope, a containment step can run without a second signature: the activation (a plan approved by two people and started by one administrator) stands in for it. That holds from the moment it starts, also during the confirm window before a second administrator confirms - if nobody confirms, the activation rolls everything back. It runs at once only when all of these hold; otherwise the ordinary approval request above is filed:
- the playbook is one the activation recorded when it started, enabled then and unchanged since (steps, trigger, owner), and its owner is active and still holds Execute containment. A playbook created or edited during the attack always asks for a second signature;
- the target comes from authenticated telemetry: the host shipped the events behind the alert with its own agent (or the trigger is the agent's own DLP incident or hunt hit), and the account or address to act on is in those same events. A name or address that appears only in a forwarded log line never drives an automatic action;
- for Disable the account: not on a domain controller (domain accounts: the Active Directory connector; a host the latest AD collection lists as a domain controller counts even if it reports no role), and only with an agent that records the account's prior state so the undo is exact: Windows 2.1.10.s or later, Linux 2.1.5.b or later.
Then the activation's guards apply: never-touch hosts (the Lawliet server, the operator list) are refused and the step fails; protected hosts (domain controllers, tier-0) and the blast-radius cap hold the step for a person. Isolations, kills, account disables and address blocks all count against the cap - except isolate and kill on a ransomware detection (ATT&CK T1486 or T1490 from authenticated telemetry), which are exempt. Every action is a change in the activation's ledger with its exact undo (release the isolation, unblock the address, put the account back as it was; a killed process cannot be undone), so ending the activation rolls it back unless an administrator keeps it. A second trigger on the same host does not act twice. Playbooks match on a rule's own severity, not the one SIEM max raised.
In the sandbox, a sandbox trigger runs through a sandbox activation and nothing reaches any host.
The Disable the account step#
Disable the account disables the account the trigger names, on the trigger's host (net user <name> /active:no on Windows, a password lock and expiry on Linux); its undo enables it again - exactly: an account that was already disabled stays disabled (Windows agents 2.1.10.s and later, Linux agents record the prior state). Each disable holds the account for its own action: undoing one (for example the activation's rollback) leaves the account disabled while another action - a person's disable during the attack - still holds it. It needs a second signature like every containment step. It never acts on a machine account (NAME$), a built-in or Lawliet service identity (SYSTEM, LocalService, NetworkService, root, krbtgt, Guest, the agent account), a domain-qualified name (DOMAIN\name, name@domain: disable domain accounts with the Active Directory connector) or a name that reads as a command-line option or holds characters no account name has (/ , : ; * ? " < > | [ ] = +). While Under Attack it also never disables the built-in Administrator by itself (by name, and on Windows by its RID 500 whatever it is renamed to): that one always goes to a person.
37.2 The Playbooks page#
Path: Playbooks.
- Table: Playbook, Trigger, Steps, Owner, Runs, Last run, Enabled. "(example)" marks a shipped example; "(needs approval)" marks a playbook with containment steps. The Enabled tick box switches it on and off; Edit opens it.
- Runs: Run, Started, Status (running, waiting, completed, failed). Open a run to see each step: pending, done, waiting for approval, failed, skipped, with links to what it created.
37.3 Procedure: create a playbook#
Permission: Manage playbooks. Four-eyes: no (containment steps still need a signature each time they run).
Risk: a loose trigger (for example any alert of any severity) opens a case and sends a notification for every alert. Rollback: untick Enabled and save.
- Open Playbooks and press New playbook.
- Fill Name and Description.
- Under When, choose the Trigger and its filters.
- Under Do, in order, choose a step type and fill its options; press Add step for more. Reorder with Up / Down; Remove deletes a step. Containment steps are marked "needs a second signature".
- Leave Enabled off for now.
- Dry run: choose a Recent trigger (or A sample instead, with a Severity) and press Dry run. "What each step would do with a trigger. Nothing is created, sent or contained." Each step shows "would be done / skipped / waiting for approval / failed" with the reason.
- Press Save playbook.
- When the dry run looks right, edit it, tick Enabled and Save playbook.
What you see: the playbook in the table. When a matching trigger arrives, a run appears in Runs.
If it fails: the form shows the server's message. A dry run step "failed" with "the playbook's owner (<name>) does not hold execute_defense" means the owner cannot file containment; have someone with Execute containment save it.
37.4 Procedure: a containment step is waiting#
- Open the run. The step shows waiting for approval.
- An approver signs it in Approvals. The step runs and turns done.
- If nobody decided before the request expired, the step turns failed and offers Ask again to a user with Manage playbooks: "File the same request again, in your name. Someone else approves it." A rejected request is not offered again.
37.5 Procedure: change, switch off or retire a playbook#
Permission: Manage playbooks. Four-eyes: no. Rollback: switch it on again, or edit it back.
Whoever saves or enables a playbook becomes its Owner: its containment steps are filed in that person's name (37.1). Check the Owner column after a colleague edits it.
To switch it off or on:
- Open Playbooks.
- Untick Enabled on the playbook's row (Enable <name>). It stops reacting to new triggers at once; runs already started finish. Tick it to switch it on again.
To change it:
- Press Edit on the row. The editor opens with its trigger and steps.
- Change the trigger or steps, run a Dry run again (37.3 step 6), and press Save playbook.
To stop a playbook without losing it, untick Enabled. For a playbook with containment steps (block, isolate, kill) that is held for a second signature, as are deleting it and editing its containment steps out (needs Execute containment): With dual control on, the console says "Disabling "<name>" was sent for approval as request N. It does not run by itself: a second administrator approves it in Approvals by <time>, then you run it from Approvals within the execution window (15 minutes after the approval by default)."
Procedure: delete a playbook#
Risk: the playbook and its runs are deleted; approvals its runs filed stay in Approvals. Rollback: none; create it again.
- Press Delete on the playbook's row.
- The row asks "Delete with its runs?" (a playbook with containment steps adds "It can act on hosts, so a second administrator approves it first."). Press Delete or Cancel.
What you see: 'Playbook "<name>" deleted.', or for a containment playbook with dual control on the held message above. The approver reads "Delete playbook '<name>' (enabled), which contains: Block the source address". Every edit is in the audit trail with the trigger and steps before and after.