turbot/gcp_compliance

Query: compute_firewall_default_rule_restrict_ingress_access_except_http_and_https

Usage

powerpipe query gcp_compliance.query.compute_firewall_default_rule_restrict_ingress_access_except_http_and_https

Steampipe Tables

SQL

with default_firewall_rule 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']
)
and name in ('default-allow-ssh', 'default-allow-icmp', 'default-allow-internal', 'default-allow-rdp')
)
select
self_link resource,
case
when not name like 'default-%' then 'skip'
when name in (select name from default_firewall_rule) then 'alarm'
else 'ok'
end as status,
case
when not name like 'default-%' then title || ' is not default firewall.'
when name in (select name from default_firewall_rule) then title || ' is default firewall with public access.'
else title || ' is default firewall with no public access.'
end as reason
, location as location, project as project
from
gcp_compute_firewall;

Controls

The query is being used by the following controls: