Upwind raises $250M Series B to secure the cloud for the world →
Get a Demo

Kubernetes audit logs are a cornerstone of cluster visibility. They capture the who, what, and when of user and service activity. But their sheer volume and complexity often create bottlenecks for security teams trying to distinguish meaningful anomalies from routine noise. We’re going deeper into the role of Kubernetes audit logs in DevSecOps workflows, exploring their potential and limitations in detecting threats in dynamic environments.

Let’s Review: What Are Kubernetes Audit Logs?

Kubernetes audit logs are detailed records of all API server requests, capturing key information such as:

Kubernetes includes built-in audit logging capabilities, but they are not enabled by default. To use audit logs, cluster administrators must configure an audit policy that defines what events to log and set up external tools for storing, managing, and analyzing the logs effectively.

Kubernetes logs provide contextual security for containers by identifying threats at the cluster orchestration level. However, unlike in Kubernetes runtime security, they don’t monitor processes or behaviors occurring inside the containers themselves.

Audit logs are indispensable for both operations and security, offering actionable insights into cluster activity.

Operational Insights


From an operations standpoint, Kubernetes audit logs provide visibility into resource utilization so teams can identify which developers, workloads, or containers are consuming disproportionate compute resources. This data gives operations teams the tools to optimize resource allocation, reduce costs, and prevent bottlenecks in highly dynamic environments. However, the challenge lies in correlating raw log data with actionable trends — it can require tooling and expertise to derive meaningful insights.

Monitoring resource utilization in Kubernetes doesn’t have to come from audit logs. Here, runtime security monitoring offers insight into resource allocation. It can also help catch anomalous usage that could signal an attack.
Monitoring resource utilization in Kubernetes doesn’t have to come from audit logs. Here, runtime security monitoring offers insight into resource allocation. It can also help catch anomalous usage that could signal an attack.

Security Use Cases


From a security perspective, audit logs are a critical line of defense. They can uncover how attackers gained initial access, escalated privileges, or moved laterally across containers and into host systems. Beyond detection, these logs are used in post-incident forensics, allowing teams to reconstruct a detailed timeline, pinpoint the attack vector, assess the scope of the attack, and, ultimately, assign accountability.

Screenshot of a security detection dashboard for a Kubernetes cluster. Shows a detailed view of a privileged pod creation alert, including timeline, severity, and detections list with four categories: Active, Medium, and Low threats, all marked in the sidebar.
Organizations can see who accessed a resource, what resource was targeted, and the resulting success or failure. But visibility beyond API interactions can add security to log data, like this detection of network traffic, showing traffic to an unknown IP.

In runtime security, proactive monitoring of audit logs often determines whether an attack is stopped midstream or allowed to progress unchecked. Yet, the sheer volume of logs in a busy Kubernetes environment can overwhelm traditional analysis methods, requiring organizations to balance comprehensive monitoring with efficient signal-to-noise filtering. 

As the most comprehensive activity record within Kubernetes runtime, audit logs are foundational to securing containers and their infrastructure. However, their value depends on effective collection, processing, and analysis.

Components of Kubernetes Audit Logging

To fully harness the operational and security power of audit logs, it helps to start at the beginning, with their components, how they’re generated, and how audit policies control their collection and use. 

Kubernetes audit logs originate within the kube-apiserver component. Each time a user or process makes a request, an audit event is generated at every stage of the request’s execution. Next, the event is processed based on a pre-defined audit policy and written to a backend. The audit policy specifies which events to log, while backends — such as log files or webhooks — manage the storage of these logs.

Audit policies define rules about which requests are recorded and what information each request needs to include. To set up an audit policy, teams must first record the parameters about the events that need to be logged. This includes defining which level of event needs to be recorded, which external storage needs to receive the log data, and the amount of time to retain log data.

Properly configuring the audit policy to store the right activity data and retain it for an appropriate length of time ensures that companies can maximize the use of Kubernetes audit log data.

To analyze logs, DevOps and DevSecOps teams examine the structured JSON data within each log entry by looking for patterns or anomalies across the logs. The analysis typically involves using dedicated monitoring tools or security information and event management (SIEM) solutions to filter, query, and visualize the data to pinpoint suspicious behavior or compliance issues.

By carefully configuring audit policies, teams can ensure that logs capture the right events with the necessary detail, avoiding unnecessary noise while retaining critical information. When combined with robust analysis tools like SIEMs, these logs transform into a powerful resource for identifying threats, ensuring compliance, and optimizing resource allocation. 

Kubernetes Audit Log Best Practices

Managing Kubernetes in production environments has become a linchpin for modern cloud-native security and operational strategies—but it’s no secret that teams often feel the pressure to “get it right.”

“When done correctly, containers are a really strong security boundary. The problem is what does being done correctly really mean for your organization.” — One CTO on “Hacking Kubernetes”

The controversies surrounding Kubernetes security often center on balancing comprehensiveness with practicality. Logging every event can overwhelm storage and analysis pipelines, while overly selective logging risks missing critical activity. Furthermore, with the increasing adoption of tools like CNAPPs, some question whether Kubernetes-native audit logs are enough. Ultimately, logs work best when coupled with runtime insights offered by more comprehensive solutions, keeping the following best practices in mind:

Focus Audit Policies on Critical Issues

Properly configured Kubernetes audit logs are an important foundation for deriving actionable insights and maintaining security and compliance. But achieving it involves setting a well-defined audit policy and choosing appropriate storage backends.

A well-defined audit policy specifies:

A basic audit policy configuration might look like this:

apiVersion: audit.k8s.io/v1
kind: Policy
rules:
  - level: RequestResponse
    omitStages:
      - RequestReceived
    resources:
      - group: ""

Copied

Using fields like omitStages to exclude unneeded stages (e.g., RequestReceived) helps filter noise so the resulting logs are focused on meaningful events. 

Use External Storage for Secure and Scalable Log Retention

Audit logging operates on two levels:

  1. Policy: Determines which events to capture.
  2. Backend: Specifies how logs are stored or forwarded.

Audit log management requires external storage since storing logs in etcd is neither supported nor practical for long-term retention. Instead:

Build a Foundation for Incident Response

Routing logs to external storage enables advanced security monitoring and incident response, too. Logs forwarded to SIEMs, observability platforms, or similar tools allow organizations to:

Before implementing a CNAPP, this approach provides foundational visibility and analysis for Kubernetes environments. While a CNAPP consolidates and automates runtime security, compliance, and threat detection across the stack, external audit log management can serve as a stepping stone for teams building out their cloud-native security strategy incrementally.

Overall, combining tailored policies with strong external storage solutions helps Kubernetes audit logs become powerful tools for proactive monitoring, compliance, and post-incident analysis.

Scale Log Management with Intelligent Filtering

As Kubernetes clusters scale, the sheer volume of audit logs can overwhelm traditional storage and analysis methods, making it difficult for teams to continue extracting meaningful data. Effective log management at scale means intelligent filtering and context-aware tools prioritizing critical information. To manage scalability:

Next, add context to audit logs. While Kubernetes audit logs provide critical API-level activity records, they lack runtime and behavioral context. 

By focusing on critical events, using external storage, integrating with incident response workflows, and scaling intelligently, teams can use Kubernetes audit logs as a force for securing dynamic cloud-native environments. These best practices offer a roadmap for balancing scalability, security, and operational efficiency in even the most complex clusters.

Runtime Security with Audit Logs

Kubernetes audit logs are a real-time source of activity data within the cluster, offering visibility into API-level actions as they happen. With auditing enabled, DevSecOps teams can monitor events like user or container access attempts, actions performed, and whether those actions succeeded or failed.

When properly configured and monitored, audit logs provide critical visibility into runtime security and compliance readiness. That enables security teams to:

While Kubernetes audit logs are not a comprehensive runtime monitoring solution, they form a vital component of runtime security workflows when combined with external analysis tools.

Detecting Runtime Threats with Kubernetes Audit Logging

Kubernetes audit logs capture a range of events that can signal potential runtime security threats. These include:

  1. Unauthorized Access Attempts:
    Audit logs track access attempts to resources, as defined by the audit policy. Unauthorized attempts can trigger security alerts, notifying incident response teams of potential breaches.
  2. Configuration Changes:
    Changes to Kubernetes configurations, such as RoleBindings or resource quotas, can be logged to identify misconfigurations or unauthorized updates. This visibility helps teams roll back problematic changes, investigate suspicious activity, or ensure compliance.
  3. Resource Manipulation:
    Logs can be configured to flag containers or users exceeding assigned resources. Excessive usage — especially if it follows attack patterns like cryptojacking or denial-of-service attacks — can alert teams to malicious activity.
  4. Privilege Escalation:
    Attempts to gain unauthorized access to higher-level resources or escape container boundaries are logged when included in audit policies. This helps teams detect and interrupt privilege escalation attacks in progress or use the logs for post-incident forensic analysis.
  5. Data Exposure Events:
    Logs capturing access to sensitive data stores like etcd or attempts to exfiltrate data from containers can signal potential breaches. External monitoring solutions augment this detection, enabling real-time alerts and mitigation.

Improving Runtime Security with Audit Logs

Kubernetes audit logs offer valuable insight into runtime events but work best as part of a layered security strategy. Here’s how to enhance runtime security using audit logs:

Upwind Secures Kubernetes

Attacks often begin with subtle actions that might be tagged as separate events in a Kubernetes audit log. With Upwind’s runtime security and Issue Stories, these events gain context as part of the full attack sequence, allowing for a clearer picture of how incidents unfold. With multi-cluster visibility, correlated events, and behavioral analysis, Kubernetes has never been more secure.

Want to see what Upwind adds for DevSecOps teams? Learn more about Upwind’s Kubernetes security and get advice on best practices with a demo

Frequently Asked Questions

What’s the minimum audit log configuration for security compliance?

In most cases, organizations should retain audit logs for at least 90 days. However, some regulations may stipulate longer storage, as is often the case in sensitive and/or critical industries like healthcare and finance. Many organizations find that a minimum of one year satisfies most regulatory requirements. 

How do you handle audit logs at scale?

Organizations need to utilize a centralized logging system with strong data storage capabilities, like a data lake, that can aggregate, store, and analyze large volumes of data to support compliance, threat detection, and forensic analysis. Centralized logging systems, effective storage, and optimized log volume are the first steps in scaling.

Complementary tools, like runtime-powered CNAPP such as Upwind, can add additional layers of context by detecting runtime anomalies.

How do you integrate audit logs with existing security tools?

Integrating Kubernetes audit logs with existing security tools bridges the gap between cluster-specific activity and broader security workflows. By centralizing, formatting, and correlating log data, organizations can unlock actionable insights, detect complex threats, and streamline compliance reporting. The first steps share much in common with the steps organizations must take in order to scale logs. Teams will need to:

What audit events should you monitor for security threats?

Focus on events that signal high-risk behaviors, anomalies, or potential misconfigurations that attackers often exploit. Here are the key categories of audit events to prioritize:

By prioritizing these audit events and integrating logs with analysis tools, teams can detect security threats early, respond effectively, and maintain compliance without being overwhelmed by noise.