Skip to content
Threat Feed
low advisory

Detection of Unauthorized AWS Lambda Layer Modifications

Adversaries with compromised credentials may modify AWS Lambda configurations by injecting unauthorized layers to establish persistence, run arbitrary code, or intercept data.

Adversaries possessing sufficient permissions to interact with the AWS Lambda API can exploit the service's layer architecture to maintain stealthy persistence. By adding a malicious or unauthorized Lambda layer to an existing function, an attacker can inject code into the function's execution environment without modifying the primary source code. This technique allows for the interception of sensitive data, execution of unauthorized backend tasks, or modification of function output.

This activity is often identified via AWS CloudTrail events where UpdateFunctionConfiguration or PublishLayerVersion actions occur outside of established CI/CD pipelines. Because Lambda layers are designed for legitimate code sharing and dependency management, monitoring requires distinguishing between automated infrastructure-as-code (IaC) deployments and manual or anomalous API requests. Security teams should prioritize visibility into configuration changes originating from non-authorized identities or unexpected source IP addresses.

Impact

Successful exploitation allows attackers to persist within a serverless environment, potentially leading to long-term data exfiltration or the subversion of internal business logic. The impact is significant for organizations relying heavily on serverless architectures, where such modifications can remain undetected if not monitored at the API level.

Recommendation

  • Deploy the provided detection logic to monitor for AWS Lambda configuration updates that do not originate from known CI/CD or IaC tooling.
  • Audit existing Lambda functions to identify currently attached layers that do not map to authorized internal code repositories.
  • Implement IAM policies that restrict the ability to modify Lambda configurations and publish new layers to specific, highly-privileged automation service roles.
  • Establish a baseline of expected deployment activity to reduce noise from routine CI/CD releases.

Immediate actions

Deploy rule to identify manual Lambda layer changes.

Detection Engineering 7d

Threat Hunt

Search CloudTrail logs for all UpdateFunctionConfiguration events over the past 30 days.

T1578.005 medium medium confidence hunt now

Data: CloudTrail logs

Detection coverage 1

Detect Unauthorized AWS Lambda Layer Modifications

low

Detects when a Lambda layer is added or a function is updated using AWS CloudTrail, excluding activity from known IaC tools like Terraform or Pulumi.

sigma tactics: defense_evasion, execution techniques: T1578.005, T1648 sources: cloud, aws

Detection queries are available on the platform. Get full rules →