Lesson 1 of 15 · 5 min read
Detection Engineering: From Hypothesis to Tested Alert
In this lesson
TL;DR: Good detections target a behaviour the attacker needs, not a tool's name. They depend on data that is actually collected everywhere it matters. They are tuned against history with narrow, owned exceptions, proven to fire by emulating the technique, and shipped with a runbook. Managed as code (versioned, tested, reviewed, staged), and measured by precision and exercise detection rate. Use ATT&CK to prioritise and find gaps; never confuse a rule's existence with coverage.
Before you read
Pick an answer before you read further. The lesson below explains it, and guessing first, right or wrong, helps the explanation stay with you.
1A detection for credential dumping matches the name of one popular tool's binary. Why is this weak?
The lifecycle of one detection
Hypothesis
behaviour attackers need
Data check
collected on every asset?
Logic + tuning
history, exceptions
Emulation test
proves it fires
Production
runbook, metrics, owner
Behaviour, then data
Pick what the technique requires, and confirm the logs that record it arrive from every asset in scope.
- Hypothesis. A technique worth catching, chosen from threat intelligence, choke points (credential access, privilege escalation, persistence, exfiltration) and coverage gaps.
- Data. Which events record the behaviour, and do all relevant assets send them with the needed fields? Add health checks; a rule on missing data is silently blind.
- Logic. Target the behaviour plus context (parent process, asset type, actor's history).
- Tuning. Run over 30 to 90 days of history; classify matches; add narrow exceptions with owners and expiry.
- Testing. Reproduce the technique several ways in a lab or with an emulation framework; keep the samples as test fixtures.
- Shipping. Runbook (meaning, first checks, escalation, containment options), severity, owner, review date.
- Operating. Precision, volume, time to triage, and whether emulation exercises still trigger it.
Precision and severity
A paging, high-severity alert needs high precision. Weak signals should not page anyone; they feed risk-based alerting, which scores entities and alerts when several signals accumulate on one host or user. This keeps recall without burning analysts out.
Detection as code
Store each rule with metadata (technique, severity, data sources, owner, runbook) and tests (positive and negative samples) in a repository. CI validates syntax, runs tests and checks metadata; reviewers check logic and false-positive risk; deployment is automated, starting in shadow mode. Scheduled end-to-end emulations confirm alerts still arrive after log-pipeline changes. Sigma is a common vendor-neutral format.
A Sigma rule (specification 2.1.0, August 2025) needs only a title, a logsource saying which kind of log it reads, and a detection block whose condition combines named selections; status (experimental, test, stable) and level (informational to critical) carry its maturity and severity. The pySigma toolchain converts rules for a specific SIEM through backends and processing pipelines that map generic field names to your schema, which is what keeps detection logic separate from vendor field names. Sigma correlation rules express counts, distinct values and ordered sequences over a time window, for example "more than 20 failed logons for distinct accounts from one source in 5 minutes", without writing each SIEM's query language by hand.
Document each detection with a fixed template so the next analyst knows what it is for. Palantir's Alerting and Detection Strategy framework, published in 2017, is the widely copied one: goal, categorisation, strategy abstract, technical context, blind spots and assumptions, false positives, validation, priority and response. The "blind spots" section is the one most teams skip and most need.
Detect the absence of data
A rule on a log source that stopped arriving is silently blind. Every source needs a health check: a heartbeat or expected event rate per host and source, and an alert when it drops. Some failures are subtle: on Windows, process-creation command lines (event 4688) are off by default and need two separate policies, and a basic audit policy can overwrite advanced audit settings, which Windows records as event 4719. Treat "this host stopped sending process events" as a detection in its own right, because attackers who disable logging rely on nobody noticing.
Coverage, honestly
ATT&CK organises tactics, techniques and procedures. Use it to choose what to build and test. Its structure changes, so coverage claims must name a version: version 18 (October 2025) replaced per-technique detection notes with first-class detection strategies and analytics, and version 19 (April 2026) split the defense evasion tactic into stealth and defense impairment, giving Enterprise ATT&CK 15 tactics. Releases come twice a year, in April and October.
Aim detections high on David Bianco's Pyramid of Pain (2013), which ranks indicators by how much it costs an attacker to change them: hash values at the bottom, then IP addresses, domain names, network and host artefacts, tools, and tactics, techniques and procedures at the top. A rule on a malware hash is trivially evaded; a rule on the behaviour the technique requires is not. A technique is covered only when tested detections or preventive controls handle the procedures you expect, on the assets that matter. One rule for one procedure does not make a technique green.
Worked example: local admin added on a server
Behaviour: an account added to a server's local Administrators group (Windows events 4720 and 4732). Data check: 7 percent of servers were not forwarding security logs; fixed first. History: 140 matches in 60 days, 131 from the provisioning service on configuration-management hosts (narrow exception), 9 from admins during approved change windows (context: change ticket). Test: four methods of adding an admin in the lab; all fire. Production: high severity on domain controllers, medium elsewhere, runbook linked, precision tracked monthly.
Put numbers on it. Before tuning, precision was 0 of 140: no historical match was malicious. After the provisioning exception and change-ticket enrichment, expected volume is about 9 alerts in 60 days, roughly one a week, each a two-minute ticket check. Recall on the tested procedures is 4 of 4, and the claim stops there: other ways of adding an administrator are not covered until they are emulated. And every rule competes for the same analysts: a team with 1,000 analyst-minutes a day for triage at 10 minutes per alert can afford about 100 alerts a day across all rules, so each rule must justify its share of that budget.
Behaviour
admin added to a server
Data health
7% of servers silent
History and tuning
140 matches to ~9
Emulation
4 of 4 methods fire
Operate
severity, runbook, budget
What each stage guards against
Silent blindness
- Alert when a source stops sending
Alert fatigue
- About 100 alerts a day of capacity
False coverage
- Claim only tested procedures
Start from a behaviour, then check the data
A rule is only as good as the logs that reach it; fix the silent hosts first.
Misconceptions interviewers listen for
- "A rule mapped to a technique means the technique is covered." It covers the procedures you tested, on the assets that send the data.
- "Hash and IP indicators are good detections." They sit at the bottom of the Pyramid of Pain; attackers change them for free.
- "More alerts means more security." Volume beyond triage capacity lowers effective recall.
- "Command lines are in the Windows logs." Not by default; two policies must be enabled.
- "ATT&CK has 14 tactics, including defense evasion." Since version 19 it has 15, with stealth and defense impairment.
What if · interview follow-ups
Hold your answer as the constraints change
You own detection engineering for a mid-sized company with a SIEM, Windows and Linux servers and a SOC of four analysts. The interviewer pushes on one detection, then on the programme.
Start here
What if the new rule fires 200 times a day?
What is its precision, and what is the team's capacity?
Measure precision on a sample first. If most hits are benign, split it: a narrow, high-precision variant that pages, and a low-severity signal that feeds risk-based alerting where several weak signals on one entity combine. Any exception gets an owner and an expiry, never a silent deletion of the noisy population.
Carry it forwardPrecision and capacity decide whether a rule helps; split noisy rules instead of muting them.
Weak answerSuppressing the rule's noisiest hosts with no record.
Constraint changes
What if a set of hosts silently stops sending logs?
Can a rule detect an event that never arrives?
No, so log-source health must be monitored separately: heartbeats and expected event rates per host and source, with alerts on drops, plus specific signals such as Windows audit-policy changes. A host that goes quiet is itself suspicious, because disabling logging is a common attacker step.
Carry it forwardMonitor the presence of data, not just its contents.
Weak answerAssuming no alerts means nothing happened.
Constraint changes
What if an attacker uses a variant of the technique you never emulated?
What exactly did your test prove?
Your coverage claim was per procedure, so the variant may pass unseen. Move the logic up the Pyramid of Pain toward the behaviour every variant needs, add the variant to the emulation suite, and report coverage as tested procedures rather than technique colours.
Carry it forwardClaim coverage only for what you tested; aim logic at behaviour, not tooling.
Weak answerMarking the technique green because one rule exists.
Constraint changes
What if the SIEM vendor renames a field your rules depend on?
Which tests would catch it before production?
Detection-as-code with positive and negative fixtures in CI catches it: the positive sample stops matching. Writing rules in Sigma with a processing pipeline for field mapping means the fix is one mapping change, not edits to every rule, and scheduled end-to-end emulation confirms alerts still arrive.
Carry it forwardSeparate detection logic from vendor schema, and test both continuously.
Weak answerDiscovering the break during an incident.
Constraint changes
What if leadership asks for an ATT&CK coverage percentage?
What would one number hide?
Offer tested procedures per tactic on critical assets, against a named ATT&CK version, with the data gaps listed. A single percentage hides which assets lack data and which techniques were only mapped, not tested, and the version 19 tactic split changes the denominator anyway.
Carry it forwardReport coverage as evidence with its limits, not a score.
Weak answerProducing a heat map coloured by rule count.
Now defend it
As the defender, what would a monthly detection health report contain?
Log-source health by asset class with silent hosts listed, precision and volume per rule against the triage budget, emulation results with pass and fail per procedure, rules changed or retired with reasons, and open blind spots from each rule's documentation.
How this shows up in interviews
"Write a detection for X", "how do you reduce false positives", "detection as code" and "how do you measure coverage" all test this lifecycle.
Say it in 30 seconds: "I start from a behaviour the attacker needs, confirm the data that records it arrives from every asset, write logic with context, tune against history with narrow owned exceptions, and prove it fires by emulating the technique. It ships with a runbook and an owner, lives as code with tests and review, and I measure precision and exercise detection rates. ATT&CK tells me what to build and test, not what colour the map is."
Check yourself
Say or write your answer first, then reveal. Explaining it from memory, in your own words, is the skill an interviewer is checking.
1A rule generates 400 alerts a day, almost all benign. What are your options, in order of preference?
2Why do end-to-end emulation tests matter even when a rule has unit tests?
3What does the Pyramid of Pain say about where to aim detections?
4A SOC has 1,000 analyst-minutes a day for triage at about 10 minutes per alert. What does that imply for rule design?