turbot/gcp_insights

Query: sql_database_instance_is_public

Usage

powerpipe query gcp_insights.query.sql_database_instance_is_public

SQL

select
'Public Access' as label,
case when ip_configuration -> 'authorizedNetworks' @> '[{"name": "internet", "value": "0.0.0.0/0"}]' then 'Enabled' else 'Disabled' end as value,
case when ip_configuration -> 'authorizedNetworks' @> '[{"name": "internet", "value": "0.0.0.0/0"}]' then 'alert' else 'ok' end as type
from
gcp_sql_database_instance
where
project = split_part($1, '/', 7)
and self_link = $1;

Dashboards

The query is used in the dashboards: