More Info:
Verifies that —audit-log-maxage is set to 30 days or an appropriate value so audit records are retained long enough for investigations.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On every control plane node, open the API server static pod manifest for editing:
-
In the
command:(orargs:) list forkube-apiserver, add or modify the audit log max age flag so it is present exactly once and set to at least 30. For example, ensure there is a line like: -
Save and exit the file. The kubelet will automatically detect the change and restart the
kube-apiserverstatic pod. Be aware this briefly restarts the API server on that node. -
Wait for the
kube-apiserverpod to restart and become Running on that node:(Usedocker psinstead ofcrictlif the node uses Docker.) -
Verify the
kube-apiserverprocess now includes the correct--audit-log-maxageparameter on each control plane node:
Using kubectl
Using kubectl
kubectl cannot modify the kube-apiserver static pod manifest or its process flags, so it cannot be used to set
--audit-log-maxage. This must be fixed directly on each control plane node by editing /etc/kubernetes/manifests/kube-apiserver.yaml; see the Manual Steps section for the exact procedure.Automation
Automation

