Most Entra ID tenants can see who signed in and what changed in the directory, but not what a token actually did once it reached Microsoft Graph. The Microsoft Graph activity log closes that gap: it records every HTTP request the Graph service processes for your tenant, with the app, the user, the token identifiers and the exact URI. This guide is for SOC analysts and detection engineers who want to turn that table into working detections. It covers what to collect and keep, the fields that matter, how to join Graph requests back to the sign-in that issued the token, and a detection set for token replay, directory reconnaissance, privilege escalation and misuse of mail and file permissions. Bulk mail and file pulls by OAuth apps have their own page, the Microsoft Graph Exfiltration Detection guide, and are only summarised here.
Key takeaways
- Off until you turn it on. Graph activity logs need an Entra ID P1 or P2 licence and a diagnostic setting that selects MicrosoftGraphActivityLogs; there is no history from before that moment.
- The token identifiers are the detection. SignInActivityId joins each Graph request to the sign-in log row with the same UniqueTokenIdentifier, so you can compare where a token was issued with where it was used.
- Recon tools leave a shape. Enumeration of users, groups, service principals and role assignments arrives as dense bursts of successful GETs to a predictable endpoint list from one IP and client.
- Write calls are rare and loud. POSTs that add directory role members, app role assignments or credentials are low volume in most tenants, which makes them good candidates for direct alerts.
- Plan for latency and cost. Events usually arrive within 30 minutes and occasionally take up to 2 hours, and volume scales with tenant size, so design rule windows and table plans around both.
What the log records and what it does not
Microsoft describes the Graph activity log as an audit trail of all HTTP requests that the Graph service received and processed for a tenant. That includes calls from line-of-business apps, scripts, SDKs and API clients, calls made by Microsoft first-party apps such as Outlook, Teams and the admin portals, and calls from AI clients that use the Microsoft MCP Server for Enterprise, whose RequestUri contains /enterprise. For a SOC this is the first Microsoft source that shows read activity against the directory at request level: the Entra audit log records changes, and the sign-in logs record token issuance, but neither shows a token listing every service principal in the tenant.
Know the limits before you write rules against it:
- Resource tenant only: you see requests made against your tenant. A multi-tenant app's activity in other tenants is not visible to you.
- No filtering at source: diagnostic settings cannot filter the stream. Volume is reduced afterwards with a workspace transformation or a cheaper table plan.
- Sign-in matches are not guaranteed: Microsoft notes that some activity by Microsoft apps may not have matching sign-in log entries, so a failed join is not by itself suspicious.
- Request, not content: you get the URI, method, status and response size, not the body. Item and message IDs in URIs often need a second source to resolve to names.
- Anything in a URI is logged: Microsoft warns not to store secrets in directory attributes or other auditable resources, because request URIs and stored values can appear in these logs and in every place you export them.
Enabling collection and choosing a destination
Collection is a diagnostic setting on Entra ID. Microsoft lists Security Administrator as the least privileged supported role to create it. The Microsoft Graph Exfiltration Detection guide walks through the setting itself; the decisions that matter for detection are below.
| Destination | Use it for | Detection trade-off |
|---|---|---|
| Log Analytics workspace (Microsoft Sentinel) | KQL rules, joins to SigninLogs and AuditLogs, workbooks | Full query capability on the Analytics plan; the table also supports the Basic and Auxiliary plans and workspace transformations, at reduced query capability |
| Event Hubs namespace | Streaming to a third-party SIEM or data lake | You must also stream the four Entra sign-in log categories to the same platform, or the token joins below cannot run |
| Storage account | Long retention and investigation backfill | Cheap to keep, slow to search; pair it with a hot destination for rules |
Microsoft's published estimates are about 15 GiB a month in Azure Monitor Logs for a 1,000-user tenant and about 1,200 GiB a month for a 100,000-user tenant, with actual volume depending on app usage. Two practical consequences follow. First, if you trim columns with a transformation, never drop SignInActivityId, UniqueTokenId, SessionId, IPAddress, UserAgent, AppId, ServicePrincipalId, UserId, RequestUri, RequestMethod or ResponseStatusCode: every rule in this guide needs them. Second, if you move the table to a lower-cost plan, confirm that your scheduled rules can still query it at the frequency you need before you switch.
Turn on the sign-in log categories at the same time: SignInLogs, NonInteractiveUserSignInLogs, ServicePrincipalSignInLogs and ManagedIdentitySignInLogs. The Entra ID Sign-In and Audit Log Detection Guide covers those streams in depth.
Schema: the fields that carry detections
The MicrosoftGraphActivityLogs table has around three dozen columns. These are the ones detection logic depends on, with the meaning Microsoft documents and how to use each one.
| Field | What it holds | Detection use |
|---|---|---|
| AppId, ServicePrincipalId | Client application ID and the calling service principal | Per-app baselines; app-only calls have an AppId and no UserId |
| UserId | Object ID of the signed-in user, for delegated calls | Join to risky users and identity data; empty for app-only tokens |
| SignInActivityId | Identifier of the sign-in activity that issued the token | Join key to UniqueTokenIdentifier in the sign-in logs |
| UniqueTokenId | Unique identifier of the token used for the call | Group every request made with one token |
| SessionId | Identifier of the authentication session | Follow one session across many tokens and IPs |
| TokenIssuedAt | Time the token was issued | Spot tokens used long after issue, from a new place |
| IPAddress, UserAgent, DeviceId | Client IP, user agent string, device of the authentication request | Issuance versus use comparisons; tool and script user agents |
| ClientAuthMethod | 0 public client, 1 client ID and secret, 2 client certificate | Flag a service principal that normally uses a certificate suddenly calling with a secret |
| Roles, Scopes | Application permissions (roles) and delegated scopes (scp) in the token | Tie behaviour to granted permissions, such as RoleManagement.ReadWrite.Directory |
| Wids | Tenant-wide Entra role template IDs held by the user | Raise priority when the caller holds a privileged role |
| RequestUri, RequestMethod, ResponseStatusCode, ResponseSizeBytes | What was called, how, the result and response size | Endpoint classes, write detection, failure bursts (401, 403), throttling (429) |
| OperationId | Batch identifier, shared by all requests in a $batch | Count batched sub-requests correctly instead of as one call |
| ConditionalAccessStatus | Conditional Access status Graph recorded for the request | Context for whether policy applied to the call |
Two habits make rules more robust. Normalise RequestUri by stripping the host, the v1.0/ or beta/ segment and the query string, and by replacing GUIDs with a placeholder, so /v1.0/servicePrincipals/<id>/owners and the beta equivalent group together. Microsoft's own sample queries use parse_url() with string replacement for this. And treat the first matching success response, not the request, as the signal: a burst of 403s is a different story from a burst of 200s.
Joining Graph requests to the token that made them
The join that makes token abuse visible is documented by Microsoft: Graph activity rows join to the union of SigninLogs, AADNonInteractiveUserSignInLogs, AADServicePrincipalSignInLogs, AADManagedIdentitySignInLogs and ADFSSignInLogs on SignInActivityId == UniqueTokenIdentifier. The sign-in log describes the unique token identifier as the identifier of the token passed during the sign-in, used to correlate the sign-in with the token request. Once joined, each Graph request carries the IP, location, client app, device and Conditional Access result of the sign-in that produced its token.
Build the join as a reusable function or saved query rather than repeating it in every rule. Use a sign-in lookback at least as long as the longest token lifetime you expect. Microsoft documents a default access token lifetime of a random 60 to 90 minutes, and 20 to 28 hours for long-lived tokens issued to clients in tenants with Continuous Access Evaluation, so a one-hour sign-in window will miss legitimate matches and create noise.
Token abuse and reconnaissance detections
The rules below are written as logic, not code, so they port to any SIEM. Thresholds are starting points: tune them on two to four weeks of your own data before alerting. All technique IDs are ATT&CK v20.
| Detection | Logic | Main tuning concern | ATT&CK |
|---|---|---|---|
| Service principal token used from a new IP | Join app-only requests to AADServicePrincipalSignInLogs; alert when the Graph IPAddress differs from the sign-in IP for a workload that normally runs from fixed egress | Workloads behind NAT pools or multi-region runners; build an allow list per app | T1528, T1550.001 |
| User session reused from a second IP | Same SessionId or token seen at sign-in and at Graph from different IPs within minutes, with Graph use after the sign-in | Users switching networks, mobile carriers, VPN reconnects | T1550.001, T1078.004 |
| Directory enumeration burst | Many successful GETs from one IP and client to users, groups, members, owners, servicePrincipals, applications, roleManagement and devices endpoints in a short window | Admin portals, IGA and backup tools that crawl the directory on schedule | T1087.004, T1069.003 |
| Directory role member added through Graph | POST to directoryRoles/{id}/members/$ref or to roleManagement/directory/roleAssignments with a 2xx response, especially by an app-only caller | PIM and provisioning automation; enumerate and exclude known callers by AppId | T1098.003 |
| Credential added to an app or service principal | POST to applications/{id}/addPassword, addKey or the servicePrincipals equivalents, correlated with the Entra audit event | Certificate rotation pipelines; expect them at known times | T1098.001 |
| Mail sent by an app on behalf of users | POST to sendMail with a 202 by an AppId that has not sent mail before, or to many recipients from one user token | Notification apps; note that 202 confirms submission, not delivery | T1534 |
| Mailbox and file reads outside baseline | Distinct mailboxes or drives read per AppId versus its trailing baseline | Covered fully in the Microsoft Graph Exfiltration Detection guide | T1114.002, T1530 |
| Mass user deletion | Several DELETE calls to /users/{id} with 204 from one caller in a short window | Joiner, mover and leaver automation | T1531 |
| Permission probing | Burst of 401 and 403 responses from one AppId or user across many resource types | Misconfigured apps after a permission change | T1087.004 |
Microsoft's threat hunting team published a reconnaissance pattern for tools such as GraphRunner and AzureHound: normalise URIs, filter to a list of directory endpoints, bin requests into two-minute windows by IP and caller, and flag windows with a span under 100 seconds that contain either at least 40 requests across at least three distinct endpoints, or more than 100 requests. Treat those numbers as a starting point, as Microsoft does, and add endpoints you see in your own tenant such as /policies/authorizationPolicy, /organization and roleManagement/directory/estimateAccess.
For the service principal replay rule, the approach published in Nicola Suter's open ITDR detection set compares the IP in AADServicePrincipalSignInLogs with the IP of the Graph request (and of Azure Resource Manager calls in AzureActivity) for the same token identifier. It works best for workloads that use workload identity federation or managed identities from known runners, because an attacker who exfiltrates a short-lived token from a CI job will replay it from somewhere else. For user sessions, Elastic's prebuilt rule for suspicious session reuse to Graph access uses a five-minute window, requires more than one source IP for the same session, and lists network switching as the main false positive.
Where identity fits
Most of the high-value Graph activity in a tenant is made by non-human identities: service principals, managed identities and the automation behind them. App-only calls carry application permissions in the Roles field, and those permissions are tenant-wide unless scoped. Keep an inventory of which service principals hold permissions such as RoleManagement.ReadWrite.Directory, AppRoleAssignment.ReadWrite.All, Application.ReadWrite.All and Mail.ReadWrite, and give their Graph behaviour the tightest baselines and the lowest alert thresholds. The How to find high-privilege Microsoft Graph application permissions guide shows how to build that list. ClientAuthMethod is a useful identity signal here: a workload that has always authenticated with a certificate (2) and suddenly calls with a client secret (1) usually means someone added a secret.
Responding to a token abuse alert
- Scope the token and session: pull every Graph request with the same UniqueTokenId, SessionId and SignInActivityId, plus all requests from the suspect IP, for the full token lifetime.
- Classify what was touched: group normalised URIs by method; reads of directory objects point to reconnaissance, writes to roles, credentials or consent grants point to persistence, and mail or drive content paths point to collection.
- Contain a user: call
revokeSignInSessionson the user, which resets signInSessionsValidFromDateTime and invalidates refresh tokens and browser session cookies; Microsoft notes revocation can take a few minutes and does not apply to external users signing in through their home tenant. Issued access tokens remain a concern until they expire unless the resource enforces Continuous Access Evaluation. - Contain a workload: remove added credentials, rotate the remaining ones, and disable the service principal if business impact allows. See How to investigate a compromised Azure service principal.
- Undo changes: reverse role assignments, app role grants and consent made during the window, confirmed against the Entra audit log.
- Preserve evidence: export the joined Graph and sign-in rows, the audit events and the app's permission state at the time, before retention or remediation changes them.
Continuous Access Evaluation helps here: critical events such as account disable, password reset and an administrator revoking refresh tokens are pushed to supporting services, and Microsoft documents that Exchange Online, SharePoint Online, Teams and Microsoft Graph can evaluate key Conditional Access policies within the service. See CAEP and Continuous Access Evaluation for the mechanics.
Choosing your approach
- Small tenants without a SIEM: send the logs to a Log Analytics workspace, run the reconnaissance, role-write and credential-add rules as scheduled queries, and keep 12 months in Storage for investigations.
- Large tenants: apply a transformation that keeps the detection columns, keep write methods at full fidelity, and put the session reuse and enumeration rules into risk-based scoring rather than direct alerts. See the Correlation Rules and Risk Based Alerting Guide.
- Third-party SIEM: stream Graph and all sign-in categories through the same Event Hub path so the token join runs on one platform; confirm the field names your connector maps, since some rename the token and session fields.
- Direct alert versus hunt: alert directly on role member adds and credential adds by unexpected callers; hunt weekly on enumeration bursts and 403 storms until baselines are stable.
Detection and measurement
- Ingestion health: hourly row count per tenant with an alert on a drop of more than half against the same hour last week, and median delay between TimeGenerated and ingestion time.
- Join coverage: percentage of non-Microsoft app requests whose SignInActivityId matches a sign-in row; a sudden fall usually means a sign-in category stopped flowing.
- Privileged app coverage: share of service principals with high-impact Graph permissions that have a per-app baseline and an owner.
- Rule precision: true positive rate per rule over a rolling 90 days, with rules under your floor sent back for tuning.
- Time to contain: minutes from alert to session revocation or credential removal for confirmed token abuse.
Framework mapping
| Framework | Reference | How this guide applies it |
|---|---|---|
| NIST CSF 2.0 | DE.CM-03, DE.AE-02, DE.AE-03 | Monitor technology usage, analyse adverse events, correlate Graph with sign-in data |
| NIST SP 800-53 Rev. 5 | AU-2, AU-6(5), AU-11, AU-12, SI-4 | Log Graph events, integrated analysis across sources, retention, system monitoring |
| CIS Controls v8.1 | 8.2, 8.9, 8.11 | Collect audit logs, centralise them, review them for anomalies |
| ISO/IEC 27001:2022 Annex A | 8.15, 8.16 | Logging and monitoring activities |
| MITRE ATT&CK v20 | T1528, T1550.001, T1087.004, T1069.003, T1098.001, T1098.003, T1534, T1114.002, T1530, T1531 | Techniques the detection table covers |
Common failure patterns
- Collecting Graph logs without the sign-in categories: the token join returns nothing and replay rules never fire. Turn on all four Entra sign-in streams in the same change.
- Trimming the wrong columns: a cost transformation that drops SignInActivityId or SessionId silently breaks every token rule. Review transformations as detection changes.
- Short sign-in lookback: joining to one hour of sign-ins misses long-lived tokens and turns normal traffic into false "unmatched token" alerts.
- Counting batches as one request: enumeration through
$batchhides inside a single call unless you count sub-requests by OperationId. - Alerting on every IP mismatch: user session rules without network-switch handling flood the queue; start with service principals on fixed egress, where mismatches are rare.
- Exempting all Microsoft first-party apps: attackers use legitimate client IDs too. Exempt by AppId and behaviour, not by publisher.
Practitioner checklist
- Confirm Entra ID P1 or P2 and create a diagnostic setting for MicrosoftGraphActivityLogs, recording the go-live date.
- Stream all four Entra sign-in categories and the audit log to the same platform.
- Keep at least 12 months of Graph logs, in cold storage if the SIEM retention is shorter.
- Protect the detection columns in any transformation and test rules after any table plan change.
- Build a reusable Graph-to-sign-in join on SignInActivityId and UniqueTokenIdentifier with a lookback of at least 28 hours.
- Deploy direct alerts for role member adds and credential adds by unexpected callers.
- Deploy enumeration, session reuse and service principal IP mismatch rules in hunting mode, then promote after tuning.
- Inventory service principals with high-impact Graph permissions and baseline each one.
- Write the containment runbook: revoke sessions, remove credentials, reverse changes, preserve evidence.
- Monitor ingestion volume, delay and join coverage as health metrics.
Standards and references
- Microsoft Learn: Access Microsoft Graph activity logs
- Microsoft Learn: MicrosoftGraphActivityLogs table reference
- Microsoft Learn: Access token claims reference
- Microsoft Learn: Continuous access evaluation
- Microsoft Learn: user revokeSignInSessions
- Microsoft Security Experts: Hunting with Microsoft Graph activity logs
- Nicola Suter ITDR: Service principal access token replay detection
- Elastic: Microsoft Entra ID suspicious session reuse to Graph access
Related NHI Mgmt Group resources: Microsoft Graph Exfiltration Detection, Entra ID Sign-In and Audit Log Detection Guide, How to detect adversary-in-the-middle phishing and session token replay in Entra ID, Microsoft 365 Unified Audit Log Guide for Detection, Okta System Log Detection Guide.