More Info:
Verifies that —audit-log-maxsize is set to 100 MB or an appropriate value to control rotation of audit log files.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On every control plane node, back up the current manifest before editing:
-
On every control plane node, edit the API server manifest to set the audit log max size (example: 100 MB):
If the flag does not exist, add this line under the
command:section with the other- --flags: -
Wait for the kubelet on each control plane node to automatically restart the
kube-apiserverstatic pod after the manifest change (this happens automatically; no manual restart command is needed). Be aware this briefly restarts the API server on that node. -
Verify on every control plane node that the API server is running with the correct
--audit-log-maxsizevalue:The command should return a line showing--audit-log-maxsize=100in the kube-apiserver process arguments.
Using kubectl
Using kubectl
kubectl cannot modify the kube-apiserver static pod manifest or its process flags, so this finding cannot be fixed via the Kubernetes API. The
--audit-log-maxsize setting must be changed directly in /etc/kubernetes/manifests/kube-apiserver.yaml on every control plane node; follow the Manual Steps section to make and verify that change.Automation
Automation

