Skip to main content

More Info:

Enable auditing on the Kubernetes API Server and set the desired audit log path.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, open the API server static pod manifest for editing:
  2. In the container command/args section for kube-apiserver, add or update the audit log path argument so it is present as its own list item, for example:
    Ensure it is aligned with the other - -- arguments under the same list.
  3. Still on the same node, make sure the target directory exists and has appropriate permissions:
  4. Save the file and exit the editor. The kubelet will automatically detect the change to /etc/kubernetes/manifests/kube-apiserver.yaml and restart the API server static pod; expect a brief control-plane disruption during the restart.
  5. After 1–2 minutes, verify that the API server process now includes the --audit-log-path argument on every control plane node:
    Confirm the output shows a segment similar to:
    --audit-log-path=/var/log/apiserver/audit.log
kubectl cannot configure API server process flags or edit the static pod manifest on disk, so it cannot be used to set --audit-log-path. 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.

Additional Reading: