Add cosign v3 bundle format with Fulcio cert caching#514
Draft
codysoyland wants to merge 16 commits intochainguard-dev:mainfrom
Draft
Add cosign v3 bundle format with Fulcio cert caching#514codysoyland wants to merge 16 commits intochainguard-dev:mainfrom
codysoyland wants to merge 16 commits intochainguard-dev:mainfrom
Conversation
Add a "legacy" secant package, which reverts some of the changes in chainguard-dev#471. This means we have 2 isolated secant packages that can be used by the provider to sign using either v2 or v3. Not included here is a way to configure the provider to sign in one of 3 modes: - Just v3 - Just v2 ("legacy") - Both Signed-off-by: Josh Dolitsky <josh@dolit.ski>
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
89101a6 to
8064ed4
Compare
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.
Summary
BundleSignerin the secant library with Fulcio certificate caching — the first sign operation fetches a cert viacbundle.SignData's built-in Fulcio flow, then extracts and caches it from the bundle output so subsequent operations skip Fulcio entirelysignature_formatparameter (legacy,bundle, orboth) at both provider and resource levelcbundle.SignDatafromcosign/v3for all signing logic, avoiding reimplementation of Fulcio client construction, Rekor, and TSA setupKey changes
pkg/private/secant/bundlesign.go— newBundleSignerstruct with cert caching (30s expiry buffer),SignBundle(), andAttestBundle()functionsinternal/provider/provider.go—signature_formatprovider config,BundleSignercached at provider levelinternal/provider/resource_sign.go/resource_attest.go— dual-path signing: legacy secant path and new bundle path based onsignature_formatinternal/provider/oidc.go— OIDC token caching with JWT expiry awareness, shared across both signing pathsTest plan
go build ./...compiles cleanlygo test ./pkg/private/secant/...— cert caching unit tests passgo test ./internal/provider/...— provider tests passgo vet ./...— no issuesdefault_signature_format = "bundle", sign an image, verify bundle is written as OCI referrer🤖 Generated with Claude Code