Detection: KMS Key Deletion Scheduled
Overview
Detect when an AWS Key Management Service (KMS) key was scheduled for deletion. Scheduling key deletion can render all associated encrypted data inaccessible, leading to data loss, application downtime, and workflow disruptions. Monitoring key deletion schedules ensures data availability, protects sensitive information, and maintains operational continuity.
References:
Usage
Run the detection in your terminal:
powerpipe detection run aws_cloudtrail_log_detections.detection.kms_key_deletion_scheduled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe detection run aws_cloudtrail_log_detections.detection.kms_key_deletion_scheduled --share
SQL
This detection uses a named query:
select tp_timestamp as timestamp,string_split(event_source, '.')[1] || ':' || event_name as operation,request_parameters ->> 'keyId' 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 = 'kms.amazonaws.com' and event_name = 'ScheduleKeyDeletion' and error_code is null
order by event_time desc;