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
Result on the sample · 7 rows
| TimeGenerated | OperationName | Actor | FromIP | Target | Change |
|---|---|---|---|---|---|
| 2026-06-10 08:03:41 | Reset user password | it.admin@contoso.com | 192.0.2.10 | julia.santos@contoso.com | |
| 2026-06-10 08:04:02 | Update user | it.admin@contoso.com | 192.0.2.10 | julia.santos@contoso.com | true |
| 2026-06-10 08:47:15 | Add member to group | it.admin@contoso.com | 192.0.2.10 | mei.chen@contoso.com | Finance Reports |
| 2026-06-10 09:25:50 | Update user | it.admin@contoso.com | 192.0.2.10 | omar.haddad@contoso.com | Senior Analyst |
| 2026-06-10 09:40:15 | Add member to role | alex.morgan@contoso.com | 203.0.113.77 | alex.morgan@contoso.com | Global Administrator |
| 2026-06-10 10:12:07 | Update user | it.admin@contoso.com | 192.0.2.10 | lena.fischer@contoso.com | Finance |
| 2026-06-10 11:05:33 | Add member to group | it.admin@contoso.com | 192.0.2.10 | raj.patel@contoso.com | London 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)
Result on the sample · 6 rows
| TimeGenerated | OperationName | Target | NewValue |
|---|---|---|---|
| 2026-06-10 08:03:41 | Reset user password | julia.santos@contoso.com | |
| 2026-06-10 08:04:02 | Update user | julia.santos@contoso.com | true |
| 2026-06-10 08:47:15 | Add member to group | mei.chen@contoso.com | Finance Reports |
| 2026-06-10 09:25:50 | Update user | omar.haddad@contoso.com | Senior Analyst |
| 2026-06-10 10:12:07 | Update user | lena.fischer@contoso.com | Finance |
| 2026-06-10 11:05:33 | Add member to group | raj.patel@contoso.com | London 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.