Repository navigation
Description
Recommendation
Stop showing fleet jobs the host's whole /etc. Give them a short allow-list of /etc entries instead, and check from inside the sandbox that this is all they see. Then "a job cannot read that secret" is true because the file is not there, not because a parser guessed right.
Why
Today fork-fleet-job-paths.txt lists /etc, so the launcher binds all of it into every job. The etc-secrets wall then reads /etc (and /usr) and tries to guess which readable files hold a secret: it copies four config languages (shell, systemd unit, systemd env-file, fish/csh/pam_env) with regexes and shlex, and follows pointers like *_FILE and *_COMMAND.
That can never be a proof. A *_COMMAND value is a program: which file it reads depends on bash and on every program it calls. Every review round of #240 found one more form the copy reads differently from the real parser, and that supply does not run out. So #240 merges with etc-secrets described as what it is: a lint that looks for secrets in the common places (#240 round 4).
What to build (option D)
- Allow-list. Replace the
/etcline infork-fleet-job-paths.txtwith the entries builds need, for example:passwd,group,nsswitch.conf,hosts,ssl/certs,ssl/openssl.cnf,ca-certificates,pki,alternatives,ld.so.cache,ld.so.conf,ld.so.conf.d,localtime,timezone,os-release,java-*-openjdk,maven,gitconfig,mime.types,fonts,login.defs,protocols,services. A project adds more through the existingALLOW_PATHS. The launcher already binds single paths and skips missing ones. Login files, units,/etc/default, fstab, cron and every backup tool's folder are then simply not in the job's file system. - Check by looking. The existing in-sandbox probe (it runs as the runner user with the real unit settings) lists the job's
/etcand FAILs on any entry that is not on the list. It also tries to read a canary file the host keeps outside the list (and one readable only by group or ACL), and FAILs if the read works. - Walls rule: "no whole
/etcin the paths list". Themountswall (linux and wsl2) FAILs if the launcher'spathsholds/etcitself. - Older kit: its paths file still lists
/etc. The every-start check must FAIL on that with "re-run the installer", and never start a runner with the old view. - Delete the pointer-following code in
fork-fleet-walls/linux:command_secret,word_paths,inline_script, specifier expansion for secrets, the env-file and login-file readers, and the mount-table reader. About 600 lines and many tests go. - Keep a small lint for what jobs still see outside
/etc:/usr(mainly/usr/localscripts and/usrunit files) andALLOW_PATHS. Token shapes, secret file names, and a plain rule: a line whose raw text holds a secret word must be one exact simple form, else FAIL. - Keep from fleet walls: the seven #226 follow-ups (fail closed) #240: all of
job-units(unit_lines, drop-in order, BOM, continuation), the launcher tripwires,public_only, the folder-owner checks, token shapes, and "any error = FAIL". - Reviews: this is launcher code, so two independent Opus high reviewers. Each asks the state question below.
The risk moves to builds: a build may miss an /etc file. That error is loud (the build fails and names the file) and safe. Run the real CI jobs once and add what is missing. Today a wrong guess is silent and unsafe.
What happens when this runs again, stops half-way, or meets old or empty state?
- Runs again: the view is built fresh at every start from the paths file, nothing stored. Same view each time.
- Stops half-way: systemd starts the unit with all its settings or not at all.
- Older kit: its paths file lists
/etc; the check FAILs ("re-run the installer") before any runner starts. - Hand-made host: its odd
/etcfiles no longer matter, which is the point. - Missing entry on a host: skipped by the launcher, and the probe confirms what the job really sees.
Open forms today: closed by design, not by more parsing
Each form below makes etc-secrets PASS on a test root while a job could read the secret. They are known and listed in the etc_secrets_wall docstring. Do not fix them one by one in the parser; option D removes them, because the files are no longer in the job's view.
BORG_PASSCOMMAND="cat <readable file>": borg's own standard name.PASSCOMMANDis one word and matches no secret word.- A password in
/etc/cron.d/*or/etc/crontab. - A password in a script under
/usr/local/bin(this one stays in the small/usrlint, item 6). - A password on a unit's
ExecStart=line. - A readable password file that nothing points at.
- A secret under a name with no secret word.
EnvironmentFile=and/etc/default/*are read with shell regexes, not systemd's env-file parser: blanks around=, unquoted values with blanks, backslash escapes, quotes in the middle of a value, continued lines.- Login files are read with the same regexes:
=/etc/restic/"pw",=/etc/restic/p\w, a value continued with\, a newline inside quotes. - A newline in
sh -c 'true<newline>cd etc/restic<newline>cat pw'hides thecd. - A quoted value over several lines in a login file (
export RESTIC_PASSWORD="Hunter2-correct<newline>horse"). - Unit settings that change the unit's view of files:
BindPaths=,BindReadOnlyPaths=,RootDirectory=,RootImage=,TemporaryFileSystem=,MountImages=. - Percent-encoding in a login file:
curl -s file:///etc/restic/p%77. - A folder read recursively:
grep -rh . /etc/resticwith the secret in a subfolder. - A
%specifier inside anEnvironment=NAME (RESTIC_PASS%iWORD_FILE=...). others_readlooks only at the "other" bits; a file the job user can read through its group or an ACL counts as private (item 2's canary read covers this).
Closed in #240 round 4: a # inside a word of a *_COMMAND (shlex read it as a comment).
Details and test inputs: the round-3 re-check comments on #240. Design audit by the fork orchestrator, 2026-11-16 (options A to D; D recommended).
🤖 Generated with Claude Code
Activity
fleet walls: etc-secrets is a lint, not a proof (PR #240 fix round 4)
scuttletoby commentedon Nov 16, 2026
From the #240 round-4 re-check (lens240q4), open forms and wording to add to this list:
.gpg/.agepasses (trusted by name); this now also coverscat ~/x#y.gpg.*_COMMANDprogram is not read.%t/%E/%Sto system folders.etc_secrets_walldocstring's; keep them the same.fork-fleet-walls.py:9("exit 0 only when every wall holds") andfork-fleet.md:235("Fleet jobs read no secrets") should sayetc-secretsis a lint, not a proof.fleet walls: the seven #226 follow-ups (fail closed) (#240)
fleet walls: jobs see an allow-list of /etc, not all of it (#243)
fleet walls: canaries only in a closed folder, as new files; pins for #…
fleet walls: the canary test once, in Launcher only (#243)
fleet walls: jobs see an allow-list of /etc, not all of it (#243) (#360)
fleet walls: the seven #226 follow-ups (fail closed) (#240)
fleet walls: jobs see an allow-list of /etc, not all of it (#243) (#360)
fleet walls: the seven #226 follow-ups (fail closed) (#240)
fleet walls: jobs see an allow-list of /etc, not all of it (#243) (#360)