SKY-D330 · Deployment and infrastructure
Privileged container with device or GPU access
A Docker Compose service that sets privileged: true and also gets a host device (such as a camera or serial port) or an NVIDIA GPU. Privileged mode turns off almost every container boundary: the container sees all host devices and holds every Linux capability.
- Languages
- Docker Compose
- Quality gate
- counted toward the gate limits (full and diff scans). Reported under security (
danger). It counts towardmax_highandmax_security; the detector never reports CRITICAL. - Finding type
- review
- Catalog name
- Docker Compose privileged edge container
Why it matters
On an edge box such as a Jetson or a robot, anyone who gets code running in that container (through a bug in the camera or model code) is effectively root on the device. They can load kernel modules, write to every disk and reach every other device.
What Skylos flags
services: camera: image: nvcr.io/nvidia/l4t-jetpack:r36.3.0 runtime: nvidia privileged: true devices: - /dev/video0:/dev/video0 environment: CAMERA_FPS: "30" restart: unless-stoppedWhat Skylos leaves alone
services: camera: image: nvcr.io/nvidia/l4t-jetpack:r36.3.0 runtime: nvidia privileged: false devices: - /dev/video0:/dev/video0 environment: CAMERA_FPS: "30" restart: unless-stoppedWhy Skylos leaves it alone
privileged: false is read as a boolean, not as text, so the service is not privileged and this rule stays quiet. The /dev/video0 mapping is still reported by SKY-D331, which looks at device mappings on their own.
How Skylos decides
- Runs with
--danger. Reads YAML files namedcompose.yaml,compose.yml,docker-compose.yaml,docker-compose.yml, or starting withcompose.ordocker-compose.and ending in.yml/.yaml, in any folder except.git,.venv,venv,node_modules,build,distand cache folders. - Skips a file larger than 1 MB, a symlink, a file that does not parse as YAML, and a document whose structure is deeper than 100 levels or has more than 50,000 nodes.
- Looks at each entry under
services:. A service counts as privileged whenprivilegedistrue, or the text1,true,yesoron. - Reports only when that privileged service also has device or GPU access: a
devices:orvolumes:entry whose host path is/dev,/proc,/sys,/run/udev, the Docker socket or a device such as/dev/video0,/dev/ttyUSB0,/dev/i2c-1or/dev/nvidia0; orruntime: nvidia; or agpus:key; or an environment value starting withNVIDIA_. - Host paths written with
${...}are not resolved and do not count. - Reports HIGH on the
privileged:line of that service, once per service.
How to fix it
Remove privileged: true and pass only the device the service needs. The NVIDIA runtime already gives the container the GPU. If the process needs one extra Linux capability, add that one with cap_add: instead.
services: camera: image: nvcr.io/nvidia/l4t-jetpack:r36.3.0 runtime: nvidiaRemoved: privileged: true devices: - /dev/video0:/dev/video0 environment: CAMERA_FPS: "30" restart: unless-stoppedWhen it can be wrong
- It misses a privileged service that gets its GPU through the Compose
deploy.resources.reservations.devicesblock (driver: nvidia,capabilities: [gpu]): that form is not read as GPU access, so the service is not reported. - Privileged services without a device or GPU, such as a
docker:dindbuild container, are outside this rule and are not reported. - The flagged example is also reported by SKY-D331 for its
/dev/video0mapping.
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
privileged:line, or on its own comment line directly above it.YAML privileged: true # skylos: ignore[SKY-D330] vendor driver needs it[tool.skylos] ignore = ["SKY-D330"]turns the rule off for the project.