Skip to main content

More Info:

Rotate log files on reaching 100 MB or as appropriate.

Risk Level

Low

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, back up the existing manifest before editing:
  1. Edit the API server manifest to set the audit log max size (example: 100 MB):
If --audit-log-maxsize is not present, add a new line under the command/- kube-apiserver args block, for example:
  1. Wait for the kubelet on the control plane node to detect the changed static pod manifest and restart the kube-apiserver pod automatically. This restart is expected and will temporarily affect the API server on that node.
  2. Verify on the same control plane node that the kube-apiserver process is running with the desired --audit-log-maxsize value (replace 100 below if you chose a different value):
kubectl cannot modify the kube-apiserver static pod manifest or its process flags, so this finding cannot be fixed via the Kubernetes API. To change --audit-log-maxsize, you must edit /etc/kubernetes/manifests/kube-apiserver.yaml directly on every control plane node; follow the steps in the Manual Steps section.

Additional Reading: