Why it matters
A `hostPort` binds the node's network interface, bypassing Services and NetworkPolicies and exposing the pod on every address the node has.
How to fix it
Remove `hostPort` and expose the pod through a Service.
What TrustIvan reads
Read through the Kubernetes API with the read-only role TrustIvan's install creates.
Benchmark controls
- CIS Kubernetes Benchmark 1.9.0, control
5.2.13: Containers using host ports are minimised - NSA/CISA Kubernetes Hardening Guidance 1.2, control
network.policies: Network policies restrict traffic. Also checked for this control: Namespace has NetworkPolicies but no default deny, Namespace has no NetworkPolicy
Control numbers are the published ones; the titles are TrustIvan's own short descriptions. The benchmarks belong to their publishers, who do not endorse TrustIvan.
Related checks
- Container adds a dangerous capability
KubernetesSeverity: High
k8s.container.dangerous-capability - Container runs `latest` or an untagged image
KubernetesSeverity: Medium
k8s.container.image-latest - Container has a credential written into its manifest
KubernetesSeverity: High
k8s.container.credential-in-env - Container runs a mutable image tag
KubernetesSeverity: Low
k8s.container.mutable-tag - Container keeps the default capabilities
KubernetesSeverity: Low
k8s.container.capabilities-not-dropped - Container keeps NET_RAW
KubernetesSeverity: Low
k8s.container.net-raw
Terms: KSPM (Kubernetes security posture management), Kubernetes RBAC, NSA/CISA Kubernetes Hardening Guidance, CIS Benchmarks
All Kubernetes posture checks · The whole catalogue · How this works in TrustIvan · Documentation