Skip to main content

More Info:

GKE cluster should use node local DNS cache

Risk Level

Low

Address

Performance Efficiency, Operational Excellence, Reliability, Security

Compliance Standards

CBP

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration “Cluster Should Use Node Local DNS Cache” for GCP using GCP console, please follow the below steps:
  1. Open the Google Cloud Console and select your project.
  2. Go to the Kubernetes Engine section of the console.
  3. Select the cluster you want to remediate.
  4. Click on the “Edit” button at the top of the page.
  5. In the “Node pools” section, click on the name of the node pool you want to remediate.
  6. Scroll down to the “Node image” section and click on the “Change” button.
  7. Select the latest version of the node image that includes the node local DNS cache feature.
  8. Click on the “Save” button to save the changes.
  9. Wait for the nodes in the node pool to be updated with the new node image.
  10. Verify that the node local DNS cache feature is enabled by running a test pod and checking its DNS resolution.
By following these steps, you can remediate the misconfiguration “Cluster Should Use Node Local DNS Cache” for GCP using GCP console.

To remediate the misconfiguration “Cluster Should Use Node Local DNS Cache” in GCP using GCP CLI, follow these steps:
  1. Open the Cloud Shell in GCP Console.
  2. Run the following command to get the list of clusters in your project:
  1. Identify the cluster that needs to be remediated and run the following command to get the cluster’s credentials:
  1. Once you have the credentials, run the following command to update the cluster configuration:
This command enables the node local DNS cache for the specified cluster.
  1. Verify that the configuration has been updated by running the following command:
This command should return the following output, indicating that the node local DNS cache is enabled:
By following these steps, you have successfully remediated the misconfiguration “Cluster Should Use Node Local DNS Cache” for your GCP cluster using GCP CLI.
To remediate the misconfiguration “Cluster Should Use Node Local DNS Cache” in GCP using Python, you can follow the below steps:Step 1: Install the necessary Python packages - google-auth and google-api-python-client.
Step 2: Authenticate with GCP using a service account key file.
Step 3: Enable the “Cloud DNS API” for the project.
Step 4: Create a new DNS policy with node-local caching enabled.
Step 5: Assign the newly created DNS policy to the cluster.
With these steps, the misconfiguration “Cluster Should Use Node Local DNS Cache” has been remediated for GCP using Python.