Use this when building, testing and tuning detections for attacker behaviour.
Detection Engineering
1. Detection engineering builds, tests and maintains detections.
2. Start from threats and data.
3. Version, review, test.
4. Measure coverage and quality.
5. Iterate with incidents and red team.
threat → hypothesis → rule → test → deploy → tune
Context & applicabilityCommon mistakes · platform/version boundaries
- Writing rules without checking the required log source exists and is complete.
- No test data, so rules are never confirmed to fire.
- Rules deployed without an owner or response playbook.
- Measuring success by number of rules rather than detection coverage and precision.
Operational reference
Fast context before you go deeper.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Subtopics
Go one level deeper into this subject.
A detection rule is logic that searches telemetry for a specific suspicious condition and raises an alert, with a description, severity, MITRE ATT&CK mapping, data source and tested response steps.
Subtopic Indicators of CompromiseIndicators of compromise (IOCs) are artefacts showing a system may be compromised — malicious hashes, IP addresses, domains, file paths or registry keys — used for searching and blocking.
Subtopic Indicators of AttackIndicators of attack (IOAs) describe attacker behaviour in progress, such as credential dumping or lateral movement, rather than artefacts.
Subtopic Behavioral DetectionBehavioral detection looks for attacker techniques rather than specific files, such as Office spawning PowerShell or LSASS memory access, so it catches new malware using known methods.
Subtopic Signature DetectionSignature detection matches known patterns of malicious code or traffic, such as byte sequences or hashes.
Subtopic Sigma RulesSigma rules are a vendor-neutral YAML format for log detection rules, which tools like sigma-cli convert to Splunk, Elastic, Sentinel and other SIEM query languages.
Subtopic YARAYARA is a pattern-matching language for identifying malware by strings, byte patterns and conditions in files or memory, widely used in malware research, scanning and incident response.
Subtopic BaselineA baseline is the normal pattern of activity for a user, host or network — logons, processes, traffic volume — measured over time so detections can recognize what is unusual.
Subtopic Anomaly DetectionAnomaly detection in detection engineering flags activity that deviates statistically from a learned baseline, such as unusual logon times or data volumes, catching unknown attacks at the cost of more false positives.
Subtopic Detection TuningDetection tuning adjusts rules to cut false positives without losing real detections: add precise exclusions, adjust thresholds, enrich with context and retire rules that never produce useful alerts.
- Behavioural detections outlast IOC-based ones.
- Every rule needs test data and a response.
- Tuning is ongoing, not a one-time job.
- Detection backlog and coverage map — ATT&CK
- Detection tests (Atomic Red Team in lab) — validation
- Rule repo with CI — detections as code
ReferenceWhy it matters1 section · depth on demand
Detection engineering lifecycle
1. Requirement: threat or technique to detect (ATT&CK, incident, threat intel).
2. Data: confirm the logs exist and are parsed.
3. Build: write the rule (Sigma, KQL, SPL) with exclusions.
4. Test: simulate the behaviour and benign activity.
5. Deploy with severity and response guidance.
6. Tune and retire: measure true/false positives, update or remove.
Store rules as code in Git with reviews (detection-as-code).
ReferenceHow it works1 section · depth on demand
In depth
Detection engineering is the discipline of designing, building, testing and maintaining detections that find malicious activity in security telemetry. It treats detections as software: version-controlled, tested, reviewed and measured.
Lifecycle:
| Stage | Activity |
|---|---|
| Requirement | Threat or technique to detect (ATT&CK) |
| Data | Confirm required telemetry exists |
| Development | Write rule (Sigma, KQL, SPL, EQL) |
| Testing | Simulate the technique; check for false positives |
| Deployment | Through CI/CD to the SIEM/EDR |
| Maintenance | Tune, retire, measure true-positive rate |
The topics in this group cover detection rules, indicators, behavioural detection, Sigma and YARA.
ReferenceImportant terms & boundaries1 section · depth on demand
Detection-as-code workflow
1. Write the rule in a portable format (Sigma) with metadata and ATT&CK mapping.
2. Store in Git; peer review via pull request.
3. Test in CI against sample logs (true positive and benign samples).
4. Deploy to the SIEM via pipeline (e.g. sigma convert -t splunk).
5. Monitor alert volume and precision; retire or tune.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Detection Engineering. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://sigmahq.io/docs/basics/rules.html · confidence 94%