VeriKQL by Kaushik Saha

Level 6 · Is this one incident? · Mission 2 of 5 · by Kaushik Saha

The role grant

Alert Six alerts, one attacker · Idea nested lists · TargetResources[0]

Commands here project · where · == · extend · tostring · all commands

Briefing

Attackers who reach an admin portal look for more power. Microsoft Entra ID records every directory change in AuditLogs: who did it (InitiatedBy) and to what (TargetResources).

One idea: read a list with [0], then dot notation

AuditLogs
| extend Actor = tostring(InitiatedBy.user.userPrincipalName), FromIP = tostring(InitiatedBy.user.ipAddress),
    Target = tostring(TargetResources[0].userPrincipalName),
    Change = tostring(TargetResources[0].modifiedProperties[0].newValue)
| project TimeGenerated, OperationName, Actor, FromIP, Target, Change
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 7 rows

TimeGeneratedOperationNameActorFromIPTargetChange
2026-06-10 08:03:41Reset user passwordit.admin@contoso.com192.0.2.10julia.santos@contoso.com
2026-06-10 08:04:02Update userit.admin@contoso.com192.0.2.10julia.santos@contoso.comtrue
2026-06-10 08:47:15Add member to groupit.admin@contoso.com192.0.2.10mei.chen@contoso.comFinance Reports
2026-06-10 09:25:50Update userit.admin@contoso.com192.0.2.10omar.haddad@contoso.comSenior Analyst
2026-06-10 09:40:15Add member to rolealex.morgan@contoso.com203.0.113.77alex.morgan@contoso.comGlobal Administrator
2026-06-10 10:12:07Update userit.admin@contoso.com192.0.2.10lena.fischer@contoso.comFinance
2026-06-10 11:05:33Add member to groupit.admin@contoso.com192.0.2.10raj.patel@contoso.comLondon Office

Six changes by the IT admin from the office: among them, unlocking Julia's account after the spray. And one more: at 09:40, Alex's account made itself a Global Administrator, from the attacker's second address.

Your turn

List every change the IT admin made today, with the time, the change, the user changed and the new value.

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

Show one answer
AuditLogs
| where tostring(InitiatedBy.user.userPrincipalName) == "it.admin@contoso.com"
| project TimeGenerated, OperationName, Target = tostring(TargetResources[0].userPrincipalName),
    NewValue = tostring(TargetResources[0].modifiedProperties[0].newValue)
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 6 rows

TimeGeneratedOperationNameTargetNewValue
2026-06-10 08:03:41Reset user passwordjulia.santos@contoso.com
2026-06-10 08:04:02Update userjulia.santos@contoso.comtrue
2026-06-10 08:47:15Add member to groupmei.chen@contoso.comFinance Reports
2026-06-10 09:25:50Update useromar.haddad@contoso.comSenior Analyst
2026-06-10 10:12:07Update userlena.fischer@contoso.comFinance
2026-06-10 11:05:33Add member to groupraj.patel@contoso.comLondon Office

Check your own query

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

Debrief

A finance user's account with Global Administrator can do anything in the tenant. This is the moment the incident becomes critical. Next: put every step on one timeline.

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.