Lawliet LAWLIET
Book a demo

31. Logs: detection rules, alerts, Sigma, entities and ATT&CK

This guide describes Lawliet 1.5.13.s (the current release). 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.

Detection rules are standing questions over the collected logs. When a rule's condition is met, it raises an alert. Alerts are triaged through their review-queue items, in the same way as any other finding. Sigma installs community rules translated to Lawliet's query language. Entities ranks users, hosts and addresses by the alerts that name them. ATT&CK shows which techniques the rules cover.

Permissions:

TaskPermissionFour-eyes
See rules, alerts, entities, coverage; preview or test a rule; translate SigmaSearch logs-
Create, edit, enable, disable, delete, run, restore a rule; import Sigma; suppress; recompute entitiesManage detection rulesno
Triage alerts (status, assign, comment)Work the review queueno
Escalate alerts into an investigationRun forensicsno

31.1 The Rules tab#

Path: Logs > Rules. "Standing rules over the collected logs: thresholds, sequences, baselines, pipelines and Sigma."

A rule whose Health shows an error cannot run and raises nothing. Open it and fix it.

Rule kinds#

KindFires when
Threshold - N matches in a windowThe query matches at least Threshold times inside the Window, per Group by value if set
Sequence - A then B (then C...), on a shared fieldEvery step happens, in order, for the same value of the Shared field, inside the window
First seen - a value with no historyA value appears that was never seen in the Baseline period
Went quiet - a source that stopped reportingA stream that normally reports goes silent
Spike - far above its own baselineThe count is a Multiple of normal above its baseline
Pipeline - every row of a stats query is a findingEach row returned by a | stats ... query
Distinct - one subject touching many valuesOne subject reaches Distinct values of the Counted field (for example one address trying many users)
Unusual hours - activity outside the subject's own patternA subject acts at a time it rarely does

31.2 Procedure: create a detection rule#

Permission: Manage detection rules. Four-eyes: no.

Risk: a noisy rule floods the review queue; a rule that never fires gives false comfort. Always preview before enabling. Rollback: disable the rule, or restore an earlier version.

  1. Open Logs > Rules and press New rule (or Make this a rule from a search).
  2. On the Definition tab fill:
FieldMeaning
NameFor example "Repeated failed logins for one account"
KindOne of the kinds above
SeverityThe alert severity
Query / Step 1 / Scope / PipelineThe filter or pipeline (label depends on the kind)
Step 2 (sequence)The next step; Add step 3 and on, up to step 8
Shared field (sequence)The field the steps must share
Group byOne alert per value of this field; or "Nothing - count everything"
Counted field (distinct values)For the Distinct kind
Threshold (or the kind's equivalent)How much is enough to fire
Window (minutes)The period counted
Baseline (minutes)For First seen, Spike, Unusual hours
Cooldown (minutes)No repeat alert for the same subject in this time. Per subject: "an attack on one account never silences the alert for another"
ExceptionsA filter; events it matches never count. For example user:svc_backup OR src_ip:10.20.0.0/16
ATT&CK techniquesThe techniques this rule detects (feeds the ATT&CK tab)
What this catches, Tags, Author, References, Known false positivesContext for the analyst
EnabledLeave off until previewed
  1. Open the Preview and test tab.
  2. Under Preview against real history press Preview. "Reads only. No alerts are raised and nothing is saved." Read how many events matched and how many alerts the rule would have raised. "Nothing reached the line" means it would not have fired: maybe right, maybe too strict.
  3. Optional: Test on sample lines - paste raw lines (syslog, JSON, CEF, Windows XML), oldest first, and see which match and how they were parsed.
  4. Press Create rule (for an existing rule: Save as new version).
  5. When the preview looks right, press Enable on the rule row.

What you see: the rule in the table with its version. Enabled rules are evaluated on the next cycle.

To check a rule at once: press the run button ("Evaluate now, for real"). The notice says "<rule> evaluated N group(s) and raised M alert(s)" or "<rule> could not be evaluated: <error>". This is a real run: alerts it raises are real.

Procedure: change a rule#

Permission: Manage detection rules. Four-eyes: no. Rollback: restore the previous version (below).

  1. Open Logs > Rules and click the rule's name. The editor opens with the current definition.
  2. Change the fields on Definition; check the effect on Preview and test (31.2 steps 3-5).
  3. Press Save as new version. The Version column goes up by one.

Procedure: enable, disable or run a rule now#

  1. Open Logs > Rules.
  2. Press Enable ("Start evaluating this rule") or Disable ("Stop evaluating this rule") on the row. The notice says "<rule> enabled (version N)." or "<rule> disabled (version N)."; each change is saved as a new version.
  3. To evaluate it at once, press the play button (Run <rule> now, "Evaluate now, for real"). Alerts it raises are real.

Procedure: restore an earlier version#

Every save is a new version. "History is never rewritten: restoring saves the current definition as a version first."

  1. On the rule's row press the clock button (History of <rule>, "Version history").
  2. The panel "History: <rule>" shows "Current version N" and a button per older version (vN). Press one to see what differs (Field, vN, Current).
  3. Press Restore vN as a new version.
  4. What you see: "Version N of <rule> restored as version M." If it fails: "That version could not be restored."

"This rule has never been edited" means there is only one version.

Procedure: delete a rule#

Risk: deleting a rule deletes its version history and, if it has raised alerts, those alerts and their review-queue links. Rollback: none. Prefer Disable, which stops the rule and keeps everything.

  1. On the rule's row press the bin (Delete <rule>).
  2. The browser asks "Delete the rule <rule>? Its version history goes with it." Press OK.
  3. If the rule has raised alerts, a second question follows: "<rule> has raised alerts. Deleting it deletes that history too, including anything linked from the review queue. Disable it instead to stop it running. Delete the history as well?" Press OK only if that history must go; Cancel keeps the rule.
  4. What you see: the row disappears. If it fails: "<rule> could not be deleted."

31.3 The Alerts tab#

Path: Logs > Alerts. "What the detection rules raised, triaged through the review queue."

Procedure: triage alerts in bulk#

  1. Tick alerts (or Select all).
  2. In the bar that appears, choose the new status, type a Comment ("kept on each review item") and press Set status; or choose a person in Assign selected (or Nobody (unassign)).

Procedure: escalate alerts to an investigation#

Permission: Run forensics.

  1. Tick the alerts.
  2. Under Investigation choose an open case or A new investigation; give a Name ("Named after the first alert if empty") and a Priority.
  3. Press Escalate. The alerts are linked to the case (chapter 34).

Procedure: work one alert#

Permissions: Work the review queue to triage; Manage detection rules to suppress; Run forensics to escalate. Four-eyes: no.

  1. Open Logs > Alerts and click the alert. The drawer shows Window, Matches and Review item.
  2. To triage it: under Triage choose the Status, type a Comment and press Save; choose a person in Assign alert to assign it. ("This alert has no review item" means there is nothing to triage.)
  3. To silence an expected subject: under Suppress this subject choose Suppress for (4 hours, 1 day, 3 days, 7 days, 30 days), type the Reason, tick every rule to cover all rules, and press Suppress. Alerts for that subject stop until the suppression ends. If the rule is not grouped there is no subject; add an Exception to the rule instead.
  4. To open a case from it: press Escalate, choose the case or A new investigation, and press To an investigation.
  5. To see the context: read Evidence (the events behind the alert) and press Search around it to open the Search tab at that time.

A suppression cannot be listed or ended early in the console in this release; it lapses at the end of the period you chose. Choose the shortest period that covers the expected activity. Alerts are never deleted by hand; they are closed through their review item and removed only with their rule (above) or by retention.


31.4 The Sigma tab#

Path: Logs > Sigma. Two views: Rule pack and Paste YAML.

Procedure: install rules from the pack#

  1. Open Logs > Sigma (Rule pack).
  2. Search (Title, technique, description or path) and filter by product and state (Not installed, Installed, Cannot be translated).
  3. Click a rule to see what it Translates to, what it is grouped by, and any Translation notes. Rules marked "not translatable" cannot be installed.
  4. Tick the rules to install. Leave Enable on install off.
  5. Press Install selected.

What you see: "Installed N rules; skipped M." With Enable on install off they are "Installed disabled: preview each one against this estate's traffic on the Rules page, then enable it." Do that (31.2 steps 3-7).

Procedure: import your own Sigma YAML#

  1. Open Paste YAML and paste one or more documents (separate them with ---).
  2. Press Translate. It writes nothing; it shows what each rule becomes and what could not be carried over.
  3. Press Import N.

31.5 The Entities tab#

Path: Logs > Entities. "Users, hosts and addresses ranked by the alerts that name them."

To rescore after changing rules or closing many alerts:

  1. Open Logs > Entities and press Recompute.
  2. The list reloads with the new scores. Use the type buttons, the search box and Find to narrow it; click an entity for Why this score; Back to entities returns to the list.

Click an entity for Why this score (Alert, Rule, Severity, Age, Points), Alerts naming it, and Recent events for a chosen window.


31.6 The ATT&CK tab#

Path: Logs > ATT&CK. "Which techniques the enabled detection rules watch, and which of them fired."


31.7 If it fails#

SymptomCauseFix
"No alerts match"No rule fired with these filters, or rules are erroringCheck Health on the Rules tab
A rule shows an error healthThe query or a field is wrongEdit, preview, save a new version
Too many alertsRule too looseRaise the threshold, add exceptions, set a cooldown, or suppress expected subjects
Escalate refusedNo Run forensicsAsk an administrator