Privileged identities whose sign-ins are not protected by Conditional Access
Description
Identifies successful sign-ins by accounts with directory or PIM roles when Conditional Access did not report success, including empty, not applied, not enabled, or failure states. Review these events for missing policy coverage and MFA enforcement.
Query · kql
let timeframe = 30d;
let PrivilegedUsers = IdentityInfo
| where isnotempty(AssignedRoles) or isnotempty(PrivilegedEntraPimRoles)
| summarize arg_max(Timestamp, AccountUpn) by AccountObjectId;
SigninLogs
| where TimeGenerated > ago(timeframe)
| where ResultType == "0"
| extend ConditionalAccessStatus = coalesce(ConditionalAccessStatus, "notEvaluated")
| where ConditionalAccessStatus !~ "success"
| 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),
ConditionalAccessStatuses = make_set(ConditionalAccessStatus),
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, ConditionalAccessStatuses,
AuthRequirements, LastIP, AppDisplayName
| sort by SignInAttempts desc