For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/terraform/kubernetes/psp_allows_containers_to_share_the_host_network_namespace.md.
A documentation index is available at /llms.txt.
Checks whether kubernetes_pod_security_policy resources allow containers to share the host network namespace. The rule identifies resources where spec.hostNetwork is set to true. Allowing hostNetwork exposes the node’s network stack to pods, increasing attack surface and risking port collisions and privilege escalation. spec.hostNetwork should be set to false or left undefined to ensure pods use isolated network namespaces.