Add gitsign commit-signature verification - #6121
Open
samuv wants to merge 2 commits into
Open
Conversation
Git-installed skills need the same install-time verification as OCI artifacts (RFC THV-0080). This adds Verifier.VerifyGit: the commit's CMS signature is cryptographically verified over the commit payload via the ietf-cms package (the same library gitsign wraps — importing gitsign itself would compile cosign and the cloud KMS SDKs into the binary), the certificate chain is verified against the Fulcio roots in toolhive-core's embedded trusted material, and the signer identity is extracted with core's normalization. Expected identities from the lock file are compared explicitly — git signatures carry no Sigstore bundle to bind a policy into. Verification time is anchored inside the signing certificate's own validity window, matching gitsign's verifier: Fulcio certificates live for minutes, and proving actual signing time is the transparency log's job. Validating the embedded Rekor proof is a tracked follow-up — the reconstruction helpers are gitsign-internal. git.HeadCommit and gitresolver.ResolveResult gain the signed payload (the encoded commit minus its signature header) so install flows can hand the verifier exactly the bytes the signature covers. Part of #5899. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
JAORMX
previously approved these changes
Jul 28, 2026
ietf-cms v0.2.0 mutates a package-level variable during BER decoding, so concurrent ParseSignedData calls race (caught by -race in CI). Signature verification is not hot-path, so serialize the calls with a mutex rather than forking the library the way gitsign does. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## skills-sig/08-verifier #6121 +/- ##
=======================================================
Coverage 72.41% 72.41%
=======================================================
Files 737 738 +1
Lines 75960 76054 +94
=======================================================
+ Hits 55005 55074 +69
- Misses 17055 17069 +14
- Partials 3900 3911 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Stack 2 of RFC THV-0080 (tracking issue #5899) — stacked on #6091 (verifier wrapper); merges after it, into it, or rebases onto main once #6091 lands. This completes the git half of the verification story that #6084 deliberately deferred.
Summary
Git-installed skills need the same install-time verification as OCI artifacts. This PR adds
Verifier.VerifyGit, full cryptographic verification of gitsign commit signatures:github/smimesign/ietf-cms— the same library gitsign wraps. Importing gitsign's ownpkg/gitwas evaluated and rejected: its package graph compiles cosign and the GCP/Azure/AWS KMS SDKs into the binary (~54 new module entries). ietf-cms was already in our dependency graph.SummarizeCertificateand core'sIdentityFromResult.ErrSignerMismatch): unlike the OCI path there is no Sigstore bundle to bind a policy into. Nil expected is trust-on-first-use, same as OCI.git.HeadCommitandgitresolver.ResolveResultgain the signed payload (encoded commit minus the signature header — the exact bytes the signature covers), so the install flow can hand the verifier signature + payload from one lookup.Type of change
Test plan
task teston the stack tip)task lint-fix, 0 issues)gpgsigheader, present for unsigned commits too). Zero network.Does this introduce a user-facing change?
No — nothing calls
VerifyGityet; enforcement arrives with the install-verification PR.Special notes for reviewers
internal/and reimplementing them pulls in the cosign dependency this PR deliberately avoids. Flagging explicitly since the approved plan wanted Rekor validation in-stack — this PR ships the signature+chain half; happy to discuss whether the follow-up should block PR11.verifyGitSignaturetakes injectable pools; the exportedVerifyGitpins the embedded Fulcio roots).Generated with Claude Code