apiVersion: kyverno.io/v1 kind: ClusterPolicy metadata: name: disallow-host-namespaces annotations: policies.kyverno.io/title: Disallow Host Namespaces policies.kyverno.io/category: DoD STIG policies.kyverno.io/severity: high policies.kyverno.io/description: >- STIG V-242386: Containers must not share the host process ID, IPC, or network namespace. Sharing host namespaces allows containers to access host-level resources and break isolation boundaries. spec: validationFailureAction: Enforce background: true rules: - name: host-namespaces skipBackgroundRequests: true match: any: - resources: kinds: - Pod exclude: any: - resources: namespaces: - kube-system - rook-ceph - istio-system - prometheus - kyverno - crowdsec validate: allowExistingViolations: true message: >- Sharing host PID, IPC, or network namespaces is not allowed (STIG V-242386). pattern: spec: =(hostPID): false =(hostIPC): false =(hostNetwork): false