Hi! First of all, I highly suggest reviewing the following documentation, which may be useful in case any steps were missed when setting up the environment for version 4.11:
-
https://wazuh.com/blog/monitor-office-365-with-wazuh/-
https://documentation.wazuh.com/4.11/cloud-security/office365/monitoring-office365-activity.html
Turn on Office365 module debug and inspect the real error
Those “Sending Office365 internal message … tenant connected successfully” lines just show high-level status. To see the actual HTTP/API errors, enable module debug:
Edit /var/ossec/etc/local_internal_options.conf (create it if it doesn’t exist) and add:
wazuh_modules.debug=2
sudo systemctl restart wazuh-manager
Now watch /var/ossec/logs/ossec.log for office365 messages:
sudo tail -f /var/ossec/logs/ossec.log | grep office365
You’re looking for lines like: Unknown error while getting access token , StartSubscription [CorrId=...] ... failed. or Unknown error in the response field.
Whatever you see there will usually map directly to a Microsoft error.
Check the Microsoft side: audit, subscriptions, and licensing
a) Make sure Audit logging is actually enabled
In the Microsoft Purview compliance portal:
1. Go to Audit.
2. Open Audit settings.
3. Ensure “Start recording user and admin activity” is turned On (Unified Audit Log).
If this was off, O365 will happily authenticate your app, but there will be no content blobs for Wazuh to pull.
b) Validate the app registration & API permissions
In Azure / Entra ID → App registrations → your Wazuh app:
Under API permissions, you should have: Office 365 Management APIs, ActivityFeed.Read, ActivityFeed.ReadDlp (if you use DLP), ServiceHealth.Read
All of them should be Application permissions with Admin consent granted.
c) Confirm subscription status via API (outside of Wazuh)
Since your logs say the tenant connects successfully, test the Microsoft API directly:
Double-check your <office365> block in ossec.conf
It’s worth verifying every field, here is an example of configuration:
<office365>
<enabled>yes</enabled>
<interval>1m</interval>
<curl_max_size>1M</curl_max_size>
<only_future_events>yes</only_future_events>
<api_auth>
<tenant_id>your_tenant_id</tenant_id>
<client_id>your_client_id</client_id>
<client_secret>your_client_secret</client_secret>
<api_type>commercial</api_type>
</api_auth>
<subscriptions>
<subscription>Audit.AzureActiveDirectory</subscription>
<subscription>Audit.General</subscription>
</subscriptions>
</office365>
If after trying these steps the issue is not resolved, please send me the debug logs so we can identify the problem and proceed accordingly.