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

Query: storage_bucket_iam_permission_granted_public_access

Usage

powerpipe query gcp_audit_log_detections.query.storage_bucket_iam_permission_granted_public_access

Tailpipe Tables

SQL

with policy as(
select
*,
unnest(from_json((service_data -> 'policyDelta' -> 'bindingDeltas'), '["JSON"]')) as bindings
from
gcp_audit_log
where
method_name ilike 'storage.setiampermissions'
)
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
policy
where
(bindings ->> 'member') = 'allUsers'
and severity != 'Error'
-- TODO: Do we need to check operation?
-- and (operation_src is null or operation_src.last = true)
order by
timestamp desc;

Detections

The query is being used by the following detections: