Repository navigation
Detection Rule Lifecycle
Last reviewed: 2026-11-28
Prerequisites: Detection Engineering index ยท Detection content validation.
One lifecycle for Sigma, YARA/YARA-X, Suricata, Zeek and Wazuh content: author, review, test, deploy, tune and retire. It records how each engine identifies and versions a rule, so a change can be traced from the rule file to its test evidence.
Gives the stage gates, the identifier and version fields per engine, and a peer-review checklist. Engine commands are linked to their canonical guides rather than repeated.
No rule reaches production without a stable ID, a version bump on change, a reviewer, and a fixture that proves both a match and a non-match.
- Writing a new rule or importing one from upstream.
- Changing the logic, level or log source of an existing rule.
- Deciding whether to tune, replace or retire a rule.
| Stage | Exit criteria | Evidence to keep |
|---|---|---|
| Author | Behavior, required telemetry and minimum fields are written down (telemetry guide); the rule has an ID in an allocated range | Rule file, linked issue or hypothesis |
| Review | A second person checks logic, field names, ID, version and false-positive notes (checklist below) | Review approval on the pull request |
| Test | Positive, near-miss negative and malformed fixtures behave as expected in the real engine (testing guide) | Expectation manifest and evidence manifest |
| Deploy | The rule file loaded on the target is byte-identical to the reviewed file, and the engine accepted it | Hash comparison and engine load or config-test output |
| Tune | Every change has a measured reason and a regression fixture (tuning guide) | Tuning record |
| Retire | The replacement or reason is recorded; the ID is never reused | Retirement note and, for Sigma, a related link |
The deploy gate is modelled on the lab: it compares the SHA-256 of the Wazuh rule file inside the container with the committed file and records lab_rules_loaded_match.
| Engine | Identifier | Version on change | Source |
|---|---|---|---|
| Sigma |
id: a random UUID (version 4). Use a new id for major logic changes, derived rules kept active alongside the original, or merges |
modified date (YYYY-MM-DD) when the title, detection, level or log source changes, or status becomes deprecated
|
Sigma rules specification 2.1.0 |
| Suricata |
sid (greater than zero), with gid
|
rev: "If a signature is modified, the number of rev will be incremented" |
Suricata 8.0.8 meta keywords |
| Wazuh |
<rule id>. Wazuh documents 100000-120000 for custom rules; test_wazuh_rule_contracts.py enforces 100000-119999 and uniqueness across the listed files |
No version field; track changes in Git and the rule description
|
Wazuh custom rules (4.14) |
| YARA/YARA-X | Rule identifier, unique within its namespace | No built-in version; keep one in meta and in Git history |
YARA-X rule lab |
| Zeek | Script path and, for alerts, the Notice::Type enum value (declared with redef enum Notice::Type += { ... }) |
No built-in version; track in Git or the package metadata you use | Network detection |
| Engine | Range | Owner |
|---|---|---|
| Suricata | 1007001-1007002 (inside the 1000000-1999999 local-use range recorded at sidallocation.org) | Canary lab |
| Wazuh | 100600-100609 (100601-100603 in use) | Canary lab |
| Wazuh | 100300-100354 and 100400-100423 | Kismet, nzyme and honeypot rules |
Pick a new block that does not overlap these, and add any new Wazuh rule file to FILES in test_wazuh_rule_contracts.py so its IDs and parents are checked. A built-in parent such as 86601 is accepted only if it is listed in that test's BUILTIN_PARENTS, with the upstream file it was verified in.
-
Sigma:
statusis one ofstable,test,experimental,deprecatedorunsupported.relatedtypes arederived,obsolete,merged,renamedandsimilar. Runsigma check --fail-on-issues; the defaultsigma checkexits 0 even when it reports validation issues (observed with sigma-cli 4.0.1). -
YARA-X:
yr check <RULES_PATH>checks syntax andyr fmt --check <PATH>exits 1 if a file would be reformatted (both read from the v1.25.0 CLI source; not run in the lab). The lab compiles rules with the Pythonyara_x.compile()API, which raisesCompileError. -
Suricata: load only the rule file under test with
-S, and run a configuration test with-Tbefore deploying. Rule-writing guidance is in Network detection; offline replay is in Suricata + Zeek. -
Zeek:
zeek -a <script>exits after parsing, andzeek -C -r <pcap> <script>replays a capture while ignoring checksums (flags read fromsrc/Options.ccat v9.0.1). Zeek is not covered by the canary lab, so Zeek rules stay at the static tier until a fixture run exists. -
Wazuh: to change a built-in rule, copy it to a file under
/var/ossec/etc/rules/and addoverwrite="yes". Wazuh ignoresif_sid,if_group,if_level,if_matched_sidandif_matched_groupin an overwrite rule and keeps the original values. Prefer a child rule with a new ID when you only need different behavior for a subset of events.
- The ID is new, in an allocated range, and not reused from a retired rule.
- The version field (
rev,modified) changed if the logic, level or log source changed. - Every field name exists in the ingested data, not only in the vendor schema. Check conversions with the field-mapping guide.
- Anchors and match boundaries are deliberate, for example
startswith/endswithin Suricata or^...$in Wazuh<field>. - Parent rules exist (
if_sidin Wazuh) and the rule fires only where the parent fires. - A near-miss negative fixture exists and is one small change away from the positive.
- Known false positives and the expected volume are written down.
- The reviewer is not the author.
-
Sigma: set
status: deprecatedand updatemodified. The replacement rule lists the old ID underrelatedwith typeobsolete. -
Suricata: remove or disable the signature, and keep its
sidrecorded as retired so it is not reallocated. -
Wazuh: check for children first. Any rule with
if_sidorif_matched_sidpointing at the retired ID stops working; the contract test fails when a listed parent is missing. - All engines: remove or update the fixtures and expectation manifest entries in the same change, and say in the tuning record why the rule was retired.
- README.md - Detection Engineering index
- labs/wazuh-suricata/README.md - worked example with rule files for all four lab engines
- ../../tools/tests/test_wazuh_rule_contracts.py - offline Wazuh rule ID and structure contract
โฌ ๏ธ Detection Engineering index | Master Index | ๐ฏ Role Navigation | Legal Notice
๐ Source: IncidentResponse/DetectionEngineering/rule-lifecycle.md | โ๏ธ Suggest an edit | โฌ
๏ธ Back to Incident Response
- ๐บ๏ธ Browse by Topic
- ๐ All Repository Files
- ๐งญ Learning Paths
- ๐ Master Guide
- ๐ค Glossary
- โ๏ธ Legal & Disclaimer
๐ Foundations & Learning
๐ก๏ธ Defense & Investigations
- Incident Response
- Open Source Intelligence (OSINT)
- Reverse Engineering
- Operations Security (OPSEC)
- Compliance
โ๏ธ Platforms & Infrastructure
๐ก Hardware, Wireless & Field Projects
- PNWC Cyberdeck
- Hardware Testing
- Hardware Hacking
- Software-Defined Radio
- Wardriving
- uConsole
- Space Security
๐งฐ Assessment & Field Reference
๐ฆ Downloads & Project Resources
๐๏ธ Additional Topics