CertGrid CertGrid
Hands-on Lab·Certified Kubernetes Security Specialist

Querying Kubernetes Audit Logs

An audit log is a haystack by design. This guide does five ordinary things to a cluster and then finds each of them again, which is the skill the competency is actually about.

Monitoring and Runtime Guide 33 of 40 Advanced

The same cka8001 apiserver, with audit logging on from the previous guide. The query helper is thirty lines of Python and is on the page.

The same single node, still running with audit logging enabled from the previous page.
Server NameIP AddressOSRolesCPURAMHDD
CKA8001192.168.0.56Ubuntu 26.04 LTSSingle Node (control plane, untainted)2 Core4 GB50 GB

This guide includes

Use this once auditing is on, because the log is a haystack by design. This matters because filtering by resource is not the query you want - the useful questions are about verbs and identities.

Before you start

  1. Do five things worth finding later

  2. Why filtering by resource is not the query

  3. The one that matters most

  4. What it costs, and putting it back

Official sources