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#
- Open the Microsoft Entra admin center and go to Identity → Applications → App registrations → New registration.
- Name it
Logthread audit reader, choose Accounts in this organizational directory only, leave Redirect URI empty, and choose Register. - On the app's Overview page, copy the Application (client) ID and the Directory (tenant) ID. Both are GUIDs.
- 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):
| Integration | API | Permission | Why |
|---|---|---|---|
| Entra ID | Microsoft Graph | AuditLog.Read.All | Read the sign-in logs and directory audit logs |
| Entra ID | Microsoft Graph | Directory.Read.All | Graph needs it alongside AuditLog.Read.All to return the audit logs |
| Microsoft 365 | Office 365 Management APIs | ActivityFeed.Read | Read the unified audit log through the Management Activity API, and the DLP alerts when you turn them on |
| Entra ID, optional | Microsoft Graph | RoleManagement.Read.Directory | Only 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.
3. Grant admin consent#
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.
| Question | Answer |
|---|---|
| Directory (tenant) ID | From the app's Overview page |
| Application (client) ID | From the same page |
| Client secret value | The secret's Value. It is stored encrypted and never shown again. |
| Client secret expires on | The 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.outcomeservice:microsoft-365 | stats count() by m365.workload, event.actionFailed sign-ins by user:
service:entra-id event.outcome:failure | stats count() by user.nameWhere sign-ins come from:
service:entra-id event.category:authentication | stats count() by source.geo.country_iso_codeThe 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.
| Detection | Fires when | Reads |
|---|---|---|
| Sign-ins from two countries within an hour | a user signs in successfully from 2 or more countries within 60 minutes | Entra ID |
| MFA fatigue | 5 or more MFA prompts denied or not answered for one user within 15 minutes | Entra ID, Microsoft 365 |
| Sign-in over legacy authentication | a successful sign-in over IMAP, POP, SMTP, Exchange ActiveSync or older Office clients | Entra ID |
| High-risk sign-in | Entra ID Protection rates a sign-in high risk (needs P2) | Entra ID |
| Directory role granted | a user is added to a directory role, directly, as eligible or through PIM | Entra ID, Microsoft 365 |
| Mail forwarded to an outside address | an inbox rule or mailbox setting forwards or redirects mail to another domain | Microsoft 365 (Exchange) |
| Mass file download from SharePoint or OneDrive | 200 or more downloads by one user within 15 minutes | Microsoft 365 (SharePoint) |
| Mass file deletion in SharePoint or OneDrive | 100 or more files or folders deleted by one user within 15 minutes | Microsoft 365 (SharePoint) |
| Brute force from one address | more than 10 failed sign-ins from one address within 10 minutes | all sign-in sources |
| Password spraying | failed sign-ins for 5 or more users from one address within 15 minutes | all 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-InboxRuleandSet-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.name7. 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 field | Logthread field |
|---|---|
status.errorCode 0 | event.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.errorCode | event.outcome: failure |
userPrincipalName, userId, userDisplayName | user.name, user.id, user.display_name |
ipAddress | source.address |
location.countryOrRegion, .city, .state | source.geo.country_iso_code, source.geo.city_name, source.geo.region_name |
status.errorCode, status.failureReason | entra.status.error_code, entra.status.reason |
clientAppUsed | entra.client_app, and entra.legacy_auth: true when it is not Browser or Mobile Apps and Desktop clients |
the higher of riskLevelDuringSignIn and riskLevelAggregated | entra.risk_level |
appDisplayName, resourceDisplayName, conditionalAccessStatus, deviceDetail | entra.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 field | Logthread field |
|---|---|
activityDisplayName | event.action (snake case) and entra.activity |
result | event.outcome |
initiatedBy.user.userPrincipalName (or the app's name) | user.name |
initiatedBy.user.ipAddress | source.address |
the first target's userPrincipalName | user.target.name |
the Role.DisplayName change | entra.role.name |
category, operationType | entra.category, entra.operation_type |
Severity: warn on failure or a role change, otherwise info.
Microsoft 365#
| Microsoft field | Logthread field |
|---|---|
Operation | event.action (snake case) and m365.operation |
ResultStatus | event.outcome |
UserId | user.name |
ClientIP (port and brackets removed) | source.address |
Workload, RecordType, ObjectId | m365.workload, m365.record_type, m365.object_id |
Entra UserLoggedIn, UserLoginFailed | event.category: authentication, event.action: sign_in, entra.status.error_code from ErrorNumber (same outcome rule as above) |
| SharePoint and OneDrive file operations | event.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 says | What to do |
|---|---|
| Microsoft refused the client secret | The 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 tenant | Copy the Application (client) ID from the app's Overview page, in the same tenant as the tenant id. |
| Microsoft does not know the tenant id | Copy the Directory (tenant) ID from the app's Overview page. |
| Microsoft Graph refused to read the audit log | Add 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 app | Add 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 roles | Add 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 licence | Directory 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 available | In Microsoft Purview, open Audit and choose Start recording user and admin activity. It can take up to a day to apply. |
| Throttled | Microsoft 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.
- 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.
- 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.
- 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.
- 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.
- In the app registration, add Microsoft Graph → Application permissions →
RoleManagement.Read.Directoryand choose Grant admin consent. MFA registration usesAuditLog.Read.All, which you granted already. - 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:
| What | Microsoft Graph (v1.0) | Needs |
|---|---|---|
| Active role assignments: user, group or app, role, scope | GET /roleManagement/directory/roleAssignments?$expand=principal and the role definitions | RoleManagement.Read.Directory |
| Eligible role assignments through Privileged Identity Management, with their end date | GET /roleManagement/directory/roleEligibilitySchedules?$expand=principal | Entra ID P2 (or Entra ID Governance) |
| Each user's MFA registration: registered, capable, methods, admin | GET /reports/authenticationMethods/userRegistrationDetails | AuditLog.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 field | Logthread field |
|---|---|
Operation DlpRuleMatch, DlpRuleUndo, DlpInfo | event.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, .PolicyId | m365.dlp.policy.name, m365.dlp.policy.id (comma separated when several match) |
Rules[].RuleName, .Severity, .Actions, .OverriddenActions, .RuleMode | m365.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 Count | m365.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 happened | m365.dlp.workload, m365.dlp.location (site, mailbox or device), event.category (file or email) |
| SharePoint and OneDrive document | file.name, file.path, m365.site, m365.dlp.external_access: true when outside users can open it |
| Exchange message | m365.dlp.recipient_count only: never the subject, the message id or the user agent |
| Endpoint device | host.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):
| Detection | Fires when | Severity |
|---|---|---|
| High-severity DLP policy match | a high-severity rule matches, one incident per user (MITRE T1567, T1048) | critical |
| Many DLP policy matches by one user | 20 or more matches by one user within 60 minutes | warning |
| DLP policy overridden by a user | a 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.nameThe 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.