A GKE Cluster's Kubelet configuration file should disable anonymous requests

Description

Disable anonymous requests to the Kubelet server. You should rely on authentication to authorize access and disallow anonymous requests to prevent unwanted actions in your cluster.

Remediation

Choose a remediation method from below. For both steps, a restart of the Kubelet service is required.

Kubelet config file

  1. Add the json below to this file: /etc/kubernetes/kubelet/kubelet-config.json
"authentication": { "anonymous": { "enabled": false } }

Executable arguments

  1. Edit the kubelet service file on each worker node and ensure the below parameters are part of the KUBELET_ARGS variable string.
--anonymous-auth=false