SKY-D332 · Deployment and infrastructure
Host networking on an edge or device service
A Docker Compose service on a robot, Jetson or other device that uses network_mode: host. The container then shares the device's network stack, so every port it opens is open on every interface of the device.
- Languages
- Docker Compose
- Quality gate
- counted toward the gate limits (full and diff scans). Reported under security (
danger) at MEDIUM. It counts towardmax_security. - Finding type
- review
- Catalog name
- Docker Compose host networking on edge service
Why it matters
Robot and device control services (ROS nodes, camera streams, debug consoles) often listen without authentication. With host networking they are reachable from any network the device joins, such as a customer's Wi-Fi, instead of only from the containers that need them.
What Skylos flags
services: nav-stack: image: ros:humble-ros-base network_mode: host command: ros2 launch nav_bringup robot.launch.py environment: ROS_DOMAIN_ID: "7"What Skylos leaves alone
services: status-page: image: nginx:1.27-alpine network_mode: host volumes: - ./site:/usr/share/nginx/html:roWhy Skylos leaves it alone
Host networking alone is not reported. This service has no GPU runtime, no host device and no edge image or command, so the rule does not treat it as an edge service.
How Skylos decides
- Runs with
--danger. Reads the same Compose files as SKY-D330 (compose.y*ml,docker-compose.y*mland names starting withcompose.ordocker-compose.), skipping symlinks, files over 1 MB and YAML that does not parse. - Looks only at services whose
network_modeishost. - Reports when the service also looks like an edge or device service: it has GPU access (
runtime: nvidia, agpus:key or anNVIDIA_environment value); the image name or any key or value in the service containsjetson,l4t,nvidia,cuda,ros:orros2; or it maps a host device or control path as described under SKY-D331. - Reports MEDIUM on the service's
network_mode:line.
How to fix it
Put the service on a Compose network and publish only the ports other machines must reach, bound to the interface that should see them. Containers on the same Compose network still reach each other.
services: nav-stack: image: ros:humble-ros-baseRemoved: network_mode: hostAdded: networks: [robot] command: ros2 launch nav_bringup robot.launch.py environment: ROS_DOMAIN_ID: "7"Added: ports:Added: - "127.0.0.1:9090:9090"Added: networks:Added: robot: {}When it can be wrong
- The edge test is a plain text search, so a service whose name, image or settings merely contain
cudaornvidia(for example in an environment value) counts as an edge service. - A non-edge service on host networking, such as a reverse proxy, is not reported even when host networking is the real risk.
- Some ROS 2 setups need host networking for DDS discovery across machines. Keep the service on a trusted network and suppress the finding with that reason.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Put the marker on the
network_mode:line, or on a comment line directly above it.YAML network_mode: host # skylos: ignore[SKY-D332] DDS needs multicast on robot LAN[tool.skylos] ignore = ["SKY-D332"]turns the rule off for the project.