Skip to main content

More Info:

Do not disable the secure port.

Risk Level

Critical

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, back up the current manifest before editing:
  1. On every control plane node, edit the API server manifest to remove or change the --secure-port flag. For example, to set it to 6443:
If the flag appears in another form, open the file and edit manually:
and either delete the --secure-port=0 line or change 0 to your desired non‑zero port.
  1. Wait for the kubelet on each control plane node to automatically restart the kube-apiserver static pod due to the manifest change (typically within ~1 minute). Be aware this restarts the API server and may briefly impact API availability.
  2. On any machine with SSH access to each control plane node, verify the new kube-apiserver process is running with a non‑zero secure port:
Confirm there is no --secure-port=0 argument in the output; if --secure-port appears, it must be set to a non‑zero port (for example --secure-port=6443).
kubectl cannot modify the kube-apiserver static pod manifest or its process flags. This finding must be fixed directly on every control plane node by editing /etc/kubernetes/manifests/kube-apiserver.yaml; see the Manual Steps section for the exact procedure.

Additional Reading: