Repository navigation
Walkthrough: what a PC lets in before apt installs (Supply.lean: the release ledger) #62
zenos-maintainer
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This is the fourth walkthrough of the Lean side of ZENOS, after Flow.lean (where content may go), Ledger.lean (the tamper-evident ledger) and Egress.lean (what may leave the PC). This one covers
formal/ZenosFormal/Supply.lean: the decision a PC makes before apt installs a package file.Status: this is in
mainbut not in a release. The 0.1.2 Developer Preview does not have the update-path checks; releasing them is planned for 0.1.3 (#26, ROADMAP.md). Like the rest of ZENOS, it has not been audited yet.The path from apt to the proof
system/sbin/zenos_pkgcheck.pybefore installing anything (DPkg::Pre-Install-Pkgs) and passes it the package files.system/lib/zsupply.pygathers the facts for each file: its SHA-256, the signed answer of every audit node configured on the PC about that exact file, which enrolled release officers' Ed25519 signatures over the release record verify, whether an agreed revocation exists, and when this PC's rollout ring opens.zenos-decide(opinstall), the program built from the same Lean definitions, and the PC follows its answer. Every check, allowed or refused, is written to the PC's ledger, which is shipped to the audit nodes.The decision (
decideInstall)Three details that are easy to miss:
agreeingcounts a node only if it is one of the configured nodes, its answer's signature verified, and it answered with this very (non-empty) record. Each node is counted once (dedup), so a node answering twice, or a node the PC does not know, adds nothing.countedSignerscounts only officers enrolled on the PC, each once. Other keys do not count.required = 0is refused as"policy", so a configuration mistake cannot turn into "no signatures needed". Whenrequiredis not set in/etc/zenos/supply.json, the check uses 2.What is proved
install_sound1 ≤ required ≤counted signers, and the ring is open.one_node_not_enoughone_key_not_enoughrevoked_refusedrefuse "revoked", whatever else holds.What is not proved here
zsupply.pyare right, and that the facts passed in are true. Lean checks the decision on those facts./etc/zenos/audit.jsonor/etc/zenos/release-keys/is outside this model./etc/zenos/supply.jsoncan be"enforce"(refuse),"warn"(record and let in) or"off"(record only). The theorems are about the decision; only"enforce"stops apt.The same file also has the rule for which destinations system services may reach (
decideSysEgress, withsysegress_cut_only_unlistedandsysegress_listed_kept).Questions for reviewers
required?install_sound?Checking it yourself
Axioms.leanfails the build if any theorem rests onsorryor on an axiom beyond Lean's standard ones. Steps for a fresh machine are in docs/FORMAL_VERIFICATION.md.If a theorem here looks weaker than its comment claims, or the model leaves out something that matters, please say so in this thread or in an issue. Security holes go to the private channel in SECURITY.md.
All reactions