Do Not Share Host Network With Containers

Ensure not sharing host network with containers.

Policy Details

Policy Subtype
Build
Severity
High
Template Type
Kubernetes

Build Rules

Do not share host network with containers.
JSON Query:
$.spec.template.spec.hostNetwork is true
Recommendation:
Recommended solution to not sharing host network with containers.
It is recommended not to share host network with containers. Please make sure "hostNetwork" is set to "false".
For example:
"spec": { "hostNetwork": false, "containers": [ { "name": "friendly-container", "image": "alpine:3.4", "command": [ "/bin/echo", "hello", "world" ] } ] }

Recommended For You