Testing Sigma Rules Before Production: Fixtures, Regression, and Shadow Mode
How to test Sigma rules before production: true/false-positive fixtures, regression testing with Atomic Red Team, shadow mode, and coverage backtesting.
A Sigma rule deploys in minutes. The confidence you can place in it is built over several days of testing. In between sits a risk every detection team knows: the rule that never fires (because the field it watches is not the one the actually deployed product writes), and the rule that fires on everything (because the condition is too broad and drowns the analyst in false positives). Neither problem is new, but both got worse once copilots started generating Sigma rules on demand: the output looks syntactically correct, it reads convincingly, but nobody has confirmed it actually covers the technique it claims to. Here is the method for testing a rule before it goes live: fixtures, regression against real attack techniques, and a silent observation period before any alert fires.
Why an untested rule costs more than it delivers
A Sigma rule pushed to production without validation produces one of three costly outcomes:
- The silent false negative. The rule exists, it shows up in the ATT&CK coverage table, but it never fires because the log field it targets does not exist in your normalization, or the expected value differs from what the actual version of the monitored tool produces. This is worse than having no rule at all: you believe you are covered.
- The false-positive flood. An overly permissive condition (a bare keyword match on a command line, with no parent-process or path context) fires hundreds of times a day. The classic outcome: the team disables the rule within a week, or worse, stops looking at alerts from that source entirely.
- Silent drift. The rule worked when it was written, then an environment change (a product update, a log format change) quietly makes it obsolete, and nobody notices until an incident goes undetected.
All three share the same root cause: absence of proof. A Sigma rule is only trustworthy once it has been tested against real data in both directions: it fires on what it should, and it stays silent on everything else.
True-positive and false-negative fixtures with pySigma and sigma-cli
The first step is building test fixtures, small datasets that replay representative events and check the rule behaves as expected. sigma-cli, the pySigma-based command-line tool, converts a rule to the target engine and validates its syntax:
# Validate rule syntax and metadata
sigma check rules/proc_creation_win_lsass_dump.yml
# Convert the rule to the target query engine (here, Splunk)
sigma convert -t splunk -p sysmon rules/proc_creation_win_lsass_dump.ymlSyntax validation, though, proves nothing about effectiveness. The real test is running the converted rule against two event sets:
# fixture_true_positive.yml: an event that MUST trigger the rule
title: LSASS dump via procdump
logsource:
category: process_creation
product: windows
detection:
event:
Image|endswith: '\procdump.exe'
CommandLine|contains: 'lsass'
condition: event# fixture_false_negative_check.yml: a legitimate variant that must NOT trigger
# example: procdump used against a process other than lsass, for routine diagnostics
detection_test:
Image: 'C:\Tools\procdump.exe'
CommandLine: 'procdump.exe -ma notepad.exe notepad.dmp'
expected: no_matchpySigma exposes a Python API that lets you write these checks as real unit tests, run in CI on every rule change:
pytest tests/sigma/test_lsass_dump.py -vThe principle is simple but rarely applied with rigor: every rule deserves at least one case that must fire (true positive) and one that must not (an expected false negative), replayed against the real engine, not just a syntax checker.
Regression testing against Atomic Red Team: proving actual coverage
A hand-crafted fixture proves the rule reacts to a manufactured event. It does not prove the rule detects the MITRE ATT&CK technique its metadata claims to cover. For that, you need to replay a real technique and confirm the alert actually fires. Atomic Red Team, the library of attack tests organized by ATT&CK technique, exists for exactly this purpose:
# Run the atomic test for T1003.001 (OS Credential Dumping: LSASS Memory)
Invoke-AtomicTest T1003.001 -TestNumbers 1The test generates the real activity (here, an LSASS memory dump through a legitimate tool), and you then check downstream in the log pipeline that the associated Sigma rule actually fired, with the correct fields populated. Across a rule set covering dozens of techniques, this regression suite runs on a loop: every time a collection agent, a log format, or a monitored tool's version changes, you replay the matching atomic catalog and compare the firing rate before and after. This is the only tangible proof that a line reading "covers T1003.001" in a coverage table matches operational reality, rather than merely the stated intent in a rule's metadata.
Shadow mode: seven days of silence before the first alert
A rule that passes fixtures and Atomic Red Team regression is still not production-ready, because both tests run against a controlled environment, not the real background noise of the client's actual environment. The last step is shadow mode: the rule deploys but is configured to raise no visible alert, only a count of matches over a seven-day window.
# Example daily match count in shadow mode (pseudo-query)
SELECT date_trunc('day', matched_at) AS day, count(*) AS volume
FROM sigma_matches
WHERE rule_id = 'proc_creation_win_lsass_dump'
AND mode = 'shadow'
GROUP BY day
ORDER BY day;Seven days cover a full weekly cycle (weekdays and weekend), enough to capture scheduled tasks, maintenance scripts, and recurring business workflows that a one-day test would never surface. If the volume stays low and stable (a handful of legitimate matches, identified and excluded), the rule is a candidate for promotion. If the volume spikes on a specific client environment, that is the sign of a legitimate local tool reproducing the watched behavior, and it needs to be excluded before activation, not discovered after the first alert flood.
Backtesting an AI-generated rule: real coverage versus the feeling of coverage
Copilots that generate Sigma rules from a plain-language description produce syntactically valid output in seconds. The problem is not the syntax, it is the gap between the feeling of coverage and actual coverage. A generated rule can cite an ATT&CK technique in its metadata without its detection logic actually covering the behavior that technique describes: a poorly chosen field, a condition narrow enough to catch only one attack variant, or conversely a condition so broad it also captures legitimate usage.
The treatment is exactly the same as for any new rule, with no shortcut: true-positive and false-negative fixtures, an Atomic Red Team replay of the cited technique, then shadow mode. A generated rule that fails any one of these three tests is not "almost good," it simply has not been proven yet. The sense of security a syntactically clean rule provides, tidy metadata, a convincing description, is precisely what makes this backtest indispensable: polish reassures, it does not prove anything.
Promotion metrics: precision, volume, drift
Before moving a rule from shadow mode to active production, three metrics are enough to decide:
| Metric | What it measures | Go/no-go criterion |
|---|---|---|
| Precision | Share of shadow-mode matches confirmed relevant after manual triage | Above a threshold set by the technique's criticality (typically 80 to 90 percent for a rule meant to raise an automated alert) |
| Volume | Number of matches per day over the seven-day window | Stable, with no unexplained isolated spike |
| Drift | Volume change between two consecutive shadow-mode windows (or after an environment change) | No significant drift without a documented infrastructure change |
A rule that satisfies all three criteria moves to production with active alerting. A rule that fails on precision stays in tuning (an added exclusion, a tightened condition). A rule that fails on volume or drift goes back into shadow mode for another observation window.
Why a pre-validated pack changes the equation
Reproducing this method, fixtures, Atomic Red Team regression, seven-day shadow mode, for every rule individually is substantial work, made heavier by the growing volume of rules copilots generate without validation keeping pace. That is exactly the work a humanly pre-validated rule pack absorbs upstream: every rule has already gone through this cycle before it reaches your environment, cutting both your validation workload and the noise from unproven, auto-generated rules.
The ThreatClaw Sigma rule feed applies this discipline continuously, so your analysts receive proven alerts, not promises of coverage.
Related articles
We detonated a live Phobos sample. Here is what it does, deleting shadow copies, killing the firewall, and the Sigma rule that catches it, validated across multiple samples with zero false positives.
Shadow AI is shadow IT's faster, leakier cousin. This guide covers what it is, why it is a real risk, and — the part nobody writes about — how to actually detect unsanctioned AI use in your network, proxy and endpoint logs, with a working Sigma rule.
A Sigma pipeline CI/CD detection as code setup: validate, translate, test, deploy, with ATT&CK fixtures and experimental-to-stable governance for untested rules.
Getting started with Sigma detection engineering: rule anatomy, sigma-cli tooling, the hypothesis-test-promote loop, and the false-positive traps to avoid.