More Info:
Retain 10 or an appropriate number of old log files.Risk Level
LowAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On every control plane node, open the kube-apiserver static pod manifest for editing:
-
In the
command:section of thekube-apiservercontainer, locate any existing--audit-log-maxbackupflag. 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: - 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.
-
Wait for the kube-apiserver container to become ready again:
-
Verify that the kube-apiserver process is now running with the correct
--audit-log-maxbackupargument on this control plane node: - Repeat steps 1–5 on every control plane node.
Using kubectl
Using kubectl
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.Automation
Automation

