Using Shielded GKE nodes

This page shows you how to use the Shielded GKE nodes feature. Shielded GKE nodes provide strong, verifiable node identity and integrity to increase the security of Google Kubernetes Engine (GKE) nodes.

About Shielded GKE nodes

Shielded GKE nodes are built on top of Compute Engine Shielded VMs. Without Shielded GKE nodes an attacker can exploit a vulnerability in a Pod to exfiltrate bootstrap credentials and impersonate nodes in your cluster, giving the attackers access to cluster secrets. When Shielded GKE nodes is enabled, the GKE control plane cryptographically verifies that:

  • Every node in your cluster is a virtual machine running in Google's data center.
  • Every node is part of the managed instance group provisioned for the cluster.
  • The kubelet is being provisioned a certificate for the node on which it is running.

This limits the ability of an attacker to impersonate a node in your cluster even if they are able to exfiltrate bootstrap credentials of the node.

You can optionally configure node integrity checks on node pools to provide enhanced rootkit and bootkit protection for your nodes. These node pool settings are independent from Shielded GKE nodes and will work even if Shielded GKE nodes is disabled on the cluster.

For more information, see the Shielded VM documentation.

There is no additional cost to run Shielded GKE nodes. However, Shielded GKE nodes generate about 0.5 KB more logs on startup than standard nodes. See the Cloud Logging pricing page for details.

Availability

  • Shielded GKE nodes are available in GKE version 1.13.6-gke.0 and later.
  • Shielded GKE nodes are available in all zones and regions.
  • Shielded GKE nodes can be used with all node images.
  • Shielded GKE nodes can be used with GPUs.

Before you begin

Before you start, make sure you have performed the following tasks:

Set up default gcloud settings using one of the following methods:

  • Using gcloud init, if you want to be walked through setting defaults.
  • Using gcloud config, to individually set your project ID, zone, and region.

Using gcloud init

If you receive the error One of [--zone, --region] must be supplied: Please specify location, complete this section.

  1. Run gcloud init and follow the directions:

    gcloud init

    If you are using SSH on a remote server, use the --console-only flag to prevent the command from launching a browser:

    gcloud init --console-only
  2. Follow the instructions to authorize gcloud to use your Google Cloud account.
  3. Create a new configuration or select an existing one.
  4. Choose a Google Cloud project.
  5. Choose a default Compute Engine zone for zonal clusters or a region for regional or Autopilot clusters.

Using gcloud config

  • Set your default project ID:
    gcloud config set project PROJECT_ID
  • If you are working with zonal clusters, set your default compute zone:
    gcloud config set compute/zone COMPUTE_ZONE
  • If you are working with Autopilot or regional clusters, set your default compute region:
    gcloud config set compute/region COMPUTE_REGION
  • Update gcloud to the latest version:
    gcloud components update

Enabling Shielded GKE nodes in a new cluster

You can create a new cluster with Shielded GKE nodes enabled by using the gcloud tool or Google Cloud Console.

gcloud

When creating a new cluster, specify the --enable-shielded-nodes option:

gcloud container clusters create CLUSTER_NAME --enable-shielded-nodes

Console

  1. Go to the Google Kubernetes Engine page in Cloud Console.

    Go to Google Kubernetes Engine

  2. Click Create.

  3. From the navigation pane, under Cluster, click Security.

  4. Select the Enable Shielded GKE nodes checkbox.

  5. Configure your cluster as desired.

  6. Click Create.

See Creating a cluster for more details about creating clusters.

Enabling Shielded GKE nodes in an existing cluster

You can enable Shielded GKE nodes in an existing cluster by using the gcloud command-line tool or Google Cloud Console.

After you enable Shielded GKE nodes, the control plane and nodes are recreated as Shielded VMs. The control plane is unavailable while it is being recreated. The cluster nodes are recreated in a rolling fashion to minimize downtime.

gcloud

When updating the cluster, specify the --enable-shielded-nodes option:

gcloud container clusters update CLUSTER_NAME --enable-shielded-nodes

Console

  1. In the Cloud Console, go to the Google Kubernetes Engine page.

    Go to Google Kubernetes Engine

  2. Click the name of the cluster you want to modify.

  3. Under Security, in the Shielded GKE nodes field, click Edit Shielded GKE nodes.

  4. Select the Enable Shielded GKE nodes checkbox.

  5. Click Save Changes.

Verifying that Shielded GKE nodes are enabled

You verify that your cluster is using Shielded GKE nodes with the gcloud command-line tool or Google Cloud Console.

gcloud

Describe the cluster:

gcloud container clusters describe CLUSTER_NAME

If Shielded GKE nodes are enabled, the output of the command will include these lines:

shieldedNodes:
  enabled: true

Console

To verify that a cluster is using Shielded GKE nodes:

  1. In the Cloud Console, go to the Google Kubernetes Engine page.

    Go to Google Kubernetes Engine

  2. Click the name of the cluster you want to inspect.

  3. Under Security, in the Shielded GKE nodes field, verify that Shielded GKE nodes is Enabled.

You can also monitor the integrity of your nodes' underlying Shielded VMs. See Monitoring Integrity on Shielded VM Instances for the procedure.

Disabling Shielded GKE nodes

You can disable Shielded GKE nodes with the gcloud command-line tool or Google Cloud Console.

gcloud

When updating the cluster, specify the --no-enable-shielded-nodes option:

gcloud container clusters update CLUSTER_NAME --no-enable-shielded-nodes

Console

  1. In the Cloud Console, go to the Google Kubernetes Engine page.

    Go to Google Kubernetes Engine

  2. Click the name of the cluster you want to modify.

  3. Under Security, in the Shielded GKE nodes field, click Edit Shielded GKE nodes.

  4. Clear the Enable Shielded GKE nodes checkbox.

  5. Click Save Changes.

After you disable Shielded GKE nodes, the control plane and nodes are recreated as ordinary, unshielded VMs. The control plane is unavailable while it is being recreated. The cluster nodes are recreated in a rolling fashion to minimize downtime.

Node integrity

Secure Boot and Integrity Monitoring are node pool settings that can be used alongside Shielded GKE nodes. Shielded GKE nodes, Secure Boot, and Integrity Monitoring are independent features that can each be enabled or disabled individually.

Secure boot

Secure boot is a node pool setting that's disabled by default on GKE because third-party unsigned kernel modules cannot be loaded when secure boot is enabled.

If you don't use third-party unsigned kernel modules, you can enable secure boot with the gcloud command-line tool or Google Cloud Console.

gcloud

To enable secure boot when creating a cluster:

gcloud container cluster create CLUSTER_NAME --shielded-secure-boot

To enable secure boot when creating a node pool:

gcloud container node-pool create POOL_NAME --shielded-secure-boot

Secure boot is disabled by default. You can explicitly disable it when creating a cluster or node pool with the --no-shielded-secure-boot option.

Console

To enable secure boot when creating a node pool:

  1. In the Cloud Console, go to the Google Kubernetes Engine page.

    Go to Google Kubernetes Engine

  2. Click the name of the cluster you want to modify.

  3. Click Add Node Pool.

  4. From the navigation menu, click Security.

  5. Under Shielded options, select the Enable secure boot checkbox.

  6. Click Create.

Integrity monitoring

Integrity monitoring is a node pool setting that's enabled by default on GKE. You can disable integrity monitoring with the gcloud command-line tool or Google Cloud Console.

gcloud

To disable integrity monitoring for system components when creating a cluster:

gcloud container cluster create CLUSTER_NAME --no-shielded-integrity-monitoring

To disable integrity monitoring for system components when creating a node pool:

gcloud container node-pool create POOL_NAME --no-shielded-integrity-monitoring

Integrity monitoring is enabled by default. You can explicitly enable it when creating a cluster or node pool with the --shielded-integrity-monitoring option.

Console

To disable integrity monitoring when creating a node pool:

  1. In the Cloud Console, go to the Google Kubernetes Engine page.

    Go to Google Kubernetes Engine

  2. Click the name of the cluster you want to modify.

  3. Click Add Node Pool.

  4. From the navigation pane, click Security.

  5. Under Shielded options, clear the Enable integrity monitoring checkbox.

What's next