Skip to main content
security · kubernetes

Workloads whose pods share the node's network namespace

resource types
3
rule IDs covered
9
severity
high

What does ZopNight detect here?

ZopNight flags an EKS, GKE or AKS Deployment, StatefulSet or DaemonSet whose pod spec sets `hostNetwork: true`, outside system namespaces such as `kube-system`, `istio-system` and `cilium`. Such pods use the node's own network stack, which the Pod Security Standards Baseline profile disallows, and NetworkPolicy behaviour for them is undefined.

Signal and threshold

How ZopNight evaluates Workloads whose pods share the node's network namespace.
Field Value
Rule IDsRC-1729 · RC-1829 · RC-1929 · RC-1730 · RC-1830 · RC-1930 · RC-1731 · RC-1831 · RC-1931
Categorysecurity
Severityhigh
Metricnone — pure configuration read
ThresholdhostNetwork true outside system namespaces
SourceZopNight
Permissions usedlist deployments.apps · list statefulsets.apps · list daemonsets.apps

Host networking removes the pod’s network boundary

A pod normally gets its own network namespace and IP address. With hostNetwork: true, described in the Pod API reference as using the host’s network namespace, the pod shares the node’s interfaces instead. It binds directly to the node’s addresses and competes for ports with everything else on the node; any hostPort must match the containerPort.

Network isolation weakens as well. The network policies page says NetworkPolicy behaviour for hostNetwork pods is undefined. In the most common implementation the plugin ignores them when matching pod selectors and treats their traffic as traffic from the node IP. The Pod Security Standards place spec.hostNetwork under Host Namespaces in the Baseline profile, allowed only when unset or false.

Finding pods on the host network

Terminal window
kubectl get deployments,statefulsets,daemonsets -A -o json | jq -r '
.items[]
| select(.spec.template.spec.hostNetwork == true)
| "\(.kind) \(.metadata.namespace)/\(.metadata.name)"'

Running pods can also be listed directly, since spec.hostNetwork is a supported field selector:

Terminal window
kubectl get pods -A --field-selector spec.hostNetwork=true

One flag, outside the system namespaces

ZopNight reads the hostNetwork value recorded for each Deployment, StatefulSet and DaemonSet and fires when it is true. A workload where the value was not collected is skipped. The namespace must not be a system namespace, because cluster components and CNI or mesh agents there legitimately need host networking.

Namespaces that are never flagged

The exclusions are kube-system, kube-public, kube-node-lease, kubeadm, calico-system, tigera-operator, istio-system, linkerd, linkerd-viz, cilium and cilium-system, plus any namespace whose name starts with gke-managed- or aks-managed-. Agents installed elsewhere are checked like any other workload. Related container-level risks are covered by Privileged container and Container running as root.

A high-severity exposure without a saving

There is no dollar figure. The risk is a workload that shares the node’s network identity and sits outside the controls your NetworkPolicies are meant to provide.

Taking the workload off the host network

  1. Ask why it was enabled. Common reasons are binding a fixed port or reaching node-local services.
  2. Remove hostNetwork: true and expose the workload through a Service instead.
  3. Avoid swapping it for hostPort; the Baseline profile disallows host ports too, unless they are restricted to a known list.
  4. If an agent truly needs the host network, run it in a dedicated namespace with minimal privileges and document the exception.
  5. Label application namespaces pod-security.kubernetes.io/enforce: baseline so new pods cannot turn host networking back on.

See it fire on your bill.

Connect an account read-only. The first findings land in minutes.

472 rule families across 353 resource types on 22 platforms. Every threshold, metric, and IAM action is documented on these pages before you grant anything.

472 rule families documented
353 resource types covered
read-only default access level
Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console· Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console·