Advanced Security In progress
Intermediate 16 min read Advanced Security
Detection Engineering
Write detections that survive real data: grounded in ATT&CK, tuned against noise, versioned like code, and measured by false positives as well as hits.
Sigmarule lifecyclefalse positivesATT&CK mappingdetection as codecoverage
Introduction
What is this?
Detection engineering is the disciplined practice of turning threat knowledge into durable, measurable detections — designed, tested, tuned, and retired like software.
Motivation
Why do you need it?
- Alert volume is untuned noise unless rules carry the discipline of code: tests, review, and revision history.
- ATT&CK mapping turns 'we alert on X' into a coverage story leadership and blue teams can reason about.
- Detections decay: environments change, adversaries adapt, so rules need a lifecycle, not a one-time write.
Think about it
Mental model
Imagine
Static firewall rules
Think of
Signature updates at the endpoint
Fixed rules quietly rot; tuned detections evolve with the environment and the threat landscape.
Mechanics
How it works
- Covert techniques translate to data queries through the ATT&CK lens: technique, then the telemetry that exposes it.
- Sigma rules give a vendor-neutral detection language that ports across SIEMs.
- Rules are tested against attack simulations and peacetime traffic; false positives are tuned, not buried.
- Version the rules, review them, and report coverage: technique coverage beats raw alert count as a metric.
The detection rule lifecycle
Hunttechnique becomes a hypothesis
Writerule + ATT&CK mapping
Testattack simulation and baseline
Runalert triage feeds back in
Tuneretire or refine at the review
Real world
In production
- A team converts its 'new user runs powershell.exe -enc' alert into a Sigma rule mapped to T1059.001 with exclusions.
- Detection backlog prioritizes techniques by threat-intel relevance and asset sensitivity, not effort spent writing rules.
- Quarterly rule review drops detections with zero hits and unreachable logic, or fixes their blind spots.
Guidelines
Best practices
- Write the rule next to its ATT&CK technique and the exact telemetry fields it relies on.
- Test with a real simulation, then measure signal-to-noise over at least two weeks.
- Version rules in git; a detection you cannot review is a checkbox, not a control.
- Report coverage as technique-to-detection mapping, so gaps are visible decisions.
Watch out
Common mistakes
- Porting a rule into a SIEM without ever testing it against your actual data schema.
- Deleting noisy rules instead of tuning them, quietly losing coverage.
- Writing detections that depend on fields the environment does not collect.
- Confusing 'alert fires' with 'detected an intrusion' in the coverage story.
When things break
Debugging tips
- When a rule never fires, prove your data flow: generate the log line, confirm the index, then check the rule fields.
- When a rule floods, triage 10 alerts and group their root causes before tuning exclusions.
- Pin rule review to the ATT&CK update cadence; technique revisions are when detections need revision.
Security
Security considerations
- Detections reveal your environment's blind spots; store rules as sensitive as your SIEM itself.
- Adversaries read public detection content too; tune with baseline behavior on top of published patterns.
- An alerting pipeline is itself a trust boundary — protect its build and deploy path from tampering.
Interviews
Interview checkpoint
Practice
Hands-on lab
Write, Test, and Tune Your Own Detection
45 min · intermediate
Objectives
- Draft a Sigma-style rule mapped to an ATT&CK technique.
- Generate matching and peacetime logs on your own machine.
- Measure false positives and tune the rule by evidence.
Write, Test, and Tune Your Own Detection
45 min · intermediate
0/5 steps
0%
sandbox · Linux sandbox
$
Try these commands
Test yourself
Quick quiz
0/2
1
A detection that depends on uncollected fields will...
2
Coverage reporting should map...
Go deeper