31. SIEM: detection rules, alerts, Sigma, entities and ATT&CK
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.
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:
| Task | Permission | Four-eyes |
|---|---|---|
| See rules, alerts, entities, coverage; preview or test a rule; translate Sigma | Search logs | - |
| Create, edit, enable, disable, delete, run, restore a rule; import Sigma; suppress; recompute entities | Manage detection rules | no |
| Triage alerts (status, assign, comment) | Work the review queue | no |
| Escalate alerts into an investigation | Run forensics | no |
31.1 The Rules tab#
Path: SIEM > Rules. "Standing rules over the collected logs: thresholds, sequences, baselines, pipelines and Sigma."
- Filters: Name, query, technique or tag, Every kind, origin (Custom and Sigma, Custom, Sigma), Any health.
- Columns: Rule, Kind, Health, ATT&CK, Origin, Version, Fired, Last run, Actions.
- Actions: Enable / Disable, run now ("Evaluate now, for real"), Version history, Delete.
A rule whose Health shows an error cannot run and raises nothing. Open it and fix it.
Rule kinds#
| Kind | Fires when |
|---|---|
| Threshold - N matches in a window | The query matches at least Threshold times inside the Window, per Group by value if set |
| Sequence - A then B (then C...), on a shared field | Every step happens, in order, for the same value of the Shared field, inside the window |
| First seen - a value with no history | A value appears that was never seen in the Baseline period |
| Went quiet - a source that stopped reporting | A stream that normally reports goes silent |
| Spike - far above its own baseline | The count is a Multiple of normal above its baseline |
| Pipeline - every row of a stats query is a finding | Each row returned by a | stats ... query |
| Distinct - one subject touching many values | One subject reaches Distinct values of the Counted field (for example one address trying many users) |
| Unusual hours - activity outside the subject's own pattern | A 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.
- Open SIEM > Rules and press New rule (or Make this a rule from a search).
- On the Definition tab fill:
| Field | Meaning |
|---|---|
| Name | For example "Repeated failed logins for one account" |
| Kind | One of the kinds above |
| Severity | The alert severity |
| Query / Step 1 / Scope / Pipeline | The 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 by | One 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" |
| Exceptions | A filter; events it matches never count. For example user:svc_backup OR src_ip:10.20.0.0/16 |
| ATT&CK techniques | The techniques this rule detects (feeds the ATT&CK tab) |
| What this catches, Tags, Author, References, Known false positives | Context for the analyst |
| Enabled | Leave off until previewed |
- Open the Preview and test tab.
- 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.
- Optional: Test on sample lines - paste raw lines (syslog, JSON, CEF, Windows XML), oldest first, and see which match and how they were parsed.
- Press Create rule (for an existing rule: Save as new version).
- 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).
- Open SIEM > Rules and click the rule's name. The editor opens with the current definition.
- Change the fields on Definition; check the effect on Preview and test (31.2 steps 3-5).
- Press Save as new version. The Version column goes up by one.
Procedure: enable, disable or run a rule now#
- Open SIEM > Rules.
- 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.
- 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."
- On the rule's row press the clock button (History of <rule>, "Version history").
- The panel "History: <rule>" shows "Current version N" and a button per older version (vN). Press one to see what differs (Field, vN, Current).
- Press Restore vN as a new version.
- 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.
- On the rule's row press the bin (Delete <rule>).
- The browser asks "Delete the rule <rule>? Its version history goes with it." Press OK.
- 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.
- What you see: the row disappears. If it fails: "<rule> could not be deleted."
31.3 The Alerts tab#
Path: SIEM > Alerts. "What the detection rules raised, triaged through the review queue."
- Filters: time range, Any status, Any severity, Every rule, User, host or address + Filter.
- Columns: Severity, Alert, Entities, ATT&CK, Status, Assignee, Raised.
Procedure: triage alerts in bulk#
- Tick alerts (or Select all).
- 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.
- Tick the alerts.
- Under Investigation choose an open case or A new investigation; give a Name ("Named after the first alert if empty") and a Priority.
- 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.
- Open SIEM > Alerts and click the alert. The drawer shows Window, Matches and Review item.
- 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.)
- 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.
- To open a case from it: press Escalate, choose the case or A new investigation, and press To an investigation.
- 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: SIEM > Sigma. Two views: Rule pack and Paste YAML.
Procedure: install rules from the pack#
- Open SIEM > Sigma (Rule pack).
- Search (Title, technique, description or path) and filter by product and state (Not installed, Installed, Cannot be translated).
- 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.
- Tick the rules to install. Leave Enable on install off.
- 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). Since 1.5.14.s the pack is already installed and enabled (see "Detection out of the box"); this procedure is for a rule you deleted, or for one you want to install again.
Detection out of the box#
The whole pack is enabled on a fresh install (1.5.14.s). On an update, every pack rule nobody chose a setting for is switched on: rules never installed, and rules imported earlier that are still disabled and were never edited. A rule you disabled, retuned or deleted stays as you left it - each pack rule is switched on once per installation and never again.
33 broad rules are installed at severity low with the tag suggest-only. In the replay (below) they also fired on recordings of other techniques: generic PowerShell download, encoded-command and dropper patterns, scripts written to suspicious folders, "Sysmon Configuration Change". Rules for named attack tools (HackTool rules such as Mimikatz, PurpleSharp and PowerUp, and rules tagged with an ATT&CK software id) keep their severity: they fire across techniques because those attacks used the same tool. The suggest-only rules raise an alert and a review item, but they never send a critical notification, never trigger the agent's kill on a high or critical detection, and never count as a second signal for an Under Attack suggestion. To make one page you, edit its severity on the Rules page.
To switch the pack off, disable its rules on the Rules page (filter by origin Sigma); they stay off after restarts and updates.
What the pack detects, and what it needs from the hosts#
The pack's coverage is measured by replaying recorded attacks (SigmaHQ regression samples and public Atomic Red Team captures: 655 recordings of 182 ATT&CK techniques) through the same agent, endpoint, rules and engine a deployment uses. A rule can only fire on events the hosts send:
| Data collected | Techniques detected |
|---|---|
| Out of the box: Security, System, Application, Defender, PowerShell without script blocks | 10 of 182 |
| plus Sysmon | 138 of 182 |
| plus process creation with command line (Security 4688) | 119 of 182 |
| plus PowerShell script block logging | 67 of 182 |
| All recommended sources (Sysmon, 4688 with command line, script block logging) | 152 of 182 |
The starter rules alone (the default before 1.5.14.s) detect 3 of the 182.
Recommended data sources#
The Windows agent ships Security, System and Application, and - when the host has them - Microsoft-Windows-Sysmon/Operational, Microsoft-Windows-PowerShell/Operational and Microsoft-Windows-Windows Defender/Operational. It checks hourly which of these logs exist, so a Sysmon installed later is collected without restarting the agent; it starts each one at its newest event (no backlog). PowerShell script text is shipped with obvious secrets (passwords, -Password values, ConvertTo-SecureString strings) masked and cut at 16 KiB. To ship none of the three, set LAWLIET_LOG_OPTIONAL_CHANNELS= (empty) in the agent's configuration.
Switch on, on every Windows host:
- Sysmon. Install Microsoft Sysinternals Sysmon with a vetted configuration (for example a community baseline your security team reviews). Most Sigma rules read its process, network, registry, file, image-load and process-access (LSASS) events.
- Process creation with command line (Security 4688). Windows does not audit process creation by default. Apply the hardening controls WIN-LEGACY-CIS-AUDIT-PROCESS-CREATION (Audit Process Creation) and WIN-LEGACY-CIS-AUDIT-PROCESS-CMDLINE (include the command line) from Hardening > Planner (chapter 41). On hosts without Sysmon this is how process rules see what ran: 267 of 277 recorded attacks detected through Sysmon process events were also detected through 4688 alone.
- PowerShell script block logging. Apply WIN-LEGACY-CIS-PS-SCRIPTBLOCK-LOG. Without it Windows logs only the script blocks it judges suspicious.
Linux. Rules read audit.log; auditd must log executions (-S execve) and watch the files the rules name. The default hardening rules log privileged executions only.
Procedure: import your own Sigma YAML#
- Open Paste YAML and paste one or more documents (separate them with
---). - Press Translate. It writes nothing; it shows what each rule becomes and what could not be carried over.
- Press Import N.
31.5 The Entities tab#
Path: SIEM > Entities. "Users, hosts and addresses ranked by the alerts that name them."
- Type buttons: All, Users, Hosts, Source IPs, Destination IPs; Find; a minimum score.
- Columns: Entity, Type, Risk, Alerts, Tactics, Top factors, Last alert.
- Recompute (Manage detection rules) rescores every entity from the alerts so far.
To rescore after changing rules or closing many alerts:
- Open SIEM > Entities and press Recompute.
- 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: SIEM > ATT&CK. "Which techniques the enabled detection rules watch, and which of them fired."
- Alerts: last 7 / 30 / 90 / 365 days and Only techniques with rules.
- Legend: Covered and fired, Covered by an enabled rule, Only disabled rules, No rule.
- Select a technique for its detail: Rules for <technique> opens the Rules tab filtered to it; Find a Sigma rule opens the Sigma tab to look for one.
31.7 Under Attack: SIEM max and the war-room feed (1.5.14.s)#
When an Under Attack activation whose plan has SIEM max on is live, detection is sharpened for as long as it lasts. The rules themselves are not edited: the engine reads each rule through the activation, so nothing can be left on afterwards.
| While SIEM max is on | Effect |
|---|---|
| Rules switched on | Every Sigma, starter and built-in rule, and every rule with an ATT&CK technique, even if it is off. A custom rule without a technique keeps its own on/off; a rule whose query errors stays off |
| Sigma pack | Pack rules never installed here are installed (off) at the start, so they can be switched on |
| Thresholds | Counts (threshold, query, distinct, absence) halve, never below 1; a spike multiple halves, never below 2; an unusual-time percentage doubles, at most 25. Rare and sequence rules are unchanged |
| Severity | One level up, at most critical. The alert's summary says "severity raised from X to Y by Under Attack activation N" |
| Cooldown | A quarter, never below 5 minutes, never longer |
| Auto-response | Playbook containment runs without a second signature (37.1) |
The activation's plan also decides Isolate on critical detection: an alert whose rule is critical by its own severity (not raised by SIEM max) isolates its host, if the host is in scope and shipped the alert's events with its own agent (a forwarded log line naming a host isolates nothing). It counts against the blast-radius cap, and the never-touch list applies. A ransomware detection (ATT&CK T1486 or T1490, high or critical) isolates its host even when the cap is reached (owner decision: ransomware is exempt from the cap) - but only from a shipped rule (Sigma pack, starter, built-in) that was there, unchanged, when the activation started. A rule created, edited or retagged during the attack never gets the exemption: its isolations count against the cap like any other.
When it ends. At the end (or when nobody confirmed the activation in time) SIEM max is switched off first, before any other change is kept or rolled back, and the result is checked rule by rule against what was recorded at the start. The report lists rules an operator edited during the activation (their edit stands: a rule edited while Under Attack leaves the overlay at once), pack rules removed again (they raised nothing), pack rules kept switched off because they raised alerts (removing them would delete those alerts), pack rules handed over to another activation that is still live (the last one to end removes them), and the pack rules it installed: they are switched off at once, and the background sweep removes them a moment later, one at a time and only when no detection run is using them - so an exit never pauses detection and a run never loses its alerts to it. An administrator can also switch SIEM max or auto-response off on their own while the activation runs, by rolling back that one change.
War-room feed (API, Under Attack view permission). Sandbox accounts see sandbox activations only.
| Request | Returns |
|---|---|
GET /api/v1/under-attack/activations/{id}/timeline?cursor=&limit=&scope_only= | Alerts (from 24 hours before the start) and every status each ledger change reached, oldest first, plus state changes and playbook actions on the first page; pass the returned next_cursor as cursor to poll for what is new. The cursor follows rows in the order they were committed, so nothing is skipped under a flood or when a slow transaction commits late; a change appears again as its status moves on, and the first poll may repeat items of the first page (upsert by ref). Alerts only for a role that may search logs |
GET /api/v1/under-attack/activations/{id}/attack-chain?scope_only=true | ATT&CK tactics in kill-chain order with their techniques, counts, first and last seen and hosts |
GET /api/v1/under-attack/activations/{id}/siem | Per rule: the setting before and the setting while Under Attack; playbooks; hosts at maximum telemetry; the end-of-activation report |
31.8 Detections on endpoint telemetry (1.5.15.s)#
Agents from 1.5.15.s send process, network and file activity themselves (endpoint telemetry: ETW or Sysmon on Windows, auditd and the kernel's process events on Linux), so detection no longer waits for a site to configure Sysmon or auditd logging. Each event is stored as an ordinary log event (search _exists_:fields.edr.kind) on a log source named telemetry:agent-<id>, and the same rules read it:
- Sigma process_creation rules (Windows and Linux) and Windows network_connection, file_event, dns_query and image_load rules read telemetry as they read Sysmon, including on a Windows host with no Sysmon. Linux network_connection and file_event rules read telemetry too.
- Sigma
OriginalFileNameis the program's PE header name where the event carries one (Sysmon, and telemetry from agents that read it) and its file name otherwise, so rules that catch a renamed tool (a header name of procdump on a file called pd.exe) fire where the header is known. - One copy: each record reaches the server once. The agent sends an event as telemetry or as a log line, never both, and whatever it did not send as telemetry (filtered, excluded, a lower profile, a full queue) still arrives as a log line, so no profile sees less than 1.5.14.s did. If the same record does arrive both ways, the server recognises it (same record id, time and process) and stores it once.
- Starter rules added in 1.5.15.s (written on the normalised fields, so most also fire on Sysmon, 4688, 4625/4624 and auditd):
| Rule | Severity | ATT&CK |
|---|---|---|
| Successful logon after brute force (8 failures then a success of one account in 15 min; loopback and machine accounts ignored) | high | T1110 |
| Reverse shell command line (Linux): bash -i to /dev/tcp, nc -e, socat exec, mkfifo, python pty | high | T1059.004 |
| Shell process opened a network connection (Linux; telemetry only) | high | T1059.004 |
| certutil or bitsadmin used to download a file | high | T1105 |
| Office application started a shell | high | T1566.001, T1204.002 |
| Download piped into a shell (Linux; one command line only, not a pipe typed interactively) | medium | T1105, T1059.004 |
| Program run from a temporary directory (Linux; build tools excepted) | medium | T1204.002 |
| Account with UID 0 created (Linux) | high | T1136.001 |
| Password hashes read (Linux) | high | T1003.008 |
| SUID bit set on a file (Linux) | medium | T1548.001 |
| Cron table written (Linux; telemetry only) | medium | T1053.003 |
| Microsoft Defender protection switched off | high | T1562.001 |
| Privileged group enumeration | low | T1087.002 |
Like every starter rule, each is added once and can be tuned, disabled or deleted; an existing installation gets the new ones on its next start.
What this covers is command lines, connections and file writes. Techniques that leave none of those (a registry-only Run key, LSASS opened without a tool command line, injection, WMI subscriptions) are detected only where Sysmon's own events for them are collected.
A regression replay sends a synthetic, Atomic Red Team-style corpus through the agent endpoint, the shipped rules and the engine. The corpus was written together with the starter rules, so its results are a regression baseline, not a detection rate.
From an alert whose evidence includes telemetry, the console's Attack story shows the chain (the first process, its children, their connections and file writes) and the Process tree; both are described in chapter 55 (the telemetry console). The profiles, retention and the over-budget step-down are set there too; POST /api/v1/telemetry/agents/{id}/reset puts a host the step-down lowered back on its group's profile.
31.9 If it fails#
| Symptom | Cause | Fix |
|---|---|---|
| "No alerts match" | No rule fired with these filters, or rules are erroring | Check Health on the Rules tab |
| A rule shows an error health | The query or a field is wrong | Edit, preview, save a new version |
| Too many alerts | Rule too loose | Raise the threshold, add exceptions, set a cooldown, or suppress expected subjects |
| Escalate refused | No Run forensics | Ask an administrator |
Rules "not yet run" for a while, or Detection tick spent ... deferred in the backend log | The detection timer (every 60 s) ran out of its time budget (CORRELATION_TICK_BUDGET_SECONDS, 40 s by default; 0 = no limit): the rules it had no time for go first at the next tick, so none is starved, but a large pack on a slow log store can stay behind | GET /api/v1/detections/summary shows tick (last duration, deferred rules, ticks over budget); use ClickHouse (the bundle default) for the log store, or switch off pack rules you do not need |