Egress traffic is restricted to approved destinations; no open egress to 0.0.0.0/0
Why it matters
Open egress to 0.0.0.0/0 means a compromised pod can exfiltrate data to any external server, download attacker tooling, or call command-and-control infrastructure — the container boundary provides zero containment for outbound traffic (NIST 800-53 SC-7, AC-4). Most production workloads communicate with a small, predictable set of destinations: a database, a few external APIs, and the Kubernetes control plane. Default Kubernetes networking permits unrestricted egress, so without explicit NetworkPolicy egress rules, a compromised pod has an outbound channel to the public internet from inside your cluster perimeter.
Severity rationale
Medium because unrestricted egress enables data exfiltration and C2 communication from compromised containers, but requires initial code execution within the pod first.
Remediation
Add egress NetworkPolicies to every application namespace in k8s/network-policies.yaml. Start with a blanket deny, then allow specific required destinations:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: restrict-egress
namespace: production
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- to:
- podSelector:
matchLabels:
role: database
ports:
- protocol: TCP
port: 5432
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
ports:
- protocol: UDP
port: 53
- to:
- ipBlock:
cidr: 10.0.0.0/8 # Internal VPC only
ports:
- protocol: TCP
port: 443
For external API calls, use a dedicated egress gateway so the allowed destination list is auditable.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Infrastructure Hardening Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- nist:rev5 · SC-7 — Boundary Protection
- nist:rev5 · AC-4 — Information Flow Enforcement
- external · CIS-Kubernetes-5.3.2 — CIS Kubernetes Benchmark §5.3.2 — Ensure that all Namespaces have Network Policies defined
- soc2:2017 · CC6.6 — Protection against threats from outside system boundaries
Taxons
History
- 2026-04-18·v1.0.0·Initial import from infrastructure-hardening·automated
- 2026-07-06·v1.0.1·Add SOC 2 TSC mapping (CC6.6) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2