Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

One trust model: attribution at the boundary, and a log of what it decided

f50f6fabc7de2f2d33d22a4f2a8e5518ddb5becb · Keenan Nemetz · 16d ago · parent 671f2aa7

One trust model: attribution at the boundary, and a log of what it decided

The system had two answers to "who did this". Runner results were attributed
by a commit signature; issues, comments, approvals and every push were
attributed by the account the SSH handshake resolved. One was cryptographic
and lived in the object, three were boundary-based and lived in the
instance's word.

Keeping both meant keeping allowed_signers generation, ssh-keygen
-Y find-principals semantics, a --key contract in the runner, a pre-flight key
check before every build, a key column in the queue, and the standing
obligation to keep all of it agreeing with the mechanism used everywhere
else. The signature lost on three counts: it restated the handshake (a runner
signs with the key it already pushes with, so the only thing it added was
portability nobody consumes), it proved attribution rather than truth (a
runner can sign a lie), and an assurance mechanism nobody verifies is a
liability, because it looks like security.

So the signature is gone, and what replaced it is the thing a trust-the-box
model actually requires: a record. post-receive now writes one line per
accepted ref update — ref, old, new, account, repo — into the same
append-only log as the privileged acts. In post-receive rather than
pre-receive because pre-receive returning 0 is a permission and this is the
event, and it can never fail a push: the update has already landed, and
reporting it as rejected would make a client re-send something that worked.

Attribution is unchanged in substance — a record must still name the account
that pushed it, which is the rule an issue's author and an approval's owner
already follow — and the gate's three checks simplify to two, since "the
commit must be signed by that account's key" and "the signature's principal
must be that account" both went with the signature. What was a signed record
is now a plain commit on the metadata branch; the run page says "reported by"
and links the commit that carries it.

Deletions, net 467 lines: CommitFilesSigned and CommitTreeAsSigned collapse
into the unsigned forms, VerifyCommitSignature and signedByRE go,
allowedSigners/rosterKeys go with them, the runner loses loadSigningKey,
loadPrivateKey, publicKeyFile, keyFromSSHCommand and checkSigningKey along
with the --key flag and the ping round-trip that validated a key before work,
and Record.Key, Attestation.Fingerprint and their usage go from the record
format and the queue.

The docs now state the model once, in one place — README "The trust model"
and roadmap "The trust model" — including the cost, which is real: a clone
can no longer show who pushed what, and that is the wrong trade for an
instance mirrored outside its operator's control. If that arrives, the answer
is per-repository mandatory signing implemented once, not a second mechanism
kept warm in the meantime. Slices 4 and 6 of Phase 4 are marked removed with
their reasoning kept, because the proposal will come back.

Measured: TestPostReceiveRecordsThePush (both ref updates logged with actor
and account, a deletion logged as "-> none", the CI spool still written) and
TestPostReceiveSurvivesAnUnwritableLog (a full disk cannot fail a push);
TestARecordCannotBeAttributedToAnotherAccount and TestARecordNeedsNoSignature
replace the three signature tests; TestARecordMustDescribeTheLeasedJob stays,
because "the record must describe the job you were given" is a boundary check
and not a crypto one.

internal/gitx/trees.go +1−17

@@ -64,17 +64,6 @@ func WriteFlatTree(g *Repo, files map[string][]byte) (string, error) {
64 64 // path for metadata refs; a second implementation would eventually disagree
65 65 // about ordering or retries, and that shows up as lost data.
66 66 func CommitFiles(g *Repo, ref string, mutate func(map[string][]byte) error, message, author string) (string, error) {
67 return commitFiles(g, ref, mutate, message, author, "")
68 }
69
70 // CommitFilesSigned is CommitFiles with every commit SSH-signed by signingKey, which
71 // is how a runner writes a result: the commit is the attestation, so it has to be
72 // signed by the party whose result it is.
73 func CommitFilesSigned(g *Repo, ref string, mutate func(map[string][]byte) error, message, author, signingKey string) (string, error) {
74 return commitFiles(g, ref, mutate, message, author, signingKey)
75 }
76
77 func commitFiles(g *Repo, ref string, mutate func(map[string][]byte) error, message, author, signingKey string) (string, error) {
78 67 const maxAttempts = 64
79 68 var lastErr error
80 69 for attempt := 0; attempt < maxAttempts; attempt++ {
@@ -93,12 +82,7 @@ func commitFiles(g *Repo, ref string, mutate func(map[string][]byte) error, mess
93 82 if err != nil {
94 83 return "", err
95 84 }
96 var commit string
97 if signingKey != "" {
98 commit, err = g.CommitTreeAsSigned(tree, old, message, author, signingKey)
99 } else {
100 commit, err = g.CommitTreeAs(tree, old, message, author)
101 }
85 commit, err := g.CommitTreeAs(tree, old, message, author)
102 86 if err != nil {
103 87 return "", err
104 88 }