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
LowAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Confirm current API server static pod manifest
- On every control plane node:
- On every control plane node:
-
Create a minimal audit policy file
- On every control plane node (same path on each):
- On every control plane node (same path on each):
-
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.
- On every control plane node, edit the static pod manifest:
-
Ensure log directory exists and has correct ownership
- On every control plane node:
- On every control plane node:
-
Wait for kube-apiserver to restart and stabilize
- On every control plane node:
- On every control plane node:
-
Verification (audit command–based)
- On every control plane node, confirm the audit policy flag is present:
- Optionally confirm audit log file is being written:
- On every control plane node, confirm the audit policy flag is present:
Using kubectl
Using kubectl
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.Automation
Automation

