VeriKQL by Kaushik Saha

Level 5 · What did they touch? · Mission 4 of 5 · by Kaushik Saha

High-risk sign-ins

Alert After the break-in · Idea where · summarize · make_set

Commands here where · == · and / or · count · summarize · countif · min / max · make_set / make_list · all commands

Briefing

Microsoft Entra ID scores every sign-in for risk. The attacker's sign-ins were rated high. A detection can use that score directly.

One idea: filter on the risk, then group what it touched

SigninLogs
| where ResultType == "0" and RiskLevelDuringSignIn == "high"
| summarize SignIns = count(), Apps = make_set(AppDisplayName), First = min(TimeGenerated), Last = max(TimeGenerated)
    by UserPrincipalName, IPAddress
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 2 rows

UserPrincipalNameIPAddressSignInsAppsFirstLast
alex.morgan@contoso.com203.0.113.772["Azure Storage","Office 365 SharePoint Online"]2026-06-10 09:08:192026-06-10 09:58:44
alex.morgan@contoso.com203.0.113.453["Office 365 Exchange Online","Microsoft Graph PowerShell","Azure Portal"]2026-06-10 08:20:362026-06-10 09:02:41

Two rows, one account, two addresses: every successful high-risk sign-in of the day was the attacker.

Your turn

Count the sign-ins at each risk level, for every user, and show only the users with any medium or high.

Write it in the box below and check it. Then compare with one answer; others can be right too.

Show one answer
SigninLogs
| summarize Low = countif(RiskLevelDuringSignIn == "low"), Medium = countif(RiskLevelDuringSignIn == "medium"),
    High = countif(RiskLevelDuringSignIn == "high") by UserPrincipalName
| where Medium > 0 or High > 0
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 1 row

UserPrincipalNameLowMediumHigh
alex.morgan@contoso.com355

Check your own query

Write your query for the task above and check it against the real schema.

Debrief

The risk score, the admin apps and the MFA prompts all point at the same account and the same two addresses. Last step of Level 5: a bug hunt.

All data on this page is sample data, made up for this course. The IP addresses come from ranges reserved for documentation, and the people and the company are fictional.

Mission by Kaushik Saha. Every query checked with Microsoft.Azure.Kusto.Language 12.4.1 against schema bundle 2026.10.29; every result computed on the course's sample with Kusto-Loco 1.4.9, an open-source KQL engine (credits). The story's clock reads 12:00 UTC on 10 June 2026.