Detection rules › Panther

RoleAssumes by Multiple Useragents

Source
github.com/panther-labs/panther-analysis

RoleAssumes with multiple Useragents could indicate compromised credentials.

Rules detecting the same action

Other rules on this platform that filter on the same API call or operation.

Rule body yaml

AnalysisType: scheduled_query
Description: RoleAssumes with multiple Useragents could indicate compromised credentials.
Enabled: false
Query: |
  SELECT
    requestParameters:roleArn as roleArn,
    userIdentity:principalId as principalId,
    count(DISTINCT userAgent) as distinctUserAgents
  FROM
    panther_logs.public.aws_cloudtrail
  WHERE
    eventSource = 'sts.amazonaws.com'
    and eventName = 'AssumeRole'
    and p_occurs_since('1 days')
    and userIdentity:principalId != 'null'
    and userAgent != 'AWS Internal'
    and requestParameters:roleArn != 'null'
  GROUP BY requestParameters:roleArn, userIdentity:principalId
  HAVING count(DISTINCT userAgent) > 1
  ORDER BY count(DISTINCT userAgent) DESC
QueryName: "RoleAssumes by Multiple Useragents"
Schedule:
  RateMinutes: 1440
  TimeoutMinutes: 5

Detection logic

Stage 1: source

panther_logs.public.aws_cloudtrail

Stage 2: filter

eventSource eq "sts.amazonaws.com"
eventName eq "AssumeRole"
userIdentity:principalId ne "null"
userAgent ne "AWS Internal"
requestParameters:roleArn ne "null"

Stage 3: having

Threshold
gt 1
Cardinality
userAgent

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
eventNameeq
  • AssumeRole
eventSourceeq
  • sts.amazonaws.com
requestParameters:roleArnne
  • null
userAgentne
  • AWS Internal
userIdentity:principalIdne
  • null

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
roleArnrequestParameters:roleArn
principalIduserIdentity:principalId
distinctUserAgentscount ( DISTINCT userAgent )