text code block:from logs-aws.cloudtrail-* // Lambda invocation data events (data-plane; requires data event logging enabled) | where event.provider == "lambda.amazonaws.com" and event.action like "Invoke*" and event.outcome == "success" and aws.cloudtrail.user_identity.arn IS NOT NULL | stats Esql.invocation_count = count(*), Esql.source_ips = values(source.ip) by aws.cloudtrail.user_identity.arn // Threshold is environment-dependent — tune to the deployment | where Esql.invocation_count >= 1000 | keep aws.cloudtrail.user_identity.arn, Esql.invocation_count, Esql.source_ips | sort Esql.invocation_count desc
Install detection rules in Elastic Security
Detect AWS Lambda Function High-Frequency Invocation by a Single Principal in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).