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

Detection: Cloud Run Function Deleted

Overview

Detect when a Cloud Run Function was deleted. Unauthorized or accidental deletions of Cloud Run Functions can disrupt critical services, cause downtime, or result in the loss of essential serverless resources. Monitoring these deletions ensures they are intentional and authorized.

References:

Usage

Run the detection in your terminal:

powerpipe detection run gcp_audit_log_detections.detection.cloud_run_function_deleted

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe detection run gcp_audit_log_detections.detection.cloud_run_function_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
*
from
gcp_audit_log
where
method_name ilike 'google.cloud.functions.v%.functionservice.deletefunction'
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