Kubernetes security monitoring: audit logs, runtime detection with eBPF and a response runbook

How to configure Kubernetes audit logs, what runtime tools like Falco and Tetragon detect, which detections are worth building first, and how to route and handle alerts without drowning your team.

Obseria TeamObseria
Summary
  • Kubernetes security monitoring needs two complementary data sources: API server audit logs that record who changed what in the cluster, and runtime signals from the nodes that show what containers actually do.
  • A good audit policy logs secrets only at Metadata level, captures RBAC and workload changes with request bodies and drops noisy read traffic, while managed clusters on EKS, GKE and AKS each expose audit logs differently.
  • Detections become actionable when every security event carries topology and deployment context, is routed by severity and comes with a short runbook that covers containment, evidence and follow-up.

Kubernetes security monitoring answers two questions that classic infrastructure monitoring ignores: who is doing what through the Kubernetes API, and what are containers doing on the nodes that they should not be doing? An attacker who has stolen a service account token, a developer who grants themselves cluster-admin "just for a minute", or a compromised image that starts mining cryptocurrency all leave traces, but only if you collect the right signals and know what to look for.

This guide covers Kubernetes audit logs and audit policy design, the specifics of EKS, GKE and AKS, runtime threat detection with eBPF-based tools such as Falco and Tetragon, admission control signals from Pod Security Standards, a table of detections worth building first, and how to correlate, route and respond to alerts. It ends with a checklist you can copy.

Two data sources: the control plane and the runtime

Kubernetes security events come from two places, and you need both:

  • Control plane (API server audit logs). Every request to the Kubernetes API, whether from kubectl, a CI pipeline, a controller or a pod using its service account token, can be recorded as an audit event. This is where you see new RoleBindings, exec sessions, secret reads and workload changes.
  • Runtime (nodes and containers). The API server does not see what happens inside a running container. A shell spawned by a web shell exploit, a binary downloaded and executed from /tmp or an outbound connection to a mining pool happens below the API. Runtime sensors on each node observe system calls, process execution, file access and network connections.

Admission control signals and image vulnerability data complement both sources.

Kubernetes audit logs and audit policy levels

On self-managed clusters you enable auditing on the kube-apiserver with --audit-policy-file and a backend: the log backend (--audit-log-path, plus rotation flags such as --audit-log-maxage, --audit-log-maxbackup and --audit-log-maxsize) or a webhook backend that sends events to an external endpoint. Without a policy file, no events are logged.

Each policy rule assigns one of four levels:

  • None: do not log matching requests.
  • Metadata: log user, groups, source IPs, user agent, verb, resource, namespace, name and response code, but no bodies.
  • Request: metadata plus the request body.
  • RequestResponse: metadata, request body and response body.

Events can be emitted at several stages (RequestReceived, ResponseStarted for long-running requests such as watches, ResponseComplete and Panic). Most teams omit RequestReceived to halve the volume. Rules are evaluated in order and the first matching rule wins, so specific rules go first and a catch-all goes last.

A practical starting policy (an example to adapt, not a complete standard):

apiVersion: audit.k8s.io/v1
kind: Policy
omitStages: ["RequestReceived"]
rules:
  # Never log secret or token contents, only who accessed them
  - level: Metadata
    resources:
    - group: ""
      resources: ["secrets", "configmaps", "serviceaccounts/token"]
    - group: "authentication.k8s.io"
      resources: ["tokenreviews"]
  # RBAC changes with full bodies
  - level: RequestResponse
    resources:
    - group: "rbac.authorization.k8s.io"
      resources: ["roles", "rolebindings", "clusterroles", "clusterrolebindings"]
  # Workload writes with request body
  - level: Request
    verbs: ["create", "update", "patch", "delete"]
    resources:
    - group: ""
      resources: ["pods", "services"]
    - group: "apps"
      resources: ["deployments", "daemonsets", "statefulsets"]
  # Drop high-volume noise
  - level: None
    users: ["system:kube-proxy"]
    verbs: ["watch"]
  - level: None
    nonResourceURLs: ["/healthz*", "/livez*", "/readyz*", "/version"]
  # Everything else
  - level: Metadata

The key design decision is the first rule: secrets at Request or RequestResponse level would write secret values into your audit log, turning the log into a target. For general guidance on protecting, retaining and reviewing audit trails, see our article on security logging and audit logs.

The fields you will query most are user.username, sourceIPs, userAgent, verb, objectRef, responseStatus.code and the authorization.k8s.io/decision annotation. A burst of 403 responses for one service account often signals a stolen token probing permissions.

Managed clusters: EKS, GKE and AKS

On managed Kubernetes you usually cannot edit the audit policy. The provider decides what is logged, and you decide whether and where it is exported. Check the current provider documentation, since details change:

PlatformHow audit logs are exposedDefaultWhat to watch out for
Amazon EKSControl plane logging to CloudWatch Logs with the log types api, audit, authenticator, controllerManager, schedulerOff; each type is enabled individuallyEnable at least audit and authenticator; CloudWatch ingestion and storage costs apply
Google GKECloud Audit Logs under the k8s.io service: Admin Activity and Data Access logsAdmin Activity always on; Data Access (get, list) off unless enabledWithout Data Access logs you will not see secret reads
Azure AKSDiagnostic settings with the categories kube-audit (all verbs) and kube-audit-admin (excludes get and list)Not enabled until you create a diagnostic settingkube-audit-admin is cheaper but hides reads; use kube-audit where read access matters

Runtime threat detection with eBPF: Falco and Tetragon

Runtime sensors use eBPF (or, in some setups, a kernel module) to observe system calls and kernel events with low overhead and without changing your containers. Two widely used open source projects:

  • Falco is a CNCF graduated project (graduation announced in February 2024). It evaluates kernel events against YAML rules and emits alerts such as "shell spawned in a container" or "sensitive file read". It enriches events with container and Kubernetes metadata and can also consume Kubernetes audit events through its k8saudit plugin, so one rule language covers both sources.
  • Tetragon is a sub-project of Cilium, which is itself a CNCF graduated project. It focuses on security observability and runtime enforcement: TracingPolicy resources define which kernel functions, process executions, file accesses or network events to observe, and Tetragon can optionally block or kill offending processes in the kernel.

A simplified Falco-style rule for interactive shells illustrates the idea (an example; Falco's default ruleset already ships a more complete version):

- rule: Shell in production container
  desc: Interactive shell started inside a container in a production namespace
  condition: >
    spawned_process and container
    and proc.name in (bash, sh, zsh, ash)
    and proc.tty != 0
    and k8s.ns.name startswith "prod"
  output: >
    Shell in container (user=%user.name pod=%k8s.pod.name
    ns=%k8s.ns.name image=%container.image.repository cmd=%proc.cmdline)
  priority: WARNING

Start in alert-only mode, tune exceptions per namespace or image for one or two weeks and only then consider enforcement: blocking on a noisy rule causes outages that look like an attack.

Detections worth building first

The table lists high-value detections, their data source and a typical signal. Severities are examples that you should adjust to your environment.

DetectionSourceSignalSeverity (example)
Exec into a podAudit log, runtimeobjectRef.subresource is exec or attach (match the subresource, the verb differs by client protocol); shell process with a TTY at runtimeHigh in production, info elsewhere
Privileged containerAudit log, admissionPod spec with privileged: true, hostPID, hostNetwork or added capabilities like SYS_ADMINHigh unless namespace is allowlisted
hostPath mountAudit log, admissionPod with hostPath volumes, especially /, /etc, /var/run or the container runtime socketHigh
New binding to cluster-adminAudit logcreate or patch on clusterrolebindings with roleRef.name: cluster-adminCritical
Unusual secret accessAudit logget/list/watch on secrets by a service account that has not done so in its baseline, or list across all namespacesHigh
Crypto-miner indicatorsRuntime, metricsKnown miner process names, stratum+tcp connections, sustained CPU at the limit on a workload that is normally idleHigh
Unusual outbound connectionRuntime, network flowsConnection to an IP or domain never seen for this workload, raw IPs instead of DNS, unexpected portsMedium, high with other signals
Image from untrusted registryAudit log, admissionPod image outside your approved registries, :latest tags or unsigned imagesMedium
Deleted events or audit gapsAudit log, pipelinedelete on events, sudden drop in audit log volumeHigh

Behavioural detections such as "unusual secret access" need one to two weeks of baseline per identity; exclude known controllers such as your GitOps operator explicitly, not broadly.

Admission control signals and image vulnerability context

Pod Security Admission, stable since Kubernetes v1.25, applies the Pod Security Standards levels privileged, baseline and restricted per namespace with three modes: enforce rejects violating pods, audit adds an annotation to the audit event and warn returns a warning to the client. A useful pattern is to enforce baseline and audit restricted:

kubectl label namespace shop \
  pod-security.kubernetes.io/enforce=baseline \
  pod-security.kubernetes.io/audit=restricted \
  pod-security.kubernetes.io/warn=restricted

The audit annotations then show you, from the audit log, which workloads would break under restricted, without breaking anything today. Policy engines such as Kyverno or OPA Gatekeeper and the built-in ValidatingAdmissionPolicy add rules beyond Pod Security Standards, for example allowed registries or required signatures. Track denials as a metric; denials outside deploy windows deserve a closer look.

Image scanning gives you a list of CVEs per image, which is only useful if you know which images are actually running, exposed and loading the vulnerable package. Our guide to vulnerability prioritization with CVSS, EPSS and runtime context covers that in depth. For security monitoring, the practical point is simpler: when a runtime alert fires on a pod, its image's known exploitable vulnerabilities belong in the alert.

Correlating security events with observability data

A security alert that says "shell in container, pod checkout-7f9c" is hard to judge on its own. The same alert with context is much faster to triage:

  • Topology: which service the pod belongs to, which databases and secrets it can reach and whether it is internet-facing.
  • Deployments: whether a rollout, config change or new image happened minutes before. Many "suspicious" events are just a new release; deployment tracking makes that visible immediately.
  • Telemetry: traces, logs and metrics from the same pod and time window, for example a burst of unusual requests to one endpoint right before the shell appeared.

This is where a SIEM and an observability platform overlap. Our comparison of SIEM and observability for security monitoring explains when each fits. For the operational side of the cluster, the Kubernetes observability checklist is a good companion to this article.

Alert routing and a response runbook

Route by severity and environment. Critical detections (cluster-admin bindings, privileged pods in production, confirmed miners) page the on-call engineer and notify security. High detections create an incident ticket with a short response target. Medium and informational events go to a channel or a daily review. Deduplicate per pod and rule so a crash-looping container does not create hundreds of alerts.

Every critical detection needs a runbook. A copyable template:

Runbook: suspicious activity in a Kubernetes workload
1. Triage (first 10 minutes)
   - Which pod, namespace, node, image, service account?
   - Recent deploy or config change? Who performed it (audit log)?
2. Preserve evidence before deleting anything
   - Export audit events and runtime alerts for the time window
   - kubectl get pod <pod> -o yaml; kubectl logs <pod> --all-containers
3. Contain
   - Isolate the pod with a deny-all NetworkPolicy (label selector)
   - Cordon the node if host compromise is possible
   - Scale down or remove the workload from the Service
4. Revoke and rotate
   - Delete compromised RoleBindings, rotate service account tokens
   - Rotate every secret the workload could read
5. Recover
   - Redeploy from a known-good, scanned image
6. Follow up
   - Postmortem and tuned detections

For the incident process around this runbook, including severities and postmortems, see our incident management guide with a postmortem template. If your organisation falls under NIS2, the detection and reporting duties described in our NIS2 monitoring requirements article apply to your clusters as well.

Kubernetes security monitoring checklist

Copy this checklist into your cluster onboarding

  • API server audit logging enabled (self-managed) or exported (EKS, GKE, AKS) for every cluster
  • Audit policy logs secrets, configmaps and tokens at Metadata level only
  • RBAC changes captured with request bodies; catch-all rule at the end of the policy
  • GKE Data Access logs or AKS kube-audit enabled where read access matters
  • Audit logs forwarded centrally, with access restricted and retention defined
  • Runtime sensor (for example Falco or Tetragon) on every node, starting in alert-only mode
  • Detections for exec, privileged pods, hostPath, cluster-admin bindings, secret access, miners, unusual egress and untrusted images
  • Pod Security Admission labels on every namespace; denials and warnings tracked as metrics
  • Allowed registries and image signatures enforced by admission policy
  • Image vulnerability data attached to runtime alerts
  • Security alerts enriched with topology, deployments and pod telemetry
  • Routing by severity, deduplication per pod and rule
  • Runbook for every critical detection, tested at least once
  • Monitoring for audit log gaps and deleted events

How Obseria helps with Kubernetes security monitoring

Obseria is an OpenTelemetry-native observability platform that brings Kubernetes audit logs and runtime security events into the same place as your traces, metrics and logs. Kubernetes monitoring provides the cluster and workload view, and application security adds vulnerability and runtime context to the services you already observe.

  • Obseria Pipeline filters noisy audit events and masks sensitive fields before storage in the EU.
  • Obseria TopoGraph shows which services, data stores and secrets a flagged pod is connected to.
  • Obseria Intelligence correlates a security alert with deployments, config changes and anomalies, with the evidence attached.
  • The AI SRE agent can propose containment steps such as isolating a pod, and acts only with your approval.

Connect your first cluster with a free Obseria trial.

Share

Observability that delivers answers.

Start for free with OpenTelemetry, no credit card required.