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
HighAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Review current API server flags for audit configuration
Run on: every control plane nodeCheck 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. -
Create a minimal audit policy file
Run on: every control plane nodeAdjust the rules later as appropriate for your organization’s logging and privacy requirements. -
Ensure filesystem permissions are appropriate
Run on: every control plane node -
Configure the API server static pod to use the audit policy
Run on: every control plane node
Edit the manifest:In thecommand:orargs:list forkube-apiserver, ensure these flags are present (add them if missing, adjusting paths as needed):In thevolumeMounts:section for the container, add:In thevolumes:section of the pod spec, add:Operational impact: saving this file will cause the kubelet to restart thekube-apiserverstatic pod. -
Confirm that the API server restarted cleanly and is writing audit logs
Run on: every control plane nodeEnsure new entries appear when you make API calls (for example, runkubectl get podsfrom a machine with kubectl access). -
Verify the API server process now includes the audit policy flag
Run on: every control plane nodeConfirm 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.
Using kubectl
Using kubectl
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.Automation
Automation

