More Info:
Verifies that the AlwaysPullImages admission plugin is enabled so images are always pulled and re-authorized, preventing pods from using cached images they are not entitled to.Risk Level
HighAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On every control plane node, back up the current manifest:
-
On every control plane node, open the API server manifest for editing:
-
In the
spec.containers[0].commandlist, locate the existing--enable-admission-plugins=argument.- If it exists, append
,AlwaysPullImagesto the list, for example: - If it does not exist, add a new line under the other
--flags, for example:
- If it exists, append
-
Save the file and exit the editor. The kubelet will automatically restart the
kube-apiserverstatic pod when the manifest changes; expect a brief control-plane disruption while it restarts. -
On every control plane node, wait for the API server pod to become Running:
Confirm the
kube-apiservercontainer is in a running state. -
On any control plane node, verify that the process now includes
AlwaysPullImagesin--enable-admission-plugins:Ensure the output shows an argument similar to:--enable-admission-plugins=...AlwaysPullImages...
Using kubectl
Using kubectl
kubectl cannot be used to enable the AlwaysPullImages admission plugin because this setting is defined in the API server static pod manifest on each control plane node. To fix this finding, edit
/etc/kubernetes/manifests/kube-apiserver.yaml directly on every control plane node as described in the Manual Steps section.Automation
Automation

