Skip to main content

More Info:

Kubernetes can audit the details of requests made to the API server. The —auditpolicy-file flag must be set for this logging to be enabled.

Risk Level

Low

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. Confirm current API server static pod manifest
    • On every control plane node:
  2. Create a minimal audit policy file
    • On every control plane node (same path on each):
  3. Configure the API server to use the audit policy file and log file
    • On every control plane node, edit the static pod manifest:
    • Under spec.containers[0].command: add (or adjust) these flags (one per line) making sure paths match what you created:
    • Under spec.containers[0].volumeMounts: ensure:
    • Under spec.volumes: ensure:
    • Saving this file will cause the kubelet to restart the kube-apiserver static pod on that node.
  4. Ensure log directory exists and has correct ownership
    • On every control plane node:
  5. Wait for kube-apiserver to restart and stabilize
    • On every control plane node:
  6. Verification (audit command–based)
    • On every control plane node, confirm the audit policy flag is present:
    • Optionally confirm audit log file is being written:
kubectl cannot be used to configure the API server’s --audit-policy-file or to edit /etc/kubernetes/manifests/kube-apiserver.yaml; those are host-level files on every control plane node. To address this finding, follow the guidance in the Manual Steps section on each control plane node.

Additional Reading: