Workloads whose pods share the node's network namespace
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
| Field | Value |
|---|---|
| Rule IDs | RC-1729 · RC-1829 · RC-1929 · RC-1730 · RC-1830 · RC-1930 · RC-1731 · RC-1831 · RC-1931 |
| Category | security |
| Severity | high |
| Metric | none — pure configuration read |
| Threshold | hostNetwork true outside system namespaces |
| Source | ZopNight |
| Permissions used | list deployments.apps · list statefulsets.apps · list daemonsets.apps |
Where it applies
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
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:
kubectl get pods -A --field-selector spec.hostNetwork=trueOne 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
- Ask why it was enabled. Common reasons are binding a fixed port or reaching node-local services.
- Remove
hostNetwork: trueand expose the workload through a Service instead. - Avoid swapping it for
hostPort; the Baseline profile disallows host ports too, unless they are restricted to a known list. - If an agent truly needs the host network, run it in a dedicated namespace with minimal privileges and document the exception.
- Label application namespaces
pod-security.kubernetes.io/enforce: baselineso new pods cannot turn host networking back on.