Panther medium experimental python

AWS STS GetCallerIdentity via TruffleHog

Detects AWS STS GetCallerIdentity calls made by TruffleHog, a credential scanning tool. Threat actors use TruffleHog to validate whether leaked or stolen AWS access keys are still active. A GetCallerIdentity call with a TruffleHog user agent indicates that credentials from this account have been discovered externally and are being tested for validity.

View Source

Detection Logic

from panther_aws_helpers import aws_rule_context


def rule(event):
    return (
        event.get("eventSource") == "sts.amazonaws.com"
        and event.get("eventName") == "GetCallerIdentity"
        and "trufflehog" in event.get("userAgent", "").lower()
    )


def title(event):
    arn = event.deep_get("userIdentity", "arn", default="<unknown>")
    ip_addr = event.get("sourceIPAddress", "<unknown>")
    return f"TruffleHog credential validation detected from [{ip_addr}] as [{arn}]"


def alert_context(event):
    return aws_rule_context(event)

Field Validations

Loading…

Comments (0)

Loading comments...