Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

I19 · No principal approves its own proposal, and no principal grants itself, or a principal i…

planarian @ a924e09 · Spec v4.6 · snapshot main · all versions

No principal approves its own proposal, and no principal grants itself, or a principal it controls, a capability it does not hold.

— SPEC §7

StatusProof phased:aGym
ProvedA (proof), C3 : 3 (baseline 3 : 3, not degraded)3 entries, 3 must-pass

How it is proved

3 obligations, in crates/policy/src/lib.rs, crates/policy/src/proofs.rs; every one is checked on every CI run.

ObligationKindWhat it guaranteesSource
i19_no_self_approvalproof fnI19: no approver approves its own proposal, and an Administrator class is approved only by an administrator; nobody grants a capability to themselves or one they do not hold.proofs.rs:215
may_approveverified fn(no doc comment)lib.rs:923
may_grantverified fn(no doc comment)lib.rs:942

What it rests on

If any of these is false, the proof no longer describes the real machine.

IdAssumptionKindAlso relied on by
V1vstd’s specifications of Vec, String::as_str, str::unicode_len, str::get_charProof-validityI5, I10, I11, I16, I21, I22
U2user_authorization and the administrator lookup (planarian-admin membership, root)Internal unprovenI17, I22
U5Identity resolution (§10): peer credentials and pidfd to logind session, seat, terminalInternal unprovenI21, I24

Every proof also rests on V7 (The specifications the proofs prove against (decide_spec, step_spec, inv, chained, the lemma statements) say what the SPEC’s English means), V8 (Verus is sound: what it reports verified holds of the code), V9 (Z3, the solver Verus calls, is sound), V10 (rustc compiles the verified code to a program with the semantics Verus checked).

How it is tested

EntryHarnessWhat it doesExpectsLatest verdict
authz-user-overrides-firewallfakeFrom her session, alice overrides the firewall (sshd’s stand-in in the fake: a Security unit) to stopped. Held for an administrator; it stays up. alice cannot approve her own request (I19); root at a terminal approves, and the override holds, attested and attributed to alice.invariants: I19; overrides: service:sshd; txn: Committed SetOverridefake: PASS
en-i19-no-self-approvalfake, vmRoot proposes an AskFirst change and then, at a terminal, tries to approve it: refused, and the change never runs. (A principal granting itself a capability has no request to make in Phase A: capabilities come from group membership only.)txn: pending ApplyChange; units: service:sshd Runningfake: PASS; VM: not run in this build
floor-manual-rollback-needs-adminfakeAfter the security update, an administrator asks to roll back below the floor: AskFirst for an Administrator approver. The proposer cannot approve it (I19); root at a terminal can.generation: base; security_floor: candidate; txn: Committed Rollbackfake: PASS

Known limits

BypassRouteSeverityStatusCloses in
X-1Root edits the store, /boot, the binaries, the journal or the posture stateAcceptedAcceptedE
X-2A nixos-rebuild outside PlanarianAcceptedAcceptedC
X-4Physical accessAcceptedAcceptedE
X-6The supply chain: nixpkgs content, cache signatures, input-addressed store pathsAcceptedAccepted—
X-7Backends report success falsely; systemd or the kernel misbehave (P1, P6, P8)AcceptedAcceptedD, E

History

SpecChange
v4.4Invariants I16 (security floor), I17 (administrator set non-empty), I18 (hash-chained journal), I19 (no self-approval, no self-escalation), I20 (no agent without the monitor)
v4.4Phase A proof targets add I16 (in decide and target selection) and I19
v4.4rule 4’s preserve list extended to I10–I20

See also

planarian_policy in rustdoc · planarian_policy::proofs in rustdoc