SV-260913r966096_rule
V-260913
SRG-APP-000039-CTR-000110
CNTR-MK-000150
CAT II
10
When using Kubernetes orchestration:
In Kubernetes, the hostNetwork setting is a part of the Pod's specification, and once a Pod is created, its hostNetwork setting cannot be directly modified. However, the desired effect can be achieved by creating a new Pod with the updated hostNetwork setting and then deleting the existing Pod. This process replaces the old Pod with the new one.
When using Swarm orchestration:
Review and remove nonsystem containers previously created by these users that allowed access to the host network namespace must be removed using:
docker container rm [container]
When using Kubernetes orchestration, ensure that Pods do not use the host machine's network namespace and uses its own isolated network namespace.
Note: If the hostNetwork field is not explicitly set in the Pod's specification, it will use the default behavior, which is equivalent to hostNetwork: false.
Execute the following for all pods:
kubectl get pods --all-namespaces -o json | jq '.items[] | select(.spec.hostNetwork == true) | .metadata.name'
If the above command returns a namespace then the "hostNetwork" = true, this is a finding unless a documented exception is present in the System Security Plan (SSP).
When using Swarm orchestration, check that the host's network namespace is not shared.
Via CLI:
Linux: As an administrator, execute the following command using a Universal Control Plane (MKE) client bundle:
docker ps --filter "label=com.docker.ucp.version" | awk '{print $1}' | xargs docker inspect --format '{{ .Name }}: NetworkMode={{ .HostConfig.NetworkMode }}'
If the above command returns NetworkMode=host, this is a finding unless a documented exception is present in the SSP.
V-260913
False
CNTR-MK-000150
When using Kubernetes orchestration, ensure that Pods do not use the host machine's network namespace and uses its own isolated network namespace.
Note: If the hostNetwork field is not explicitly set in the Pod's specification, it will use the default behavior, which is equivalent to hostNetwork: false.
Execute the following for all pods:
kubectl get pods --all-namespaces -o json | jq '.items[] | select(.spec.hostNetwork == true) | .metadata.name'
If the above command returns a namespace then the "hostNetwork" = true, this is a finding unless a documented exception is present in the System Security Plan (SSP).
When using Swarm orchestration, check that the host's network namespace is not shared.
Via CLI:
Linux: As an administrator, execute the following command using a Universal Control Plane (MKE) client bundle:
docker ps --filter "label=com.docker.ucp.version" | awk '{print $1}' | xargs docker inspect --format '{{ .Name }}: NetworkMode={{ .HostConfig.NetworkMode }}'
If the above command returns NetworkMode=host, this is a finding unless a documented exception is present in the SSP.
M
5595