feat: add keyless signature verification for Zarf packages - #1393
Conversation
| datasource | package | from | to | | --------------- | ------------------------ | ------- | ------- | | go | github.com/zarf-dev/zarf | v0.76.0 | v0.77.0 | | github-releases | zarf-dev/zarf | v0.76.0 | v0.77.0 | | github-tags | zarf-dev/zarf | v0.76.0 | v0.77.0 |
…igning configuration
|
@greptileai review this draft |
Greptile SummaryThis PR adds keyless (OIDC/Sigstore) signature verification support for Zarf packages in bundle definitions and bumps the Zarf dependency to v0.77.0, which requires it. Signing types are migrated from
Confidence Score: 5/5Safe to merge; all verification paths fail closed and the keyless feature is fully additive with no changes to existing key-based flows. The validation logic in ValidateVerifyBlobConfig correctly prevents empty or conflicting signing configs, and the mutual-exclusion check runs before any file I/O. All temp directories holding key material are cleaned up via defer os.RemoveAll. The asymmetry in selectPackageVerifyOpts results in a less-informative error in a rare edge case but does not compromise verification correctness. src/pkg/bundle/inspect.go for the selectPackageVerifyOpts keyless branch; src/pkg/utils/utils_test.go for the shared tmpDir in TestBuildVerifyBlobOptions Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Bundle
participant utils as utils.BuildVerifyBlobOptions
participant Source as sources Remote or Tarball
participant Inspect as bundle.verifyPackageSignature
participant Cosign as signing.CosignVerifyBlobWithOptions
User->>Bundle: deploy or inspect
Bundle->>utils: BuildVerifyBlobOptions(pkg, tmpDir)
utils-->>utils: ValidateVerifyBlobConfig
alt publicKey set
utils-->>Bundle: VerifyBlobOptions with Key
else keylessVerification set
utils-->>Bundle: VerifyBlobOptions with CertIdentity and OIDC
else no config
utils-->>Bundle: nil
end
Bundle->>Source: NewFromLocation with verifyOpts
Source-->>Source: LoadPackageMetadata downloads zarf.yaml.sig and zarf.bundle.sig
Bundle->>Inspect: verifyPackageSignature(pkgDir, verifyOpts, zarfPkg)
Inspect-->>Inspect: detect signed via Build.Signed or sig files on disk
Inspect-->>Inspect: selectPackageVerifyOpts picks BundlePath or Signature
Inspect->>Cosign: CosignVerifyBlobWithOptions(ctx, zarf.yaml, opts)
Cosign-->>Bundle: verified or error
Reviews (5): Last reviewed commit: "chore: prefer zarf.bundle.sig for key-ba..." | Re-trigger Greptile |
…ot.json is written and TrustedRoothPath is set on opts
|
@greptileai review this draft |
…sig in LoadPackageMetadata
…scriptions for consistency with Zarf verify docs
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 28bd18721e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
slaskawi
left a comment
There was a problem hiding this comment.
Looks good in general. Worth check the Codex comment and then I'm happy to approve.
|
Addressed in 99fcc5f. Added how-to guide for verifying keyless package signatures. Intentionally left out public keys per our discussion, @joelmccoy . |
|
@greptileai review |
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
joelmccoy
left a comment
There was a problem hiding this comment.
Generally LGTM - One comment for consideration
Description
resolving the inability to reference the Zarf init package at v0.77.0 which is signed with a keyless
identity
New bundle YAML fields (per package)
keylessVerification.certificateIdentitykeylessVerification.certificateIdentityRegexpcertificateIdentityfor pattern matching.keylessVerification.certificateOIDCIssuerkeylessVerification.certificateOIDCIssuerRegexpcertificateOIDCIssuer.keylessVerification.trustedRootkeylessVerification.insecureIgnoreTlogkeylessVerification.useSignedTimestampspublicKeyandkeylessVerificationare mutually exclusive.Example usage
Related Issue
Completes CLI-201
Type of change
Checklist before merging