turbot/gcp_compliance

Query: compute_firewall_rule_restrict_ingress_all

Usage

powerpipe query gcp_compliance.query.compute_firewall_rule_restrict_ingress_all

Steampipe Tables

SQL

with ip_protocol_all as (
select
distinct name
from
gcp_compute_firewall
where
direction = 'INGRESS'
and (
source_ranges ?& array['0.0.0.0/0']
or source_ranges ?& array['::0']
or source_ranges ?& array['0.0.0.0']
or source_ranges ?& array['0.0.0.0/0']
or source_ranges ?& array['::/0']
or source_ranges ?& array['::']
)
and allowed @> '[{"IPProtocol":"all"}]'
)
select
self_link resource,
case
when name in (select name from ip_protocol_all) then 'alarm'
else 'ok'
end as status,
case
when name in (select name from ip_protocol_all) then title || ' allows ingress from internet to all ports.'
else title || ' restricts ingress from internet to all ports.'
end as reason
, location as location, project as project
from
gcp_compute_firewall;

Controls

The query is being used by the following controls: