Sentinel Hunting and Kusto Query Language (KQL)¶
Atlanta, USA
Last updated: 2026-07-27
References
Threat hunting starts with a falsifiable hypothesis, not a broad search. Kusto Query Language (KQL) should answer a concrete question, identify the required evidence, and lead to a defined next action if it finds a match.
Hunting workflow¶
- Write the hypothesis, affected assets, relevant time range, and expected signal.
- Identify the tables, parsers, watchlists, and entity fields needed.
- Start with narrow filters and
projectonly the columns needed. - Validate results against known-good activity and source-system evidence.
- Save the query with owner, purpose, assumptions, and follow-up action.
- Convert a stable, high-value query into an analytic rule only after testing.
Advanced hunting example¶
Find successful sign-ins immediately following a burst of failed attempts from the same address:
let failed = SigninLogs
| where TimeGenerated > ago(24h)
| where ResultType != "0"
| summarize failures = count() by IPAddress, bin(TimeGenerated, 15m)
| where failures > 20;
SigninLogs
| where TimeGenerated > ago(24h)
| where ResultType == "0"
| join kind=inner failed on IPAddress
| project TimeGenerated, UserPrincipalName, IPAddress, AppDisplayName, failures
| order by TimeGenerated desc
Query quality controls¶
- State a time range in every production query; avoid unbounded scans.
- Filter early, use explicit projections, and avoid large joins without an understood cardinality and business purpose.
- Preserve query text, parameters, execution time, result reference, and analyst conclusion when a hunt becomes incident evidence.
- Verify table schema, connector status, and retention before deciding that no results mean no activity.
- Restrict hunt access and exports according to the sensitivity of the data.
Business example¶
A threat report identifies a suspicious IP range. The security operations center (SOC) uses a watchlist to search sign-in, firewall, and cloud-app tables over seven days, then validates the matches with source owners. The hunt finds a legitimate vendor range that needs an exception and one unapproved account login that becomes an incident. The final query and review evidence are retained with the detection proposal.