Skip to main content

More Info:

Verifies that the NamespaceLifecycle admission plugin is not disabled so objects cannot be created in non-existent or terminating namespaces.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, open the API server static pod manifest for editing (this will restart the API server when saved):
  1. In the spec.containers[0].command list, locate any existing --disable-admission-plugins= argument. Edit it to remove NamespaceLifecycle from the comma-separated list of plugins, ensuring the argument either:
  • does not exist at all, or
  • exists but does not contain NamespaceLifecycle (e.g. change
    --disable-admission-plugins=NamespaceLifecycle,SomeOtherPlugin
    to
    --disable-admission-plugins=SomeOtherPlugin).
  1. If NamespaceLifecycle was the only plugin listed, remove the entire --disable-admission-plugins=NamespaceLifecycle flag line from the command list.
  2. Save the file and exit the editor. The kubelet will automatically detect the manifest change and restart the kube-apiserver static pod.
  3. Wait for the API server pod to become ready:
Confirm the pod is in Running status and READY is 1/1.
  1. Verify that the NamespaceLifecycle plugin is not disabled:
Confirm that the output either shows no --disable-admission-plugins flag, or that its value does not contain NamespaceLifecycle.
kubectl cannot be used to change API server process flags or edit the static pod manifest at /etc/kubernetes/manifests/kube-apiserver.yaml on the control plane nodes. To remediate this finding, make the change directly on each control plane node as described in the Manual Steps section.