From a behaviour to a written hypothesis
Unit 1 of 5 in Detection engineering.
You will be able to turn an adversary behaviour into a hypothesis and say what you need to see, what could go wrong and how you will prove it works.
Lesson
Start from a behaviour, not from a tool
A detection that starts from 'which rule shall I write today?' tends to produce rules nobody needed. Start from a behaviour an adversary uses and ask what it leaves behind. MITRE ATT&CK gives a shared language for this. Its pages define three layers: detection strategies are high-level approaches for detecting a specific technique, and serve as containers for several platform-specific analytics; analytics hold the platform-specific detection logic, the implementation details of a strategy; and data components identify the specific properties and values relevant to detecting a technique.
In plain words: the strategy says what you are looking for, the analytic says how to look on one platform, and the data component says which evidence has to exist for the looking to work. When you opened them, the pages listed hundreds of strategies, over two thousand analytics and 120 data components, so you rarely start from nothing.
Write the hypothesis in a template
Palantir's incident response team published the template it uses for every new alert, called Alerting and Detection Strategy (ADS). It exists because of a problem you will recognise: before the framework, alerts reached production without documentation or peer review, gained a reputation for low quality, and led to fatigue and alerting apathy. The template is a natural-language form with nine sections: goal, categorization, strategy abstract, technical context, blind spots and assumptions, false positives, validation, priority and response. Palantir says each section is required before production.
Read the sections as questions. What behaviour do I want to detect (goal)? Where does it sit in ATT&CK, parent and child, such as Credential Access and Brute Force (categorization)? How does the alert work, from which data, with what enrichment (strategy abstract)? What does a responder who is not an expert need to know (technical context)? Where will it not fire (blind spots and assumptions)? What harmless activity will trigger it (false positives)? How do I generate a true positive to prove it works (validation)? How urgent is it (priority)? What does the next person do when it fires (response)?
Check that you can see it
A hypothesis is only as good as its data. A rule on process creation is useless if process creation is not logged, or is logged without the command line. The Sigma specification has a place for this: every rule names its log source with a category, a product and a service, and a rule can carry a definition that tells the reader how the source must be configured, for example which verbosity level to turn on. The definition is not evaluated by tools. It is a note for people.
Before you write the rule, answer in writing: which log, on which machines, with which fields, kept for how long. That is the lesson of the cloud logging class too. If the answer is 'we do not collect it', the first deliverable is not a rule but a logging change.
Choose how hard it should be to dodge
David Bianco's Pyramid of Pain ranks the indicators a defender can use by how much it hurts the adversary when you deny them: hash values, IP addresses, domain names, network and host artifacts, tools, and tactics, techniques and procedures (TTPs). His point is that blocking an IP address is easy for an adversary to recover from, and a new domain takes slightly more effort, while indicators near the top force the adversary to change how they work.
Use it as a design question for each hypothesis. If the rule matches one hash or one address, expect it to age in days. If it matches a behaviour, such as an unusual parent and child process pair, expect it to last longer and to need more tuning. Neither is wrong. A quick indicator rule is cheap and useful for a known incident; the behaviour rule is the one to invest in.
Decide: alert, review or enrich
Not every good detection should page a human. Sigma's level field has five values with meanings. Informational is meant for enrichment, such as tagging events, and no alert or case should be created because a huge number of events is expected to match. Low is a notable event, rarely an incident, with no immediate reaction needed but a regular review recommended. Medium should be reviewed manually on a more frequent basis. High should trigger an internal alert and prompt review. Critical indicates an incident and is for cases where the probability borders on certainty.
Decide the level when you write the hypothesis, not after the first flood of alerts. A behaviour that is common and ambiguous belongs as low, or as a threat-hunting query that an analyst runs on a schedule, and only the narrowed version should be allowed to reach the alert queue.
Key points
- ATT&CK layers: detection strategy (what), analytic (how, per platform), data component (which evidence must exist).
- A hypothesis template forces you to state goal, ATT&CK mapping, data, blind spots, false positives, validation, priority and response.
- Check the log exists, has the fields and is kept long enough before you write the rule.
- Prefer behaviours over single indicators when you can; use the Pyramid of Pain to decide.
- Choose the level before the first alert: informational, low, medium, high or critical.
Sources
- Palantir: Alerting and Detection Strategies Framework (project page on GitHub)
- Palantir: ADS Framework template (ADS-Framework.md on GitHub)
- MITRE ATT&CK: Detection Strategies
- MITRE ATT&CK: Analytics
- MITRE ATT&CK: Data Components
- David Bianco: The Pyramid of Pain
- Sigma Rules Specification, version 2.1.0
Practice in the labs
Write a hunt as a hypothesis, trace a technique to the data that shows it, and rank detections by how much they cost an adversary.
- Run a hypothesis-driven threat hunt (the PEAK/TaHiTI loop): You write a hunt document with a hypothesis, the data used, the exact method, findings and a new detection idea, then delete the practice task. Runs on a Windows machine you own.
- Query the raw MITRE ATT&CK STIX dataset in Python: from a threat group to the telemetry that detects it: You query the raw ATT&CK dataset in Python to go from a threat group to the techniques it uses and the data components that detect them. Runs offline.
- Prioritize detections with the Pyramid of Pain: You rank a set of detections by pain level and write a behavioural rule for an LSASS memory access technique. Runs offline.
Also try, in the simulators
- What a detection is, and how it goes wrong (Detection Lab lesson): The Detection Lab lesson on what a detection is and the two ways it can be wrong, the vocabulary this whole class uses.
- The Pyramid of Pain: choosing what to detect (Detection Lab lesson): The Detection Lab lesson on choosing what to detect, with the same pyramid you just used.
Knowledge check
- In ATT&CK's own words, what does a data component identify? Answer: The specific properties and values relevant to detecting a technique. The Data Components page says they identify the specific properties and values relevant to detecting a given technique; they tell you which evidence must exist for a detection to work.
- Palantir's template has a section for blind spots and assumptions. What is it for? Answer: To record where the alert may not fire, so others can see how it could fail or be avoided. The framework says no alert is perfect and that writing down assumptions and blind spots helps other engineers understand how it may fail to fire or be defeated by an adversary.
- A rule matches the exact address of one server an attacker used last week. According to the Pyramid of Pain idea, what should you expect? Answer: It is cheap to write and easy for the adversary to dodge, so expect it to age quickly. Bianco notes an adversary can change IP addresses with very little effort, so an address-based rule is a short-lived indicator, useful for a known incident but not a durable detection.
- You write a rule for a common, ambiguous activity. Which Sigma level and handling fit best? Answer: Low, with a regular review or a scheduled hunt, until you can narrow it. Sigma describes low as a notable event that is rarely an incident, reviewed regularly rather than answered at once. Informational events are for enrichment and must not create alerts; critical is for near-certainty.
Back to the syllabus or see all classes.