ATT&CK guide
Detection engineering: how a Sigma rule becomes an alert a human acts on
A rule that fires is easy. A rule that fires only when something is wrong, only once, and only with enough evidence to act on — that is the craft.
For the owner
Every vendor sells detection by counting rules. A thousand rules sounds like a thousand problems caught. It is not, and the gap between the two is where security programmes fail.
The reason is unglamorous. A rule fires when its pattern matches, and most patterns match something ordinary at least once a day. The result is a queue that fills with noise, and a team that learns to clear it without reading. At that point the rules are still there, still counted, and still worth nothing. The organisation believes it is protected and is not.
This is the single most common failure mode in mid-sized companies, and it is worth naming plainly because it is fixable and nobody fixes it: the alert volume is not a measure of security, and the number of rules is not a measure of coverage. What matters is the fraction of alerts that are true, the speed at which a real one is read, and how many attacks are caught before they finish. Those are three numbers a business can hold an MSP to.
Three questions separate a detection programme that works from one that decorates:
- When the alert fires, does the analyst know what to do next? An alert without a next step is a notification, and notifications get muted.
- How many alerts arrived yesterday that turned out to be nothing? A hundred alerts with a 2% true rate is a hundred interruptions for two useful facts.
- How long between the intruder arriving and the first alert about them? Everything else on this page is in service of shortening that number.
The good news is that this is a discipline, not a purchase. It can be improved with the rules and the telemetry you already have.
For the analyst
The shape of a rule
A Sigma rule is YAML with a detection block. The simplest useful one looks like this:
title: Encoded PowerShell Command Line
id: 4c4d0a1e-4f5e-4f9c-9d4a-8a1b2c3d4e5f
status: experimental
description: Detects a PowerShell process whose command line carries a base64 blob
logsource:
product: windows
service: sysmon
category: process_creation
detection:
selection:
EventID: 1
Image|endswith: '\powershell.exe'
CommandLine|contains|base64: 'FromBase64String'
condition: selection
falsepositives:
- Administrative scripts that decode base64 payloads
level: medium
tags:
- attack.execution
- attack.t1059.001
Four things decide whether this rule is worth having.
The selection must be specific. Image|endswith: '\powershell.exe' matches every PowerShell run on the machine — thousands a day in a large environment. Adding CommandLine|contains|base64: 'FromBase64String' narrows it to the scripts that actually decode something, which is a small fraction.
The condition should be the argument. A rule with several selections usually needs a condition that says how they relate: selection and not filter, selection1 or selection2. Writing the condition is where most of the judgement lives.
The level has to be honest. A rule marked critical that fires on a script an administrator wrote is a rule that trains people to ignore critical. Level is a promise about attention.
The false positives section is not optional. It is the design note that says "I know this fires on legitimate activity, and here is what it looks like." A rule with an empty one has not been thought about.
What makes a rule fire on the telemetry you actually have
A rule only fires if the fields it needs reach the detection engine. This is the quiet failure that produces the feeling of a product that does not work. The corpus is large and precise, and a large fraction of it needs fields a given deployment never collects.
The platform normalizes every source onto one set of columns — user_name, process_name, parent_process, command_line, file_path, src_ip, dst_ip, event_type, severity, source_type — and then carries the rest of the Sigma field tail through, so a rule written against EventID, OriginalFileName, TargetObject or ImageLoaded can still match when the collector supplies those fields.
Two consequences follow, and they are worth internalising:
- A rule that never fires is not a harmless rule. It is a rule that has silently stopped covering its technique. That is why coverage is measured as "can this rule fire at all" and "has it fired" — three states, not two. A rule for
T1027(obfuscated files) that never fires is not protecting you from obfuscation; it is a line on a spreadsheet. - Field coverage is a deployment question. The rules that need a field you do not collect will never fire, and no amount of rule writing fixes that. Coverage gaps are collection gaps.
Take a concrete example. A rule for T1059.001 (PowerShell) written against ScriptBlockText needs a field the collector has to supply. A rule for T1218 (system binary proxy execution) written against Image and CommandLine needs only the fields the core schema already carries. Both belong to the execution tactic, and one of them works out of the box while the other is paper-only until a collector is in place. You cannot tell which is which by reading the rule; you can only tell by asking what the deployment collects — which is why coverage is measured against the environment rather than against the corpus.
The tuning loop
The honest version of detection engineering is a loop, and it looks like this:
- Write the rule. From the technique, from the behaviour you saw, from the vendor's telemetry.
- Measure it. How often does it fire? On what? If it fires ten thousand times a day, it is a coverage statement, not an alert.
- Narrow it. Add the context that makes it rare: the account, the host role, the parent process, the time of day, the rarity of the value.
- Tune the environment. Not every rule should fire in every environment. A rule about an admin using a remote console is noise in an IT shop and signal in a clinic. Allowlists and per-rule tuning are not cheating; they are the difference between a rule and a wall of noise.
- Re-measure. The number of false positives should fall while the true positives stay.
The loop is the whole job, and it is why a detection programme degrades without someone doing it deliberately: environments change, rules do not.
Correlation beats volume
The most valuable detection logic is not in single-event rules at all. It is in the correlation between them: a rare event followed by a rare event, from the same identity, within a window.
title: Unusual parent process for a service account
correlation:
type: event_count
rules:
- rare_process_start
- unusual_parent_for_account
group-by:
- user_name
- host_id
timespan: 15m
condition:
count() by user_name, host_id > 0
Two rules that are individually unremarkable become a finding together. This is also why "detect in-stream, store in parallel" matters as an architecture rather than a slogan: a correlation over a sliding window can only be computed while the events are still in flight. By the time a query store has them, the window has closed.
The mistakes that cost the most
Firing on the loud thing. The most famous indicators are the most over-shared. A rule keyed on a hash or a filename that appears in every threat bulletin is a rule that fires for everyone at once and for no one in particular. The fix is to anchor on behaviour and context, not on the indicator.
Writing rules against one environment. A rule validated on a single machine's logs will misfire on the first machine with different software.
Treating the false-positive count as failure. It is not. A rule with a 5% true-positive rate that fires once a day gives you one true finding a week from a single rule. The same rule at 0.1% firing once a day gives you one true finding in three months. The number that matters is true findings per unit of analyst attention, and it is not maximized by suppressing noise blindly — it is maximized by narrowing the rule until the noise is gone.
Never measuring. A detection programme that has never been measured against its own environment is a set of beliefs.
What good looks like
A mature programme can answer, without effort, three questions: which techniques are covered by rules that can fire, which of those have fired on our own telemetry in the last ninety days, and which have neither a rule nor a collector. That third number is the one that is usually unknown, and it is the honest measure of the gap.
Where DetectMonkey fits
DetectMonkey ships the detection side of this as a corpus and an engine rather than as a promise. The pinned SigmaHQ corpus of 3164 rules is evaluated against every event as it arrives, with the rules compiled to streaming filters rather than being queried against afterwards — which is what makes the windowed correlations in the section above computable at all.
The platform also keeps the ledger that makes the third number answerable: which rules can fire against the telemetry it actually collects, which have fired, and which are paper-only because a collector is not in place. That inventory is the difference between claiming coverage and knowing it.
Tuning is part of the product, not an afterthought: per-tenant allowlists with an expiry, per-rule severity and scope changes, and containment thresholds that are explicit rather than implicit, with every suppression counted rather than discarded. What it does not do is isolate, quarantine, block or remediate anything on your systems — it detects and alerts, and the decision stays with your team.
Telemetry is processed and stored on private servers operated by Codein in New Brunswick, Canada. Analysts review in English and French. Early access is 90 days at no charge, for up to 100 seats, founder-led onboarding, and no card required.
See it on your own telemetry
Early access is 90 days at no charge, for up to 100 seats, founder-led onboarding, no card required.