Incident Response Workflow: Cloud Identity Attack.
There was no malware alert.
No ransomware note. No suspicious executable. No obvious endpoint compromise.
The attacker simply authenticated successfully, changed cloud identity settings and began moving through Microsoft 365 like a legitimate user.
Agent Foskett knew this was not an endpoint investigation. This was an attack against the organisation's cloud identity plane, and the evidence was spread across sign-ins, roles, Conditional Access, enterprise applications and Microsoft Defender XDR telemetry.
Lesson overview
Learn how to investigate a cloud identity attack by correlating Microsoft Defender XDR, Microsoft Entra ID identity telemetry, cloud activity, role changes, Conditional Access modifications and application activity.
Why cloud identity attacks matter
The cloud identity attack workflow
Step 1 — Review recent identity activity
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
let TimeFrame = 14d;
let UserToInvestigate = "user@contoso.com";
IdentityLogonEvents
| where Timestamp > ago(TimeFrame)
| where AccountUpn =~ UserToInvestigate
| project Timestamp,
AccountUpn,
ActionType,
IPAddress,
Location,
DeviceName,
FailureReason
| order by Timestamp ascStep 2 — Identify risky or unusual sign-in patterns
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
let TimeFrame = 7d;
IdentityLogonEvents
| where Timestamp > ago(TimeFrame)
| summarize SignInCount = count(),
Locations = make_set(Location, 20),
IPAddresses = make_set(IPAddress, 50),
Devices = make_set(DeviceName, 20),
FirstSeen = min(Timestamp),
LastSeen = max(Timestamp)
by AccountUpn
| where array_length(Locations) > 1 or array_length(IPAddresses) > 5
| order by SignInCount descStep 3 — Review cloud administration activity
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
let TimeFrame = 14d;
CloudAppEvents
| where Timestamp > ago(TimeFrame)
| where ActionType has_any ("Add", "Update", "Set", "Assign", "Consent", "Policy", "Role")
| project Timestamp,
AccountDisplayName,
ActionType,
Application,
ObjectName,
IPAddress,
RawEventData
| order by Timestamp descStep 4 — Hunt for application and service principal activity
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
let TimeFrame = 30d;
CloudAppEvents
| where Timestamp > ago(TimeFrame)
| where RawEventData has_any ("ServicePrincipal", "AppId", "Consent", "OAuth", "Permission")
| project Timestamp,
AccountDisplayName,
ActionType,
Application,
ObjectName,
IPAddress,
RawEventData
| order by Timestamp descStep 5 — Correlate cloud activity after the identity event
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
let TimeFrame = 7d;
let UserToInvestigate = "user@contoso.com";
CloudAppEvents
| where Timestamp > ago(TimeFrame)
| where AccountDisplayName has UserToInvestigate or AccountObjectId has UserToInvestigate
| summarize ActivityCount = count(),
Applications = make_set(Application, 20),
Actions = make_set(ActionType, 50),
IPAddresses = make_set(IPAddress, 50),
FirstSeen = min(Timestamp),
LastSeen = max(Timestamp)
by AccountDisplayName
| order by ActivityCount descStep 6 — Build the cloud identity attack timeline
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
let TimeFrame = 14d;
let UserToInvestigate = "user@contoso.com";
let SignIns =
IdentityLogonEvents
| where Timestamp > ago(TimeFrame)
| where AccountUpn =~ UserToInvestigate
| project Timestamp, EventType="IdentityLogon", Account=AccountUpn, Detail=ActionType, IPAddress, Location;
let CloudActions =
CloudAppEvents
| where Timestamp > ago(TimeFrame)
| where AccountDisplayName has UserToInvestigate
| project Timestamp, EventType="CloudAppEvent", Account=AccountDisplayName, Detail=ActionType, IPAddress, Location="";
union SignIns, CloudActions
| order by Timestamp asc