Abuse of S3 Bucket Lifecycle Expiration for Defense Evasion
Adversaries can abuse Amazon S3 lifecycle expiration configurations to automate the deletion of logs and forensic evidence, hindering incident investigation and response.
What's new
- 1. added coverage for Amazon S3 Aug 24, 09:47 via elastic
Adversaries with sufficient IAM permissions in an AWS environment can modify Amazon S3 bucket lifecycle configurations to automate the deletion of stored objects. By invoking the PutBucketLifecycle or PutBucketLifecycleConfiguration APIs, an attacker can set an expiration policy that deletes logs, forensic artifacts, or sensitive data after a defined period. This technique is used to maintain operational secrecy and prevent detection teams from performing effective post-incident analysis. This activity is often silent and can be difficult to detect if monitoring focuses only on explicit DeleteObject calls rather than configuration management events. Security teams should monitor CloudTrail logs for unexpected lifecycle changes, particularly on buckets containing security-critical data, and validate these changes against known infrastructure-as-code deployments.
Impact
Successful abuse of S3 lifecycle policies leads to the permanent loss of logs and forensic evidence, significantly complicating incident response efforts. This technique directly targets the availability of data needed for auditing and attribution in cloud environments.
Recommendation
- Deploy detection logic to monitor CloudTrail for
PutBucketLifecycleandPutBucketLifecycleConfigurationAPI calls. - Establish guardrails using AWS Config rules, such as
s3-bucket-lifecycle-configuration-check, to monitor and alert on unauthorized lifecycle changes. - Restrict
s3:PutLifecycleConfigurationands3:PutBucketLifecycleIAM permissions to specific, highly privileged administrative roles. - Enable S3 Object Lock on buckets containing critical audit logs or forensic evidence to prevent deletion, even if lifecycle rules are modified.
Immediate actions
Deploy the Sigma rule to monitor for suspicious PutBucketLifecycle events.
Mitigations
Enable S3 Object Lock on buckets containing security-critical logs.
Prevention of unauthorized log deletion via lifecycle rules.
Detection coverage 1
AWS S3 Bucket Expiration Lifecycle Configuration Added
lowDetects the addition of an expiration lifecycle configuration to an Amazon S3 bucket, which can be used to automate the deletion of logs or forensic evidence.
Detection queries are available on the platform. Get full rules →