Skip to main content

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

High

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, back up the current manifest:
  2. On every control plane node, open the API server manifest for editing:
  3. In the spec.containers[0].command list, locate the existing --enable-admission-plugins= argument.
    • If it exists, append ,AlwaysPullImages to the list, for example:
    • If it does not exist, add a new line under the other -- flags, for example:
  4. Save the file and exit the editor. The kubelet will automatically restart the kube-apiserver static pod when the manifest changes; expect a brief control-plane disruption while it restarts.
  5. On every control plane node, wait for the API server pod to become Running:
    Confirm the kube-apiserver container is in a running state.
  6. On any control plane node, verify that the process now includes AlwaysPullImages in --enable-admission-plugins:
    Ensure the output shows an argument similar to: --enable-admission-plugins=...AlwaysPullImages...
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.