Ensure Automatic node upgrades are enabled on Kubernetes Engine Clusters nodes

Creating a new cluster using Google Cloud Platform has the auto upgrade option enabled by default.

Risk Level: High
Cloud Entity: Kubernetes Cluster
CloudGuard Rule ID: D9.GCP.AS.04
Covered by Spectral: Yes
Category: Compute

GSL LOGIC

GkeCluster should have nodePools contain [ management.autoUpgrade=true ]

REMEDIATION

From Portal

  1. Go to the Google Kubernetes Engine page in Cloud Console: https://console.cloud.google.com/kubernetes/list?
  2. In the cluster list, click the name of the cluster you want to modify.
  3. Click the Nodes tab.
  4. Under Node Pools, click the name of the node pool you want to modify.
  5. On the Node pool details page, click Edit.
  6. Under Management, select the Enable auto-upgrade checkbox.
  7. Click Save.

From TF
Set the 'auto_upgrade' to be equal to true:

resource "google_container_node_pool" "primary_preemptible_nodes" {
	...
	management{
		auto_upgrade ="true"
	}
	...
}

From Command Line
Run

gcloud container node-pools update NODE_POOL_NAME --cluster CLUSTER_NAME --zone COMPUTE_ZONE --enable-autoupgrade

References

  1. https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-upgrades
  2. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool

Kubernetes Cluster

Kubernetes Engine is a managed, production-ready environment for deploying containerized applications. It brings our latest innovations in developer productivity, resource efficiency, automated operations, and open source flexibility to accelerate your time to market.

Launched in 2015, Kubernetes Engine builds on Google's experience of running services like Gmail and YouTube in containers for over 12 years. Kubernetes Engine allows you to get up and running with Kubernetes in no time, by completely eliminating the need to install, manage, and operate your own Kubernetes clusters.

Compliance Frameworks

  • CloudGuard GCP All Rules Ruleset
  • GCP CIS Foundations v. 1.0.0
  • GCP CloudGuard Best Practices
  • GCP MITRE ATT&CK Framework v12.1
  • GCP NIST 800-53 Rev 5