Join our Newsletter — 33% off our NHI Course
Home› Guides› Microsoft Graph Activity Logs: Enabling, Schema and Token…
Guide SOC & Detection Engineering

Microsoft Graph Activity Logs: Enabling, Schema and Token Abuse Detections

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 16 min read
On this page

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.

DestinationUse it forDetection trade-off
Log Analytics workspace (Microsoft Sentinel)KQL rules, joins to SigninLogs and AuditLogs, workbooksFull query capability on the Analytics plan; the table also supports the Basic and Auxiliary plans and workspace transformations, at reduced query capability
Event Hubs namespaceStreaming to a third-party SIEM or data lakeYou must also stream the four Entra sign-in log categories to the same platform, or the token joins below cannot run
Storage accountLong retention and investigation backfillCheap 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.

FieldWhat it holdsDetection use
AppId, ServicePrincipalIdClient application ID and the calling service principalPer-app baselines; app-only calls have an AppId and no UserId
UserIdObject ID of the signed-in user, for delegated callsJoin to risky users and identity data; empty for app-only tokens
SignInActivityIdIdentifier of the sign-in activity that issued the tokenJoin key to UniqueTokenIdentifier in the sign-in logs
UniqueTokenIdUnique identifier of the token used for the callGroup every request made with one token
SessionIdIdentifier of the authentication sessionFollow one session across many tokens and IPs
TokenIssuedAtTime the token was issuedSpot tokens used long after issue, from a new place
IPAddress, UserAgent, DeviceIdClient IP, user agent string, device of the authentication requestIssuance versus use comparisons; tool and script user agents
ClientAuthMethod0 public client, 1 client ID and secret, 2 client certificateFlag a service principal that normally uses a certificate suddenly calling with a secret
Roles, ScopesApplication permissions (roles) and delegated scopes (scp) in the tokenTie behaviour to granted permissions, such as RoleManagement.ReadWrite.Directory
WidsTenant-wide Entra role template IDs held by the userRaise priority when the caller holds a privileged role
RequestUri, RequestMethod, ResponseStatusCode, ResponseSizeBytesWhat was called, how, the result and response sizeEndpoint classes, write detection, failure bursts (401, 403), throttling (429)
OperationIdBatch identifier, shared by all requests in a $batchCount batched sub-requests correctly instead of as one call
ConditionalAccessStatusConditional Access status Graph recorded for the requestContext 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.

DetectionLogicMain tuning concernATT&CK
Service principal token used from a new IPJoin app-only requests to AADServicePrincipalSignInLogs; alert when the Graph IPAddress differs from the sign-in IP for a workload that normally runs from fixed egressWorkloads behind NAT pools or multi-region runners; build an allow list per appT1528, T1550.001
User session reused from a second IPSame SessionId or token seen at sign-in and at Graph from different IPs within minutes, with Graph use after the sign-inUsers switching networks, mobile carriers, VPN reconnectsT1550.001, T1078.004
Directory enumeration burstMany successful GETs from one IP and client to users, groups, members, owners, servicePrincipals, applications, roleManagement and devices endpoints in a short windowAdmin portals, IGA and backup tools that crawl the directory on scheduleT1087.004, T1069.003
Directory role member added through GraphPOST to directoryRoles/{id}/members/$ref or to roleManagement/directory/roleAssignments with a 2xx response, especially by an app-only callerPIM and provisioning automation; enumerate and exclude known callers by AppIdT1098.003
Credential added to an app or service principalPOST to applications/{id}/addPassword, addKey or the servicePrincipals equivalents, correlated with the Entra audit eventCertificate rotation pipelines; expect them at known timesT1098.001
Mail sent by an app on behalf of usersPOST to sendMail with a 202 by an AppId that has not sent mail before, or to many recipients from one user tokenNotification apps; note that 202 confirms submission, not deliveryT1534
Mailbox and file reads outside baselineDistinct mailboxes or drives read per AppId versus its trailing baselineCovered fully in the Microsoft Graph Exfiltration Detection guideT1114.002, T1530
Mass user deletionSeveral DELETE calls to /users/{id} with 204 from one caller in a short windowJoiner, mover and leaver automationT1531
Permission probingBurst of 401 and 403 responses from one AppId or user across many resource typesMisconfigured apps after a permission changeT1087.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

  1. 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.
  2. 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.
  3. Contain a user: call revokeSignInSessions on 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.
  4. 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.
  5. Undo changes: reverse role assignments, app role grants and consent made during the window, confirmed against the Entra audit log.
  6. 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

FrameworkReferenceHow this guide applies it
NIST CSF 2.0DE.CM-03, DE.AE-02, DE.AE-03Monitor technology usage, analyse adverse events, correlate Graph with sign-in data
NIST SP 800-53 Rev. 5AU-2, AU-6(5), AU-11, AU-12, SI-4Log Graph events, integrated analysis across sources, retention, system monitoring
CIS Controls v8.18.2, 8.9, 8.11Collect audit logs, centralise them, review them for anomalies
ISO/IEC 27001:2022 Annex A8.15, 8.16Logging and monitoring activities
MITRE ATT&CK v20T1528, T1550.001, T1087.004, T1069.003, T1098.001, T1098.003, T1534, T1114.002, T1530, T1531Techniques 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 $batch hides 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

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.

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.