Back

K05: Inadequate Logging and Monitoring - Overview

What is Inadequate Logging and Monitoring?

Inadequate Logging and Monitoring (K05 in the OWASP Kubernetes Top 10) is the condition of running a cluster that cannot see itself being attacked. The controls that would record who did what to the API server, what processes ran inside containers, and which network flows crossed the cluster are either switched off, configured too coarsely, never collected centrally, or collected but never alerted on. The vulnerability is not a single exploitable bug—it is a detection gap that lets every other weakness be exploited quietly.

A Kubernetes cluster is a distributed control system with many independent sources of security-relevant signal: the API server (every create, exec, delete, and secret read), the kubelet on each node, the container runtime, the workloads themselves, the network layer, and the underlying cloud control plane. Each of these can emit an audit trail—but only if it is explicitly enabled, routed somewhere durable, and watched. When any link in that chain is missing, an attacker's actions leave no trace an operator will ever read.

K05 is a meta-weakness. It rarely causes the breach; it determines whether you notice the breach in minutes, in months, or never. Dwell time—the interval between compromise and detection—is the metric this control governs.

Core Concept

Cluster that can see itself:
  API audit      -> audit policy logs metadata for all verbs,
                    RequestResponse for exec/secrets/RBAC changes
  Runtime        -> Falco / Tetragon watch for shell-in-container,
                    sensitive mounts, unexpected privilege escalation
  Workload logs  -> pod stdout/stderr shipped off-node before the pod dies
  Aggregation    -> all sources centralized in tamper-resistant storage
  Alerting       -> high-risk events page a human / open a case
  Retention      -> logs kept long enough to investigate (weeks to months)

Cluster that is blind (K05):
  API audit      -> audit logging disabled, or Metadata-only and unread
  Runtime        -> no runtime sensor; a reverse shell in a pod is invisible
  Workload logs  -> logs live only on the node and vanish when the pod restarts
  Aggregation    -> nothing shipped off-cluster; an attacker can delete it
  Alerting       -> nobody is paged; dashboards exist but no one watches
  Retention      -> logs rotate in hours, gone before an investigation starts

Why It's Critical for Kubernetes

Kubernetes concentrates several conditions that make a detection gap especially costly:

Why Does This Matter?

Business Impact

Technical Impact

Technical Context

The Signal Sources a Cluster Should Capture

SourceWhat it recordsTypical K05 failure
API server audit logEvery request: who, verb, resource, responseDisabled, or Metadata-only and never read
Runtime sensor (Falco/Tetragon)Process exec, syscalls, mounts, network in containersNot deployed; runtime activity invisible
Pod / container logsApplication stdout/stderrNever shipped off-node; lost on pod restart
kubelet / node logsNode-level events, image pulls, evictionsNot collected centrally
Cloud control-plane auditManaged API-server / IAM activityNot enabled or not forwarded to SIEM
Admission / policy logsDenied and allowed admission decisionsWebhook audit annotations dropped

Common K05 Failure Modes

1. API-server audit logging disabled or too coarse

# The kube-apiserver is started with NO audit policy:
#   (no --audit-policy-file / --audit-log-path flags)
# Result: no record of exec, secret reads, RBAC changes, or deletes.

# Or a policy that only captures the "None"/"Metadata" level for
# everything, so a secret read is logged as "someone read a secret"
# with no indication of which secret, or not logged at all.

Risk: The single richest security signal in Kubernetes—the API audit trail—does not exist or is too shallow to investigate with.

2. No runtime threat detection

# No Falco, Tetragon, or equivalent DaemonSet on the nodes.
# A reverse shell inside a running container:
kubectl exec -it web-7f9 -- /bin/sh
#   -> produces an API audit event (if audit is on) but NO
#      process-level evidence of what the shell then did.

Risk: Post-exploitation activity inside containers—spawning shells, reading /etc/shadow, mounting the host, launching a miner—is completely invisible.

3. Logs not centralized or tamper-resistant

# Pod logs exist only via `kubectl logs`, backed by files on the node:
#   /var/log/pods/<ns>_<pod>_<uid>/<container>/0.log
# When the pod is deleted/rescheduled, the files rotate away.
# An attacker with node access can simply delete them.

Risk: Evidence is stored on the very asset the attacker controls, and disappears with normal pod churn.

4. No alerting on high-risk events

# Audit logs are collected and sit in an index nobody queries.
# There is no rule that says:
#   "page on-call when a ClusterRoleBinding grants cluster-admin"
#   "alert when a pod is created with hostPID/privileged:true"
#   "alert on image pulls from an unknown registry"
# Detection exists in theory; response never happens.

Risk: Collection without alerting is a filing cabinet nobody opens—detection latency is effectively infinite.

5. No retention or time synchronisation

# Logs rotate after a few hours or a day of volume.
# Node clocks drift; events from node-a and node-b cannot be
# ordered against the cloud audit trail.
# By the time an incident is noticed, the relevant window is gone
# or cannot be correlated.

Risk: Even where data was captured, it is unusable for an investigation that starts days or weeks later.

Real-World Impact

The incidents below are described as classes of real, well-documented events rather than specific numbered advisories. In each, the underlying compromise was made far worse—or was only possible to sustain—because detection was inadequate.

Case Class 1: Exposed Dashboard to Cryptomining (Cloud-Native Cryptojacking)

Pattern:

Why K05 made it worse: With no runtime detection and no alerting on unusual image pulls or CPU patterns, the mining workloads ran until an operator happened to notice cost or performance degradation—typically long after deployment. The Tesla cloud-cryptojacking incident (2018) is the archetypal public example: an unauthenticated Kubernetes dashboard led to mining workloads running inside the environment.

Case Class 2: Long-Dwell Data Exfiltration via Service-Account Tokens

Pattern:

Why K05 made it worse: Because API-server audit logging was off (or Metadata-only and unmonitored), the anomalous use of a service-account token from a workload that normally never talks to the API server generated no alert. The activity blended into normal control-plane traffic and continued undetected.

Case Class 3: Worming Malware Across Misconfigured Clusters

Pattern:

Why K05 made it worse: These campaigns specifically thrive in environments with no runtime monitoring. The tell-tale behaviours—new binaries executing in containers, outbound connections to mining pools and C2, disabling of security agents—are exactly what a Falco/Tetragon rule would catch, and exactly what goes unseen when no such sensor exists.

Case Class 4: Insider or Credential Abuse of the Control Plane

Pattern:

Why K05 made it worse: Nothing distinguished the malicious use from legitimate administration because RBAC changes and privileged-pod creation were not audited or alerted on. The absence of a baseline of "normal" made the abuse invisible.

Common thread: In none of these classes did inadequate logging cause the initial compromise. In all of them it converted a contained incident into a sustained, expensive, and hard-to-scope breach.

Prevalence and Detectability

Inadequate logging and monitoring is consistently among the hardest weaknesses to notice from the inside, because the symptom of the problem is the absence of symptoms. A cluster with no audit logging looks perfectly healthy right up until an external party reports the breach.

Rather than cite precise figures (which vary by survey and year), the defensible picture is:

Note: exact percentages differ between reports. The durable takeaway is that detection controls are opt-in, commonly skipped, and—because their absence is silent—rarely discovered until an incident forces the question.

Common Misunderstandings

Myth 1: "The cloud provider logs everything for us"

Reality: Managed control planes expose some audit data, but it is frequently off by default, may not include the API audit trail at a useful level, and never covers in-container runtime behaviour. Node-level and workload telemetry are the customer's responsibility under the shared-responsibility model.

Myth 2: "We have kubectl logs, so we have logging"

Reality: kubectl logs reads files on the node that rotate and vanish when the pod restarts. It is a debugging convenience, not a durable, tamper-resistant, centralised audit trail. It also captures only application stdout—not API activity or process events.

Myth 3: "Metrics and dashboards mean we're monitored"

Reality: CPU and memory graphs are operational monitoring, not security monitoring. They may hint at cryptomining after the fact, but they do not record who did what, and a dashboard nobody watches raises no alert.

Myth 4: "Audit logging is too noisy/expensive to enable"

Reality: A well-designed audit policy logs metadata cheaply for routine traffic and full request/response only for sensitive verbs (exec, secret access, RBAC changes). Cost is a tuning problem, not a reason to run blind.

Myth 5: "If we ever get breached, we'll turn on logging then"

Reality: Logging is only useful for events that were captured while they happened. Enabling it after an incident tells you nothing about what already occurred; the forensic window is already gone.

Myth 6: "Collecting the logs is the hard part"

Reality: Collection is necessary but insufficient. Without alerting, retention, tamper-resistance, and time synchronisation, a mountain of logs still yields zero detection and an unusable investigation.

How K05 Differs from Related Kubernetes Weaknesses

AspectK05 Inadequate Logging & MonitoringK01 Insecure Workload ConfigK03 Overly Permissive RBAC
Root causeDetection controls off/unwatchedUnsafe pod/container settingsExcessive granted permissions
What it enablesAttacks go unnoticedEscape / privilege abuseUnauthorized cluster actions
SymptomSilence (no alerts, no trail)Privileged/hostPath podsBroad verbs on many resources
Typical fixAudit policy, runtime sensor, SIEM, alertingHarden pod spec / policyLeast-privilege roles

K05 is the control that lets you see the others being exploited. A cluster can have excellent RBAC and hardened workloads and still be breached; without logging and monitoring, it will not know.

Key Takeaways

  1. K05 is a detection gap, not a single bug—it governs whether every other weakness is exploited quietly or caught quickly.
  2. Kubernetes has many signal sources—API audit, runtime, workload, node, and cloud—and each must be explicitly enabled and routed.
  3. Ephemeral workloads destroy evidence—telemetry must be shipped off-node in real time or it is lost to normal pod churn.
  4. Collection is not detection—alerting, retention, tamper-resistance, and time sync turn logs into an actual defence.
  5. The absence of the control is silent—you will not notice you are blind until an incident forces the question, so enable it before you need it.

How to Identify if You're Vulnerable

Ask these questions about your cluster:

If you answered "no" or "not sure" to several of these, an attacker in your cluster today would likely operate undetected.

Next Steps