Skip to main content

More Info:

Verifies that the API server —audit-log-path argument is set so API activity is recorded. Without audit logging, security incidents cannot be investigated.

Risk Level

High

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, back up the existing manifest so you can roll back if needed:
  2. On every control plane node, create the audit log directory and set safe permissions:
  3. On every control plane node, edit the API server static pod manifest:
    In the command: list for kube-apiserver, add (or modify) this flag so it appears as a separate list item:
    Save and exit. Editing this file will cause the kubelet to restart the kube-apiserver pod automatically.
  4. On every control plane node, wait for the API server pod to restart and become Running:
    (If you use Docker instead of containerd, use sudo docker ps | grep kube-apiserver.)
  5. On any machine with kubectl access, confirm the API server is healthy:
    Ensure the output is ok.
  6. On every control plane node, verify the process now includes the --audit-log-path flag:
    The command should return a line showing --audit-log-path=/var/log/apiserver/audit.log.
kubectl cannot configure API server process flags or edit the static pod manifest at /etc/kubernetes/manifests/kube-apiserver.yaml on control plane nodes. To set --audit-log-path as required, follow the host-level instructions in the Manual Steps section on every control plane node.