Skip to content

feat(sign): support for keyless signing and offline verification#4891

Merged
brandtkeller merged 43 commits into
mainfrom
2805_keyless_signing
May 26, 2026
Merged

feat(sign): support for keyless signing and offline verification#4891
brandtkeller merged 43 commits into
mainfrom
2805_keyless_signing

Conversation

@brandtkeller
Copy link
Copy Markdown
Member

@brandtkeller brandtkeller commented May 11, 2026

Description

Note - Breaking Changes

  • The cosign functionality under src/pkg/utils has been moved to `src/pkg/signing
  • The embedded structs in signing.Sign|VerifyBlobOptions have been updated to align with cosign.

This PR enables the use of connected keyless signing workflows and offline-compatible verification for a keyless signed package via an embedded trusted root.

This uses the previously implemented zarf tools trusted-root create command to refresh the embedded trusted root. Think of this as a mechanism to streamline the UX of enabling offline verification of keyless-signed packages so that users are not required to bring additional verification material by default - but of which they can overwrite as required.

Additionally this PR enables the bundlesignature feature by default. Note that the VersionRequirement for a package with a bundle signature is v0.71.0 which is the version that introduced the ability to load packages with the bundle file. The feature flag gates are retained such that users who cannot use the bundle still have an opportunity to opt-out until we fully remove.

One early improvement is the UX of retrieving the keyless-signed identity and issuer. These are retrieved on package sign so that we can log the entries that package creators need to provide to those who want to verify - but additionally I believe we could add a zarf package inspect signature <package> command to make this discoverable. We can't place it directly in the build data because it is only accessible post-signing - whereby the zarf definition can no longer be modified without invalidating the signature.

Best practices documentation to follow.

Try it Yourself

# Build the CLI
make build

# Pull a package for signing
zarf tools download-init

# Sign the package (this will conduct browser auth)
./build/zarf package sign zarf-init-arm64-v0.75.0.tar.zst --keyless

# (optional) turn off wifi

# Verify the package
./build/zarf package verify zarf-init-arm64-v0.75.0.tar.zst --certificate-identity [email protected] --certificate-oidc-issuer https://github.com/login/oauth

Related Issue

Fixes #2805
Fixes #4571

Relates to #

Checklist before merging

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 33.13953% with 230 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cmd/package.go 30.00% 70 Missing ⚠️
src/pkg/signing/cosign.go 2.04% 48 Missing ⚠️
src/pkg/packager/layout/package.go 60.78% 30 Missing and 10 partials ⚠️
src/pkg/utils/oci_artifacts.go 0.00% 39 Missing ⚠️
src/pkg/signing/trustedroot.go 29.41% 8 Missing and 4 partials ⚠️
src/pkg/signing/bundle.go 54.16% 8 Missing and 3 partials ⚠️
src/pkg/packager/publish.go 0.00% 4 Missing and 3 partials ⚠️
src/cmd/tools_trustedroot.go 0.00% 1 Missing ⚠️
src/pkg/packager/load.go 0.00% 1 Missing ⚠️
src/pkg/packager/pull.go 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/pkg/feature/feature.go 91.12% <100.00%> (ø)
src/pkg/packager/layout/assemble.go 43.17% <100.00%> (ø)
src/cmd/tools_trustedroot.go 75.64% <0.00%> (ø)
src/pkg/packager/load.go 62.89% <0.00%> (ø)
src/pkg/packager/pull.go 50.00% <0.00%> (ø)
src/pkg/packager/publish.go 63.10% <0.00%> (-3.21%) ⬇️
src/pkg/signing/bundle.go 54.16% <54.16%> (ø)
src/pkg/signing/trustedroot.go 29.41% <29.41%> (ø)
src/pkg/utils/oci_artifacts.go 0.00% <0.00%> (ø)
src/pkg/packager/layout/package.go 66.49% <60.78%> (-0.54%) ⬇️
... and 2 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from 4572_sign_verify_flags to main May 12, 2026 17:25
@netlify
Copy link
Copy Markdown

netlify Bot commented May 12, 2026

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 1e118b8
🔍 Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/6a0f60d96a674d00099693c1

#!/usr/bin/env bash
# Refresh the embedded Sigstore TrustedRoot used for keyless verification.
# Run before each release. Commit the result.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making a mental note to schedule daily checks and notify the zarf channel using this process. A lag in releasing new trusted roots won't be critical but should be nice to have.

@brandtkeller brandtkeller marked this pull request as ready for review May 13, 2026 01:48
@brandtkeller
Copy link
Copy Markdown
Member Author

Removed viper configuration in favor of additional issue / PR to track a few solutions.

Comment thread src/cmd/package.go Outdated
Comment thread src/pkg/packager/layout/package.go Outdated
Comment thread src/pkg/signing/trustedroot.go Outdated
Comment thread RELEASES.md Outdated
@brandtkeller brandtkeller self-assigned this May 21, 2026
@brandtkeller brandtkeller marked this pull request as draft May 21, 2026 03:46
@brandtkeller brandtkeller marked this pull request as ready for review May 21, 2026 06:02
Copy link
Copy Markdown
Member

@AustinAbro321 AustinAbro321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, excited to see this in

@brandtkeller brandtkeller added this pull request to the merge queue May 26, 2026
Merged via the queue into main with commit d0b8665 May 26, 2026
43 checks passed
@brandtkeller brandtkeller deleted the 2805_keyless_signing branch May 26, 2026 04:13
@github-project-automation github-project-automation Bot moved this from In progress to Done in Zarf May 26, 2026
jonnyborbs pushed a commit that referenced this pull request May 27, 2026
Signed-off-by: Brandt Keller <[email protected]>
Signed-off-by: Brandt Keller <[email protected]>
Co-authored-by: Austin Abro <[email protected]>
Signed-off-by: Jon Schulman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Embed the Public Good Sigstore Trusted Root Integrate Sigstore for "keyless signing" of packages and their build provenence

2 participants