How Wazuh monitors Microsoft 365 audit activity
A security team that needs Exchange, SharePoint, OneDrive and Teams activity in the same place as its endpoint data has a practical question: can the SIEM that already receives agent telemetry also receive Microsoft 365 audit events without a separate tool? In Wazuh, the answer is that Microsoft 365 audit activity is collected through the Office 365 Management Activity API. The Wazuh server, not the agents on endpoints, is the component that authenticates to this API and pulls the audit records. That distinction matters for planning, because the server needs outbound network access to Microsoft's endpoints and a registered application with read permission on the audit feed, while the endpoint estate stays unchanged.
In plain terms, the integration collects audit records for the workloads your tenant has enabled, such as mailbox, file and Teams events, and turns them into JSON events that Wazuh can search. The server polls the API on a schedule, keeps track of what it has already read, and passes each record through its decoders and rules. Decoders extract fields such as the user, operation and workload, and rules decide which events raise alerts. Events that match no rule are still stored for searching, so the team should expect a lot of routine activity to be retained without generating alerts. Stored events reach the Wazuh indexer, which holds alerts and archived events, and analysts see them through the Wazuh dashboard, where Microsoft 365 events can be filtered alongside agent data.
The exact module name, the configuration keys, the required Microsoft 365 subscriptions and the polling options differ between Wazuh releases, so do not copy settings from older guides or forum posts. Confirm them against the Wazuh documentation for the release you run, and check the release notes for changes to the connector before an upgrade. Before you go further, decide which workloads the team needs, who owns the app registration secret, and how the alerting rules will be tested against sample events from your own tenant.
What must be in place before the Microsoft 365 integration starts
The Microsoft 365 integration depends on four things set up before any configuration begins: a Wazuh release and deployment you can confirm, a tenant where someone can register an application and enable auditing, a network path from the Wazuh server to Microsoft's endpoints, and a secure place for credentials and certificates. Each card names what your team must confirm with its own tenant and network owners before the work starts.
Target Wazuh release and deployment
Confirm which Wazuh 4.14 patch level you will run and where it is deployed, because the release notes list frequent 4.14 patch releases and the integration steps should match the version in production. Record whether the server is an all-in-one install, a step-by-step install or a cluster, since a cluster changes where the module configuration lives and how it is restarted. Ask your platform team to confirm the version in writing before a test server is built.
Wazuh release notesTenant admin roles for app registration
Identify who can register an application in Microsoft Entra ID and grant it the permissions the Office 365 Management Activity API needs. Your tenant administrators must confirm whether they will create the app registration themselves or delegate it, and who approves the admin consent. Also confirm who can turn on unified audit logging in Microsoft Purview, since audit collection depends on it being enabled for the tenant.
Outbound network path to Microsoft
The Wazuh server must reach the Microsoft login and Office 365 Management Activity API endpoints over HTTPS. Ask your network owners to confirm outbound rules, any web proxy the server must use, and whether TLS inspection rewrites Microsoft certificates, since inspection often breaks token requests. Test the path from the exact host that will poll the API, not from a workstation, because firewall rules are usually scoped per server.
Credential storage on the Wazuh server
The app registration produces a client identifier and a client secret or certificate that Wazuh uses to request tokens. Decide where these live before configuration: a file readable only by the Wazuh service account, or a secrets manager your organization already operates. Confirm who may read and rotate the secret, and set a calendar reminder for the expiry date that the chosen secret type carries, because an expired secret silently stops collection.
Certificates and trust for the Wazuh server
Confirm that the Wazuh server trusts the certificate chain presented by Microsoft endpoints, including any internal certificate authority your proxy uses. If you use certificate-based app authentication, confirm the certificate's private key permissions and backup location. Also confirm the TLS certificates on the Wazuh dashboard and indexer, since changes to those during the same window complicate troubleshooting.
Change window and rollback owner
Name one person who owns the integration change and one who can revert it. The integration adds configuration to the Wazuh server and creates tenant-level audit settings, so a rollback has two parts. Agree with the security operations and tenant owners which alerts are expected during the first collection cycle so that initial backlog events are not mistaken for an incident.
How Microsoft 365 audit events reach Wazuh alerts
The flow starts with Exchange, SharePoint, OneDrive and Teams audit activity inside the Microsoft 365 tenant, which is exposed through the Office 365 Management Activity API. The Wazuh server, which holds the app registration credentials, polls that API across the network path, then decodes the events and applies rules. Alerts are stored in the Wazuh indexer and shown in the dashboard. Check where the credentials sit, what crosses the network boundary, and which rules match your risky activity.
Audit events move from the Microsoft tenant through the Wazuh server into alerts and dashboards.
Setting up the app registration, subscriptions and Wazuh configuration
This sequence takes a Microsoft 365 tenant from no integration to a Wazuh server that pulls Exchange, SharePoint, OneDrive and Teams audit events through the Office 365 Management Activity API, with each step closed by a check that proves it worked.
Register the application in Microsoft Entra ID
A Microsoft Entra administrator creates an app registration for the Wazuh integration in the tenant that owns the audit logs, recording the application (client) ID and directory (tenant) ID. Keep the registration limited to this single purpose so its permissions and secrets have one owner and one review path. The step is complete when the application appears in the Entra app registrations list with both IDs copied into your change record. Confirm the exact portal navigation with your tenant administrators, because menu layouts change over time.
Grant Management Activity API permissions with admin consent
In the app registration, add the Office 365 Management APIs permissions that read activity feeds, then have a tenant administrator approve them with admin consent. Request only the permissions for the audit sources you intend to collect, since each one widens what the credential can read. The step is complete when the permissions show as granted with admin consent in the API permissions view. A pending or unconsented permission will cause token or content requests to fail later, so check the status column before moving on.
Enable the audit content types to collect
Using the Microsoft 365 audit tooling, confirm that auditing is turned on for the tenant and that the content types you plan to collect, such as Exchange, SharePoint and general Azure Active Directory activity, are available to the subscription. Teams activity is typically covered within the general audit content types, so verify it in your tenant rather than assuming. Record which content types are enabled so the Wazuh module configuration matches them exactly. The step is complete when a test administrative action, such as a sample mailbox or SharePoint setting change, appears in the unified audit log.
Store the client secret or certificate securely on the Wazuh server
Create a client secret or upload a certificate to the app registration, then place the value in a file on the Wazuh server that only root and the Wazuh service account can read. Set restrictive ownership and permissions on the file and avoid pasting the secret into shell history, tickets or shared configuration repositories. Record the secret's expiry date in your credential calendar, because an expired secret stops collection without an obvious dashboard error. The step is complete when the file has restricted permissions and a token request made from the Wazuh server with those credentials returns an access token.
Add the office365 module configuration to the Wazuh server
On the Wazuh server, add the office365 module block to the ossec.conf configuration, referencing the tenant ID, client ID, the secret file, and the content types chosen in the earlier step. Validate the XML structure before continuing, since a malformed block can stop the daemon from starting. Then restart the Wazuh manager service so the module loads the new configuration. The step is complete when the manager restarts cleanly and the log shows the office365 module starting without authentication or subscription errors. Confirm the exact key names against the current module documentation for your Wazuh version.
Confirm subscriptions are enabled and events reach the indexer
Check the Wazuh server logs for each content type subscription being started, then search the Wazuh dashboard for events from the office365 module over the last few hours. Generate a known test event, such as a sharing change on a test SharePoint site or a test mailbox rule, and confirm it appears as an alert or archived event with the expected fields. If nothing arrives, check the manager log for token errors, missing admin consent and subscription status before changing rules. The step is complete when the test event is visible in the dashboard, which proves collection, decoding and indexing work end to end.
Which Microsoft 365 workloads and fields map to Wazuh data
This table maps each Microsoft 365 workload to the audit content type it produces, the key fields to expect, and the dashboard field an analyst will filter on. Confirm every field name against the decoder files shipped with your Wazuh release before writing rules, because names change between releases. Teams and OneDrive events are the workloads most likely to need extra work.
| Workload | Audit content type to confirm | Key fields to confirm | Dashboard filter to check |
|---|---|---|---|
| Exchange Online | Exchange audit records from the Management Activity API | UserId, Operation, ClientIP, ObjectId, ResultStatus | Confirm the office365 data prefix on a test event, then filter on operation and user |
| SharePoint Online | SharePoint audit records from the Management Activity API | UserId, Operation, ClientIP, SiteUrl, SourceFileName, ObjectId | Filter on site and object fields to isolate file access and sharing |
| OneDrive for Business | Typically reported with SharePoint-family events, confirm the content type in your tenant | UserId, Operation, ClientIP, SourceFileName, ObjectId | Separate by workload field, since OneDrive events may share the SharePoint layout |
| Microsoft Teams | General audit records, which may need the general content type subscription | UserId, Operation, Workload, ClientIP, ObjectId | Thin for some operations, so check which events carry a usable object field before alerting |
| Sign-in context (shared) | Azure Active Directory audit content type, if enabled in the same subscription | UserId, ClientIP, ResultStatus, Operation | Use to correlate suspicious workload activity with the user's sign-in source |
| Result and failure status | Present in most workloads but not uniformly named | ResultStatus or equivalent, error codes | Confirm presence per workload before writing success or failure rules |
| Fields needing custom decoding | Nested or workload-specific properties that the shipped decoders may not extract | Nested parameters, custom object paths, Teams-specific details | Plan custom decoders and test them with wazuh-logtest before relying on them |
Which Microsoft 365 activity should trigger alerts first
Start with the few Microsoft 365 events that most often signal a compromised account or data leaving the organization, and leave the rest collected but unalerted until the team understands its own traffic. The first set should cover sign-ins from unusual locations or with failed multi-factor prompts, new inbox rules and mailbox forwarding or delegation changes in Exchange, sharing links created or opened by external users in SharePoint and OneDrive, bulk file downloads, and changes to Teams membership, ownership or tenant settings. Attackers who take over a mailbox usually create a forwarding rule or delegate access early, so those events deserve high severity from day one. Each candidate rule should be traced back to a specific operation name in the audit records that Wazuh receives, and the team should confirm that the rule ID and level it relies on exist in the shipped rule set or in its own custom rules before anyone builds a dashboard on them.
Test every rule against sample events before it pages anyone. Take a known-benign record and a known-suspicious one for each operation, feed them through wazuh-logtest so the decoder and rule chain is visible, and confirm which rule fires and at what level. Then replay a month of history if the data is available and count how many alerts each rule would have produced. A rule that fires dozens of times a day for a routine business process needs tuning. Noisy operations can be handled in two ways: an allow list keyed on a stable field such as a known service account, a trusted IP range or a sanctioned external domain, or a level change that keeps the event searchable without sending it to a responder. Prefer the allow list when the exception is precise, because a broad level reduction also hides real activity from the same operation.
Baseline normal activity for each workload before raising severity. Mail forwarding is common for shared mailboxes and some departments, external sharing is routine for some partners, and bulk downloads are normal for backup or migration accounts. Two to four weeks of collected events, reviewed with the mailbox, SharePoint and Teams owners, shows which users, groups and external domains are expected. Record those findings as the baseline the allow lists are built from, and agree who approves a change to them. Severity should rise only after the baseline is stable and the false positive rate is acceptable to the people who will respond. Confirm the audit retention and licensing your tenant provides for these logs with Microsoft, because a baseline cannot be built from records that were never kept.
Protecting the app registration and the audit data
The Microsoft 365 integration holds a credential that can read tenant audit data, and the audit events it collects are sensitive in their own right. The controls below cover the app registration, the credential file on the Wazuh server, the module configuration, the indexer roles and the outbound polling path, so each one can be checked before the integration goes live.
Least-privilege Management Activity API permissions
Grant the app registration only the Office 365 Management Activity API permissions for the workloads you intend to collect, such as Exchange, SharePoint, OneDrive or Teams, and skip the rest. An app that can read every workload widens what a stolen credential exposes. Check the registration's API permissions page against your collection plan and confirm that no broader directory or mail permissions were added during testing.
Client secret rotation or certificate use
A client secret is a shared string that anyone with the file can reuse until it expires, so set a short expiry and record a rotation owner. Where your identity team supports it, a certificate is harder to copy from a configuration file. Check the secret's expiry date in the registration, confirm a rotation step is in your runbook, and confirm the old secret is removed after the new one is in place.
Restricted read access to the credential file
The Wazuh server needs the client secret or certificate to request audit content, so the file that holds it should be readable only by the service account that runs the Wazuh server process and by administrators who manage it. Check the file's owner, group and mode on the server and confirm that backups and configuration exports do not copy the secret into a location with wider access.
Limited edit rights on module configuration
Changes to the Microsoft 365 module settings alter which tenant, content types and polling intervals are collected, and a silent change can stop collection or send data to the wrong place. Restrict who can edit the server configuration and the Wazuh agent group that carries it, and record changes through your normal change process. Check the access list on the server and confirm that edits are reviewed before they reach production.
Role-based access to audit events in the indexer
Microsoft 365 audit events can include user identities, file names and mailbox activity, so not every dashboard user should read them. Create indexer roles that limit access to the index pattern holding these events, and assign them to named groups rather than to the default admin account. Check by logging in as a user without the role and confirming that the Microsoft 365 alerts and documents do not appear.
Polling over approved outbound routes
The module polls Microsoft endpoints from the Wazuh server, so that server needs outbound access to the Microsoft login and management endpoints. Allow only those destinations through your egress controls, route them through any approved proxy, and log denied connections. Check firewall rules from the server with a test request, and confirm that polling errors in the Wazuh logs are visible to the team that owns the integration.
Why Microsoft 365 events stop arriving in Wazuh
This table lists the most common reasons Microsoft 365 events stop reaching Wazuh, the likely cause of each, and the first fix to try. Work through the rows in order, since authentication and consent problems sit upstream of every other symptom. Confirm each cause against the Wazuh server and agent logs and the current Wazuh documentation before applying a fix.
| Symptom | Likely cause | First fix to verify |
|---|---|---|
| Authentication errors when requesting tokens | Wrong tenant ID or client ID in the integration settings, or an expired client secret | Compare the tenant ID and application ID with the app registration in Entra ID, then create a new client secret and update the configuration |
| Empty results or permission errors on content retrieval | Admin consent was not granted for the required Office 365 Management APIs application permissions | Grant admin consent for the application permissions in the Entra ID portal and confirm the status shows as granted |
| No events for one content type while others arrive | Subscription not started for that content type, such as Exchange, SharePoint, OneDrive or Teams activity | Check the subscription status for each content type through the API and enable the missing ones before retesting |
| Events missing for recent hours or days | Audit logging is off in the tenant, or the audit pipeline is delayed for newly enabled logging | Confirm unified audit logging is on in the Microsoft Purview portal, then allow time for backfill before assuming the connector failed |
| Connection timeouts or intermittent collection | Outbound firewall, proxy or TLS inspection blocking calls to Microsoft login and management endpoints | Test outbound access from the Wazuh server to the required Microsoft endpoints, and configure proxy settings in the integration if your network uses one |
| Events arrive but no alerts or fields are parsed after an upgrade | Decoder or rule mismatch after a Wazuh upgrade changed field names or module behavior | Run sample events through wazuh-logtest, compare with the release notes for the installed version, and review the upgrade notes before changing content |
| Alert volume spikes or the dashboard becomes unusable | Rules set to alert on broad activity such as every file access, so too many events match after enablement | Start with narrow rule groups, review match counts for a set period, and raise or lower levels or add filters before expanding scope |
Questions buyers ask before setting up Microsoft 365 monitoring
What drives the cost and effort of a Wazuh Microsoft 365 integration?
Effort follows the size and shape of the tenant and the number of workloads you want to collect: Exchange, SharePoint, OneDrive and Teams each produce different content and volume. The other drivers are how many rule sets you tune to your own users and admin patterns, how much existing Wazuh and Entra ID knowledge your team already has, and whether the app registration and permission approvals need several internal sign-offs. Cost is mostly the labor for setup, testing and tuning, and it is one-time for the initial build. Ask any provider to price each workload and the tuning pass separately, so you can see what scales with tenant size.
How long does Wazuh Microsoft 365 setup take?
No duration has been established for this work, so treat any timeline you are given as unverified until it is written into scope. The duration depends on which workloads you enable, how quickly your Microsoft 365 admins approve the app registration and permissions, how much alert tuning you agree to, and how many test cycles the team needs before go-live. A scope agreed in writing should set the timeline, with milestones for the tenant configuration, the Wazuh side and the validation of alerts. Ask for each milestone and what you must provide before it starts.
What does the work need from our Microsoft 365 admins and Wazuh operators?
Your Microsoft 365 administrators need to register an application in Microsoft Entra ID, grant the permissions the Office 365 Management Activity API requires, and enable the audit logging for the workloads in scope. Your Wazuh operators need to supply a host to run the integration, store the configuration and secrets securely, and review the resulting alerts. Both groups should agree who owns the tenant settings and who owns the rules, because changes to either can silently stop collection. Confirm the exact permissions and audit settings against Microsoft's current documentation during planning.
Can our internal team set up Microsoft 365 monitoring without a partner?
Yes, a capable internal team can do this if it already runs Wazuh and has someone who understands Entra ID app registrations, Microsoft 365 audit logging and Wazuh rule syntax. The harder parts are usually not the first connection but the tuning: separating normal administrative activity from risky activity, and testing that each alert fires on realistic events. A partner adds value when the team lacks one of those skills, needs the work delivered inside a fixed scope, or wants the evidence and documentation prepared for a compliance review. Compare the internal effort with a written scope before deciding.
What recurs after Microsoft 365 monitoring goes live?
Some work is one-time, such as the initial app registration and the first rule set, but several items recur. Client secrets or certificates used by the app registration need rotation before they expire, so calendar them and record who owns each renewal. Wazuh upgrades can change how modules and decoders behave, so retest collection after each one. Rules also need ongoing tuning as your users, workloads and business processes change, and that review should be scheduled rather than left to ad hoc requests. Ask any provider which of these tasks they include in a retainer and which stay with your team.
Which Wazuh and Microsoft 365 points should we verify before go-live?
Confirm that the Wazuh server version you run is supported with the integration you plan to use, and check the current Wazuh release notes before upgrading. Verify that each enabled workload produces events in Wazuh, that the alerts map to the intended rules, and that the credentials are stored in a protected location rather than in plain configuration files. Test the risky-activity rules with controlled events in a non-production tenant where possible. Record the results so your security and compliance teams can review the setup later.
What should we ask for in a quote for this work?
Ask for a written scope that lists the workloads to be collected, the Wazuh and Microsoft 365 components touched, the number of tuning rounds, and the validation tests. Request a breakdown of one-time setup work separately from recurring items such as secret rotation support, upgrade testing and rule reviews. Ask who performs each task, what you must provide and by when, and how changes to scope are priced. The quote should also state the handover documents you receive, including configuration records and the runbook for rotation and troubleshooting.
Does Microsoft 365 monitoring need separate licensing from Wazuh?
The self-hosted Wazuh software is open source and carries no license fee, so the main cost of this integration is labor and infrastructure. Microsoft 365 licensing is a separate matter: audit log availability and retention depend on your Microsoft 365 subscription and admin settings, so confirm those with your Microsoft account team before scoping. Also review the license terms of any third-party tools you add, and check the Wazuh LICENSE file if you plan to modify or redistribute the software.
How to prove the Microsoft 365 integration works end to end
The point of this verification is to show, with recorded evidence, that each Microsoft 365 workload you chose to monitor produces events in the Wazuh indexer and that the alert rules fire as intended. Start by agreeing the test plan with the owner of the tenant and the change board. Then generate known activity in four places: a pilot mailbox in Exchange, a test SharePoint site, a OneDrive folder and a Teams channel. Each action should be written down before it is performed, with the time, the account used, the object touched and the expected operation name, so that you can match every event to a deliberate action rather than to background noise.
For each test action, search the Wazuh indexer and confirm that the event arrived with the expected fields. Check the source workload, the operation, the user identifier, the client IP address and the object reference, and confirm that the field names match what the decoders in your installation extract. Then confirm that each alert fires exactly once at the level you planned. A duplicate or a missing alert usually points to a rule overlap, a second collection path for the same audit data, or a poll window that re-reads events. Record any mismatch as a finding before you tune anything, because tuning changes the baseline you are trying to prove.
Next, test failure visibility. Disable the subscription for one workload, or revoke the client secret in a pilot app registration, and confirm that the integration logs an error that someone would see and that no silent gap appears. Re-enable the subscription or restore the secret afterward and confirm collection resumes. Keep the tests inside your acceptable use and data handling rules: use synthetic content, avoid real personal or regulated data in the test files, and get written approval for any activity in a production mailbox. Store the timestamps, query exports, screenshots and the change ticket reference together as the evidence pack for your change record.
How DeployOpen works on this
DeployOpen plans and delivers Wazuh Microsoft 365 monitoring inside your own infrastructure, starting from a written scope that names the tenant, the Office 365 workloads and the alert content you need. Work moves from app registration and subscription design through rule testing to documented handover and optional ongoing support.
How we scope
- Confirm which Exchange, SharePoint, OneDrive and Teams activity your security team needs to see in Wazuh
- Record tenant layout, admin roles and who approves the app registration in your Microsoft 365 environment
- Agree in writing which Wazuh server, indexer and dashboard components are in scope and where they run
- List the risky activity types to alert on, so rule work and tuning have a defined target
How we build
- Register the Office 365 Management Activity API application with the permissions your scope requires, using your tenant admins
- Configure the Wazuh integration and enable the content subscriptions that match the agreed workloads
- Write or adapt alerting rules for risky activity and test each one against sample audit events before go-live
- Check that duplicate events, ingestion volume and alert noise are reviewed against the scoped workloads
How we hand over
- Deliver a written record of the app registration, permissions, subscriptions and where client secrets are stored
- Document each rule, its test cases, its alert level and the mapping to the activity it watches
- Walk your operations and security staff through daily checks, troubleshooting steps and how to change a rule
- Provide a retest summary showing which scoped alerts fired during testing and which did not
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts
- Ongoing support, upgrades and continuous testing are available as a retainer for Wazuh and its integrations
- Ask any quote to separate one-time build effort from recurring support, upgrades and retesting
- Confirm with your Microsoft 365 administrators how licensing and audit log retention affect the activity you can collect

