EventSentry provides the ability to monitor Azure logs, which is crucial for maintaining security and compliance within your organization. By keeping a close eye on these logs, you can detect suspicious activities, ensure data integrity, and respond quickly to potential threats. In the example below we will automate the download of AzureAd / Entra ID and Azure Sign-in logs.
Creating an App Registration with API access is necessary to securely authenticate and authorize the download of Azure logs. This ensures that EventSentry can retrieve log data from Azure in a controlled and secure manner.
For accessing logs, your App Registration will need the following permissions:
• AuditLog.Read.All
• Directory.Read.All
Follow the KB-518 to configure an App Registration with API Access:
https://www.eventsentry.com/kb/518-how-to-enable-api-access-to-microsoft-entra-id-azuread
In EventSentry, the workflow involves creating a Delimited Log File definition to specify the structure of the Azure logs. Once the definition is configured, we will setup an automated script to pull the Azure logs and import them every day.
Under Packages -> Log Files -> Define Files and File Types, click the [+] in the Log Files section to add the Log File Types
Save the downloaded file to %PROGRAMFILES%\EventSentry\scripts
To complete the setup, you will need to:
These changes should be made in the batch file azure_log_importer.bat.
%PROGRAMFILES%\EventSentry\scripts\azure_log_importer.bat
1 2 3 4 5 |
@echo off :: EventSentry Azure Importer %PROGRAMFILES%\EventSentry\scripts\azure_log_downloader.exe -client_id <client_id> -client_secret <client_secret> -tenant_id <tenant_id> -log_type all -duration 1d %PROGRAMFILES%\EventSentry\eventsentry_db_import_x64.exe /file:"C:\Program Files\EventSentry\scripts\logs\azure_directory_logs.csv" /filedefinition:AzureAD /action:"Primary Database" %PROGRAMFILES%\EventSentry\eventsentry_db_import_x64.exe /file:"C:\Program Files\EventSentry\scripts\logs\azure_authentication_logs.csv" /filedefinition:"Azure Sign-in Events" /action:"Primary Database" |
To ensure that your Azure logs are regularly imported into EventSentry, you need to schedule the script that pulls the logs. This can be done using either the EventSentry Application Scheduler or the Windows Task Scheduler.
By following these steps, you ensure that the script runs at the specified intervals, allowing EventSentry to import the Azure logs based on the predefined settings.