turbot/steampipe-mod-terraform-gcp-compliance

Control: Ensure that DNSSEC is enabled for Cloud DNS

Description

Cloud Domain Name System (DNS) is a fast, reliable and cost-effective domain name system that powers millions of domains on the internet. Domain Name System Security Extensions (DNSSEC) in Cloud DNS enables domain owners to take easy steps to protect their domains against DNS hijacking and man-in-the-middle and other attacks.

Usage

Run the control in your terminal:

powerpipe control run terraform_gcp_compliance.control.dns_managed_zone_dnssec_enabled

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_gcp_compliance.control.dns_managed_zone_dnssec_enabled --share

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std ->> 'visibility') = 'private' then 'skip'
when (attributes_std -> 'dnssec_config') is null or coalesce((attributes_std -> 'dnssec_config' ->> 'state'), '') in ('', 'off')
then 'alarm'
when (attributes_std -> 'dnssec_config' -> 'default_key_specs' ->> 'algorithm') = 'rsasha1' and
(attributes_std -> 'dnssec_config' -> 'default_key_specs' ->> 'key_type') = 'keySigning'
then 'alarm'
else 'ok'
end as status,
split_part(address, '.', 2) || case
when (attributes_std -> 'dnssec_config') is null then ' ''dnssec_config'' is not defined'
when coalesce((attributes_std -> 'dnssec_config' ->> 'state'), '') = ''
then ' ''dnssec_config.state'' is not defined'
when (attributes_std ->> 'visibility') = 'private'
then ' is private'
when coalesce((attributes_std -> 'dnssec_config' ->> 'state'), '') = 'off' then ' DNSSEC not enabled'
when (attributes_std -> 'dnssec_config' -> 'default_key_specs' ->> 'algorithm') = 'rsasha1' and
(attributes_std -> 'dnssec_config' -> 'default_key_specs' ->> 'key_type') = 'keySigning'
then ' using RSASHA1 algorithm for key-signing'
else ' not using RSASHA1 algorithm for key-signing'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'google_dns_managed_zone';

Tags