Skip to main content

More Info:

Retain the logs for at least 30 days or as appropriate.

Risk Level

Low

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, open the kube-apiserver static pod manifest for editing:
  2. In the container command section, either add or update the --audit-log-maxage flag to use at least 30 days, for example:
    Ensure it is listed as a separate - item alongside the other -- flags.
  3. Save and close the file. The kube-apiserver static pod will be automatically restarted by the kubelet when the manifest changes. Expect a brief control plane disruption while it restarts.
  4. Wait for the kube-apiserver pod to come back to a Running state:
  5. Verify that the new process is running with the correct --audit-log-maxage setting on each control plane node:
kubectl cannot modify the API server’s host-level static pod manifest or its process flags, so this finding cannot be fixed via kubectl. To remediate, you must edit /etc/kubernetes/manifests/kube-apiserver.yaml directly on every control plane node to set --audit-log-maxage=30 (or your chosen value); see the Manual Steps section for details.

Additional Reading: