docs: list the files in /etc a confined worker's programs need

Merged
KI
23d ago
+38-3

Problem

RFC 0008's default rules let a confined worker read, list, and run files beneath /usr, /lib, /lib64, /bin, /sbin, and /nix/store, plus /etc/ld.so.cache, /dev/null, and /dev/urandom. #83 listed "programs that need more than a loader and libraries to start" as not measured. Nothing said which common programs fail without files in /etc, or which --direct paths fix them.

Change

Docs only. The default rules are unchanged.

  • RFC 0008 gains "Programs that read files in /etc" under its answer, with the measured table, and narrows its "Not measured" line.
  • The README's confinement paragraph names the paths that Node.js, git, name lookups, and HTTPS needed. It also describes the defaults as "read, list, and run files beneath …", which is what the rules allow.
  • The roadmap adds this as evidence under M10's "confined worker beyond Ubuntu" item.

Measurement

Two probe runs on the throwaway branch test/worker-runtime-probe, which is 834b4b7 with only a probe workflow added: 43361464148 and 43470752361. They ran on CI's Ubuntu 26.04.1 with Linux 7.0.0-1019-azure. Each program ran three ways, each under strace -f -Z -e trace=%file,%network:

  • through fsgate-broker --unconfined, as the control;
  • confined with the default rules;
  • confined with --direct for the files it was refused.

Every control passed.

ProgramDefault rulesPasses with --direct
sh -c 'echo ok', date +%Zpass
Node.js 24.22.2 (node -e)exit 13: fopen(/etc/ssl/openssl.cnf) refused/etc/ssl/openssl.cnf:r
Node's fetch("https://github.com")exit 13, as above/etc/ssl/openssl.cnf:r and the three name files
getent hosts github.comexit 2/etc/resolv.conf:r, /etc/hosts:r, /etc/nsswitch.conf:r
curl https://github.comexit 6, cannot resolve the namethe three name files and /etc/ssl:rl
Python urllib.request.urlopen("https://github.com")exit 1the three name files and /etc/ssl:rl
git --versionpasses, with a warning about /etc/gitconfig
git ls-remote https://github.com/farming-labs/fsgate HEADexit 128, "unknown error occurred while reading the configuration files"/etc/gitconfig:r, the three name files, and /etc/ssl:rl, from the checkout and from /
id -unexit 1, "cannot find name for user ID 1001"/etc/passwd:r, /etc/group:r, /etc/nsswitch.conf:r
mktemp, Python tempfile.mkstemp()exit 1none: --direct gives no write
grep -c . /proc/self/statusexit 2/proc:r

/etc/localtime links to /usr/share/zoneinfo/Etc/UTC, so date read it under /usr. These refusals left the result unchanged: /proc/self/maps, /proc/mounts, /proc/filesystems, /etc/host.conf, /etc/passwd for curl and git, and a Unix socket call, which RFC 0009's filter refused.

Verification

  • The table comes from the two runs' logs, rechecked against each claim after writing. Where the runs did not show why something failed, the table gives only the exit code: Python's HTTPS failure, for example, was cut off before its last line.
  • Locally, on macOS 26.2 with Rust 1.99.1:
    • cargo fmt --all --check and cargo clippy --all-targets --locked -- -D warnings: clean.
    • cargo test --locked: 121 passed, the README doctest included.
    • RUSTDOCFLAGS='-D warnings' cargo doc --locked --no-deps: clean.

Not verified:

  • Systems other than Ubuntu 26.04, and a Node.js or git from a distribution's packages instead of the runner image.
  • Whether each --direct path is needed on its own. The runs added them as a set per program.
  • What happens where /etc/gitconfig or /etc/ssl/openssl.cnf does not exist. Both exist on the runner.
  • The probe ran the broker from 834b4b7, before #93 changed the socket filter. #93 does not touch the filesystem rules.

Documentation and release

No changelog entry, because no behavior changes. Whether /etc/ssl/openssl.cnf or other /etc files should join the default rules is left to the maintainer, since that widens what every confined worker can read.


Summary by cubic

Documents which common programs fail when a confined worker lacks /etc files, and which --direct paths fix them, based on probe runs on Ubuntu 26.04. Docs only: the default rules are unchanged.

  • RFC 0008 gains a measured table under "Programs that read files in /etc" and narrows its "Not measured" line.
  • The README's confinement paragraph names the paths Node.js, git, name lookups, and HTTPS need.
  • The roadmap cites the probe runs as evidence under the confined-worker item.

Key findings

  • Node.js does not start without /etc/ssl/openssl.cnf.
  • git ls-remote fails without /etc/gitconfig.
  • Name lookups need /etc/resolv.conf, /etc/hosts, and /etc/nsswitch.conf.
  • id -un needs /etc/passwd, /etc/group, and /etc/nsswitch.conf.