Skip to main content

More Info:

Retain 10 or an appropriate number of old log files.

Risk Level

Low

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, open the kube-apiserver static pod manifest for editing:
  2. In the command: section of the kube-apiserver container, locate any existing --audit-log-maxbackup flag. If it exists with the wrong value, change it to 10 (or your chosen appropriate value). If it does not exist, add it as a separate list item, for example:
  3. Save and exit the editor. The kubelet will automatically detect the manifest change and restart the kube-apiserver static pod. Be aware this restarts the API server on this node.
  4. Wait for the kube-apiserver container to become ready again:
  5. Verify that the kube-apiserver process is now running with the correct --audit-log-maxbackup argument on this control plane node:
  6. Repeat steps 1–5 on every control plane node.
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; see the Manual Steps section for how to update --audit-log-maxbackup and verify the fix.

Additional Reading: