Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AC_GCP_0014 (dnsStateIsNotOn) false positive #1033

Closed
PurpleBooth opened this issue Sep 23, 2021 · 1 comment
Closed

AC_GCP_0014 (dnsStateIsNotOn) false positive #1033

PurpleBooth opened this issue Sep 23, 2021 · 1 comment
Assignees

Comments

@PurpleBooth
Copy link

PurpleBooth commented Sep 23, 2021

  • terrascan version: v1.10.0
  • Operating System: macOS big sur

Description

AC_GCP_0014 (dnsStateIsNotOn) false positive

What I Did

terrascan init
terrascan scan

on

module "dns_zones" {
  source    = "./modules/dns_zones"
  dns_zones = var.dns_zones

  providers = {
    google-beta = google-beta
  }
}

where the module contains

resource "google_dns_managed_zone" "dns_zones" {
  provider   = google-beta
  count      = length(var.dns_zones)
  name       = replace(var.dns_zones[count.index], ".", "-")
  dns_name   = "${element(var.dns_zones, count.index)}."
  visibility = "public"

  dnssec_config {
    kind          = "dns#managedZoneDnsSecConfig"
    non_existence = "nsec3"
    state         = "on"

    default_key_specs {
      algorithm  = "rsasha256"
      key_length = 2048
      key_type   = "keySigning"
      kind       = "dns#dnsKeySpec"
    }

    default_key_specs {
      algorithm  = "rsasha256"
      key_length = 1024
      key_type   = "zoneSigning"
      kind       = "dns#dnsKeySpec"
    }
  }

  lifecycle {
    prevent_destroy = true

    ignore_changes = [
      visibility,
    ]
  }
}

output "zone_names" {
  value = zipmap(google_dns_managed_zone.dns_zones.*.dns_name, google_dns_managed_zone.dns_zones.*.name)
}

variable "dns_zones" {
  type = list(string)
}

terraform {
  required_providers {
    google-beta = {
      source = "hashicorp/google-beta"
    }
  }
  required_version = ">= 0.13"
}

outputs



Violation Details -
    
	Description    :	Ensure that DNSSEC is enabled for Cloud DNS.
	File           :	modules/dns_zones/main.tf
	Module Name    :	dns_zones
	Plan Root      :	./
	Line           :	1
	Severity       :	LOW
	Rule Name      :	dnsStateIsNotOn
	Rule ID        :	AC_GCP_0014
	Resource Name  :	dns_zones
	Resource Type  :	google_dns_managed_zone
	Category       :	Infrastructure Security
	
	-----------------------------------------------------------------------
	
	Description    :	Ensure that DNSSEC is enabled for Cloud DNS.
	File           :	modules/dns_zones/main.tf
	Module Name    :	root
	Plan Root      :	modules/dns_zones
	Line           :	1
	Severity       :	LOW
	Rule Name      :	dnsStateIsNotOn
	Rule ID        :	AC_GCP_0014
	Resource Name  :	dns_zones
	Resource Type  :	google_dns_managed_zone
	Category       :	Infrastructure Security
	
	-----------------------------------------------------------------------
	

Scan Summary -

	File/Folder         :	/Users/billie/Code/infrastructure-netlify
	IaC Type            :	all
	Scanned At          :	2021-09-23 20:05:51.659743 +0000 UTC
	Policies Validated  :	2
	Violated Policies   :	2
	Low                 :	2
	Medium              :	0
	High                :	0
	


@PurpleBooth PurpleBooth changed the title AC_GCP_0014 false positive AC_GCP_0014 (dnsStateIsNotOn) false positive Sep 23, 2021
hoexter added a commit to hoexter/terrascan that referenced this issue Jan 4, 2022
Unroll the data structure in two steps and fix the actual state
comparison.
cesar-rodriguez pushed a commit that referenced this issue Feb 3, 2022
Unroll the data structure in two steps and fix the actual state
comparison.
@hoexter
Copy link
Contributor

hoexter commented Feb 14, 2022

@cesar-rodriguez I did not close this issue correctly in #1107 but it's fixed and part of the last release (1.13.1). Maybe you can close this one by hand?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants