turbot/steampipe-mod-gcp-compliance

Control: Ensure that sinks are configured for all log entries

Description

It is recommended to create a sink that will export copies of all the log entries. This can help aggregate logs from multiple projects and export them to a Security Information and Event Management (SIEM).

Usage

Run the control in your terminal:

powerpipe control run gcp_compliance.control.logging_sink_configured_for_all_resource

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run gcp_compliance.control.logging_sink_configured_for_all_resource --share

SQL

This control uses a named query:

with project_sink_count as (
select
project,
count(*) no_of_sink
from
gcp_logging_sink
where
filter = ''
and destination != ''
group by
project
)
select
'https://www.googleapis.com/logging/v2/projects/' || s.project resource,
case
when s.no_of_sink > 0 then 'ok'
else 'alarm'
end as status,
case
when s.no_of_sink > 0
then 'Sinks configured for all log entries.'
else 'Sinks not configured for all log entries.'
end as reason
, p.project_id as project
from
gcp_project p
left join project_sink_count s on s.project = p.project_id;

Tags