Test a rule
A rule that has only ever met its author's imagination tends to do well there. Paste a Sigma rule and a few real events. The page shows which events the rule matches, which part of the rule decided each one, and which field the rule reads that the event does not have.
It runs in this browser, in the same Python engine as the query translator. The rule and the events are sent nowhere and are not kept after you close the page.
Results
The two files are the kit's fixtures. Put them in a detection's tests/ folder and tools/replay.py --fixtures runs the same events through real engines. Lint asks for at least one event the rule must match and one it must ignore.
Limits of the test
- It tests one event at a time, which is what a Sigma rule describes. A rule that counts events or joins two of them needs the SIEM.
- Field names are compared as written. Each SIEM renames fields, so a rule that passes here still has to pass the kit's replay in the engine it will run on.
- A nested event is read with dotted names, so
process.namereads the name insideprocess. - Text matches ignore case, as Sigma does, unless the rule uses the
casedmodifier. - The robustness draft reads the rule's fields and values by the method the detection library uses, which is checked against rules MITRE's Center for Threat-Informed Defense scored by hand.
- A query in SPL, KQL, or another language goes through Translate a query first, which writes it as Sigma.
Rendered from framework.json v0.136.0, CC BY-NC 4.0. The example is DET-0001 from the kit, with five events from OTRF Security-Datasets.