turbot/gcp_insights

Query: network_firewall_rules_count

Usage

powerpipe query gcp_insights.query.network_firewall_rules_count

SQL

with compute_firewall as (
select
network,
project
from
gcp_compute_firewall
), compute_network as (
select
name,
project,
id
from
gcp_compute_network
where
id = (split_part($1, '/', 1))::bigint
and project = split_part($1, '/', 2)
)
select
'Firewall Rules' as label,
count(f.*) as value,
case when count(f.*) > 0 then 'ok' else 'alert' end as type
from
compute_firewall f,
compute_network n
where
split_part(f.network, 'networks/', 2) = n.name
and f.project = n.project;

Dashboards

The query is used in the dashboards: