Hello!
But in the azure_logs.log I see that it was unsuccessfull:
10/25/2022 06:05:10 PM INFO: AZURE Azure Graph starting.
10/25/2022 06:05:10 PM INFO: AZURE Graph: Getting authentication token.
10/25/2022 06:05:10 PM DEBUG: AZURE Starting new HTTPS connection (1):
login.microsoftonline.com:44310/25/2022 06:05:10 PM DEBUG: AZURE
https://login.microsoftonline.com:443 "POST /<my_tenatnt_domain>/oauth2/token?api-version=1.0 HTTP/1.1" 200 1482
10/25/2022 06:05:10 PM INFO: AZURE Graph: Getting data.
10/25/2022 06:05:10 PM INFO: AZURE Graph: The search starts from the date: 2022-10-24T15:05:10.1666613110Z for query: 'auditLogs/directoryAudits'
10/25/2022 06:05:10 PM DEBUG: AZURE Starting new HTTPS connection (1):
graph.windows.net:44310/25/2022 06:05:10 PM DEBUG: AZURE
https://graph.windows.net:443 "GET /<my_tenatnt_domain>/auditLogs/directoryAudits&$filter=activityDate+ge+2022-10-24T15:05:10.1666613110Z HTTP/1.1" 404 0
10/25/2022 06:05:10 PM INFO: AZURE Graph: Request status: 404
10/25/2022 06:05:10 PM ERROR: AZURE Error: The request for the query could not be made: '404 Client Error: Not Found for url:
https://graph.windows.net/<my_tenatnt_domain>/auditLogs/directoryAudits&$filter=activityDate+ge+2022-10-24T15:05:10.1666613110Z'.
10/25/2022 06:05:10 PM INFO: AZURE Graph: End
wodle section in ossec.conf is:
<!-- Logs from Azure -->
<wodle name="azure-logs">
<disabled>no</disabled>
<run_on_start>yes</run_on_start>
<log_analytics>
<auth_path>/var/ossec/wodles/credentials/log_analytics_credentials.txt</auth_path>
<tenantdomain>*****</tenantdomain>
<request>
<tag>azure-log-analytics</tag>
<query>AzureActivity</query>
<workspace>********</workspace>
<time_offset>1h</time_offset>
</request>
</log_analytics>
</wodle>
<!-- Logs from Azure AD -->
<wodle name="azure-logs">
<disabled>no</disabled>
<run_on_start>yes</run_on_start>
<graph>
<auth_path>/var/ossec/wodles/credentials/ad_credentials.txt</auth_path>
<tenantdomain>****</tenantdomain>
<request>
<tag>azure-ad-graph</tag>
<query>auditLogs/directoryAudits</query>
<time_offset>1d</time_offset>
</request>
</graph>
</wodle>
File /var/ossec/wodles/credentials/ad_credentials.txt consist of:
application_id = *********
application_key = *********
How can I set up Azure AD monitoring?