Skip to main content

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration “Cluster Master Endpoint Should Not Be Global” for GCP using GCP console, follow the below steps:
  1. Go to the Google Kubernetes Engine (GKE) console.
  2. Select the cluster for which you want to remediate the misconfiguration.
  3. Click on the “Edit” button on the top of the page.
  4. Scroll down to the “Endpoint” section.
  5. Under the “Master endpoint” section, select the “Regional” option.
  6. Select the region where your cluster is located.
  7. Click on the “Save” button to apply the changes.
Once you have completed these steps, your cluster master endpoint will no longer be global and will be limited to the selected region. This will help to reduce the attack surface and improve the security of your GKE cluster.

To remediate the misconfiguration “Cluster Master Endpoint Should Not Be Global” for GCP using GCP CLI, follow the below steps:
  1. Open the Google Cloud Console and navigate to the Kubernetes Engine.
  2. Select the cluster that you want to remediate.
  3. Click on the “Edit” button at the top of the page.
  4. Scroll down to the “Master endpoint” section.
  5. Click on the “Customize” button next to the “Master endpoint” field.
  6. Select “Regional” from the dropdown menu.
  7. Choose the region where you want to create the endpoint.
  8. Click on the “Save” button.
  9. Verify that the endpoint has been updated to the regional endpoint by running the following command in the GCP CLI:
Replace [CLUSTER_NAME] and [ZONE] with your cluster name and zone respectively.
  1. Ensure that the endpoint is not global by running the following command:
If the endpoint is not global, you will see the regional endpoint in the output.By following these steps, you will remediate the misconfiguration “Cluster Master Endpoint Should Not Be Global” for GCP using GCP CLI.
To remediate the misconfiguration “Cluster Master Endpoint Should Not Be Global” for GCP using Python, you can follow the below steps:Step 1: Install the necessary libraries
Step 2: Import the necessary libraries
Step 3: Set up the credentials for authentication
Step 4: Create a client object for the Container API
Step 5: Get the cluster details
Step 6: Check if the master endpoint is global
Step 7: Verify if the master endpoint is updated to regional
By following these steps, you can remediate the misconfiguration “Cluster Master Endpoint Should Not Be Global” for GCP using Python.
Changing an existing public cluster to use private_cluster_config (or changing these fields) forces replacement of the cluster in Terraform, which means control-plane and node recreation and associated downtime; plan this as a migration, not an in-place tweak.For verification, terraform plan should show google_container_cluster.gke_private with private_cluster_config.enable_private_endpoint = true, private_cluster_config.enable_private_nodes = true, a set master_ipv4_cidr_block, and master_global_access_config.enabled = false, with the cluster marked for recreation if it was previously public.