Skip to main content

More Info:

An audit policy file must be configured so the API server records audit events. Without it, security-relevant activity is not logged.

Risk Level

High

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. Review current API server flags for audit configuration
    Run on: every control plane node
    Check whether --audit-policy-file= is present. If it is already configured and points to an existing file, refine that policy instead of creating a new one.
  2. Create a minimal audit policy file
    Run on: every control plane node
    Adjust the rules later as appropriate for your organization’s logging and privacy requirements.
  3. Ensure filesystem permissions are appropriate
    Run on: every control plane node
  4. Configure the API server static pod to use the audit policy
    Run on: every control plane node
    Edit the manifest:
    In the command: or args: list for kube-apiserver, ensure these flags are present (add them if missing, adjusting paths as needed):
    In the volumeMounts: section for the container, add:
    In the volumes: section of the pod spec, add:
    Operational impact: saving this file will cause the kubelet to restart the kube-apiserver static pod.
  5. Confirm that the API server restarted cleanly and is writing audit logs
    Run on: every control plane node
    Ensure new entries appear when you make API calls (for example, run kubectl get pods from a machine with kubectl access).
  6. Verify the API server process now includes the audit policy flag
    Run on: every control plane node
    Confirm that the output includes --audit-policy-file=/etc/kubernetes/audit/audit-policy.yaml (and associated audit log flags), demonstrating that the minimal audit policy is in use.
kubectl cannot configure the API server’s audit policy or edit /etc/kubernetes/manifests/kube-apiserver.yaml, because these are host-level settings on each control plane node. To address this finding, make the changes directly on the control plane nodes as described in the Manual Steps section.