Skip to main content

More Info:

Ensure that shielded nodes are used in node pools

Risk Level

Medium

Address

Operational Excellence, Reliability, Security

Compliance Standards

  • CIS GKE

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration of not using Shielded Nodes for a Kubernetes Cluster in GCP, you can follow the below steps using GCP console:
  1. Go to the GCP Console and select the Kubernetes Engine from the navigation menu.
  2. Select the Kubernetes Cluster for which you want to enable Shielded Nodes.
  3. Click on the Edit button at the top of the page.
  4. Scroll down to the Node Pools section and click on the node pool name for which you want to enable Shielded Nodes.
  5. In the Node Pool edit page, scroll down to the Security section and enable the Shielded Nodes option.
  6. Click on the Save button to save the changes.
After completing these steps, Shielded Nodes will be enabled for the selected node pool in your Kubernetes Cluster. You can repeat these steps for all the node pools in your cluster to ensure that all nodes are using Shielded Nodes.

To remediate the misconfiguration of using shielded nodes for a Kubernetes cluster on GCP using GCP CLI, you can follow the below steps:
  1. First, you need to check if the Kubernetes cluster is using shielded nodes or not. To check this, run the following command:
  1. If the output of the above command shows that shielded nodes are not enabled, then you can enable it by running the following command:
  1. If the output of the above command shows an error message saying that the beta component is not enabled, then you need to enable it by running the following command:
  1. Once the beta component is installed, you can run the previous command again to enable the shielded nodes.
  2. After enabling the shielded nodes, you can verify it by running the first command again. The output should show that shielded nodes are enabled for the Kubernetes cluster.
By following the above steps, you can remediate the misconfiguration of not using shielded nodes for a Kubernetes cluster on GCP using GCP CLI.
To remediate the misconfiguration of not using shielded nodes for a Kubernetes cluster in GCP using Python, follow these steps:
  1. Install the Google Cloud SDK and Python client library using the following commands:
  1. Create a new GCP project or select an existing project to work with.
  2. Enable the necessary APIs for the project using the following command:
  1. Authenticate the SDK using the following command:
  1. Create a new Kubernetes cluster using the following command:
  1. Verify that the shielded nodes are enabled for the cluster using the following command:
This command should return “True” indicating that the shielded nodes are enabled for the cluster.
  1. If you have an existing cluster, you can update the cluster to enable shielded nodes using the following command:
This command will update the existing cluster to enable shielded nodes.By following these steps, the misconfiguration of not using shielded nodes for a Kubernetes cluster in GCP can be remediated using Python.
Enabling shielded_instance_config.enable_secure_boot = true on an existing node pool forces recreation of the nodes in that pool (the node pool may be replaced depending on current settings), which is a disruptive change for workloads running on those nodes.To verify, terraform plan should show the google_container_node_pool (and optionally google_container_cluster) gaining shielded_instance_config.enable_secure_boot = true, with node recreation indicated in the plan.

Additional Reading: