You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Sigma correlation rule support to the LogScale backend
Correlation rules previously raised an error because the backend declared
no correlation methods. They now convert to CQL:
- event_count and value_count
- value_sum, value_avg, value_percentile and value_median
- temporal, including boolean conditions (e.g. rule_a and rule_b)
Aggregation uses bucket(), event typing for temporal rules uses case{},
and the threshold filter uses test(). Field aliases are normalised so
group-by works across rules with different field names. temporal_ordered
is not supported and raises NotImplementedError.
Bumps the minimum pysigma to 1.2.0, which is where extended temporal
condition support was added.
Copy file name to clipboardExpand all lines: README.md
+58Lines changed: 58 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,64 @@ The following categories and products are supported by the pipelines:
24
24
25
25
There's likely more windows categories that can be supported by the pipelines; We will be adding support gradually as availability allows.
26
26
27
+
## Correlation Rules
28
+
The `LogScaleBackend` supports [Sigma correlation rules](https://github.com/SigmaHQ/sigma-specification/blob/main/specification/sigma-correlation-rules-specification.md). Aggregation is expressed with LogScale's [`bucket()`](https://library.humio.com/data-analysis/functions-bucket.html) function, which divides the search interval into fixed windows of the rule's `timespan` and groups by the `group-by` fields. The aggregated rows are then filtered on the computed metric with [`test()`](https://library.humio.com/data-analysis/functions-test.html).
|`value_percentile`|`percentile(<field>, percentiles=[<p>], as=…)` (renamed to a fixed field) |
39
+
|`value_median`|`percentile(<field>, percentiles=[50], as=…)` (renamed to a fixed field) |
40
+
|`temporal`|`count(field=event_type, distinct=true, as=event_type_count)` over events tagged by a [`case{}`](https://library.humio.com/data-analysis/syntax-conditional.html) statement |
41
+
|`temporal` with a boolean condition (`r1 and r2 not r3`) |[`collect()`](https://library.humio.com/data-analysis/functions-collect.html) the fired rules per group, then [`array:contains()`](https://library.humio.com/data-analysis/functions-array-contains.html) membership tests |
42
+
43
+
For example, the following `event_count` correlation rule:
`temporal` correlations reference multiple rules. Each rule's matching events are tagged with an `event_type` in a `case{}` statement (events matching no referenced rule are dropped), and the query fires when the distinct number of matched rules per group reaches the number of referenced rules. Field `aliases` are normalised with `| <alias> := <field>` so that `group-by` works across rules with differing field names.
75
+
76
+
**Caveats:**
77
+
- Only the correlation query is emitted; the referenced rules are used as subqueries and are not returned separately.
78
+
- Like Splunk's `bin _time`, `bucket()` uses fixed (tumbling) windows aligned to the timespan boundary, so a burst of events that straddles a window boundary may not reach the threshold within a single window.
79
+
-`bucket()` is emitted with `limit=max` to avoid its low default series cap, but it is still bounded (top series by value). Very high-cardinality `group-by` correlations may be truncated, and `lt`/`lte` thresholds are unreliable beyond that cap.
80
+
-`value_count` uses LogScale's `distinct=true`, which is an estimate (typical error < 2%); exact distinct counts are not available in LogScale.
81
+
-`timespan` units map onto LogScale relative-time spans: `s`, `m`, `h`, `d`, `w`, `y` are emitted verbatim and `M` (month) is translated to `mon` (30-day fixed month).
82
+
-`value_percentile` uses LogScale's estimated `percentile()`; `value_median` is computed as the 50th percentile.
83
+
-`temporal_ordered` is not supported and raises `NotImplementedError`; LogScale has no template-friendly ordered-sequence primitive.
84
+
27
85
## Limitations and caveats:
28
86
-**Full Paths**:
29
87
Falcon agents do not capture drive names when logging paths. Instead, when drive letters are expected the device path is used. For example, `C:\Windows` results to `\Device\HarddiskVolume3\Windows` in the logs. To account for this, the pipeline replaces any drive letters in fields containing full path with `\Device\HarddiskVolume?\` (where '?' can be any single character).
0 commit comments