Description
kube-apiserver can write audit events to a file or send them to a webhook. If --audit-log-path is absent, check whether a webhook receives the events.
Potential impact
Without a working destination, you can lose the request history needed to trace a change or investigate misuse.
Remediation
- For file output, set
--audit-log-pathto a writable file on persistent storage. For a webhook, check delivery to the receiver. - Make a request covered by the audit policy and find its event at the destination. Include that destination in monitoring and retention.
Examples
These v1.6.0 excerpts show the path argument. Use an image matching your cluster and supply the audit configuration and storage your version requires.
Before
yaml
apiVersion: v1
kind: Pod
metadata:
name: command-demo
spec:
containers:
- name: command-demo-container
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0
command: ["kube-apiserver"]
args: [""]
After
yaml
apiVersion: v1
kind: Pod
metadata:
name: command-demo
spec:
containers:
- name: command-demo-container
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0
command: ["kube-apiserver"]
args: ["--audit-log-path=path/to/log"]
The second manifest adds path/to/log. Replace it with the path on your mounted log volume.