Skip to main content

More Info:

Use the Container-Optimized OS (cos_containerd) image for GKE nodes, which is hardened and minimizes the attack surface. Other images carry more packages and larger exposure.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS GKE

Triage and Remediation

Remediation

Manual Steps

  1. List all node pools and their image types
    Run on any machine with gcloud configured:
  2. Identify non‑compliant node pools
    From the output, note any node pool where config.imageType is not COS_CONTAINERD (e.g. UBUNTU, UBUNTU_CONTAINERD, COS) for further review.
  3. Assess workload and feature compatibility before changing images
    For each non‑COS_CONTAINERD node pool:
    • Confirm workloads don’t rely on OS‑specific packages, custom agents, or kernel modules only present on the current image.
    • Confirm any node‑level DaemonSets (monitoring, logging, security agents) support cos_containerd.
    • If unsure, create or use a test cluster/node pool with cos_containerd and validate workloads there first.
  4. Plan and execute node pool image migration
    For each node pool you decide to migrate, run on any machine with gcloud configured:
    This recreates nodes in that pool with the new image and will cause pod evictions and rescheduling; perform during a maintenance window and ensure PodDisruptionBudgets and autoscaling are configured appropriately.
  5. Verify node pool image types after upgrade
    Re‑run, on any machine with gcloud configured:
    Confirm all intended node pools now show COS_CONTAINERD as config.imageType.
  6. Spot‑check via the original audit command
    Optionally, for each node pool, run:
    Ensure the value returned is "COS_CONTAINERD" for compliant node pools.
kubectl cannot modify the node image type or node pool configuration; this setting is managed at the GKE control-plane / cloud-provider level (gcloud, console, or IaC). To address this finding, follow the guidance in the Manual Steps section using the appropriate GCP tools.