Perform Threat Hunting · Topic 3 of 4
Sentinel Hunting Queries and the Data Lake
SC-200 Sentinel hunting: hunting queries, bookmarks, livestream, data lake exploration, KQL jobs that promote data and summary rules.
- 7 min
- Hunting queries are tagged with MITRE techniques, can be run from advanced hunting in the Defender portal, and combine Defender and Sentinel tables.
- Bookmarks save evidence. Livestream watches a query in real time and does not alert.
- The data lake holds up to 12 years of data. KQL jobs run one time or scheduled, on the lake and federated tables, and can promote data to the Analytics tier.
What it is
Microsoft Sentinel holds data from many sources, so it is where you hunt across everything, including non Microsoft logs and long term history. You hunt with hunting queries, you save evidence with bookmarks, and you reach data that is no longer in the hot tier by using the Microsoft Sentinel data lake with KQL jobs and summary rules.
How it works
Hunting queries
The Hunting page lists built in queries from the Content hub and your own. Each query is KQL tagged with MITRE tactics and techniques, so you can pick queries for a technique. In the Defender portal you run them from advanced hunting, where Defender XDR tables and Sentinel workspace tables can be queried together. That lets one query join DeviceProcessEvents with SecurityEvent, for example.
Typical workflow:
- Choose or write a hypothesis.
- Run the relevant hunting queries and review the results.
- Add interesting rows as bookmarks, with notes and entity mappings.
- Attach bookmarks to an incident, or create an incident from them.
- If the query is valuable, create an analytics rule from it, so it runs automatically.
Bookmarks and livestream
A bookmark saves rows of hunting results, with comments and tags, so evidence is not lost. Bookmarks can be mapped to entities and attached to incidents, and they can be searched later.
Livestream runs a hunting query continuously in the background and shows new results as they arrive, with a notification, so you can watch for a pattern in real time during an investigation, for example a specific IP address. It does not create alerts, and it is meant for short term monitoring. Turn the query into an analytics rule if the monitoring must be permanent.
The data lake
The Sentinel data lake is a low cost store for large volumes of security data, kept for up to 12 years. Data in the data lake tier is not available for real time analytics or hunting in the Analytics tier, but you can query it whenever you need.
Data lake exploration in the Defender portal lets you run interactive KQL queries directly on lake data, over multiple workspaces. This suits an analyst who needs history for an incident when the data is older than the Analytics tier retention, and wants to use familiar KQL.
KQL jobs
KQL jobs are one time or scheduled asynchronous KQL queries that run on data in the data lake and on federated tables. Federated tables are external sources, such as Microsoft Entra ID, Microsoft 365 and Microsoft Resource Graph tables, which you can query next to lake tables without ingesting them.
Use jobs for:
- Long running, one time queries for incident investigations and response.
- Aggregation tasks that support enrichment, using low fidelity logs.
- Historical threat intelligence matching, scanning old data for indicators that you learned about recently.
- Anomaly detection scans across several tables.
Jobs are effective when the query uses joins or unions across datasets. The key idea is promotion: a job writes its results into a table in the Analytics tier, where you can query them with the normal advanced hunting editor. Promotion has benefits, which are combining current and historical data, lowering query costs, and combining data from several workspaces into one. It also has a cost, because storage in the Analytics tier costs more than in the lake, so project only the columns you need and filter the rows before you promote.
| The need | Use |
|---|---|
| Quick, interactive look at old firewall logs | Data lake exploration with KQL |
| Run the same heavy aggregation every night | A scheduled KQL job |
| Match last quarter's logs against a new indicator list | A KQL job for historical threat intelligence matching |
| Bring a narrow slice of lake data into hunting | A job that promotes results to the Analytics tier |
Summary rules
Summary rules aggregate large sets of data in the background and write the results to a custom table in the Analytics tier. The summary data is precompiled, so queries over it are fast, and it can be derived from low cost tiers.
They help with:
- Fast analysis and reports over very large datasets and long time ranges.
- Cost savings. Keep verbose logs in a cheap tier, and send only the summarised data to the Analytics table for analysis.
- Privacy. Remove or hide sensitive details in the summary and limit access to the raw tables.
A summary rule has a query, a time bin that sets how often it runs and the size of the window, and a destination table, whose name ends in _CL. Templates exist for common cases.
| KQL job | Summary rule | |
|---|---|---|
| Purpose | Query and promote data from the lake, one time or scheduled | Continuously aggregate data into a smaller table |
| Output | A table you choose in the Analytics tier | A custom _CL table in the Analytics tier |
| Typical use | Investigations, retrospective scans | Reports, dashboards, cheap detection on summaries |
Search jobs and restore
For older data in Analytics tables with long retention, search jobs pull matching rows into a new table (with the _SRCH suffix), and restore brings a time range of archived data back into a table (with the _RST suffix) so you can query it. The usual order is start the job, wait for the table to be ready, query it, then delete the restored table when the investigation ends.
A worked scenario
A SOC learns of a new campaign with a list of 500 malicious IP addresses. Hunting queries from the content hub find nothing in the last 30 days. The team runs a KQL job on the data lake firewall logs for the past year, matching against the indicator list, and the job promotes the matches to the Analytics tier, where they confirm one old connection. For a monthly report, a summary rule aggregates daily sign in counts into a custom table. During the incident, an analyst keeps a livestream running on the attacker's IP address, and bookmarks the key rows to the incident.
What to remember for the exam
- Hunting queries are tagged with MITRE techniques, can be run from advanced hunting in the Defender portal, and combine Defender and Sentinel tables.
- Bookmarks save evidence. Livestream watches a query in real time and does not alert.
- The data lake holds up to 12 years of data. KQL jobs run one time or scheduled, on the lake and federated tables, and can promote data to the Analytics tier.
- Summary rules aggregate data into custom _CL tables in the Analytics tier for speed, cost and privacy.
- Restored tables end in _RST and search job tables end in _SRCH.
To use old data in hunting, a KQL job promotes the rows you need into the Analytics tier.
How the exam asks about this
- "Run a query across firewall logs and Defender tables." Advanced hunting in the Defender portal.
- "Scan a year of logs for a newly published indicator list." A KQL job on the data lake.
- "Precompute daily totals from a verbose log." A summary rule.
- "Save rows of results as evidence on an incident." A bookmark.
Common mistakes
Expecting lake data to be searchable in analytics rules. It must be promoted first.
Promoting everything. Analytics storage costs more, so project and filter.
Using livestream for permanent monitoring. Create an analytics rule.
Confusing KQL jobs with summary rules. Jobs run queries and promote. Summary rules aggregate continuously.
Check yourself
What does a KQL job use to bring lake data into hunting?
Promotion of its results into a table in the Analytics tier.
What are summary rules for?
Aggregating large datasets in the background into custom tables, for fast queries, lower cost and privacy.
What does livestream do?
It runs a hunting query continuously and shows new results as they arrive, without creating alerts.
Topic 3 of 4 in Perform Threat Hunting
Test yourself on Perform Threat Hunting
The full Microsoft SC-200 question bank has 650 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Microsoft. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.