Files
splunk-security_content/detections/cloud/aws_lambda_updatefunctioncode.yml

46 lines
2.1 KiB
YAML

name: AWS Lambda UpdateFunctionCode
id: 211b80d3-6340-4345-11ad-212bf3d0d111
version: 7
date: '2025-05-02'
author: Bhavin Patel, Splunk
status: production
type: Hunting
description: The following analytic identifies IAM users attempting to update or modify
AWS Lambda code via the AWS CLI. It leverages CloudTrail logs to detect successful
`UpdateFunctionCode` events initiated by IAM users. This activity is significant
as it may indicate an attempt to gain persistence, further access, or plant backdoors
within your AWS environment. If confirmed malicious, an attacker could upload and
execute malicious code automatically when the Lambda function is triggered, potentially
compromising the integrity and security of your AWS infrastructure.
data_source:
- AWS CloudTrail
search: '`cloudtrail` eventSource=lambda.amazonaws.com eventName=UpdateFunctionCode* errorCode = success user_type=IAMUser
| rename user_name as user
| stats count min(_time) as firstTime max(_time) as lastTime by signature dest user user_agent src vendor_account vendor_region vendor_product
| `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` |`aws_lambda_updatefunctioncode_filter`'
how_to_implement: You must install Splunk AWS Add on and enable Cloudtrail logs in
your AWS Environment.
known_false_positives: While this search has no known false positives, it is possible
that an AWS admin or an autorized IAM user has updated the lambda fuction code legitimately.
references:
- http://detectioninthe.cloud/execution/modify_lambda_function_code/
- https://sysdig.com/blog/exploit-mitigate-aws-lambdas-mitre/
tags:
analytic_story:
- Suspicious Cloud User Activities
asset_type: AWS Account
mitre_attack_id:
- T1204
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
security_domain: threat
tests:
- name: True Positive Test
attack_data:
- data:
https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1204/aws_updatelambdafunctioncode/aws_cloudtrail_events.json
sourcetype: aws:cloudtrail
source: aws_cloudtrail