Analytic rule catalog
Potential Password Spray Attack
Back
| Id | e27dd7e5-4367-4c40-a2b7-fcd7e7a8a508 |
| Rulename | Potential Password Spray Attack |
| Description | This query searches for failed attempts to log into the Okta console from more than 15 various users within a 5 minute timeframe from the same source. This is a potential indication of a password spray attack. |
| Severity | Medium |
| Tactics | CredentialAccess |
| Techniques | T1110.003 |
| Required data connectors | OktaSSO OktaSSOv2 |
| Kind | Scheduled |
| Query frequency | 1h |
| Query period | 1h |
| Trigger threshold | 0 |
| Trigger operator | gt |
| Source Uri | https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Okta%20Single%20Sign-On/Analytic%20Rules/PasswordSpray.yaml |
| Version | 1.1.2 |
| Arm template | e27dd7e5-4367-4c40-a2b7-fcd7e7a8a508.json |
// Adjust threshold for failed logins to reduce noise
let FailureThreshold = 15;
let FailedEvents = OktaSSO
| where eventType_s =~ "user.session.start" and outcome_reason_s in ("VERIFICATION_ERROR","INVALID_CREDENTIALS")
| summarize dcount(actor_alternateId_s) by client_ipAddress_s, bin(TimeGenerated, 5m)
| where dcount_actor_alternateId_s > FailureThreshold
| project client_ipAddress_s, TimeGenerated;
OktaSSO
| where eventType_s =~ "user.session.start" and outcome_reason_s in ("VERIFICATION_ERROR","INVALID_CREDENTIALS")
| summarize Users = make_set(actor_alternateId_s) by client_ipAddress_s, City = column_ifexists('client_geographicalContext_city_s', ""), Country = column_ifexists('client_geographicalContext_country_s', ""), bin(TimeGenerated, 5m)
| join kind=inner (FailedEvents) on client_ipAddress_s, TimeGenerated
| project TimeGenerated, client_ipAddress_s, Users, DistinctUsers = array_length(Users), City, Country
| sort by TimeGenerated desc
relevantTechniques:
- T1110.003
id: e27dd7e5-4367-4c40-a2b7-fcd7e7a8a508
queryFrequency: 1h
requiredDataConnectors:
- connectorId: OktaSSO
dataTypes:
- Okta_CL
- connectorId: OktaSSOv2
dataTypes:
- OktaSSO
queryPeriod: 1h
entityMappings:
- fieldMappings:
- identifier: Address
columnName: client_ipAddress_s
entityType: IP
version: 1.1.2
query: |
// Adjust threshold for failed logins to reduce noise
let FailureThreshold = 15;
let FailedEvents = OktaSSO
| where eventType_s =~ "user.session.start" and outcome_reason_s in ("VERIFICATION_ERROR","INVALID_CREDENTIALS")
| summarize dcount(actor_alternateId_s) by client_ipAddress_s, bin(TimeGenerated, 5m)
| where dcount_actor_alternateId_s > FailureThreshold
| project client_ipAddress_s, TimeGenerated;
OktaSSO
| where eventType_s =~ "user.session.start" and outcome_reason_s in ("VERIFICATION_ERROR","INVALID_CREDENTIALS")
| summarize Users = make_set(actor_alternateId_s) by client_ipAddress_s, City = column_ifexists('client_geographicalContext_city_s', ""), Country = column_ifexists('client_geographicalContext_country_s', ""), bin(TimeGenerated, 5m)
| join kind=inner (FailedEvents) on client_ipAddress_s, TimeGenerated
| project TimeGenerated, client_ipAddress_s, Users, DistinctUsers = array_length(Users), City, Country
| sort by TimeGenerated desc
customDetails:
City: City
Country: Country
Users: Users
alertDetailsOverride:
alertDescriptionFormat: '{{DistinctUsers}} distinct users failed authentication from {{client_ipAddress_s}} in a 5 minute window.'
alertDisplayNameFormat: Potential password spray attack from IP {{client_ipAddress_s}}
description: |
This query searches for failed attempts to log into the Okta console from more than 15 various users within a 5 minute timeframe from the same source. This is a potential indication of a password spray attack.
severity: Medium
triggerThreshold: 0
tactics:
- CredentialAccess
name: Potential Password Spray Attack
status: Available
kind: Scheduled
triggerOperator: gt
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Okta%20Single%20Sign-On/Analytic%20Rules/PasswordSpray.yaml
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspace": {
"type": "String"
}
},
"resources": [
{
"apiVersion": "2024-01-01-preview",
"id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/e27dd7e5-4367-4c40-a2b7-fcd7e7a8a508')]",
"kind": "Scheduled",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/e27dd7e5-4367-4c40-a2b7-fcd7e7a8a508')]",
"properties": {
"alertDetailsOverride": {
"alertDescriptionFormat": "{{DistinctUsers}} distinct users failed authentication from {{client_ipAddress_s}} in a 5 minute window.",
"alertDisplayNameFormat": "Potential password spray attack from IP {{client_ipAddress_s}}"
},
"alertRuleTemplateName": "e27dd7e5-4367-4c40-a2b7-fcd7e7a8a508",
"customDetails": {
"City": "City",
"Country": "Country",
"Users": "Users"
},
"description": "This query searches for failed attempts to log into the Okta console from more than 15 various users within a 5 minute timeframe from the same source. This is a potential indication of a password spray attack.\n",
"displayName": "Potential Password Spray Attack",
"enabled": true,
"entityMappings": [
{
"entityType": "IP",
"fieldMappings": [
{
"columnName": "client_ipAddress_s",
"identifier": "Address"
}
]
}
],
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Okta%20Single%20Sign-On/Analytic%20Rules/PasswordSpray.yaml",
"query": "// Adjust threshold for failed logins to reduce noise\nlet FailureThreshold = 15;\nlet FailedEvents = OktaSSO\n| where eventType_s =~ \"user.session.start\" and outcome_reason_s in (\"VERIFICATION_ERROR\",\"INVALID_CREDENTIALS\")\n| summarize dcount(actor_alternateId_s) by client_ipAddress_s, bin(TimeGenerated, 5m)\n| where dcount_actor_alternateId_s > FailureThreshold\n| project client_ipAddress_s, TimeGenerated;\nOktaSSO\n| where eventType_s =~ \"user.session.start\" and outcome_reason_s in (\"VERIFICATION_ERROR\",\"INVALID_CREDENTIALS\")\n| summarize Users = make_set(actor_alternateId_s) by client_ipAddress_s, City = column_ifexists('client_geographicalContext_city_s', \"\"), Country = column_ifexists('client_geographicalContext_country_s', \"\"), bin(TimeGenerated, 5m)\n| join kind=inner (FailedEvents) on client_ipAddress_s, TimeGenerated\n| project TimeGenerated, client_ipAddress_s, Users, DistinctUsers = array_length(Users), City, Country\n| sort by TimeGenerated desc\n",
"queryFrequency": "PT1H",
"queryPeriod": "PT1H",
"severity": "Medium",
"status": "Available",
"subTechniques": [
"T1110.003"
],
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"CredentialAccess"
],
"techniques": [
"T1110"
],
"templateVersion": "1.1.2",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0
},
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
}
]
}