Detection: RDS DB Instance Deletion Protection Disabled
Overview
Detect when an Amazon RDS database instance had deletion protection disabled. Disabling deletion protection increases the risk of accidental or malicious deletions, potentially leading to data loss, downtime, and operational disruptions. Enabling deletion protection safeguards critical data and ensures secure database management.
References:
Usage
Run the detection in your terminal:
powerpipe detection run aws_cloudtrail_log_detections.detection.rds_db_instance_deletion_protection_disabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe detection run aws_cloudtrail_log_detections.detection.rds_db_instance_deletion_protection_disabled --share
SQL
This detection uses a named query:
select tp_timestamp as timestamp,string_split(event_source, '.')[1] || ':' || event_name as operation,request_parameters ->> 'dBInstanceIdentifier' 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 = 'rds.amazonaws.com' and event_name = 'ModifyDBInstance' and (request_parameters -> 'deletionProtection') = false and error_code is null
order by event_time desc;