diff options
| author | aur-build <aur-build@localhost> | 2026-11-18 10:16:12 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-18 10:16:12 +0000 |
| commit | 12fb09b0ad11c0d9305d606b3b4fced8ba04d385 (patch) | |
| tree | e33d6c974a4c31c01262ebec902c6c853152188b /src/config.rs | |
| parent | bc63622a1a91f6e1036eb8e6824c04f922e2654e (diff) | |
| download | aur-build-12fb09b0ad11c0d9305d606b3b4fced8ba04d385.tar.gz aur-build-12fb09b0ad11c0d9305d606b3b4fced8ba04d385.zip | |
I9: the pipeline stops trusting paths the build could have placed, plus README and the invariant index
Three things.
**A real hole, closed.** `collect` scans the build's srcdir for
`*.pkg.tar.zst`, and `ingest` copies whatever those paths resolve to into the
content-addressed store — from where the bytes are served from our repo and
signed with our key. The paths are generated by our own scan, but their *targets*
are not: a PKGBUILD that drops a symlink called `evil.pkg.tar.zst` pointing at
the signing keyring, the database, or anyone's home directory would have its
target copied in, published and signed by us. The chroot is supposed to be the
layer that prevents that, and the chroot tier is gated — but two protection
layers must not be load-bearing on each other, and the control plane should not
depend on isolation for the safety of its own secrets.
`collect` now rejects symlinks and rejects anything whose canonicalized target
escapes the build's own staging directory, failing the build closed with the path
in the message. `i9_a_build_cannot_smuggle_bytes_in_from_outside_its_own_staging_dir`
acts the attack out — the shim plants a symlink to the database file — and
asserts the build fails, the store is byte-for-byte untouched, and nothing
publishes. This is the last §2 invariant that had no named test; docs/INVARIANTS.md
says plainly which part of I9 this covers and which part belongs to the gated
chroot tier.
**README.md**, written for the person who has to operate this at 3am: the rule
everything else follows, the quick start, the layout, how the shim harness makes
the whole pipeline testable without root or network, the ops commands, the route
table, and the §14 constraints stated as the hard edges they are.
**docs/INVARIANTS.md**, mapping I1-I12 to the named tests that hold them, with
corroborating tests listed, and an explicit note on the two invariants enforced
by the schema (the partial unique index for I7, the append-only triggers for
I10/I7) so a future code path cannot forget them.
Also recorded in DECISIONS.md: metrics served without a session and why,
retention recording a purge instead of deleting the row, and the real-chroot tier
being explicitly skipped with what stands in for it and how to actually run it.
.gitignore already covered .pi/ but the goal-tracker files were tracked from
before the rule existed; untracked now so they stop appearing in every diff.
Diffstat (limited to 'src/config.rs')
| -rw-r--r-- | src/config.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 127c5a3..7effa53 100644 --- a/src/config.rs +++ b/src/config.rs @@ -59,6 +59,11 @@ pub struct Config { /// the pipeline, mid-step. This is how a real crash is reproduced for I5 — /// not a caught error, an uncatchable death. Never set in production. pub shim_kill_parent: Option<String>, + /// Make the build shim plant a symlink to this path in its srcdir, so a test + /// can act out the I9 attack: an untrusted PKGBUILD smuggling bytes in from + /// outside its own staging dir. + #[serde(default)] + pub shim_plant_link: Option<String>, /// How many builds may run at once (§8.2 backpressure). Default 1, which /// also means the chroot pool only needs one warm root. pub max_concurrent_builds: usize, @@ -98,6 +103,7 @@ impl Default for Config { publish_fault: None, shim_fail: None, shim_kill_parent: None, + shim_plant_link: None, max_concurrent_builds: 1, lease_secs: 90, min_free_disk_mb: 1024, @@ -151,6 +157,9 @@ impl Config { if let Some(k) = &self.shim_kill_parent { cmd.env("AUR_SHIM_KILL_PARENT", k); } + if let Some(l) = &self.shim_plant_link { + cmd.env("AUR_SHIM_PLANT_LINK", l); + } } /// Create the directory tree the server needs. Idempotent. |
