Configure detections
Custom detection rules in Defender XDR, Sentinel analytics rule types, MITRE ATT&CK coverage and anomalies.
- 18 min
- 5 concepts
- Try it yourself
- 4-question check
Learn
Detections turn data into alerts. In the unified Defender portal you can write detections either as Defender XDR custom detection rules or as Sentinel analytics rules, and both feed the same incident queue.
- 1
Create custom detection rules by using Advanced Hunting in Microsoft Defender XDR
Write an Advanced Hunting query that returns the required columns (
Timestamp,ReportIdand an entity such asDeviceIdorAccountObjectId), then Create detection rule: name, frequency (continuous/NRT, hourly up to every 24 hours), severity, MITRE category, impacted entities, and automated actions such as isolate device, collect investigation package or disable user.Remember: Return Timestamp, ReportId and an entity ID.
- 2
Manage custom detection rules in Microsoft Defender XDR
In Detection rules, view run status, last run, triggered alerts, and edit, run now, turn off or delete rules. Watch for errors such as query timeouts. Custom detections can query both Defender XDR tables and Sentinel tables in the unified portal.
Remember: Check rule health and alert counts regularly.
- 3
Configure and manage analytics rules in Microsoft Sentinel SIEM, including scheduled, near-real time (NRT), threat intelligence, and machine learning
Scheduled: KQL on a schedule (every 5 minutes to 14 days), with lookback, threshold, entity mapping, custom details, alert grouping and incident settings. NRT: runs every minute for urgent detections, with some limits. Microsoft security: create incidents from Defender alerts. Threat intelligence: matches indicators against logs. Machine learning behavioural analytics and Fusion-style multistage detection use built-in models. Use rule templates from content hub.
Remember: Urgent, single-event detection: NRT rule.
- 4
Analyze attack vector coverage by using the MITRE ATT&CK matrix
The MITRE ATT&CK page in Sentinel maps active and available rules (and hunting queries) to tactics and techniques, showing coverage and gaps. Tag your own rules with tactics and techniques so coverage is accurate, and use SOC optimization's threat-based recommendations to close gaps.
Remember: Tag rules with MITRE techniques to see real coverage.
- 5
Configure anomalies in Microsoft Sentinel
Anomaly rules use machine learning to spot unusual behaviour (for example anomalous sign-in volume or data exfiltration patterns). They run in flighting (test) or production mode; you can duplicate a rule and tune thresholds. Results go to the
Anomaliestable and enrich investigations rather than creating incidents directly. UEBA adds behaviour baselines for users and hosts.Remember: Anomalies inform, they don't create incidents on their own.
Sentinel analytics rule types
| Type | How it works |
|---|---|
| Scheduled | KQL on a schedule with thresholds |
| Near-real-time (NRT) | KQL every minute |
| Microsoft security | Incidents from Microsoft security alerts |
| Threat intelligence | Matches indicators to log data |
| Anomaly | ML models write to the Anomalies table |
Try it
Click each part of this custom detection rule query.
This interactive part needs JavaScript.
In the portal
- Custom detection rulesMicrosoft Defender portal: Investigation & response > Hunting > Custom detection rules
- AnalyticsMicrosoft Defender portal: Microsoft Sentinel > Configuration > Analytics
- MITRE ATT&CKMicrosoft Defender portal: Microsoft Sentinel > Threat management > MITRE ATT&CK
Key terms
Click a card to see the definition.
Check your understanding
4 questions. Score 80% or more and these skills are marked as confident in your SC-200 study plan.
Which columns must a Defender XDR custom detection return?
These are required to create alerts and actions.
Which Sentinel rule type runs every minute?
NRT rules run each minute.
Where do anomaly rule results go?
They enrich investigations.
How do you find detection gaps by technique?
It maps rules to techniques.
Sources
- Microsoft Learn: Create custom detection rules
- Microsoft Learn: Threat detection in Microsoft Sentinel
- Microsoft Learn: Near-real-time analytics rules
- Microsoft Learn: Understand security coverage by the MITRE ATT&CK framework
- Microsoft Learn: Anomalies in Microsoft Sentinel
Facts in this lesson are from Microsoft Learn. This site isn't affiliated with Microsoft.