turbot/tailpipe-mod-gcp-audit-log-detections

Detection: Logging Bucket Deleted

Overview

Detect when a logging bucket was deleted in GCP. Logging buckets store logs for analysis and compliance, and their deletion can result in the loss of critical log data, impacting monitoring and forensic investigations. Monitoring these events ensures the integrity and availability of log storage and prevents unauthorized or accidental deletions.

References:

Usage

Run the detection in your terminal:

powerpipe detection run gcp_audit_log_detections.detection.logging_bucket_deleted

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe detection run gcp_audit_log_detections.detection.logging_bucket_deleted --share

SQL

This detection uses a named query:

select
tp_timestamp as timestamp,
method_name as operation,
resource_name as resource,
authentication_info.principal_email as actor,
tp_source_ip as source_ip,
tp_index as project,
tp_id as source_id,
-- Create new aliases to preserve original row data
operation as operation_src,
resource as resource_src,
*
exclude operation, resource
from
gcp_audit_log
where
method_name ilike 'google.logging.v%.configservicev%.deletebucket'
and severity != 'Error'
-- TODO: Do we need to check operation?
-- and (operation_src is null or operation_src.last = true)
order by
timestamp desc;

Tags