Privileged identities authenticating via legacy protocols
Description
Identifies successful sign-ins by privileged accounts using legacy clients such as Exchange ActiveSync, IMAP4, POP3, SMTP Auth, MAPI over HTTP, or other legacy clients. These protocols may bypass modern Conditional Access and MFA controls.
Query · kql
let timeframe = 30d;
let LegacyProtocols = dynamic([
"Exchange ActiveSync",
"IMAP4",
"MAPI over HTTP",
"POP3",
"SMTP Auth",
"Authenticated SMTP",
"Other clients"
]);
let PrivilegedUsers = IdentityInfo
| where isnotempty(AssignedRoles) or isnotempty(PrivilegedEntraPimRoles)
| summarize arg_max(Timestamp, AccountUpn) by AccountObjectId;
SigninLogs
| where TimeGenerated > ago(timeframe)
| where ResultType == "0"
| where ClientAppUsed in~ (LegacyProtocols)
| join kind=inner PrivilegedUsers on $left.UserId == $right.AccountObjectId
| extend
AccountName = tostring(split(UserPrincipalName, "@")[0]),
AccountUPNSuffix = tostring(split(UserPrincipalName, "@")[1])
| summarize
SignInAttempts = count(),
FirstSeen = min(TimeGenerated),
LastSeen = max(TimeGenerated),
ClientApps = make_set(ClientAppUsed),
AuthRequirements = make_set(AuthenticationRequirement),
LastIP = tostring(arg_max(TimeGenerated, IPAddress))
by UserPrincipalName, AccountName, AccountUPNSuffix, UserId, AccountUpn, AppDisplayName
| project
UserPrincipalName, AccountName, AccountUPNSuffix, AccountUpn,
SignInAttempts, FirstSeen, LastSeen, ClientApps, AuthRequirements,
LastIP, AppDisplayName
| sort by SignInAttempts desc