This gives you the shape of the user’s activity in one pass: how many sign-ins, how many succeeded, how many unique locations and IPs, and the split between interactive and non-interactive. A compromised account often shows a sudden spike in distinct IPs and countries compared to the user’s baseline.
Scan the output for: IP addresses you do not recognise, countries outside the user’s normal pattern, unusual applications (especially “Azure Portal” or “Microsoft Graph” if the user is not an IT administrator), and sign-ins where MFA was not required.
Pattern 2: Failed Sign-In Analysis (Brute Force / Password Spray)
This finds cases where the same user signed in from two different countries within two hours. True impossible travel — for example, London to Moscow in 45 minutes — is a strong indicator of compromise. However, VPN usage causes false positives: a user might be physically in London but their VPN exit node is in Frankfurt. Correlate with your organisation’s known VPN exit IPs before escalating.
Pattern 4: Token Replay / Session Theft Detection
AiTM phishing campaigns steal session tokens rather than passwords. The stolen token is replayed from the attacker’s infrastructure. Detecting this requires looking for sign-ins where:
The sign-in succeeded (ResultType == 0)
MFA was not challenged (because the stolen token bypasses MFA)
The IP or ASN does not match the user’s normal pattern
The sign-in appears in the non-interactive table (token refresh)
Legitimate users rarely sign in from cloud hosting providers. If a non-interactive token refresh comes from DigitalOcean or AWS, and the user is not a developer running cloud-based tools, this warrants immediate investigation.
Pattern 5: Conditional Access Bypass Monitoring
Conditional Access policies are your enforcement layer. Monitoring for sign-ins that were not evaluated by CA — or where CA was applied but resulted in “notApplied” — identifies gaps in your policy coverage:
Successful sign-ins where no Conditional Access policy was applied represent your policy blind spots. If AuthenticationRequirement shows “singleFactorAuthentication” on these, users are accessing resources with only a password — no MFA, no device compliance check, no location restriction.
Pattern 6: Legacy Authentication Detection
Legacy authentication protocols (SMTP, IMAP, POP3, Exchange ActiveSync with basic auth) do not support MFA. Attackers target these protocols specifically because they bypass your Conditional Access MFA requirements:
Any successful sign-in via a legacy protocol should be investigated. Microsoft has been deprecating basic authentication, but some tenants still have it enabled for specific mailboxes or applications. If you find active legacy auth in your environment, the remediation is to block these protocols via Conditional Access.
Investigation decision: account compromise triage
You receive an alert: "Impossible travel detected for j.morrison@northgateeng.com." The user signed in from London at 09:14 and from Lagos at 09:47 — 33 minutes apart. What do you do?
Step 1: What is the most important field to check first?
Step 2: Both sign-ins succeeded. The London IP is your corporate VPN exit. The Lagos IP is unknown. What next?
Try it yourself
Write a KQL query that detects impossible travel: users who had successful sign-ins from two different countries within 60 minutes. Hint: use summarize with make_set and dcount, then filter for dcount of countries greater than 1.
This query groups successful sign-ins by user and hour, collects the distinct countries and IPs, and flags any user who signed in from more than one country within the same hour. In a real environment, you would exclude known VPN exit nodes and corporate IP ranges to reduce false positives.
Check your understanding
1. What does ResultType == 0 mean in a sign-in log?
Successful sign-in
Failed sign-in
Blocked by conditional access
ResultType 0 = success. Any non-zero value is a failure. Common failure codes: 50126 (invalid credentials), 50074 (MFA required but not completed), 53003 (blocked by conditional access), 50053 (account locked). Knowing these codes by memory speeds up triage significantly.
2. You are investigating a brute force attack. Which query pattern identifies the attack?
where ResultType == 0 | summarize count() by UserPrincipalName
where ResultType != 0 | summarize FailCount = count() by IPAddress | where FailCount > threshold
where AppDisplayName == "Exchange Online"
Brute force produces many failures from the same source. Summarizing failed sign-ins by IP address and filtering for counts above a threshold (e.g. 50 failures from one IP in an hour) is the standard detection pattern. For password spray, summarize by IP and check for failures across many different user accounts.
3. How do you detect legacy authentication protocols that bypass MFA?
Check the UserAgent field for old browser versions
Check the AppDisplayName for legacy apps
Filter on ClientAppUsed for protocols like IMAP, POP3, SMTP, or ActiveSync
The ClientAppUsed field identifies the authentication protocol. Legacy protocols (IMAP, POP3, SMTP, Exchange ActiveSync, Autodiscover) do not support MFA — they authenticate with username and password only. A conditional access policy blocking legacy authentication is one of the most important controls to deploy.