Detection: EBS Volume Detached
Overview
Detect when an EBS volume was detached from an EC2 instance. Unauthorized or accidental detachments can disrupt operations, expose critical data, or result in data loss. Monitoring volume detachments ensures timely detection of potential risks and safeguards data integrity and availability.
References:
Usage
Run the detection in your terminal:
powerpipe detection run aws_cloudtrail_log_detections.detection.ebs_volume_detached
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe detection run aws_cloudtrail_log_detections.detection.ebs_volume_detached --share
SQL
This detection uses a named query:
select tp_timestamp as timestamp,string_split(event_source, '.')[1] || ':' || event_name as operation,request_parameters ->> 'name' 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_logwhere event_source = 'ec2.amazonaws.com' and event_name = 'DetachVolume' and error_code is null
order by event_time desc;