AWS Lambda Layer Added to Existing Function

Last updated 14 days ago on 2025-12-11
Created 2 years ago on 2024-04-30

About

Identifies when a Lambda layer is added to an existing AWS Lambda function. Lambda layers allow shared code, dependencies, or runtime modifications to be injected into a function’s execution environment. Adversaries with the ability to update function configurations may add a malicious layer to establish persistence, run unauthorized code, or intercept data handled by the function. This activity should be reviewed to ensure the modification is expected and authorized.
Tags
Domain: CloudData Source: AWSData Source: Amazon Web ServicesData Source: AWS LambdaUse Case: Threat DetectionTactic: ExecutionLanguage: kuery
Severity
low
Risk Score
21
MITRE ATT&CK™

Execution (TA0002)(external, opens in a new tab or window)

False Positive Examples
Lambda function owners or deployment pipelines may legitimately add or update layers as part of normal development and maintenance workflows. Confirm that the layer addition aligns with approved changes, expected CI/CD behavior, or routine dependency updates. Known automation roles or build systems can be excluded if they consistently perform authorized modifications.
License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
Query (Kibana Query Language)
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
filebeat-*logs-aws.cloudtrail-*
Related Integrations

aws(external, opens in a new tab or window)

Query
text code block:
event.dataset: aws.cloudtrail and event.provider: lambda.amazonaws.com and event.outcome: success and event.action: (PublishLayerVersion* or UpdateFunctionConfiguration*)

Install detection rules in Elastic Security

Detect AWS Lambda Layer Added to Existing Function 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).