← Lab /Security & privacy

Kubernetes audit logs expose container escape commands missing from runtime telemetry

Correlating Kubernetes audit logs with Defend for Containers data can reliably reveal container escape attempts that are invisible in runtime process events.

Security & privacy Elastic Security Labs 3 Sep 2026 Method Prototype evidence

Published as “How to correlate Kubernetes audit logs with container runtime data”

Why it matters

Enables security teams to detect container escape attempts that would otherwise be missed by runtime monitoring alone.

Summary

The authors describe how to join Kubernetes audit logs with Defend for Containers telemetry using either the pod-name extra or a service-account/objectRef mapping. In an EKS lab they show a compromised service account creating a privileged pod and executing nsenter and chroot, which never appear in the D4C process logs but are captured in the audit requestURI. They provide Elastic queries and pre-built EQL rules to automate the correlation, demonstrating that the combined view uncovers escape attempts missed by runtime data alone.

What they found 1

  1. Escape wrappers nsenter and chroot are not recorded in runtime process events

    “The escape wrappers, nsenter and chroot , never appeared in the runtime process events.”

Caveats 3

  • Only works when the pod-name extra is present, so it misses calls attributed as a bare service account.
  • If more than one service account touched the same pod in your window, runtime gives shared context rather than clean attribution.
  • Wrappers like nsenter and chroot never appear in D4C process events, requiring audit logs for visibility.

What’s new here 4

  • Identifies two join keys (pod-name extra and service-account/objectRef) to correlate audit and runtime data.
  • Shows that nsenter and chroot wrappers are only visible in audit logs, not in Defend for Containers telemetry.
  • Provides concrete Elastic queries and pre-built detection rules for the correlation.
  • Demonstrates the technique in an EKS lab with a compromised service-account scenario.