Home/Refreshers/A record of every action against the cluster API: refresher
A record of every action against the cluster API
Cluster audit logs sent where responders can search them, so exec into a pod or a new role binding is never invisible.
Remember
- Someone calls the cluster API: exec, get secrets, create binding.
- The control plane writes an audit event: who, what, which object.
- It lands in the cloud's log service: kept for a year or more.
- Matching events raise an alert: and can flow on to the SIEM.
| Platform | Uses | The part that catches people |
|---|---|---|
| AWS | EKS control plane audit logs, kept and turned into alarms | EKS writes nothing until audit logging is switched on for the cluster. |
| Google Cloud | GKE audit logs turned into alerts, with reads recorded where they matter | GKE records changes by default and keeps them 400 days. |
| Azure | AKS audit logs in Log Analytics, turned into alerts | The full category, kube-audit, is the one used, and it is the costly one on a busy cluster. |
| Oracle Cloud | OKE API server events in the Audit service, turned into alarms | Oracle describes the feed as administrative changes, the writes, and does not say whether reads appear. |
Run the quick start
| Download providers | terraform init |
| Preview | terraform plan |
| Apply | terraform apply |
Watch out
- An audit log answers who did it only if it was kept.
- The detections follow the attack paths on the Kubernetes for defenders page: exec into a pod, new cluster role bindings, anonymous calls, secrets read by people, and bursts of refused requests.
Check it worked
Run kubectl exec into a test pod. An alert fires within minutes, and the audit entry behind it names the user who made the call.