Techniques
Sample rules
Azure AD Multiple Users Failing To Authenticate From Ip
- source: splunk
- technicques:
- T1586
- T1586.003
- T1110
- T1110.003
- T1110.004
Description
The following analytic identifies one source Ip failing to authenticate with 30 unique valid users within 5 minutes. This behavior could represent an adversary performing a Password Spraying attack against an Azure Active Directory tenant to obtain initial access or elevate privileges. Error Code 50126 represents an invalid password. This logic can be used for real time security monitoring as well as threat hunting exercises. Azure AD tenants can be very different depending on the organization. Users should test this detection and customize the arbitrary threshold if needed.
Detection logic
`azure_monitor_aad` category=SignInLogs properties.status.errorCode=50126 properties.authenticationDetails{}.succeeded=false
| rename properties.* as *
| bucket span=5m _time
| stats count min(_time) as firstTime max(_time) as lastTime dc(user) AS unique_accounts values(user) as user by src_ip
| where unique_accounts > 30
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `azure_ad_multiple_users_failing_to_authenticate_from_ip_filter`
Azure AD Unusual Number of Failed Authentications From Ip
- source: splunk
- technicques:
- T1586
- T1586.003
- T1110
- T1110.003
- T1110.004
Description
The following analytic identifies one source Ip failing to authenticate with multiple valid users. This behavior could represent an adversary performing a Password Spraying attack against an Azure Active Directory tenant to obtain initial access or elevate privileges. Error Code 50126 represents an invalid password.
The detection calculates the standard deviation for source Ip and leverages the 3-sigma statistical rule to identify an unusual number of failed authentication attempts. To customize this analytic, users can try different combinations of the bucket
span time and the calculation of the upperBound
field. This logic can be used for real time security monitoring as well as threat hunting exercises.
While looking for anomalies using statistical methods like the standard deviation can have benefits, we also recommend using threshold-based detections to complement coverage. A similar analytic following the threshold model is Azure AD Multiple Users Failing To Authenticate From Ip
.
Detection logic
`azure_monitor_aad` category=SignInLogs properties.status.errorCode=50126 properties.authenticationDetails{}.succeeded=false
| rename properties.* as *
| bucket span=5m _time
| stats dc(userPrincipalName) AS unique_accounts values(userPrincipalName) as userPrincipalName by _time, ipAddress
| eventstats avg(unique_accounts) as ip_avg, stdev(unique_accounts) as ip_std by ipAddress
| eval upperBound=(ip_avg+ip_std*3)
| eval isOutlier=if(unique_accounts > 10 and unique_accounts >= upperBound, 1,0)
| where isOutlier = 1
| `azure_ad_unusual_number_of_failed_authentications_from_ip_filter`