Microsoft
Microsoft Graph activity logs
Every HTTP request made to Microsoft Graph in the tenant: URI, method, app, user or service principal, IP and the token it used.
Why it matters
Stolen tokens and malicious OAuth apps mostly act through Microsoft Graph. These logs show what they actually requested, such as mail, files, users or role assignments, and tie each request back to the sign-in that issued the token.
How long it lasts
- Off by default. Enable the MicrosoftGraphActivityLogs category in Entra ID diagnostic settings and send it to Log Analytics, storage or an event hub.
- Requires an Entra ID P1 or P2 license. Volume is high; budget for ingestion before turning it on.
- Only requests made after the setting was enabled are available. There is no backfill.
Get the data
MicrosoftGraphActivityLogs
| where TimeGenerated > ago(7d)
| where AppId == "<app-id>" or UserId == "<user-object-id>"
| project TimeGenerated, RequestMethod, RequestUri, ResponseStatusCode, IPAddress, UserAgent, AppId, UserId, ServicePrincipalId, SignInActivityId
| order by TimeGenerated ascFields that matter
The Graph endpoint called, for example /v1.0/users/{id}/messages.
GET reads; POST, PATCH and DELETE change things.
403 shows attempts the token was not allowed to make.
The client application. Match against consented apps and first-party IDs.
Who the token represents: a user (delegated) or an app (application permissions).
Source of the request. Compare with the IP of the sign-in that issued the token.
Matches UniqueTokenIdentifier in the sign-in logs: the link from an API call to the sign-in.
Delegated scopes or application roles in the token used.
Scripting libraries and enumeration tooling often show up here.
Values to know
appId
All values- 04b07795-8ddb-461a-bbee-02f9e1bf7b46Microsoft Azure CLIPublic client for the Azure command-line interface.Depends on context
- 1950a258-227b-4e31-a9cf-717495945fc2Microsoft Azure PowerShellPublic client for Azure PowerShell.Depends on context
- de8bc8b5-d9f9-48b1-a8ad-b748da725064Graph ExplorerMicrosoft Graph Explorer web tool.Depends on context
- c44b4083-3bb0-49c1-b47d-974e53cbdf3cAzure PortalAzure portal.Depends on context
- 00000002-0000-0000-c000-000000000000Azure AD Graph (resource)The legacy Azure AD Graph API. Still used by some offensive tooling.Depends on context
- 14d82eec-204b-4c2f-b7e8-296a70dab67eMicrosoft Graph Command Line ToolsPublic client used by the Microsoft Graph PowerShell SDK.Depends on context
- 29d9ed98-a469-4536-ade2-f981bc1d605eMicrosoft Authentication BrokerFirst-party broker client used for device registration and brokered sign-ins.Depends on context
- 1b730954-1685-4b74-9bfd-dac224a7b894Azure Active Directory PowerShellPublic client of the legacy AzureAD and MSOnline PowerShell modules.Depends on context
- 9ba1a5c7-f17a-4de9-a1f1-6178c8d51223Microsoft Intune Company PortalCompany Portal client used for device enrollment.Depends on context
- 797f4846-ba00-4fd7-ba43-dac1f8f63013Windows Azure Service Management APIResource ID for Azure Resource Manager (the Azure management plane).Depends on context
Traps
- If the logs were not enabled before the incident, they cannot help with it. Turn them on now for the rest of the response.
- Requests by first-party Microsoft apps are included, so volume is dominated by normal clients. Filter by AppId and user first.
- A request with the same SignInActivityId from a different IP than the sign-in is a strong sign of token replay.