Skip to main content

More Info:

Verifies that —tls-cert-file and —tls-private-key-file are set so the API server serves connections over TLS rather than plaintext HTTP.

Risk Level

High

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, confirm where the API server static pod manifest is located and back it up:
  2. On the same control plane node, ensure you have or create a TLS certificate and key for the API server (adjust CN/SANs as appropriate for your cluster):
  3. On every control plane node, edit the API server manifest to reference the TLS cert and key (this will cause the kube-apiserver static pod to restart when you save):
    If the - kube-apiserver line does not exist exactly as matched above, instead open the file in an editor and add these two flags under command: or args::
  4. On every control plane node, ensure the certificate and key are mounted into the kube-apiserver container if not already (edit with an editor if needed):
    Add under spec.containers[0].volumeMounts in /etc/kubernetes/manifests/kube-apiserver.yaml:
    And ensure a matching volume exists under spec.volumes:
    Saving the file will restart the kube-apiserver static pod.
  5. Wait for the kube-apiserver pod to restart and become Running on each control plane node:
  6. Verify on every control plane node that the kube-apiserver process is now using the TLS certificate and key flags:
kubectl cannot modify the kube-apiserver static pod manifest or its process flags; this setting must be changed directly in /etc/kubernetes/manifests/kube-apiserver.yaml on every control plane node. Refer to the Manual Steps section for the exact edits and verification commands to remediate this finding.