Home › Studies › SC-200 › SecOps Environment › Detection Rules & Analytics

Detection Rules & Analytics

Custom detections in Defender XDR · Sentinel scheduled, NRT, TI, Fusion and ML rules · MITRE coverage · anomalies

By the tools4free.dev team · Last reviewed November 13, 2026

Practice questions for this topic →

Custom detection rules in Defender XDR

A custom detection rule is an advanced hunting query that runs at regular intervals, raises alerts and can take response actions on matches. Create it from Advanced hunting (run the query, then Create detection rule) or from Custom detection rules (+ Create detection rule).

  1. Prepare the query
  2. Create the rule and give alert details
  3. Define alert enrichment details
  4. Specify actions
  5. Set the rule scope
  6. Review and turn on the rule (it runs immediately)
Query needsWhy
Timestamp or TimeGeneratedSets the timestamp of generated alerts
Defender for Endpoint tables: DeviceId and ReportIdAlerts get the right device group scope and the process tree view is built
All other Defender tables: Timestamp and ReportId from the same eventDefender finds the original event; the alert timeline is fully enriched
A strong identifier for the impacted asset, such as DeviceId, AccountObjectId or RecipientEmailAddressMaps the impacted asset automatically in the wizard

Frequency, lookback and NRT

When you save a rule it runs against the past 30 days of data, then repeats at the chosen frequency.

FrequencyLookback for Defender XDR data
Every 24 hours30 days
Every 12 hours48 hours
Every 3 hours12 hours
Every hour4 hours
Continuous (NRT)Runs as events are collected and processed in near real time
CustomOnly when the rule uses data ingested to Microsoft Sentinel; 5 minutes to 14 days

Enrichment, actions, scope and management

AreaWhat the page says
Dynamic title and descriptionPut column names in double curly brackets, for example {{AccountName}}; up to 3 columns per field
Custom detailsUp to 20 key-value pairs per rule; 4 KB combined per alert, otherwise the whole array is dropped
Entity mappingOne column per entity type (mailbox, user, device); Defender XDR data maps entities automatically, Sentinel data needs manual selection
Device actionsIsolate device, Collect investigation package, Run antivirus scan, Initiate investigation, Restrict app execution (device from DeviceId)
File actionsAllow/Block (needs Remediate permission and a file ID such as SHA-1); Quarantine file (SHA1 or SHA256 columns)
User actionsMark user as compromised (risk level high in Microsoft Entra ID), Disable user, Reset user authentication (SID columns needed)
Email actionsMove to mailbox folder (Junk, Inbox, Deleted items) or Delete email (soft or hard); needs NetworkMessageId and RecipientEmailAddress
ScopeAll devices or specific device groups; affects only rules that check devices

Sentinel analytics rule types

Analytics rules run queries on collected data, raise alerts, and alerts are aggregated into incidents. Microsoft encourages starting from analytics rule templates in the Content hub. Learn also says custom detections are now the best way to create new rules across Sentinel SIEM and Defender XDR.

TypeWhat it doesKey facts
ScheduledKusto query on a lookback period; alert when results pass the thresholdMost common type; run every and lookback 5 minutes to 14 days
NRTSubset of scheduled rules; runs once every minuteMax 50 rules; ingestion delay under 12 hours; up to 30 single-event alerts (first 29, then a summary)
AnomalyMachine learning baseline; records anomaliesNo alerts: results go to the Anomalies table
Microsoft securityCreates incidents from alerts of other Microsoft security solutionsNot available with Defender XDR incident integration or Defender portal onboarding
Threat intelligenceMatches threat indicators to eventsThreat intelligence analytics rule (name differs between Learn pages); TI map rules
Fusion (Advanced multistage attack detection)Correlates many low-fidelity alerts into high-fidelity incidentsOn by default; only one rule; not available with Defender XDR incident integration or Defender portal onboarding
ML behavior analyticsAnomalous SSH and RDP loginsCurrently in Preview per Learn; not customizable

Scheduled, NRT and threat intelligence rule settings

SettingScheduled ruleNRT rule
CreateAnalytics > +Create > Scheduled query ruleAnalytics > +Create > NRT query rule
ScheduleRun query every and lookback: 5 minutes to 14 days; lookback must be longer than or equal to the intervalNot configurable: once per minute, one-minute lookback
DelayFive-minute delay from scheduled timeTwo-minute delay; uses ingestion time
Alert thresholdAlert when results exceed the number (0 for no threshold)Irrelevant: an alert is always generated
Event groupingOne alert for all events (default) or one alert per eventUp to 30 single-event alerts
RoleMicrosoft Sentinel Contributor, or write permission on the workspace and its resource groupSame procedure as scheduled rules

MITRE ATT&CK coverage and anomalies

CLI and PowerShell

TaskAzure CLIPowerShell
Assess anomalies from one rule (last 24 hours)Anomalies | where RuleId contains "<RuleId>"-
Compare original and customized anomaly rulesAnomalies | where AnomalyTemplateId contains "<RuleId>"-
Custom detection query that keeps Timestamp and ReportId (NRT compatible)DeviceEvents | where ingestion_time() > ago(1d) | where ActionType == "AntivirusDetection" | summarize (Timestamp, ReportId)=arg_max(Timestamp, ReportId), count() by DeviceId | where count_ > 5-

Exam Tips

Tick each tip once you can answer it without looking.

“Custom detection must run continuously; the query uses one table and no joins” → Continuous (NRT) frequency. Trap: A join, union, externaldata or comment line rules it out.

“Custom detection on Defender for Endpoint tables: which columns keep device scope and the process tree” → DeviceId and ReportId. Trap: Timestamp alone sets only the alert time.

“Custom detection returns far more alerts than expected” → Each rule creates at most 150 alerts per run: tune the query. Trap: Raising the frequency doesn't lift the cap.

“Defender XDR rule runs every 24 hours: lookback” → 30 days (12 h: 48 h; 3 h: 12 h; hourly: 4 h).

“Custom frequency (5 minutes to 14 days)” → Only for rules based solely on data ingested to Microsoft Sentinel.

“Custom detection should isolate the device and start an investigation” → Device actions: Isolate device, Initiate investigation. Trap: Device actions use the DeviceId column.

“Custom detection should delete phishing mail from mailboxes” → Delete email (soft or hard); query needs NetworkMessageId and RecipientEmailAddress.

“Role to manage custom detections on Sentinel data” → Microsoft Sentinel Contributor or higher.

“Security Operator can't edit custom detections” → RBAC is on in Defender for Endpoint: add Manage security settings.

“Run a custom detection now and reset its next interval” → Hunting > Custom detection rules > the rule > Run.

“Sentinel rule that runs once per minute” → NRT rule (max 50 rules). Trap: A scheduled rule can't run more often than every 5 minutes.

“Rule type that never raises alerts, only writes results to the Anomalies table” → Anomaly rule. Trap: Scheduled and NRT rules raise alerts.

“Tune an out-of-the-box anomaly rule” → Duplicate it, edit the copy in Flighting, then switch the copy to Production. Trap: The original can't be edited or deleted.

“Fusion incident: where does it appear” → SecurityIncident table, not SecurityAlert.

“Defender portal onboarded: Fusion and Microsoft security rules” → Not available; Defender XDR creates the incidents and correlates alerts.

“Which MITRE techniques show as covered by default” → Active scheduled and NRT rules; use Simulated rules for available ones.

Sources

Checked against Microsoft Learn on November 13, 2026.

← Data Connectors & IngestionSecOps Environment overview →