Table: gcp_dns_managed_zones

This table shows data for GCP DNS Managed Zones.

https://cloud.google.com/dns/docs/reference/v1/managedZones#resource (opens in a new tab)

The primary key for this table is id.

Relations

The following tables depend on gcp_dns_managed_zones:

Columns

NameType
_cq_iduuid
_cq_parent_iduuid
project_idutf8
cloud_logging_configjson
creation_timeutf8
descriptionutf8
dns_nameutf8
dnssec_configjson
forwarding_configjson
id (PK)int64
kindutf8
labelsjson
nameutf8
name_server_setutf8
name_serverslist<item: utf8, nullable>
peering_configjson
private_visibility_configjson
reverse_lookup_configjson
service_directory_configjson
visibilityutf8

Example Queries

These SQL queries are sampled from CloudQuery policies and are compatible with PostgreSQL.

Ensure legacy networks do not exist for a project (Automated)

SELECT
  id AS resource_id,
  'Ensure legacy networks do not exist for a project (Automated)' AS title,
  project_id AS project_id,
  CASE
  WHEN dnssec_config->>'state' != 'on' THEN 'fail'
  ELSE 'pass'
  END
    AS status
FROM
  gcp_dns_managed_zones;

Ensure that DNSSEC is enabled for Cloud DNS (Automated)

SELECT
  DISTINCT
  gdmz.id AS resource_id,
  'Ensure that DNSSEC is enabled for Cloud DNS (Automated)' AS title,
  gdmz.project_id AS project_id,
  CASE
  WHEN gdmzdcdks->>'keyType' = 'keySigning'
  AND gdmzdcdks->>'algorithm' = 'rsasha1'
  THEN 'fail'
  ELSE 'pass'
  END
    AS status
FROM
  gcp_dns_managed_zones AS gdmz,
  jsonb_array_elements(gdmz.dnssec_config->'defaultKeySpecs') AS gdmzdcdks;

Ensure that RSASHA1 is not used for the zone-signing key in Cloud DNS DNSSEC (Manual)

SELECT
  DISTINCT
  gdmz.id AS resource_id,
  'Ensure that RSASHA1 is not used for the zone-signing key in Cloud DNS DNSSEC (Manual)'
    AS title,
  gdmz.project_id AS project_id,
  CASE
  WHEN gdmzdcdks->>'keyType' = 'zoneSigning'
  AND gdmzdcdks->>'algorithm' = 'rsasha1'
  THEN 'fail'
  ELSE 'pass'
  END
    AS status
FROM
  gcp_dns_managed_zones AS gdmz,
  jsonb_array_elements(gdmz.dnssec_config->'defaultKeySpecs') AS gdmzdcdks;

Ensure that DNSSEC is enabled for Cloud DNS (Automated)

SELECT
  id AS resource_id,
  'Ensure that DNSSEC is enabled for Cloud DNS (Automated)' AS title,
  project_id AS project_id,
  CASE
  WHEN visibility != 'private'
  AND ((dnssec_config IS NULL) OR dnssec_config->>'state' = 'off')
  THEN 'fail'
  ELSE 'pass'
  END
    AS status
FROM
  gcp_dns_managed_zones;