Security operations with Microsoft Defender · Refine
Hunt for threats and build custom detections
Regular hunting in advanced hunting, with the best queries turned into custom detections.
- Duration
- Ongoing
- Effort
- A few hours a week
- Complexity
- Medium
- Beyond E5
- Nothing beyond Microsoft 365 E5
On this page
Overview
Advanced hunting is a query-based tool for exploring up to 30 days of raw Defender data across devices, email, identities and cloud apps, in a guided mode or with Kusto Query Language. A query that finds something worth knowing can become a custom detection rule, which runs on a schedule, creates alerts and can take response actions.
Technically, analysts use advanced hunting's guided or advanced mode, save queries, and create custom detection rules with a frequency, alert details, response actions and a scope. Permissions follow the data each rule queries.
You'll end up with: A hunting rhythm, a library of saved queries, and custom detections for the techniques that matter to the organization.
If you skip it: Without hunting, the team only sees what the built-in detections were designed to catch.
Before you start
The path to this playbook
- Plan security operations in Microsoft Defender
- Set up roles, notifications and automation in Defender
- Run incident response in Microsoft Defender
- Hunt for threats and build custom detections (you are here)
- Run incident response in Microsoft Defender: The incident queue worked daily: owners, investigation across the attack story, response actions and classified resolutions.
- Have analysts with the right access
How to do it
Hunting needs read access to the tables analysts will query, and managing custom detections needs manage permissions for every data source the rule uses.
Trial to adoption
3 phasesHunt on a scheduleWeekly
Set aside time each week to hunt, starting from threat analytics, recent incidents or techniques in the use case registry.
Move on when Each hunt records what was looked for, what was found and whether a detection is needed.
How to do it
Use guided mode if you're not yet familiar with KQL, and advanced mode to write queries from scratch. Advanced hunting covers up to 30 days of raw data by default; longer periods depend on licences or a connected Microsoft Sentinel workspace.
Watch out for (1)
If you: Hunt without writing down what you looked for
What tends to happen: The same hunt is repeated, and findings are lost
A better approach:Record every hunt's question, query and result, even when nothing was found
Turn findings into detectionsAs needed
Create a custom detection rule from a query worth running again, with clear alert details, a frequency and, where safe, a response action.
Move on when Each rule has been tested in advanced hunting and its alerts reach the queue as expected.
How to do it
Available frequencies are every 24, 12, 3 or 1 hours, or Continuous (near real time). A new rule checks the past 30 days of data when saved. Continuous rules must query a single table without joins or unions.
Watch out for (1)
If you: Add an automatic response action to a new rule straight away
What tends to happen: A noisy rule isolates devices or quarantines files that were fine
A better approach:Run a new rule without response actions until its results are trusted
Review rulesQuarterly
Review custom detections: alerts produced, false positives and whether each is still needed.
Move on when Every rule has an owner and produced useful alerts, or has been changed or removed.
Share hunting results with the threat intelligence and engineering owners, so a finding can also become a configuration change rather than only a detection.
How you'll know it's working
2 measures
Capture a baseline before you start, or you won't be able to show the change.
| Measure | Where you see it | Good direction |
|---|---|---|
| Hunts recorded per month | Hunting log | Steady |
| Custom detections with true positive alerts | Defender incident queue | Up |
Take it with you
plan, gate checks, 1 template
Plan outline: phases and when to move on
- Hunt on a schedule (Weekly). Move on when: Each hunt records what was looked for, what was found and whether a detection is needed.
- Turn findings into detections (As needed). Move on when: Each rule has been tested in advanced hunting and its alerts reach the queue as expected.
- Review rules (Quarterly). Move on when: Every rule has an owner and produced useful alerts, or has been changed or removed.
Gate checks: questions to answer before each phase ends
Before leaving Hunt on a schedule
- Was each hunt recorded?
Before leaving Turn findings into detections
- Was each rule's query run in advanced hunting before saving?
Before leaving Review rules
- Does every custom detection have an owner?
Hunt record
Question: [what we looked for]. Source: [threat analytics / incident / use case]. Query: [saved query name]. Result: [findings]. Follow-up: [detection, configuration change, none].
Contributor

Microsoft 365 architecture and governance · Protiviti
Compare notes or suggest an improvement
Changelog
Changelog (1 version)
| Version | Date | By | Change |
|---|---|---|---|
| 1 | Sev Derghazarian | First draft. |