How to Detect Azure and Entra ID Attack Techniques with Wazuh

· Original article ↗

Summary

A Wazuh walkthrough configures Azure Activity, Entra ID and Storage logs through Log Analytics, then uses Stratus Red Team to emulate eight cloud attack scenarios and validate custom rules for persistence, privilege escalation, exfiltration and resource-lock deletion.

Key points

  • The walkthrough configures Wazuh to collect Azure Activity, Entra ID Audit and Sign-in, and Azure Storage diagnostic logs through a Log Analytics workspace.
  • A service principal is configured with Log Analytics API read permission and assigned the Log Analytics Reader role for telemetry access.
  • Custom Wazuh rules target suspicious application and managed-identity credentials, federated identity credentials, elevated Azure access, managed-disk SAS access, storage key retrieval, and resource-lock deletion.
  • Stratus Red Team is run from an Ubuntu endpoint to emulate eight Azure and Entra ID scenarios and check that the corresponding Wazuh rules trigger.
  • The article recommends using a dedicated test subscription and cleaning up resources after the emulation exercises.

Article Details

Defense Focus
Detect suspicious Azure and Microsoft Entra ID activity by collecting cloud audit, sign-in, and storage telemetry in Wazuh and alerting on simulated persistence, privilege escalation, data access, and destructive actions.
Detection Methods
  • Alert on successful creation of service principal or application credentials and federated identity credentials.
  • Detect managed disk access associated with SAS URL generation and Azure Storage account key retrieval.
  • Alert on successful deletion of Azure resource locks and elevation to User Access Administrator at root scope.
  • Use Stratus Red Team scenarios in a controlled environment to validate that detections trigger.
Data Sources
  • Azure Activity logs, including Administrative, Policy, Security, ServiceHealth, Alert, and Recommendation categories.
  • Microsoft Entra ID AuditLogs, SignInLogs, ServicePrincipalSignInLogs, and ManagedIdentitySignInLogs.
  • Azure Storage diagnostic logs, including StorageRead, StorageWrite, and StorageDelete; blob activity is collected through StorageBlobLogs.
Rule Types
  • Custom Wazuh XML rules matching event fields, operation names, categories, and success status.
  • PCRE2 field-matching conditions in custom rules.
  • Custom rules tagged with MITRE ATT&CK IDs.
Defensive Actions
  • Forward Azure Activity, Entra ID, and Azure Storage diagnostic logs to a Log Analytics workspace.
  • Use a service principal with the required Log Analytics API Data.Read permission and Log Analytics Reader role for Wazuh log collection.
  • Configure Wazuh's azure-logs module to collect the relevant workspace queries and apply custom detection rules.
  • Test detections in a dedicated subscription that does not manage production workloads, then remove resources created during emulation.

MITRE ATT&CK

Vendors

Products

Tools

Related Articles