Skip to main content

More Info:

Verifies that —audit-log-maxbackup is set to 10 or an appropriate value so enough old audit log files are retained.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, back up the API server manifest before editing:
  2. Edit the kube-apiserver static pod manifest to set --audit-log-maxbackup (this edit triggers an automatic kube-apiserver restart):
    In the command: or args: list for kube-apiserver, add or update this flag to an appropriate value (10 or higher), for example:
  3. Save the file and exit the editor; wait 30–60 seconds for the kubelet to detect the manifest change and restart the kube-apiserver static pod.
  4. On the same control plane node, confirm the API server process is running with the desired --audit-log-maxbackup value:
    Ensure the output includes:
kubectl cannot modify the API server’s static pod manifest or its process flags, so this finding cannot be fixed via the Kubernetes API. The required change must be made directly on each control plane node in /etc/kubernetes/manifests/kube-apiserver.yaml; see the Manual Steps section for the exact procedure.