More Info:
Verifies that the NamespaceLifecycle admission plugin is not disabled so objects cannot be created in non-existent or terminating namespaces.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
- On every control plane node, open the API server static pod manifest for editing (this will restart the API server when saved):
- In the
spec.containers[0].commandlist, locate any existing--disable-admission-plugins=argument. Edit it to removeNamespaceLifecyclefrom 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).
-
If
NamespaceLifecyclewas the only plugin listed, remove the entire--disable-admission-plugins=NamespaceLifecycleflag line from thecommandlist. - Save the file and exit the editor. The kubelet will automatically detect the manifest change and restart the kube-apiserver static pod.
- Wait for the API server pod to become ready:
Running status and READY is 1/1.- Verify that the
NamespaceLifecycleplugin is not disabled:
--disable-admission-plugins flag, or that its value does not contain NamespaceLifecycle.Using kubectl
Using kubectl
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.Automation
Automation

