turbot/tailpipe-mod-aws-cloudtrail-log-detections

Detection: S3 Bucket Deleted

Overview

Detect when an Amazon S3 bucket was deleted. Bucket deletions can lead to permanent data loss, operational disruptions, or compliance violations, especially if the data is not backed up or the deletion is unauthorized. Ensuring buckets are deleted only by authorized actions helps protect critical data and maintain compliance.

References:

Usage

Run the detection in your terminal:

powerpipe detection run aws_cloudtrail_log_detections.detection.s3_bucket_deleted

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe detection run aws_cloudtrail_log_detections.detection.s3_bucket_deleted --share

SQL

This detection uses a named query:

select
tp_timestamp as timestamp,
string_split(event_source, '.')[1] || ':' || event_name as operation,
request_parameters ->> 'bucketName' as resource,
user_identity.arn as actor,
tp_source_ip as source_ip,
tp_index as account_id,
aws_region as region,
tp_id as source_id,
*
from
aws_cloudtrail_log
where
event_source = 's3.amazonaws.com'
and event_name = 'DeleteBucket'
and error_code is null
order by
event_time desc;

Tags