Repository navigation
docs: align Security Model wording with sudoers and pin the claim - #487
Conversation
vladimirrott
left a comment
There was a problem hiding this comment.
Thank you for this, and welcome. You took the part of #483 that was easiest to skip, the request to pin the wording so it cannot drift back, and you did it rather than writing a sentence saying why it was hard. The preamble rewrite is accurate: it names the sequential-gate framing, the User=sysknife line, and the three grants that reach root on their own, and it points the reader at packaging/sysknife-sudoers where the honest wording already lived.
One blocking item, and it is the guard rather than the prose.
The pin cannot fire on the file it was written for. reject_pattern runs over claim_files, which check_public_claims.sh reads from CLAIM_FILES in check_evidence_claims.py. SECURITY.md is not in that list:
$ python3 -c "
import importlib.util
spec = importlib.util.spec_from_file_location('c','scripts/check_evidence_claims.py')
m = importlib.util.module_from_spec(spec); spec.loader.exec_module(m)
print('SECURITY.md screened:', 'SECURITY.md' in m.CLAIM_FILES)
print('files:', len(m.CLAIM_FILES))"
SECURITY.md screened: False
files: 16
I applied your reject_pattern line verbatim to main, put the retired sentence back into SECURITY.md, and ran the check:
$ grep -c 'Every layer is independent' SECURITY.md
1
$ bash scripts/check_public_claims.sh; echo "rc=$?"
Published figures match the evidence artifacts.
Public claims are internally consistent.
rc=0
Green, with the exact sentence the pin exists to reject sitting live in the tree. Adding SECURITY.md to CLAIM_FILES is the fix. Please check what else that turns red before you push: the file is long and the other reject_pattern calls will start seeing it for the first time, which may surface real wording to fix or may need the pattern scoped.
Whatever you land, show the mutation in the PR: the sentence restored, the check red, the sentence removed, the check green. A guard that has never been observed failing is the defect this tracker catches most, and it is the one thing #483 asked for that nothing else in the diff can demonstrate.
Two smaller notes, neither blocking:
scripts/check_public_claims.sh goes from mode 100755 to 100644 in the diff. The release rehearsal calls it as bash scripts/check_public_claims.sh so nothing breaks today, but it is almost certainly not what you meant. chmod +x and amend.
The apt-get grant you cite as trailing-wildcard is spelled env DEBIAN_FRONTEND=... NEEDRESTART_MODE=a /usr/bin/apt-get *, and v0.19.0 and v0.20.0 have since narrowed sixteen of the grant families your text describes, including systemctl and useradd. Rebase on main and the ROOT_SHELL_UNITS section will need one adjustment: systemctl now carries per-subcommand constraints, so sudo -n /usr/bin/systemctl start rescue.target is refused by the grant itself. The denylist-is-not-containment point still stands and is still worth making; the worked example needs a different verb.
Once the pin bites and the mode bit is back, this merges. Say the word if you would rather I take the CLAIM_FILES half and leave you the prose.
If you administer Linux boxes yourself, sysknife doctor and sysknife audit verify are read-only and take nothing but a checkout, and I would rather hear what they get wrong on a real host than guess.
SECURITY.md was not in CLAIM_FILES, so the reject_pattern added for it ran over a list that did not include the file. Add it, restore the executable bit on check_public_claims.sh, spell the grants the way packaging/sysknife-sudoers writes them, and switch the denylist example to the systemctl enable grant. Extend public-claims.test.sh with the mutation: sentence restored -> red, sentence removed -> green.
|
Thanks for the review — and for catching that the pin could not fire. Pushed The pin now bites
printf '
SysKnife uses a layered enforcement model. Every layer is independent; a
bypass of one does not bypass the others.
' >> "$fixture/SECURITY.md"
assert_rejected 'layer-independence framing restored in SECURITY.md'
cp "$repo_root/SECURITY.md" "$fixture/SECURITY.md"Mutation, observedThe other notes
What adding
|
vladimirrott
left a comment
There was a problem hiding this comment.
Reviewed at 53b0dc3b. You fixed the right thing and then proved it: SECURITY.md is in CLAIM_FILES, and the new fixture puts the retired sentence back and asserts the check rejects it. I ran tests/release/public-claims.test.sh on your branch merged with current main, in a container, clean and with two mutations:
=== clean rc=0
Public claims contract passed.
=== m1 rc=1 ("SECURITY.md" removed from CLAIM_FILES)
FAIL: checker accepted stale claim: layer-independence framing restored in SECURITY.md
=== m2 rc=1 (the independence reject_pattern deleted)
FAIL: checker accepted stale claim: layer-independence framing restored in SECURITY.md
My merge tooling observed the same thing independently (receipt recorded for #487 at 53b0dc3b (observed: clean pass, mutated fail)). markdownlint-cli2 0.23.2 reports 0 issues on the new SECURITY.md, and your branch merges into main with no conflicts.
I owe you a correction. Last round I told you sudo -n /usr/bin/systemctl start rescue.target is refused by the grant itself. That was wrong. packaging/sysknife-sudoers on main still has:
sysknife ALL=(root) NOPASSWD: /usr/bin/systemctl start *
The narrowing split the bare systemctl grant into one line per subcommand, but each of those lines takes any arguments, so your original example was correct. Your new one, enable --now debug-shell.service under systemctl enable *, is also correct, so keep it. I'm sorry for costing you a rewrite on my mistake.
One small item, not blocking. This push flips two files from 100755 to 100644, the reverse of the fix you made to check_public_claims.sh:
$ git diff ca8ad237 53b0dc3b | grep -A2 '^diff --git a/\(scripts/check_evidence\|tests/release/public\)'
diff --git a/scripts/check_evidence_claims.py b/scripts/check_evidence_claims.py
old mode 100755
new mode 100644
--
diff --git a/tests/release/public-claims.test.sh b/tests/release/public-claims.test.sh
old mode 100755
new mode 100644
CI calls both through python3 and bash, so nothing breaks today. If you push again, git update-index --chmod=+x on both puts the bits back. If you don't, I'll restore them at merge.
Approving. The CI runs for this head are waiting on my approval as a first-time contributor's; that part is on me, not you.
This branch's Security Model rewrite cited `useradd --create-home *` and the per-subcommand `systemctl` grants as the examples of what the daemon account can reach root with, and `systemctl enable --now debug-shell.service` as the path around ROOT_SHELL_UNITS. Both were true when it was written and stopped being true in 0.21.0, which routed those verbs through the validating helper and dropped the grants. The point the section makes is unchanged and still correct: the layers are sequential gates on one request path, and the account is root-equivalent. The examples now name grants that are actually in the file, and the denylist section says what 0.21.0 did and does not overstate it.
vladimirrott
left a comment
There was a problem hiding this comment.
Re-approving at 28a52540. The extra commit on this branch is mine: 0.21.0 landed while this was open and removed the grants your Security Model text cited as examples, so the paragraph naming useradd --create-home * and the per-subcommand systemctl grants, and the one saying systemctl enable --now debug-shell.service walks around ROOT_SHELL_UNITS, were about to publish claims that are no longer true. They now name grants that are actually in the file (apt-get, snap install, rpm-ostree install) and say what 0.21.0 changed without overstating it.
Your point is unchanged and it is the reason this PR matters: the layers are sequential gates on one request path, sharing one root-equivalent account.
The pin earns its own receipt:
maintainer-merge verify 487 a2be2080 tests/release/public-claims.test.sh "s|reject_pattern 'Every layer|reject_pattern 'ZZZEvery layer|" shell
shell suite: evidence of 1 executed unit(s), passing unmutated
applying the mutation and re-running
receipt recorded for #487 at a2be2080 (observed: clean pass, mutated fail)
My first attempt at that mutation edited the pattern string itself, which the fixture in your test also contains, so both sides changed together and the gate reported THE GUARD DOES NOT BITE. That was my mutation being self-cancelling, not your test.
Both files went 100755 -> 100644 in that merge, which was mine to catch and I did not. CI calls them through an interpreter so nothing went red, and CONTRIBUTING.md:236 tells contributors to run check_evidence_claims.py directly, where it fails with Permission denied. Found by the 11:16 review run. The CHANGELOG lines are the ones that run listed as owed: #505's preflight fix and #487's Security Model rewrite. #506 is test-only and needs none.
What
Rewrite the Security Model preamble in
SECURITY.mdso it matches the trust boundary already described inpackaging/sysknife-sudoers, and pin the replacement wording inscripts/check_public_claims.sh.sysknifeservice account is root-equivalent by design.ROOT_SHELL_UNITSexample: the denylist stops unit names from the LLM/MCP path; it is not containment.Why
Closes #483.
SECURITY.md:43-44andpackaging/sysknife-sudoers:9-12describe the same trust boundary and disagree. All five layers run inside one process assysknife, and that account holdsuseradd,systemctl, and a trailing-wildcardapt-get— each reaches root on its own. The sudoers header is accurate; the independence sentence invites a reader to treatROOT_SHELL_UNITSas containment.check_public_claims.shYes, the replacement wording can be pinned there, and this PR pins it:
A sentence that drifted once will drift again.
How checked
SECURITY.mdagainstpackaging/sysknife-sudoersandpackaging/sysknife-daemon.service.ROOT_SHELL_UNITSincrates/sysknife-daemon/src/actions/validate.rs(refusesdebug-shell/emergency/rescue/runlevel1/singlefor typed actions) and kept both what it does and what it does not do in one place.SECURITY.mdfor sentences leaning on independence; Layer 4 already carries the right register ("This boundary protects against an untrusted MCP agent, not against arbitrary malware already running as the same Linux user").Note
#483 was offered to @mikevillari. If that work is already underway, please close this in favour of it — happy to rebase or drop.