Query Details
// Monitor Privilege User SSPR
// In today’s post by Merill, he explains how to use Maester to monitor SSPR settings for admin accounts. I agree that administrators with sensitive roles should exclusively use phishing-resistant authentication methods, which would prevent them from resetting their passwords. However, not all organizations have the cyber maturity to transition all admins to phishing-resistant authentication. Therefore, SecOps should continue to monitor SSPR for privileged users in the Entra tenant. The KQL below provides the necessary monitoring
let queryperiod = 30d;
let queryfrequency = 1h;
let PrivilegeUsers = (
IdentityInfo
| where TimeGenerated > ago(queryperiod)
| mv-expand AssignedRoles
| where AssignedRoles matches regex 'Admin'
| summarize by tolower(AccountUPN));
AuditLogs
| where TimeGenerated > ago(queryfrequency)
| where ResultDescription == "User started self-service password reset operation."
| extend AccountUPN = tolower(InitiatedBy.user.userPrincipalName)
| extend IPAdress = InitiatedBy.user.ipAddress
| where AccountUPN in (PrivilegeUsers)
// MITRE ATT&CK Mapping
// Privilege Escalation (T1078.004 - Valid Accounts: Cloud Accounts):
// The query identifies privileged users by checking for roles that match ‘Admin’. This is related to the use of valid accounts with elevated privileges.
// Credential Access (T1110.001 - Brute Force):
// Monitoring self-service password reset operations can help detect potential brute force attempts or misuse of password reset functionalities.
// Defense Evasion (T1078 - Valid Accounts):
// By focusing on privileged accounts, the query helps in identifying if legitimate accounts are being used to evade detection mechanisms.
// Initial Access (T1078.004 - Valid Accounts: Cloud Accounts):
// The detection of self-service password reset operations by privileged users can indicate an initial access attempt using valid credentials.
This KQL query is designed to monitor self-service password reset (SSPR) activities for privileged users (like administrators) in an Entra tenant. Here's a simple breakdown:
Define Monitoring Periods:
queryperiod is set to 30 days.queryfrequency is set to 1 hour.Identify Privileged Users:
IdentityInfo table for the past 30 days.Monitor SSPR Activities:
AuditLogs table for the past hour.Security Context (MITRE ATT&CK Mapping):
In summary, this query helps security operations teams monitor and detect potentially suspicious SSPR activities by privileged users, enhancing the security posture against various attack techniques.

Steven Lim
Released: September 3, 2024
Tables
Keywords
Operators