turbot/steampipe-mod-gcp-compliance

Control: Check if Cloud SQL instances are world readable

Usage

Run the control in your terminal:

powerpipe control run gcp_compliance.control.sql_world_readable

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
self_link as resource,
case
when exists (
select 1
from jsonb_array_elements(ip_configuration -> 'authorizedNetworks') as authNet
where authNet ->> 'value' = '0.0.0.0/0' or authNet ->> 'value' = '::/0'
) then 'alarm'
else 'ok'
end as status,
case
when exists (
select 1
from jsonb_array_elements(ip_configuration -> 'authorizedNetworks') as authNet
where authNet ->> 'value' = '0.0.0.0/0' or authNet ->> 'value' = '::/0'
) then title || ' is open to the internet.'
else title || ' is not open to the internet.'
end as reason
, location as location, project as project
from
gcp_sql_database_instance;

Tags