Cloud DNS managed zone DNSSEC key-signing key does not use RSASHA1
Cloud DNS zones are assessed for DNSSEC Key-Signing Key (KSK) algorithms, specifically detecting use of rsasha1. Zones with KSKs on modern algorithms are distinguished from those still using rsasha1.
Risk
Using rsasha1 for KSK weakens DNSSEC. Collision-based forgeries can enable signed record spoofing, resulting in domain hijack, cache poisoning, and redirection-compromising integrity and confidentiality. Some validators reject SHA-1, causing resolution errors and reduced availability.
Run this check with Prowler
Run in Prowler Cloudprowler gcp --checks dns_rsasha1_in_use_to_key_sign_in_dnssecRecommendation
Adopt strong, supported DNSSEC algorithms for KSKs (e.g., ECDSAP256SHA256 or RSASHA256) and retire rsasha1. Rotate keys and validate changes before deployment. Keep KSK and ZSK algorithms consistent, document key-rotation policy, and enforce least privilege for DNS/DNSSEC administration.
Remediation
CLI
gcloud dns managed-zones update <example_resource_name> --dnssec-state on --ksk-algorithm RSASHA256 --ksk-key-length 2048 --zsk-algorithm RSASHA256 --zsk-key-length 1024Terraform
resource "google_dns_managed_zone" "<example_resource_name>" {
name = "<example_resource_name>"
dns_name = "example.com."
dnssec_config {
state = "on"
default_key_specs {
key_type = "keySigning"
algorithm = "rsasha256" # FIX: use a non-RSASHA1 KSK algorithm to pass the check
key_length = 2048
}
default_key_specs {
key_type = "zoneSigning"
algorithm = "rsasha256"
key_length = 1024
}
}
}Other
Check Code
from prowler.lib.check.models import Check, Check_Report_GCP
from prowler.providers.gcp.services.dns.dns_client import dns_client
class dns_rsasha1_in_use_to_key_sign_in_dnssec(Check):
def execute(self) -> Check_Report_GCP:
findings = []
for managed_zone in dns_client.managed_zones:
report = Check_Report_GCP(
metadata=self.metadata(),
resource=managed_zone,
location=dns_client.region,
)
report.status = "PASS"
report.status_extended = f"Cloud DNS {managed_zone.name} is not using RSASHA1 algorithm as key signing."
if any(
[
key["algorithm"] == "rsasha1"
for key in managed_zone.key_specs
if key["keyType"] == "keySigning"
]
):
report.status = "FAIL"
report.status_extended = f"Cloud DNS {managed_zone.name} is using RSASHA1 algorithm as key signing."
findings.append(report)
return findingsReferences
- https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/gcp/CloudDNS/dns-sec-key-signing-algorithm-in-use.html
- https://cloud.google.com/dns/docs/dnssec-config
- https://docs.cloud.google.com/dns/docs/dnssec-config
- https://cloud.google.com/dns/docs/dnssec-advanced?hl=id
- https://docs.cloud.google.com/dns/docs/dnssec-advanced