Wiz Details Privilege-Escalation Risks in Managed Kubernetes Middleware

Summary
Wiz assesses managed Kubernetes middleware in AKS, EKS and GKE, finding risky host access and describing privilege-escalation paths through Node Problem Detector and Fluent Bit, alongside mitigations and gaps in standard controls.
Key points
- The assessment found that 8 of 25 middleware components shared host namespaces, had privileged containers or added capabilities, or mounted sensitive host volumes.
- Node Problem Detector can execute custom plugin scripts as root; an attacker able to write to its plugin directory could gain periodic host execution and access tokens belonging to pods on the node.
- A poisoned Fluent Bit ConfigMap can use the EXEC plugin to run commands, exfiltrate service-account tokens, and support movement to other nodes.
- The article says middleware permissions were not over-privileged, but that necessary operations can still require high privileges.
- Pod Security Admission does not protect middleware in exempt namespaces, and 13 of 25 assessed components could not automatically migrate to user namespaces in their current configuration.
- Suggested mitigations include running containers as non-root, placing configurable add-ons in more granular namespaces, and minimizing container images; host-level middleware remains difficult to cover with cluster controls.
Article Details
- Attack Vectors
- Write access to the Node Problem Detector (NPD) custom plugin directory can enable periodic execution of bash scripts with root privileges on the host.
- An attacker with permission to update a Fluent Bit ConfigMap can poison its configuration and use the EXEC plugin for periodic command execution.
- The article describes reaching the NPD plugin directory through a file-write vulnerability in a pod with a suitable volume mapping, a compromised registry image, or pod escape.
- The Fluent Bit attack demo included pod enumeration, ConfigMap poisoning, service-account-token exfiltration to a C2 server, and pivoting to other nodes.
- Defensive Notes
- Run containers as non-root where possible to reduce the impact of container escape and limit the ability to write to sensitive locations such as the NPD custom plugin directory.
- Where add-ons can be configured to run outside kube-system, use a separate namespace so admission-controller policies can be applied; the article notes that kube-system is exempt from Pod Security Admission in AKS and EKS.
- Cloud service providers can reduce incident impact by minimizing managed middleware container images; the article gives the CoreDNS image lacking a bash execution context as an example.
- Include control-plane and managed-cluster-middleware components in security-control coverage rather than excluding them by process name, image, or namespace.
- For host-level middleware, the article suggests deploying components as DaemonSets or running them as CronJobs with controlled affinity.
- Use visibility and configuration checks to identify principals that can update Fluent Bit or NPD ConfigMaps and pods with sensitive volume mappings that permit writes to the NPD custom plugin directory.
- The article says user namespaces cannot automatically accommodate 52% of the assessed default v1.25 middleware components, and do not apply to host-level middleware.
MITRE ATT&CK
T1041 · Exfiltration Over C2 ChannelThe Fluent Bit attack demo describes exfiltrating service account tokens to a C2 server.T1059.004 · Unix ShellNPD custom plugins are bash scripts that can execute periodically with root privileges; the Fluent Bit EXEC plugin can also run shell commands.T1098.004 · SSH Authorized KeysThe article cites SSH-key planting as a possible follow-on technique after gaining root execution on a node.T1496 · Resource HijackingThe article cites running a cryptominer as a possible use of root execution gained through the NPD plugin directory.T1528 · Steal Application Access TokenIn the described Fluent Bit attack demo, service account tokens were exfiltrated after ConfigMap poisoning.T1562.001 · Disable or Modify ToolsThe article says malicious code running as root through the trusted NPD component could bypass node EDR solutions.T1611 · Escape to HostPod escape is described as one possible route to write to the NPD custom plugin directory.
Vendors
Products
AKSOur internal numbers show that about 83% of customers with Kubernetes have clusters managed by AKS, EKS, or GKE.CoreDNSnode. For instance, the node-exporter process on AKS hosts can be labelled MCM, whereas kube-proxy and CoreDNS deployments are crucial parts of the K8s control plane and therefore cannot be considered middleware. TheEKSOur internal numbers show that about 83% of customers with Kubernetes have clusters managed by AKS, EKS, or GKE.Fluent BitPrivilege escalation via Fluent Bit ConfigMapGKEOur internal numbers show that about 83% of customers with Kubernetes have clusters managed by AKS, EKS, or GKE.KubernetesManaged clusters have become a go-to way to deploy and operate production Kubernetes workloads.Node Problem DetectorPrivilege escalation via Node Problem Detector Pod Security AdmissionIn Kubernetes v1.21, Pod Security Policies (PSP) were officially deprecated and replaced with Pod Security Admission (PSA). PSA implements Pod Security Standards (PSS), a set of policies describing variousPod Security StandardsDoes not work – Pod Security Standards