Skip to main content

More Info:

Ensure that Cloud DNS has logging enabled.

Risk Level

Low

Address

Operational Maturity, Reliability, Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CIS GCP
  • CIS GCP 2.0.0
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • Cloudanix Best Practice
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration of GCP DNS not having logging enabled, you can follow the below steps using the GCP console:
  1. Open the GCP console and navigate to the Cloud DNS page.
  2. Select the DNS zone that needs to have logging enabled.
  3. Click on the “Edit” button at the top of the page.
  4. In the “Logging” section, select the checkbox for “Log DNS queries”.
  5. Choose the destination for the logs. You can either select “Logs Explorer” or “Cloud Storage”.
  6. If you choose “Cloud Storage”, provide the bucket name and folder path where the logs will be stored.
  7. Click on the “Save” button to save the changes.
Once logging is enabled, DNS queries made to the DNS zone will be logged and can be viewed in the selected destination. This will help in identifying any potential security threats and troubleshooting DNS issues.

To remediate the misconfiguration of GCP DNS not having logging enabled, follow the below steps:
  1. Open the Google Cloud Console and select the project that needs to be remediated.
  2. Click on the Navigation menu and select “Logging” under the “Operations” section.
  3. Click on the “Log Exports” tab and then click on the “Create Export” button.
  4. In the “Create Export” window, select “Cloud Storage” as the sink destination.
  5. Select the Cloud Storage bucket where you want to store the logs.
  6. In the “Filter” section, select “Advanced Filter” and enter the following filter:
  1. Click on the “Create” button to create the export.
  2. Now, go to the Cloud DNS page in the Google Cloud Console.
  3. Click on the name of the DNS zone that needs to be remediated.
  4. Click on the “Edit” button at the top of the page.
  5. In the “Logging” section, select the “Export to Cloud Logging” checkbox.
  6. Select the log export that was created in step 7 from the dropdown list.
  7. Click on the “Save” button to save the changes.
With these steps, the misconfiguration of GCP DNS not having logging enabled has been remediated. Now, all DNS queries will be logged and exported to the specified Cloud Storage bucket.
To remediate this misconfiguration, you can use the following steps in Python:
  1. Import the required libraries:
  1. Set up the client for the GCP project:
  1. Define the log metric:
  1. Create the log metric:
  1. Verify that the log metric has been created:
These steps will enable logging for DNS in GCP. You can modify the filter to include other log types as well.
Substitute:
  • CLOUD_DNS_ZONE_NAME with your managed zone name.
  • DNS_NAME_WITH_TRAILING_DOT with your DNS name ending in a dot.
  • DESCRIPTION_OF_ZONE with an appropriate description.
  • GCP_PROJECT_ID with your GCP project ID.
This change is an in-place update; it does not replace the managed zone.Verification: terraform plan should show a change on google_dns_managed_zone.CLOUD_DNS_ZONE_NAME setting cloud_logging_config.enable_logging from false (or null) to true.

Additional Reading: