Skip to content

Detection Engineering

github-actions[bot] edited this page Nov 29, 2026 · 3 revisions

Last reviewed: 2026-11-28 (one engine-verified lab; see its evidence section for what CI observed)

Prerequisites: Incident Response index ยท Detection content validation ยท Wazuh deployment.

๐ŸŽฏ Purpose

This is the section hub for detection engineering in this repository. It covers how detection content is written, tested, converted, tuned and handed to incident response for Sigma, YARA/YARA-X, Suricata, Zeek and Wazuh. It also holds reproducible labs that run the real engines.

โš™๏ธ Function

  • Defines the evidence tiers used to describe what a detection claim is based on.
  • Links the lifecycle, telemetry, testing, conversion, tuning and alert-to-case guides in this section.
  • Shows where the existing engine-specific procedures elsewhere in the repository fit into those tiers.

๐Ÿ† Goal

Every detection claim in a guide or report should name its evidence tier and point at the artifact behind it: a source file, a fixture, a CI evidence manifest or a live-lab record.

๐Ÿ“‹ When To Use

  • You are writing or changing a Sigma, YARA-X, Suricata, Zeek or Wazuh rule and need the review and test steps.
  • You need to say how far a detection has been verified without overstating it.
  • You are wiring a new fixture or lab into CI.

๐Ÿ—บ๏ธ Section Guides

Guide Covers
Rule lifecycle Author, review, test, deploy, tune and retire; IDs, versions and peer review per engine
Telemetry & blind spots Required telemetry per rule type, a blind-spot register and data-source health checks
Testing & fixtures Positive, negative, malformed and duplicate fixtures; PCAP and log replay; expectation and evidence manifests; CI
Rule conversion & field mapping pySigma backends and pipelines, field-mapping pitfalls and verifying converted queries
Tuning & false positives Measurement method, tuning record template and suppression versus exclusion risks
Alert-to-case correlation Enrichment, deduplication and grouping, ownership and evidence links into the IR playbooks

๐Ÿงซ Labs

Lab Engines What it proves
Wazuh + Suricata canary lab Suricata 8.0.8, Wazuh manager 4.14.11 (wazuh-logtest socket), sigma-cli 4.0.1, YARA-X 1.25.0 The engines fire, or stay silent, as expected on synthetic positive, near-miss negative, malformed and duplicate fixtures
Cloud identity detections sigma-cli 4.0.1 with the splunk, sqlite and loki backends; Python sqlite3 Nine Entra ID, CloudTrail and GCP audit rules pass sigma check, convert to committed goldens, and the sqlite queries select exactly the synthetic match events

Each lab ships its detection content, synthetic fixtures, an expectation manifest, a runner and a CI workflow that runs the real engines and keeps an evidence manifest.

Two non-detection labs follow the same evidence pattern: the software supply-chain tooling lab and the Kubernetes admission, RBAC & NetworkPolicy lab.

๐Ÿงญ How The Pieces Fit

flowchart LR
    A[Author rule] --> B[Peer review]
    B --> C[Fixtures and expectation manifest]
    C --> D[Engine run in CI]
    D --> E[Evidence manifest]
    E --> F[Live-lab verification]
    F --> G[Deploy and tune]
    G --> H[Alert to case]
    H -->|missed or noisy detection| A
Loading

The CI step proves engine behavior on synthetic input. The live-lab step is still needed to prove sensor visibility, ingestion, alert delivery and analyst handling.

๐Ÿท๏ธ Evidence Tiers

Use the lowest tier that is actually true, and name the artifact.

Tier What it shows What it does not show Example artifact
Static The rule or procedure was read against upstream source or docs; syntax may be parsed That any engine accepted it or that it matches anything YARA-X rule lab commands (source-reviewed, never run)
Synthetic (offline) Repository code agrees with fixtures: rule structure, ID ranges, verdict logic That the real engine behaves the same way tools/tests/test_wazuh_rule_contracts.py, canary validator with --evidence-origin fixture
Engine-verified in CI The pinned engine produced the recorded output for each synthetic fixture, with input hashes recorded Sensor placement, collection, indexing, dashboards, analyst response or production coverage evidence/ci-run-46219831976.json
Live lab A real sensor saw the activity, the event was ingested, the native rule fired and the alert was delivered, with a benign negative control Coverage in environments that were not tested A record filled from the Lab verification matrix

The canary validator's levels map onto these tiers: fixture is synthetic, imported-unverified is no stronger than synthetic until someone checks the source, and independently verified live-lab evidence is the live-lab tier. The validator always reports real_siem_validated: false.

๐Ÿ“ Where Existing Procedures Sit

Procedure Canonical for Current tier
Detection content validation Upstream sources by role and the generic promotion checklist Static (source mapping)
Wazuh synthetic rule validation wazuh-logtest steps and SID tables for the Kismet, nzyme and honeypot rules Synthetic; its real-manager results are marked not tested
Canary detection validator The tools/lab_detection_validator.py CLI, input contracts and verdicts Synthetic
Lab verification matrix Repository-wide evidence ledger and live-lab record template Tracks every tier; most entries are lab blocked
Suricata + Zeek validation Suricata deployment and offline suricata -r replay Static
YARA-X rule lab YARA-X rule design and fixture prediction Static
Purple team detection validation Atomic Red Team safety and the emulation loop Live-lab procedure; no recorded result
Wazuh + Suricata canary lab Engine-verified fixtures for four engines Engine-verified in CI
Cloud identity detections Identity Sigma rules, goldens and synthetic events for Entra ID, AWS and GCP Engine-verified in CI for Sigma check, conversion and sqlite3 evaluation only; no SIEM or tenant

๐Ÿšง Evidence Boundary

A lab result here means the engines produced the recorded output for synthetic canary inputs, as stated in that lab's evidence manifest. It does not show production coverage, that alerts reach a dashboard or indexer, or that an analyst responds. Those still need the live-lab steps in the Lab verification matrix and the Canary detection validator.

See also

Related Files


โฌ…๏ธ Incident Response index | Master Index | ๐ŸŽฏ Role Navigation | Legal Notice


๐Ÿ“„ Source: IncidentResponse/DetectionEngineering/README.md | โœ๏ธ Suggest an edit | โฌ…๏ธ Back to Incident Response

Clone this wiki locally