Skip to main content

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

Medium

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, back up the current manifest before editing:
  2. 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:
  3. Wait for the kubelet on each control plane node to automatically restart the kube-apiserver static 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.
  4. Verify on every control plane node that the API server is running with the correct --audit-log-maxsize value:
    The command should return a line showing --audit-log-maxsize=100 in the kube-apiserver process arguments.
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.