SKY-D335 · Deployment and infrastructure
Root edge systemd service without basic sandboxing
An edge or device systemd service that runs as root without three common systemd safety settings: NoNewPrivileges=true, ProtectSystem=full or strict, and PrivateTmp=true. Each one takes a power away from the process that it almost never needs.
- Languages
- systemd units
- 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
- Systemd edge service missing sandboxing
Why it matters
Without them, a compromised root daemon can rewrite system binaries and configuration, gain new privileges through setuid programs, and read or plant files in the shared /tmp. With them, the same bug does much less damage.
What Skylos flags
[Unit]Description=Jetson object detectorAfter=nvargus-daemon.service [Service]User=rootExecStart=/opt/detector/bin/detector --engine /opt/detector/model.engineRestart=always [Install]WantedBy=multi-user.targetWhat Skylos leaves alone
[Unit]Description=Jetson object detectorAfter=nvargus-daemon.service [Service]User=detectorSupplementaryGroups=videoExecStart=/opt/detector/bin/detector --engine /opt/detector/model.engineRestart=always [Install]WantedBy=multi-user.targetWhy Skylos leaves it alone
The same service without the three settings, but running as its own user. The rule only checks services that run as root, so it stays quiet.
How Skylos decides
- Runs with
--danger. Reads the same*.servicefiles as SKY-D333 and needs the same[Service]section and edge context (a device, camera, GPU or robot word, or a/dev/path, somewhere in the unit). - Needs the service to run as root: no
User=in[Service], or the lastUser=is empty,0orroot. - Checks the last value of each setting in
[Service]:NoNewPrivilegesandPrivateTmpmust be1,true,yesoron;ProtectSystemmust befullorstrict(yesdoes not count). - Reports MEDIUM on the
ExecStart=line (line 1 when there is none), naming the settings that are missing.
How to fix it
When the service must stay root, add the three settings. Running it as its own user, as in the not-flagged example, clears this rule and SKY-D333 together.
[Unit]Description=Jetson object detectorAfter=nvargus-daemon.service [Service]User=rootExecStart=/opt/detector/bin/detector --engine /opt/detector/model.engineRestart=alwaysAdded: NoNewPrivileges=trueAdded: ProtectSystem=strictAdded: PrivateTmp=true [Install]WantedBy=multi-user.targetWhen it can be wrong
ProtectSystem=yesis reported as missing: it only protects/usrand/boot, and the rule asks forfullorstrict.- Settings added in a drop-in file (
object-detector.service.d/*.conf) are not read; only*.servicefiles are scanned. - Stronger settings that make these three redundant, such as a
RootDirectory=jail, are not recognised. DynamicUser=yeswithoutUser=counts as root, and any unit that mentions/dev/counts as a device service, as for SKY-D333.
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 a comment line directly above
ExecStart=. systemd reads#only at the start of a line.INI # skylos: ignore[SKY-D335] sandboxed by the vendor drop-inExecStart=/opt/detector/bin/detector --engine /opt/detector/model.engine[tool.skylos] ignore = ["SKY-D335"]turns the rule off for the project.