Free plan available. Set up in minutes with the collectors you already use. Start free
Logthread

Guide

Microsoft 365 and Entra ID

Logthread reads your Microsoft Entra ID sign-ins and directory changes, and the Microsoft 365 audit log (Exchange, SharePoint, OneDrive, Teams and more), every 5 minutes. It uses one read-only app registration in your tenant. The records arrive already in Logthread's security fields, so the identity detections, brute force and password spraying, Threads and Explore work on them at once. Nothing is installed, and Logthread changes nothing in your tenant except one thing Microsoft requires: on the first read it turns on the Microsoft 365 audit-log subscriptions you chose (Exchange, SharePoint, Azure AD, General, and DLP when you turn it on), so the audit log becomes available to read.

This guide covers Microsoft only. For the whole security setup (sources, detections, findings, compliance), see Logthread as your SIEM.

Both integrations are in beta.

What you need#

  • A Microsoft Entra administrator who can register an app and grant admin consent: a Privileged Role Administrator or a Global Administrator.
  • For Entra ID sign-in logs: a Microsoft Entra ID P1 or P2 licence. Directory changes need no extra licence. Risk levels (for high-risk sign-ins) need P2.
  • For Microsoft 365: auditing turned on in Microsoft Purview → Audit. It is on by default.
  • Optional, for privileged roles and MFA registration: one more permission, RoleManagement.Read.Directory. Eligible (PIM) roles need Entra ID P2, and MFA registration needs P1 or P2.
  • Optional, for DLP alerts: data loss prevention policies in Microsoft Purview. No extra permission.
  • In Logthread: the Admin role, to add an integration.

1. Register an app in your tenant#

  1. Open the Microsoft Entra admin center and go to Identity → Applications → App registrations → New registration.
  2. Name it Logthread audit reader, choose Accounts in this organizational directory only, leave Redirect URI empty, and choose Register.
  3. On the app's Overview page, copy the Application (client) ID and the Directory (tenant) ID. Both are GUIDs.
  4. Under Certificates & secrets → Client secrets → New client secret, choose an expiry (up to 24 months) and copy the secret's Value, not its Secret ID. The value is shown only once. Note the date in the Expires column: Logthread asks for it, and reminds you 30 days before.

One registration can serve both integrations. Logthread's form asks first: Connect Entra ID, Microsoft 365, or both? Choose Both to add the two with one registration in one go.

2. Give it read-only permissions#

Under API permissions → Add a permission, add these Application permissions (not delegated ones):

IntegrationAPIPermissionWhy
Entra IDMicrosoft GraphAuditLog.Read.AllRead the sign-in logs and directory audit logs
Entra IDMicrosoft GraphDirectory.Read.AllGraph needs it alongside AuditLog.Read.All to return the audit logs
Microsoft 365Office 365 Management APIsActivityFeed.ReadRead the unified audit log through the Management Activity API, and the DLP alerts when you turn them on
Entra ID, optionalMicrosoft GraphRoleManagement.Read.DirectoryOnly for Privileged roles and MFA registration: read who holds each directory role, active and eligible

None of these permissions can change anything. Add only the ones for the integrations you use: the Before you start card in Logthread lists exactly the permissions for what you chose, in one step. If you choose both, add all three before granting consent, or the second integration fails on the missing one.

Still under API permissions, choose Grant admin consent for your organization and confirm. The Status column turns Granted for each permission. Without consent, Microsoft refuses every request, and the connection page in Logthread says so.

4. Connect in Logthread#

Open Integrations, search for Microsoft Entra ID or Microsoft 365 (category Security). The page first asks Connect Entra ID, Microsoft 365, or both?; its Before you start card then repeats steps 1 to 3 for that choice. Fill in the form once, even for both.

QuestionAnswer
Directory (tenant) IDFrom the app's Overview page
Application (client) IDFrom the same page
Client secret valueThe secret's Value. It is stored encrypted and never shown again.
Client secret expires onThe date in the secret's Expires column (Certificates & secrets). Where do I find this? beside the question says the same.

Microsoft 365 also asks:

  • Which audit logs to read. You can choose Exchange (mailboxes, inbox rules, forwarding), SharePoint and OneDrive (files and sharing), everything else (Teams, Power Platform, Defender and more), and Entra sign-ins and directory changes. Entra sign-ins starts off when you add Entra ID too, or already have it, and the form says why: with both on, every sign-in would be counted twice.
  • Your email domains (optional), for example acme.com,acme.co.uk. Mail forwarded to any other domain counts as outside. Each user's own domain always counts as yours.

Choose Continue. Logthread starts reading at once and then every 5 minutes. The first poll reads the last 24 hours.

5. Test the connection and check the first records#

On the connection page, choose Test connection. Logthread signs in as the app and reads the audit log once, now. If something is wrong (a wrong id or secret, a missing permission, missing consent, a missing licence), the page says what to fix. Otherwise it shows how many new records arrived.

  • Entra ID: sign-ins and directory changes of the last 24 hours arrive with the first poll, as service entra-id.
  • Microsoft 365: the first poll turns on the audit subscriptions you chose. Microsoft makes the first content available up to 12 hours after a subscription starts. After that, records arrive about an hour after each event, as service microsoft-365. Until the first record, the connection page says "Microsoft delays the first Microsoft 365 records by up to 12 hours; this is normal", with when you connected and when to expect them.

Check what arrived in Explore:

service:entra-id event.category:authentication | stats count() by event.outcome
service:microsoft-365 | stats count() by m365.workload, event.action

Failed sign-ins by user:

service:entra-id event.outcome:failure | stats count() by user.name

Where sign-ins come from:

service:entra-id event.category:authentication | stats count() by source.geo.country_iso_code

The connection page also offers alerts, each with how many records it matched in the last 24 hours.

6. Turn on the detections#

The connection page's last step opens them: for Entra ID, Turn on the detections shows the ones for Entra sign-ins; for Microsoft 365, Turn on security detections for your data shows them all. You can also open Security → SIEM. Each detection shows its MITRE ATT&CK technique and how many records it could read in the last 24 hours. Turn on recommended switches on the ones that fit your data in one go, after you pick where to notify; Use opens the rule editor with one detection filled in: preview it on your data, pick a channel and save.

DetectionFires whenReads
Sign-ins from two countries within an houra user signs in successfully from 2 or more countries within 60 minutesEntra ID
MFA fatigue5 or more MFA prompts denied or not answered for one user within 15 minutesEntra ID, Microsoft 365
Sign-in over legacy authenticationa successful sign-in over IMAP, POP, SMTP, Exchange ActiveSync or older Office clientsEntra ID
High-risk sign-inEntra ID Protection rates a sign-in high risk (needs P2)Entra ID
Directory role granteda user is added to a directory role, directly, as eligible or through PIMEntra ID, Microsoft 365
Mail forwarded to an outside addressan inbox rule or mailbox setting forwards or redirects mail to another domainMicrosoft 365 (Exchange)
Mass file download from SharePoint or OneDrive200 or more downloads by one user within 15 minutesMicrosoft 365 (SharePoint)
Mass file deletion in SharePoint or OneDrive100 or more files or folders deleted by one user within 15 minutesMicrosoft 365 (SharePoint)
Brute force from one addressmore than 10 failed sign-ins from one address within 10 minutesall sign-in sources
Password sprayingfailed sign-ins for 5 or more users from one address within 15 minutesall sign-in sources

Each finding opens one incident per user or address. From the incident, Follow it in Threads shows everything that user or address did across your services.

Limits to know:

  • Two countries compares countries, not distance or speed. Neighbouring countries and a VPN exit abroad also fire it, and a long trip inside one country never does. To leave out your VPN, add its addresses to the rule, for example -source.address:198.51.100.10.
  • Mass download leaves out OneDrive sync-client downloads (file_sync_downloaded_full). A new device's first sync makes thousands of them.
  • Forwarding reads New-InboxRule, Set-InboxRule and Set-Mailbox. Inbox rules saved from Outlook itself (UpdateInboxRules) are not read yet.

To review a user's sign-ins from several countries yourself:

service:entra-id event.category:authentication event.outcome:success source.geo.country_iso_code:* | stats count_distinct(source.geo.country_iso_code) by user.name

7. What each field becomes#

Every record carries observer.vendor: Microsoft, observer.product (Entra ID or Microsoft 365), cloud.provider: azure, cloud.account.id (your tenant id) and event.kind: event. event.action is Microsoft's operation name in snake case: Add member to role. becomes add_member_to_role, FileDownloaded becomes file_downloaded, New-InboxRule becomes new_inbox_rule. The original name is kept under entra.* or m365.*.

Entra ID sign-ins#

event.category: authentication, event.action: sign_in.

Microsoft fieldLogthread field
status.errorCode 0event.outcome: success
status.errorCode of a prompt the user goes on to answer (MFA, consent, account picker, keep me signed in: 16000, 16001, 50072, 50074, 50076, 50079, 50097, 50125, 50140, 50158, 50199, 81010, 81012)event.outcome: unknown, so an office's morning MFA prompts are never a brute force
any other status.errorCodeevent.outcome: failure
userPrincipalName, userId, userDisplayNameuser.name, user.id, user.display_name
ipAddresssource.address
location.countryOrRegion, .city, .statesource.geo.country_iso_code, source.geo.city_name, source.geo.region_name
status.errorCode, status.failureReasonentra.status.error_code, entra.status.reason
clientAppUsedentra.client_app, and entra.legacy_auth: true when it is not Browser or Mobile Apps and Desktop clients
the higher of riskLevelDuringSignIn and riskLevelAggregatedentra.risk_level
appDisplayName, resourceDisplayName, conditionalAccessStatus, deviceDetailentra.app, entra.resource, entra.conditional_access, entra.device.*

Severity: info on success, warn on failure or medium risk, error on high risk.

Entra ID directory changes#

event.category: iam (or configuration for policy changes).

Microsoft fieldLogthread field
activityDisplayNameevent.action (snake case) and entra.activity
resultevent.outcome
initiatedBy.user.userPrincipalName (or the app's name)user.name
initiatedBy.user.ipAddresssource.address
the first target's userPrincipalNameuser.target.name
the Role.DisplayName changeentra.role.name
category, operationTypeentra.category, entra.operation_type

Severity: warn on failure or a role change, otherwise info.

Microsoft 365#

Microsoft fieldLogthread field
Operationevent.action (snake case) and m365.operation
ResultStatusevent.outcome
UserIduser.name
ClientIP (port and brackets removed)source.address
Workload, RecordType, ObjectIdm365.workload, m365.record_type, m365.object_id
Entra UserLoggedIn, UserLoginFailedevent.category: authentication, event.action: sign_in, entra.status.error_code from ErrorNumber (same outcome rule as above)
SharePoint and OneDrive file operationsevent.category: file, file.path, file.name, m365.site
Exchange forwarding parameters (ForwardTo, ForwardAsAttachmentTo, RedirectTo, ForwardingSmtpAddress)m365.forward.to, and m365.forward.external: true when an address is outside your domains

Severity: warn on failure or an outside forward, otherwise info.

8. Follow a user or an address#

In Explore, open any record and choose Open thread next to user.name or source.address. The thread shows every record with that value across your services: the user's sign-ins, the mail rules they changed, the files they downloaded, and what your own applications logged for them.

9. Troubleshooting#

The connection page shows the last poll and, when it failed, Microsoft's reason in plain words. Logthread tries again by itself: after an hour for credential, consent and licence errors, sooner for outages.

The page saysWhat to do
Microsoft refused the client secretThe secret is wrong or has expired. Create a new one and choose Replace secret on the connection page (see Replace the client secret). Copy the secret's Value, not its ID.
The application (client) id is not an app in this tenantCopy the Application (client) ID from the app's Overview page, in the same tenant as the tenant id.
Microsoft does not know the tenant idCopy the Directory (tenant) ID from the app's Overview page.
Microsoft Graph refused to read the audit logAdd AuditLog.Read.All and Directory.Read.All as application permissions, then Grant admin consent. Consent can take a few minutes to apply.
The Office 365 Management API refused the appAdd ActivityFeed.Read (Office 365 Management APIs) as an application permission, then Grant admin consent.
The Office 365 Management API refused the DLP alerts (DLP.All)Check that ActivityFeed.Read has admin consent. If it has, add ActivityFeed.ReadDlp and Grant admin consent, or turn DLP alerts off.
Microsoft Graph refused to read the directory rolesAdd RoleManagement.Read.Directory (Microsoft Graph, application) and Grant admin consent. Shown under Compliance, Access review, and on Home.
Entra ID sign-in logs need a P1 or P2 licenceDirectory changes still arrive. Without the licence, read sign-ins through Microsoft 365 with Entra sign-ins switched on.
The tenant's audit log is not availableIn Microsoft Purview, open Audit and choose Start recording user and admin activity. It can take up to a day to apply.
ThrottledMicrosoft asked Logthread to slow down. It waits as long as Microsoft asks and then carries on from where it stopped. Nothing is lost.

Other things to know:

  • Sign-ins appear a few minutes late. Microsoft writes sign-in and audit records several minutes after they happen. Each poll reads the last 30 minutes again to catch late records, and sends each record only once.
  • Microsoft 365 is quiet for the first hours. Content becomes available up to 12 hours after a subscription starts, and about an hour after each event after that.
  • After a backlog, for example a long outage, Logthread works through the missed records in order, up to 5,000 per audit log per poll, without skipping any.
  • Replace the secret before it expires. Home warns 30 days before; see the next section.

Only Microsoft's commercial cloud is supported. Government and national clouds are not supported yet.

10. Replace the client secret#

Secrets expire after at most 24 months. From 30 days before the date you gave, Home shows Microsoft secret expires in N days with Rotate. The connection page shows the date, and Replace secret works at any time.

  1. In the Microsoft Entra admin center, open the app registration (the page shows its client ID), then Certificates & secrets → Client secrets → New client secret. Copy its Value.
  2. Paste it with its expiry date and choose Save and test. Logthread first signs in with it for every Microsoft integration on that app registration (Entra ID and Microsoft 365 together) and stores it, encrypted, only if every sign-in works. If Microsoft refuses it, nothing changes and the current secret keeps reading. It then reads once, straight away.
  3. Once it says the new secret works, delete the old secret under Certificates & secrets.

Keep the old secret until step 2 succeeds, so reading never stops.

Integrations added before Logthread asked for the expiry date show Add your Microsoft secret's expiry date on Home. Set date records it without replacing the secret, so the reminder works.

Privileged roles and MFA registration#

Beta. With the Entra ID integration, Logthread can also read *who holds each directory role* and *who has registered for MFA*. This is a picture of the tenant, read every 6 hours, not a feed of events. It is off until you turn it on.

  1. Turn it on: when you add Entra ID, tick Privileged roles and MFA registration. For an integration you already have, open it under Integrations and tick it under What Logthread reads, or choose Turn on in Compliance → Access review.
  2. In the app registration, add Microsoft Graph → Application permissions → RoleManagement.Read.Directory and choose Grant admin consent. MFA registration uses AuditLog.Read.All, which you granted already.
  3. The first snapshot runs within 15 minutes. Take a snapshot now under Compliance → Access review starts one at once; it runs in the background and the page tells you when it is done.

Each snapshot reads, with your app registration:

WhatMicrosoft Graph (v1.0)Needs
Active role assignments: user, group or app, role, scopeGET /roleManagement/directory/roleAssignments?$expand=principal and the role definitionsRoleManagement.Read.Directory
Eligible role assignments through Privileged Identity Management, with their end dateGET /roleManagement/directory/roleEligibilitySchedules?$expand=principalEntra ID P2 (or Entra ID Governance)
Each user's MFA registration: registered, capable, methods, adminGET /reports/authenticationMethods/userRegistrationDetailsAuditLog.Read.All, Entra ID P1 or P2

Each part is read on its own. A missing licence or permission leaves that part empty, says why on the access review, and Home lists a missing permission. The other parts are still kept. A role Microsoft marks privileged is shown as privileged: Global Administrator, Privileged Role Administrator, Security Administrator, Exchange Administrator and others. A group that holds a role is listed as the group: its members are not expanded.

Where it shows:

  • Compliance → Access review, under Directory privileged roles (Entra ID) (Admins only; an external reviewer never sees this list): every privileged role holder, active or eligible, with MFA registered yes or no. Privileged users without MFA are flagged. When you choose Record review, the review also records the snapshot you reviewed.
  • The scheduled Identity and credential report (see Scheduled reports).

Logthread keeps the newest two snapshots in full (and, for each part, the last snapshot where it was read), so it can say what changed since the previous good read: role holders added or removed, and users whose MFA registration was removed. It keeps that list of changes for 400 days. Removing the integration or the workspace deletes them.

What working looks like: Compliance → Access review shows the snapshot time and the privileged holders, and no part says Not read. If a part says it needs consent, add the permission it names and grant admin consent; if it needs a licence, eligible assignments need Entra ID P2 (or Entra ID Governance) and MFA registration needs P1 or P2, and the other parts are still read. Home lists a part that failed for any reason other than a licence.

From an AI agent, the MCP tool list_entra_roles (the key's creator must be an admin) returns the same holders with MFA yes, no or unknown and the snapshot time; see MCP. An external reviewer never sees this list or the Identity and credential report.

Price: what privileged roles and MFA registration cost#

No charge of its own: a snapshot holds names, roles and flags, not log data. The Identity and credential report is part of Scheduled reports, an add-on.

DLP alerts (Microsoft Purview)#

Beta. With the Microsoft 365 integration, Logthread can read the Microsoft Purview data loss prevention events (the DLP.All feed of the Office 365 Management Activity API): a policy rule matched in Exchange, SharePoint, OneDrive or on a device, a user overrode a policy, or reported a false positive. It is off until you turn it on: tick DLP alerts from Microsoft Purview when you add Microsoft 365, or later under What Logthread reads on the integration's page. Turning it on later starts the DLP.All subscription at once and tells you if Microsoft refuses it; otherwise the first poll starts it. Microsoft makes its first content available up to 12 hours later.

No matched content is ever stored. Logthread keeps the policy, rule, severity, actions, the sensitive information *type names and counts* and where it happened, never the matched values or their context, a mail's subject, recipients or body. It never reads the matched values: ActivityFeed.Read is the permission it asks for. Microsoft may still require ActivityFeed.ReadDlp (the permission it documents for the matched sensitive values) before it lets an app read the DLP.All feed. If it is refused, only DLP alerts stop: the other Microsoft 365 content keeps being read, the connection stays healthy, and the integration's page and Home show "DLP alerts are not read" with the fix. Add ActivityFeed.ReadDlp (Office 365 Management APIs) with admin consent, and check that Purview audit is on. The message clears on the next successful read, or when you turn DLP alerts off.

Microsoft fieldLogthread field
Operation DlpRuleMatch, DlpRuleUndo, DlpInfoevent.action dlp_rule_match, dlp_rule_undo, dlp_info; event.dataset: dlp, event.kind: alert
UserId (or the document or message sender)user.name
PolicyDetails[].PolicyName, .PolicyIdm365.dlp.policy.name, m365.dlp.policy.id (comma separated when several match)
Rules[].RuleName, .Severity, .Actions, .OverriddenActions, .RuleModem365.dlp.rule.name, m365.dlp.severity (low, medium, high: the highest), m365.dlp.actions, m365.dlp.overridden_actions, m365.dlp.rule_mode
ConditionsMatched.SensitiveInformation[] type name and Countm365.dlp.sensitive_types (Credit Card Number:12,...) and m365.dlp.sensitive_count
ExceptionInfo (override, justification, false positive, reason)m365.dlp.override: true, m365.dlp.justification, m365.dlp.false_positive: true, m365.dlp.reason
Workload and where it happenedm365.dlp.workload, m365.dlp.location (site, mailbox or device), event.category (file or email)
SharePoint and OneDrive documentfile.name, file.path, m365.site, m365.dlp.external_access: true when outside users can open it
Exchange messagem365.dlp.recipient_count only: never the subject, the message id or the user agent
Endpoint devicehost.name, file.extension, m365.dlp.enforcement_mode

Severity: error for a high-severity match, warn for medium or an undo, otherwise info.

Three detections read them (Security → SIEM, search dlp):

DetectionFires whenSeverity
High-severity DLP policy matcha high-severity rule matches, one incident per user (MITRE T1567, T1048)critical
Many DLP policy matches by one user20 or more matches by one user within 60 minuteswarning
DLP policy overridden by a usera user overrides a policy tip, with or without a justification (T1562)warning

When you turn them on with Turn on recommended, the last step offers Escalate the critical detections if nobody acknowledges: pick a delay (60 minutes suggested) and the channels to tell. An unacknowledged high-severity match then reaches them in time for a notice deadline, for example a 6-hour reporting rule. It is an ordinary escalation chain, which you can change on the rule.

To see this week's matches by policy and user:

service:microsoft-365 event.dataset:dlp event.action:dlp_rule_match | stats count() by m365.dlp.policy.name, user.name

The scheduled DLP alerts report (see Scheduled reports) summarises them by policy, rule, severity, workload and user, with overrides, the trend and the DLP incidents. It names users, so an external reviewer never sees it, even approved.

From an AI agent: list_detections with query dlp lists the three detections, and search_logs with the query above returns the matches; see MCP.

Price: what DLP alerts cost#

DLP records are billed as data ingested, ₹85 ($0.90) per GB, like the rest of Microsoft 365; reading them adds no charge. Escalation (Escalate the critical detections) is the escalation add-on and the DLP alerts report is part of Scheduled reports: each is charged only for a month in which it is used. See Prices.