Sign Ins by compromised account
Description
List the interactive and noninteractive signins that have been performed by a compromised account. This can be done based on the UPN of the compromised account.
Query · kql
let CompromisedAccountUPN = "test@test.com";
let SearchWindow = 48h; //Customizable h = hours, d = days
let aadFunc = (tableName: string, email: string) {
table(tableName)
| where TimeGenerated > ago(SearchWindow)
| where ResultType == 0
| where UserPrincipalName == email
};
let aadSignin = aadFunc("SigninLogs", CompromisedAccountUPN);
let aadNonInt = aadFunc("AADNonInteractiveUserSignInLogs", CompromisedAccountUPN);
union isfuzzy=true aadSignin, aadNonInt
// In case of all details remove line below
| project TimeGenerated, Category, Location, AppDisplayName, ClientAppUsed, RiskState