What Kubernetes audit logging records and when you need it
The kube-apiserver can record every API request it receives according to an audit policy, so a security or compliance lead can answer who did what, to which resource, and when. Audit logging is the control that turns the cluster's API into an evidence trail, and it is the first thing to design when a self-managed cluster must show who changed a Deployment, read a Secret or altered an RBAC binding. Without an explicit policy, the record is thinner than most teams assume, and the answer to an assessor's question may not exist.
Regulated teams need this record because access to the Kubernetes API is effectively administrative access to every workload, namespace and credential in the cluster. Assessors who map cluster controls to a framework will ask for logs of privileged actions, changes to access rights and reads of sensitive objects, and they will ask whether those logs are complete, protected and retained. Audit events do not cover everything. They say nothing about activity on the nodes themselves, such as SSH sessions, kubelet actions outside the API or container runtime behavior, and they do not capture what an application did with its own data. Those sources need separate logging, which the monitoring and logging section and the Kubernetes security hardening section address. Before you build anything, confirm with your auditors which events they expect, which identities must be traceable and how long the evidence must be kept.
How audit events flow from kube-apiserver to a SIEM
The flow starts when an API request reaches kube-apiserver, which matches the request against the audit policy file to decide its level before any event is written. Events then go to a log file or a webhook backend, configured through flags on the API server. A log shipper on the control plane host moves events across the trust boundary to the SIEM and to separate retention storage. Check that the policy file and backend settings are readable only by administrators, and that events reach the SIEM intact.
Audit events flow from the API server through a backend to the SIEM and retention storage.
How Kubernetes audit logging decides what to record
The audit policy decides what the kube-apiserver records, and it works as an ordered list of rules. Each rule can match a request by user, verb, resource, namespace and stage. When a request matches, the first matching rule sets its level, and later rules are not applied to that request. This ordering matters in practice: a broad rule placed above a narrow one will hide the narrow one, so the most specific exceptions belong at the top and the catch-all rules at the bottom. Before writing rules, map who calls the API (human users, CI pipelines, controllers, node agents) and which resources carry sensitive data, since those two lists drive most of the rule design.
Levels run from no logging, to metadata only (who did what, to which resource, and when), to request bodies, and finally to request and response bodies. Higher levels produce more data and more storage cost, and they also carry more risk. Logging request or response bodies for Secrets is the main hazard: the audit trail would then hold the secret values themselves, copied into a second store that often has weaker access controls than etcd. A safe default is metadata-level logging for Secrets and ConfigMaps, with bodies reserved for resources where the content is needed for investigations and is not sensitive. Confirm the exact level names and their behavior against the audit documentation for your chosen Kubernetes version before you commit to a policy.
The flags that load the audit policy file and set the log backend (log file or webhook) have changed across Kubernetes releases, so confirm the exact flag names, the audit policy API version and any retention or rotation options in the kube-apiserver reference for the version you run. Treat your policy as a versioned artifact: test it in a non-production cluster, check that the rules match the requests you expect, and confirm that Secrets bodies are not written to the backend. Your security and compliance teams should sign off on the policy because it defines what evidence exists later.
Audit levels, backends and retention options and when each fits
This table compares the audit level choices, the log file and webhook backends, and file retention settings for the Kubernetes API server. Read each row against your SIEM ingestion budget and the specific controls your assessors will ask you to evidence. The main takeaway is that broader levels and full request bodies raise both evidence quality and event volume, so the policy should be narrowed to what you can justify.
| Option | What it records or does | When it fits |
|---|---|---|
| Metadata level (most resources) | Records who made the request, the verb, the resource, the namespace, the response code and timestamps, but not request or response bodies | Default for most resource groups where you need a who-did-what trail without storing full object contents |
| Request level | Adds the request body to the metadata record for the matched resources | Resources where you must show the exact change submitted, such as selected workload or admission-relevant objects, after confirming the added volume is acceptable |
| RequestResponse level | Adds both request and response bodies, which can include sensitive object contents | Rarely justified. Use only for narrow resource groups where an assessor requires full payloads and secret-bearing objects are excluded |
| None level (exclusion) | Drops matching events entirely so they never reach a backend | High-volume, low-risk read traffic such as health checks or noisy system components, once you have documented the exclusion for your evidence file |
| RBAC and authentication resources | Covers changes to roles, bindings and authentication-related objects, which show privilege changes and access grants | Typically set to a tighter or richer level than other resources because access changes are central to access control reviews |
| Log file backend | Writes events as JSON lines to a file on each control plane node, configured with a path and rotation settings | Simplest option for a collector such as an agent that tails files. Each control plane node holds its own copy, so confirm collection covers every node |
| Webhook backend | Sends events over HTTP to an external receiver that you operate or that a SIEM provides | Suits central ingestion without file agents on control plane nodes. Plan for receiver outages, TLS settings and what happens to events when the receiver is down |
| File retention settings | Flags such as maximum age, maximum number of files and maximum file size control how long local audit files are kept before rotation | Keep local retention long enough to cover your SIEM outage tolerance and evidence period. Confirm exact flag names and defaults in your version's documentation |
Setting up the audit policy and backend in a self-managed cluster
This sequence turns Kubernetes API audit logging from a plan into a working log path on every control plane node, with a tested request that proves the events are captured at the intended level. A kubeadm-built cluster is a common starting point, and each step ends with a check you can record for your change file.
Draft the audit policy for priority resources
Your security and platform leads write a policy file that names the resources and users that matter most, such as Secrets, RBAC objects, ServiceAccounts, pod exec and attach, and admin or break-glass identities. Start with a narrow rule set and widen it after you have reviewed volume. Set Secrets to log metadata only so request and response bodies never reach the log. Check the draft by reading each rule and confirming that no rule records the body of a Secret, token or credential object.
Place the policy file on every control plane node
The platform engineer copies the identical audit policy file to the same path on each control plane node, usually under /etc/kubernetes/audit, and sets matching permissions so only root can change it. In a kubeadm-built cluster, the kube-apiserver static pod manifest in /etc/kubernetes/manifests references this path, so the file must also be mounted into the kube-apiserver container. Check the result by comparing checksums of the file across all nodes and confirming that the mount appears in each manifest.
Set the log path and retention flags on kube-apiserver
The platform engineer edits the kube-apiserver manifest on each control plane node to add the audit policy flag, the log path flag, and the retention flags for maximum age, maximum backups and maximum file size. Confirm the exact flag names against the kube-apiserver reference for your Kubernetes version before editing. Mount the log directory from the host so logs survive container restarts. Check the manifest by reviewing the diff on each node, confirming that all three nodes carry the same audit settings and retention values.
Apply the change across all control plane nodes
Roll the change one control plane node at a time so the API remains available through the other members. Each kube-apiserver restarts when the kubelet detects the manifest change, so wait for the node to report ready and its kube-apiserver pod to run before moving to the next node. Confirm the rollout order in your change plan and record the time each node finished. Check that every control plane node reports the same audit flags in the running pod specification, not only in the file on disk.
Confirm kube-apiserver starts cleanly on each node
The platform engineer reviews kube-apiserver logs and pod status on every control plane node to confirm the process started without errors about the policy file, the log path, or invalid flags. A failed policy file often prevents the API server from starting, so this check comes before any test traffic. Confirm that the audit log file is being created at the configured path on each node. Check that each kube-apiserver pod is in the running state and that the audit log file grows after a simple read request.
Generate a known test request and verify its level
The engineer creates a labeled test ConfigMap in a non-production namespace, reads it back, and then deletes it. Search the audit log on each control plane node for the test request, using the user, namespace and resource name, and confirm the event appears at the level the policy assigns to that resource. Repeat with a test Secret and confirm that the event is recorded without its body. Check that both events are present on every node and that the Secret entry contains no secret data.
Record the configuration and confirm the Secret rule holds
The platform team saves the policy file, the manifest changes, the test steps and the verification output in the cluster change record, so an auditor or future engineer can reproduce the setup. Confirm with your security team whether any additional Secret access patterns, such as service account token requests, need their own rule. Check the record by confirming that a second engineer can rebuild the configuration from it and that the Secret rule still logs metadata only.
Shipping Kubernetes audit events to a SIEM such as Wazuh
The API server does not send audit events to a SIEM on its own. It either writes them to a local file through the log backend or posts them to a remote endpoint through the webhook backend, and a separate shipper or receiver has to move them from there into the SIEM. Your first decision is which path to use. A file-based design needs an agent on each control plane node that reads the audit log file, while a webhook design needs a receiver reachable from the API server that accepts the events and forwards them. Confirm the exact backend flags and their behavior in your Kubernetes version against the official documentation before you choose, because the webhook path adds a network dependency on the control plane that the file path does not have.
Once events leave the API server, the pipeline has to make them usable. Decide which shipper reads the file, how each JSON event is parsed into fields such as user, verb, resource and response code, and how every event is tagged with the cluster name, environment and control plane node. Without a cluster tag, events from several clusters look identical in the SIEM. Define the alert logic before you build the ingestion path: for example, who may read Secrets, changes to RBAC bindings, or exec into pods in restricted namespaces. Each alert needs a named owner who responds to it, and the pipeline needs an owner who fixes it when it stops delivering events. Name both roles in writing.
Wazuh is one option you may evaluate. It is distributed under the GNU General Public License version 2, with an exception that permits linking with the OpenSSL library, so confirm that this license fits your own distribution and linking practices with your legal team. Wazuh documents several installation routes, including all-in-one and step-by-step installation, Docker, Kubernetes, Ansible and an offline installation guide for networks without internet access, which matters for air-gapped control planes. Treat the SIEM choice, its license terms and its ingestion sizing as separate decisions to confirm with the vendor and in your own environment. The audit policy itself does not depend on which SIEM receives the events.
How audit logging changes for connected and air-gapped clusters
When the control plane and nodes can reach public registries and a hosted SIEM, the audit pipeline can use standard image pulls and direct egress. The audit policy and API server flags are the same as in any cluster, but the shipper, such as a log agent that reads the audit file or receives webhook events, can be pulled from its upstream registry and updated on your normal schedule. The main risk shifts from availability to data handling, because audit events often contain usernames, source addresses, object names and request metadata that leave your boundary.
- Pin image versions: Reference shipper images by version or digest, not
latest, so audit collection does not change during an unplanned pull. - Restrict egress: Allow outbound traffic from the shipper only to the SIEM endpoint on the required port, and log denied connections.
- Encrypt in transit: Require TLS to the SIEM and confirm how certificates are rotated.
- Review event content: Decide which request bodies and resource fields are recorded at each audit level, since higher levels can capture sensitive data.
- Confirm data residency: Ask the hosted provider where events are stored, how long they are retained and who at the provider can access them.
Check that the audit file or webhook buffer survives a SIEM outage, and that the retention you set in the cluster matches the retention promised by the SIEM provider.
Without an internet path, every component of the audit pipeline must be available from inside your network. kubeadm supports this: kubeadm config images list and kubeadm config images pull identify and fetch the control plane images, and --image-repository points kubeadm init at a private registry. The shipper image, the SIEM server components and the vulnerability content must be staged the same way, and each import needs a recorded source and checksum so the change can be reviewed.
- Mirror images to a private registry: Copy control plane and shipper images into an internal registry, then point kubeadm and the workload manifests at it.
- Install the SIEM offline: Wazuh documents an offline installation guide for systems without internet connectivity, which should be followed with the same version set used for the cluster.
- Use an offline vulnerability repository: Wazuh vulnerability detection can use an offline repository instead of the Wazuh Cyber Threat Intelligence platform, so agent software inventory is matched against content you refresh and approve.
- Plan the audit file transfer: Decide whether audit files leave through a one-way diode, a removable media process or an approved internal relay, and document who authorizes each transfer.
- Stage updates as bundles: Treat each mirror refresh as a release with a manifest, test run and rollback copy.
Confirm with the vendor which SIEM components need external lookups at runtime, since any hidden callout will fail silently in an isolated network.
Many regulated environments run a cluster that is air-gapped while the SIEM or reporting team sits in a connected zone. In that model the audit files are the only regular data crossing the boundary, so the transfer design decides whether evidence is complete, tamper-evident and available for review. The cluster keeps writing audit events locally, while the transfer step moves them on a schedule or by a triggered process approved by your security team.
- Define the boundary object: Specify whether the transferred unit is the raw audit file, a compressed batch or a filtered subset, and what metadata accompanies it.
- Preserve integrity: Record hashes before transfer and verify them on arrival, so gaps or edits are detectable.
- Handle gaps explicitly: Decide how a failed transfer is detected, alerted and replayed without losing events from rotated files.
- Limit who can move data: Assign a named owner for the transfer process and log every batch that crosses the boundary.
- Test the full path: Run a sample request, confirm it appears in the connected SIEM, and document the time between event and visibility.
Ask your auditors which evidence they will request from each side of the boundary before the design is final.
Security and operational risks of audit logs
Audit logs record who did what in the API server, which makes them valuable and sensitive at the same time. The cards below cover the risks that tend to surface after an audit policy goes live, each paired with a control and a check you can run.
Sensitive data in request bodies
At the RequestResponse level, audit events can include full request and response bodies, including Secret values. Kubernetes stores Secrets unencrypted in etcd by default, so a log that captures those bodies can expose credentials a second time. Limit body capture to the resources you need, keep Secrets at the Metadata level, and confirm that encryption at rest is configured for etcd. Check a sample of recent Secret events to see what was written.
Secrets good practicesTampering and unauthorized reading
Audit files on a control plane node and webhook traffic to a collector are only useful if nobody can alter or quietly read them. Restrict file permissions on the audit log directory to root, and make sure the log shipper runs with read access only. Use TLS and client authentication on the webhook channel. Verify that an operator without cluster-admin rights cannot read the audit directory or modify the webhook configuration.
Disk pressure on control plane nodes
Audit logs grow with request volume, and a generous retention setting can fill the disk of a control plane node that also runs etcd. A full disk can stop etcd and take the cluster down. Set the audit log maximum size, age and file count deliberately, and size the partition holding the log directory separately from etcd data. Watch disk usage on every control plane node and alert before the partition fills.
Noisy policy hiding important events
A broad rule set can produce so many events that the ones that matter, such as changes to RBAC bindings or admission webhooks, are buried or dropped by the backend. Start with a focused policy, measure event volume for a representative period, and then widen coverage. Give high-value resources explicit rules at a detailed level, and place low-value noise such as health checks in a rule that omits them. Confirm that the rules you expect to fire actually appear in the log.
Policy drift without review
The audit policy file is the record of what the cluster captures, and an edit made directly on a control plane node leaves no history. Keep the policy in version control, require review for changes, and deploy it through the same pipeline used for other cluster configuration. Compare the running policy file against the reviewed version during periodic checks, and record the commit that each cluster runs so auditors can trace the setting.
Logs without detection rules
Collecting audit events does not by itself notify anyone about suspicious activity. A SIEM only raises alerts for the patterns someone writes as rules, such as repeated forbidden responses, Secret reads by unexpected identities, or changes to cluster-admin bindings. Define these rules with your security team, test each one against sample events, and assign an owner for every alert. Review alert volume regularly so the rules stay useful.
What do buyers ask about Kubernetes audit logging cost, effort and ownership?
What drives the effort of setting up Kubernetes audit logging?
The effort depends mostly on how many control plane nodes you run, whether the control plane is managed or self-managed, which SIEM receives the events, how detailed the audit policy needs to be, and what evidence your assessors expect. A self-managed cluster lets you edit the API server flags and policy file directly. In a managed service, you usually depend on the provider's audit settings and may have less control over what is recorded. Each SIEM has its own ingestion format, parsing, and retention model, so the shipping pipeline is often the largest variable. Ask the partner to break the estimate into policy design, control plane configuration, shipping and SIEM mapping, and validation.
Is the audit policy work a one-time task or does it recur?
Writing the first audit policy is one-time work, but it is not a set-and-forget task. Policy tuning continues after go-live as teams notice noisy events or missing detail, and new workloads or custom resources may need their own rules. Retention reviews recur because log volume, storage cost, and legal hold requirements change over time. Kubernetes upgrades can also change audit configuration, so the policy and flags need checking at each minor version change. Ask whether the quote covers the initial tuning window only or includes periodic reviews, and whether those reviews are part of a retainer.
Can our internal platform team set up Kubernetes audit logging alone?
Often yes, if the team has someone who can edit control plane configuration, administers the SIEM, and can write and test an audit policy. The hard parts are usually not the YAML. They are deciding which events matter for your investigations, making sure the logs do not expose sensitive request bodies, and proving that events arrive in the SIEM with the fields analysts need. A partner can be useful when the team lacks SIEM or security engineering capacity, or when the work must be reviewed by an independent party. Your team should still own the policy decisions after handover.
What does the client need to provide for this work?
You need access to control plane nodes or the cluster configuration path, with change windows for API server restarts. You also need SIEM administrators who can create indexes, parsers, and alert rules, and a named owner who approves the audit policy, because the policy decides what is recorded and what is excluded. Security and compliance staff should confirm which evidence they need and how long records must be kept. Ask for a list of access requirements in the written scope before work starts, so that delays from waiting on approvals are visible in the plan.
Does audit logging support compliance evidence on its own?
No. Audit logging produces records that can support controls such as access monitoring and change tracking, but it does not make a cluster compliant. Assessors look at whether the logs are complete for the scope, protected from modification, retained for the required period, reviewed, and linked to an owner. DeployOpen prepares systems, controls, and evidence for compliance assessments, but independent auditors and certification bodies issue any reports or attestations. Ask the partner to map the logging controls to the framework you are assessed against, and confirm which framework requirements your own legal or compliance team must interpret.
Which parts of the audit logging scope should a written quote include?
A written scope should name the cluster or clusters covered, the audit levels and resources in the policy, the log backend, any webhook backend and its receiver, the retention settings, the SIEM and its parsing and alerting work, and the test method used to prove events arrive. It should also list the Kubernetes minor versions in use, the change windows, and what documentation and handover you receive. Ask whether the quote includes post-upgrade checks, a tuning period, and a retest. Anything not listed should be marked as out of scope so both sides know what remains with your team.
What risks should we ask about before approving audit logging changes?
The main risks are logging too little to answer investigation questions, logging so much that sensitive data such as request bodies or secrets is stored in logs, and overloading the SIEM or the log storage path. Misconfigured webhook backends can also block API requests if the receiver is unavailable, so ask how failure behavior is set and tested. Changes to API server flags require restarts, which carry operational risk on production control planes. Ask the partner how they test the policy in a non-production cluster first, how they check for sensitive data in events, and how they roll back a bad change.
Limits to confirm in your environment before you commit
Audit logging depends on the Kubernetes version you run, the control plane your provider exposes, the SIEM you ship to and the compliance obligations you must meet. Each of the cards below is a point where an assumption can fail, so confirm them with the people who own each dependency before you fix the design.
Flags and policy behavior by version
Audit flags and policy handling can change between minor releases, so a policy that works on one cluster may not load on another. As of September 2026, the supported minor versions are 1.35, 1.36 and 1.37, with end-of-life dates of February 28, 2027, June 28, 2027 and October 28, 2027 respectively, according to the Kubernetes releases page. Confirm the version you will run, check the flags against that version's API server reference, and plan a retest of your audit policy at each upgrade.
Kubernetes releasesManaged control plane exposure
If a managed provider runs your control plane, the provider decides which audit logs reach you and how they are delivered. Some services expose only part of the API server audit stream, and retention and access to those logs are governed by the provider's service terms. Ask the provider which audit event categories are exported, whether you can change the audit policy, and how long logs stay available to you before you assume the self-managed design applies.
SIEM ingestion and log volume
Audit logs at high request rates can produce large event volumes, and SIEM licenses often price or throttle by ingested data. Ask your SIEM vendor for its current ingestion limits, parsing support for Kubernetes audit events, and the cost of storing events at your expected volume. Measure real request rates in a staging cluster before you choose the level of detail for each resource, because a policy that records full request bodies for busy resources can exceed what your SIEM contract allows.
Wazuh version and shipper compatibility
The current Wazuh release line is 4.14, and the 4.14 patch releases have arrived roughly every one to two months, so the agent and server versions in your environment may differ from the ones your shipper was tested against. Confirm the Wazuh version you will deploy, check that the log collection method you choose for audit files is supported on it, and test the full path from the API server to the dashboard after each patch. Record the versions you validated so later upgrades start from a known state.
Wazuh release notesFramework event, retention and integrity requirements
Compliance frameworks may require specific events, minimum retention periods or tamper evidence for audit records, and those requirements decide the policy levels, storage tier and access controls you need. Your auditor or compliance lead must confirm which events must be captured, how long they must be kept, and whether logs must be protected against modification or deletion. Do not infer these requirements from the Kubernetes defaults, because the default settings do not state them.
CIS Benchmark scope in the control set
The CIS Kubernetes Benchmark includes recommendations about API server audit configuration, so whether your organization adopts it determines how much of the audit design is prescribed. Confirm with your security team whether the benchmark is in scope, which version of it applies to your distribution, and whether your managed provider already documents a conformance position for it. Use the benchmark's audit recommendations as a checklist for your policy and record any deviation with a reason.
CIS Kubernetes BenchmarkHow DeployOpen scopes and delivers Kubernetes audit logging
DeployOpen plans, builds and documents Kubernetes API audit logging inside the client's own clusters and infrastructure. The work starts with the compliance and security requirements that the audit trail must satisfy, then turns them into a written audit policy, log and webhook backends, a SIEM pipeline and a handover the client's teams can operate.
How we scope
- We confirm which audit events your security and compliance teams need, and which resources and users they cover.
- We review your Kubernetes version, distribution and managed-service limits before choosing log or webhook backends.
- We agree the scope, deliverables and timelines in writing before work starts, since most engagements are fixed-scope.
How we build
- We write the audit policy with levels per resource, keeping sensitive Secrets and ConfigMaps at metadata level only.
- We configure kube-apiserver audit flags, log rotation, retention and backend settings on your control plane nodes.
- We connect audit events to your SIEM and test that sample API calls produce the expected records and alerts.
How we hand over
- We document the audit policy, backend settings, retention values and SIEM parsing rules so your team can review them.
- We provide a verification checklist that your engineers can rerun after cluster upgrades or control plane changes.
- We deliver runbooks for investigating events, rotating log files and handling audit pipeline failures.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover.
- A retainer can cover audit policy reviews when new workloads, CRDs or compliance requirements change what must be recorded.
- We retest the audit pipeline after Kubernetes minor upgrades, since policy and flag behavior can change between releases.

