Detection rules › Panther

AWS CloudTrail Password Spraying

Status
Experimental
Severity
medium
Group by
awsRegion, recipientAccountId
Log types
AWS.CloudTrail
Tags
Initial Access:Valid Accounts
Source
github.com/panther-labs/panther-analysis

Detects password spraying attacks by alerting when more than 9 distinct usernames fail to authenticate to the AWS console from the same account and region within 60 minutes.

MITRE ATT&CK coverage

TacticTechniques
Initial AccessT1078 Valid Accounts

Rule body yaml

AnalysisType: rule
Filename: aws_cloudtrail_password_spraying.py
RuleID: "AWS.CloudTrail.PasswordSpraying"
DisplayName: "AWS CloudTrail Password Spraying"
Status: Experimental
Enabled: false
Severity: Medium
DedupPeriodMinutes: 60
Threshold: 10
LogTypes:
  - AWS.CloudTrail
Description: >
  Detects password spraying attacks by alerting when more than 9 distinct usernames
  fail to authenticate to the AWS console from the same account and region within 60 minutes.
Reports:
  MITRE ATT&CK:
    - TA0001:T1078
Tags:
  - Initial Access:Valid Accounts
Runbook: |
  1. Query CloudTrail for all ConsoleLogin events in the 2 hours around this alert grouped by sourceIPAddress to identify the origin of the spray targeting recipientAccountId
  2. Check if any of the targeted usernames subsequently had a successful ConsoleLogin from any sourceIPAddress in the 6 hours after the alert
  3. Find other alerts for this recipientAccountId or any of the targeted usernames in the past 7 days to determine if this is part of a broader campaign
Tests:
  - Name: Failed Console Login
    ExpectedResult: true
    Log:
      awsRegion: us-east-1
      eventName: ConsoleLogin
      eventSource: signin.amazonaws.com
      eventType: AwsConsoleSignIn
      recipientAccountId: "111122223333"
      responseElements:
        ConsoleLogin: Failure
      userIdentity:
        type: IAMUser
        userName: alice
  - Name: Successful Console Login
    ExpectedResult: false
    Log:
      awsRegion: us-east-1
      eventName: ConsoleLogin
      eventSource: signin.amazonaws.com
      eventType: AwsConsoleSignIn
      recipientAccountId: "111122223333"
      responseElements:
        ConsoleLogin: Success
      userIdentity:
        type: IAMUser
        userName: alice
  - Name: Non-Console Event
    ExpectedResult: false
    Log:
      awsRegion: us-east-1
      eventName: DescribeInstances
      eventSource: ec2.amazonaws.com
      eventType: AwsApiCall
      recipientAccountId: "111122223333"
      responseElements: null
      userIdentity:
        type: IAMUser
        userName: alice
  - Name: Failed Console Login - Root User
    ExpectedResult: true
    Log:
      awsRegion: us-east-1
      eventName: ConsoleLogin
      eventSource: signin.amazonaws.com
      eventType: AwsConsoleSignIn
      recipientAccountId: "111122223333"
      responseElements:
        ConsoleLogin: Failure
      userIdentity:
        type: Root
        userName: root

Detection logic

Condition

eventType eq "AwsConsoleSignIn"
responseElements.ConsoleLogin eq "Failure"

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
  • AwsConsoleSignIn
responseElements.ConsoleLogineq
  • Failure

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.

Field
eventName
eventSource
awsRegion
recipientAccountId
sourceIPAddress
userAgent
userIdentity