Detection rules › Kusto

Brute force attack against user credentials

Status
available
Severity
medium
Time window
1h
Group by
User, UserId, UserType
Source
github.com/Azure/Azure-Sentinel

'Identifies evidence of brute force activity against a user based on multiple authentication failures and at least one successful authentication within a given time window. This query limits IPAddresses to 100 and may not potentially cover all IPAddresses. The default failure threshold is 10, success threshold is 1, and the default time window is 20 minutes.'

MITRE ATT&CK coverage

TacticTechniques
Credential AccessT1110 Brute Force

Rule body kusto

id: 5a6ce089-e756-40fb-b022-c8e8864a973a
name: Brute force attack against user credentials
description: |
  'Identifies evidence of brute force activity against a user based on multiple authentication failures and at least one successful authentication within a given time window. This query limits IPAddresses to 100 and may not potentially cover all IPAddresses.
  The default failure threshold is 10, success threshold is 1, and the default time window is 20 minutes.'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: SalesforceServiceCloudCCPDefinition
    dataTypes:
      - SalesforceServiceCloud
queryFrequency: 1h
queryPeriod: 1h
triggerOperator: gt
triggerThreshold: 0
tactics:
  - CredentialAccess
relevantTechniques:
  - T1110
query: |
  let failureCountThreshold = 10;
  let successCountThreshold = 1;
  let Failures =
  SalesforceServiceCloud
  | where EventType == "Login" and LoginStatus != "LOGIN_NO_ERROR"
  | summarize
        FailureStartTime = min(TimeGenerated),
        FailureEndTime = max(TimeGenerated),
        IpAddresses = make_set (ClientIp, 100),
        FailureCount = count() by User, UserId, UserType;
    SalesforceServiceCloud
    | where EventType == "Login" and LoginStatus == "LOGIN_NO_ERROR"
    | summarize
            SuccessStartTime = min(TimeGenerated),
            SuccessEndTime = max(TimeGenerated),
            IpAddresses = make_set (ClientIp, 100),
            SuccessCount = count() by User, UserId, UserType
    | join kind=leftouter Failures on UserId
    | where FailureCount >= failureCountThreshold and SuccessCount >= successCountThreshold
    | where FailureEndTime < SuccessStartTime
    | project User, EventStartTime = FailureStartTime, EventEndTime = SuccessEndTime, IpAddresses
customDetails:
  EventStartTime: FailureStartTime
  EventEndTime: SuccessEndTime
  IPAddresses: IpAddresses
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: FullName
        columnName: User
version: 1.0.4
kind: Scheduled

Stages and Predicates

Parameters

let failureCountThreshold = 10;
let successCountThreshold = 1;

Let binding: Failures

let Failures = SalesforceServiceCloud
| where EventType == "Login" and LoginStatus != "LOGIN_NO_ERROR"
| summarize
      FailureStartTime = min(TimeGenerated),
      FailureEndTime = max(TimeGenerated),
      IpAddresses = make_set (ClientIp, 100),
      FailureCount = count() by User, UserId, UserType;

Stage 1: source

SalesforceServiceCloud

Stage 2: where

| where EventType == "Login" and LoginStatus == "LOGIN_NO_ERROR"

Stage 3: summarize

| summarize
          SuccessStartTime = min(TimeGenerated),
          SuccessEndTime = max(TimeGenerated),
          IpAddresses = make_set (ClientIp, 100),
          SuccessCount = count() by User, UserId, UserType
Threshold
ge 1

Stage 4: join

| join kind=leftouter Failures on UserId

Stage 5: where

| where FailureCount >= failureCountThreshold and SuccessCount >= successCountThreshold

Stage 6: where

| where FailureEndTime < SuccessStartTime

Stage 7: project

| project User, EventStartTime = FailureStartTime, EventEndTime = SuccessEndTime, IpAddresses

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
EventTypeeq
  • Login transforms: cased
FailureCountge
  • 10 transforms: cased
FailureEndTimelt
  • SuccessStartTime transforms: cased
LoginStatuseq
  • LOGIN_NO_ERROR transforms: cased
LoginStatusne
  • LOGIN_NO_ERROR transforms: cased
SuccessCountge
  • 1 transforms: cased

Output fields

Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.

FieldSource
EventEndTimeproject
EventStartTimeproject
IpAddressesproject
Userproject