Lesson 3 of 5 · 25 min read

Azure and Entra ID Detection — Sign-in Logs, Activity Logs, and Defender

Azure’s identity system (Entra ID, formerly Azure Active Directory) is the most common enterprise cloud identity platform — making it the primary attack surface and the primary detection surface.


Entra ID Sign-in Log Structure

Every authentication event in Entra ID generates a sign-in log entry:

{
  "createdDateTime": "2026-05-18T02:14:23Z",
  "userPrincipalName": "alice@corp.onmicrosoft.com",
  "appDisplayName": "Microsoft Graph",
  "ipAddress": "203.0.113.42",
  "location": {
    "city": "Moscow",
    "countryOrRegion": "RU"
  },
  "status": {
    "errorCode": 0,
    "failureReason": null
  },
  "authenticationRequirement": "singleFactorAuthentication",
  "conditionalAccessStatus": "success",
  "riskLevelAggregated": "high",
  "riskDetail": "unfamiliarFeatures",
  "clientAppUsed": "Other clients; IMAP"
}

Key detection fields: ipAddress, location, status.errorCode, authenticationRequirement, clientAppUsed, riskLevelAggregated.


Detection Pattern 1: Password Spray

Password spray is the dominant initial access technique against M365/Azure environments:

title: Azure Password Spray Attack
logsource:
  product: azure
  service: signinlogs
detection:
  selection:
    ResultType: "50126"   # Invalid username or password
  timeframe: 5m
  condition: selection | count(UserPrincipalName) by SourceIP > 10
falsepositives:
  - Misconfigured service accounts with wrong stored credentials
  - Bulk password reset events (coordinate with IT before filtering)
level: high

Additional signals: Check UserAgent — spray tools have distinctive user agents. Real users use modern browsers; spray tools often report python-requests/2.x or curl/7.x.


Detection Pattern 2: Legacy Authentication Protocol Use

Legacy protocols bypass MFA — they remain the most common attack path against organizations that haven’t disabled them:

title: Azure Sign-in via Legacy Authentication Protocol
logsource:
  product: azure
  service: signinlogs
detection:
  selection_legacy_proto:
    ClientAppUsed:
      - "IMAP4"
      - "POP3"
      - "SMTP AUTH"
      - "Exchange ActiveSync"
      - "Exchange Online PowerShell"
      - "Other clients"
  selection_success:
    ResultType: "0"   # Successful authentication
  condition: selection_legacy_proto and selection_success
falsepositives:
  - Legacy MFP (multifunction printer) using SMTP AUTH for email scanning
  - Old on-prem mail servers relaying through Exchange Online
level: medium

Detection Pattern 3: Impossible Travel

title: Impossible Travel — Same User, Two Countries Within 1 Hour
logsource:
  product: azure
  service: signinlogs
detection:
  selection_success:
    ResultType: "0"
  # Implemented via correlation: same UserPrincipalName, different country, < 1 hour
  correlation:
    type: temporal_proximity
    field: UserPrincipalName
    group_by: CountryOrRegion
    timeframe: 1h
    threshold: 2   # 2 different countries = impossible travel
level: high

SIEM implementation: Most SIEMs implement this as a lookup join rather than native Sigma — correlate sign-in events for the same UPN, compute distance/time between location pairs, flag where implied travel speed > 800 km/hr.


Detection Pattern 4: MFA Fatigue (Prompt Bombing)

An attacker who has a valid password sends repeated MFA push notifications, hoping the user approves out of fatigue:

title: Excessive MFA Push Requests — Possible MFA Fatigue Attack
logsource:
  product: azure
  service: signinlogs
detection:
  selection:
    ResultType: "500121"   # Auth blocked by strong auth requirement (MFA pending)
  timeframe: 10m
  condition: selection | count() by UserPrincipalName > 5
falsepositives:
  - User locked out with misconfigured authenticator app
level: high

Follow-up: After detecting MFA fatigue, check if the same UPN eventually authenticates successfully — an approval after 10+ rejected prompts is a high-confidence MFA fatigue success.


Azure Activity Log: Control Plane Detection

Azure Activity Log covers resource management — the equivalent of AWS CloudTrail management events:

title: Azure Network Security Group Rule Modification
logsource:
  product: azure
  service: activitylog
detection:
  selection:
    operationName|startswith: "Microsoft.Network/networkSecurityGroups"
    operationName|endswith:
      - "/securityRules/write"
      - "/securityRules/delete"
  filter_known_automation:
    caller|contains: "terraform"
  condition: selection and not filter_known_automation
falsepositives:
  - Authorized network engineering changes
level: medium

High-priority Activity Log events:

EventWhy it matters
Microsoft.Authorization/roleAssignments/writeNew role assignment — possible privilege escalation
Microsoft.KeyVault/vaults/secrets/readSecrets accessed — possible credential theft
Microsoft.Compute/virtualMachines/runCommand/actionRemote command execution on VM
Microsoft.Storage/storageAccounts/blobServices/containers/writeStorage container created (possible exfil staging)
Microsoft.Insights/diagnosticSettings/writeLogging configuration changed (attacker may disable)

Microsoft Defender for Identity: Lateral Movement Detection

Defender for Identity (formerly Azure ATP) monitors on-prem Active Directory activity forwarded to the cloud:

AlertATT&CK techniqueSignal
Suspected DCSync attackT1003.006Non-DC requesting replication rights
Suspected Pass-the-HashT1550.002NTLM auth from unusual source
Suspicious LDAP queriesT1087.002Bulk AD enumeration from non-admin
KerberoastingT1558.003RC4 TGS requests for high-SPN services
Suspected golden ticket usageT1558.001Kerberos ticket with anomalous PAC
Azure AD Sign-in Logs— Microsoft Brute Force: Password Spraying (T1110.003)— MITRE