-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor verifyNewBundle into library function #4013
Refactor verifyNewBundle into library function #4013
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4013 +/- ##
==========================================
- Coverage 40.10% 36.84% -3.26%
==========================================
Files 155 210 +55
Lines 10044 13356 +3312
==========================================
+ Hits 4028 4921 +893
- Misses 5530 7817 +2287
- Partials 486 618 +132 ☔ View full report in Codecov by Sentry. |
@haydentherapper @cmurphy @steiza I would appreciate a look at this whenever you have a moment! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! I don't have any further comments other than the things already raised by @malancas.
I will take a look at the conformance failures Monday. Thanks all! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Needs a rebase to fix the tests that didn't run |
Signed-off-by: Cody Soyland <codysoyland@github.com>
Signed-off-by: Cody Soyland <codysoyland@github.com>
Signed-off-by: Cody Soyland <codysoyland@github.com>
Signed-off-by: Cody Soyland <codysoyland@github.com>
Signed-off-by: Cody Soyland <codysoyland@github.com>
Signed-off-by: Cody Soyland <codysoyland@github.com>
Signed-off-by: Cody Soyland <codysoyland@github.com>
Signed-off-by: Cody Soyland <codysoyland@github.com>
This var has a default value so shouldn't be checked Signed-off-by: Cody Soyland <codysoyland@github.com>
These tests are incorrect: they set the signature field which is not allowed when doing bundle verification. Previously they were passing due to logic errors. Signed-off-by: Cody Soyland <codysoyland@github.com>
5932f1f
to
4a08df9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally lgtm, couple minor questions and a typo
Co-authored-by: Colleen Murphy <cmurphy@users.noreply.github.com> Signed-off-by: Cody Soyland <codysoyland@github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few small nits, looks great!
|
||
return sev.Verify(bundle, verify.NewPolicy(artifactOpt, identityPolicies...)) | ||
} | ||
|
||
func AssembleNewBundle(ctx context.Context, sigBytes, signedTimestamp []byte, envelope *dsse.Envelope, artifactRef string, cert *x509.Certificate, ignoreTlog bool, sigVerifier signature.Verifier, pkOpts []signature.PublicKeyOption, rekorClient *client.Rekor) (*sgbundle.Bundle, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a later PR, we should move this to somewhere under pkg/ rather than be under the cli package. It looks like this is only used by the cosign bundle
command.
Signed-off-by: Cody Soyland <codysoyland@github.com>
Signed-off-by: Cody Soyland <codysoyland@github.com>
Signed-off-by: Cody Soyland <codysoyland@github.com>
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [cosign](https://github.com/sigstore/cosign) | patch | `2.4.2` -> `2.4.3` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>sigstore/cosign (cosign)</summary> ### [`v2.4.3`](https://github.com/sigstore/cosign/blob/HEAD/CHANGELOG.md#v243) [Compare Source](sigstore/cosign@v2.4.2...v2.4.3) #### Features - Bump sigstore/sigstore to support KMS plugins ([#​4073](sigstore/cosign#4073)) - Enable fetching signatures without remote get. ([#​4047](sigstore/cosign#4047)) - Feat/file flag completion improvements ([#​4028](sigstore/cosign#4028)) - Update builder to use go1.23.6 ([#​4052](sigstore/cosign#4052)) #### Bug Fixes - fix parsing error in --only for cosign copy ([#​4049](sigstore/cosign#4049)) #### Cleanup - Refactor verifyNewBundle into library function ([#​4013](sigstore/cosign#4013)) - fix comment typo and imports order ([#​4061](sigstore/cosign#4061)) - sync comment with parameter name in function signature ([#​4063](sigstore/cosign#4063)) - sort properly Go imports ([#​4071](sigstore/cosign#4071)) #### Contributors - Bob Callaway - Carlos Tadeu Panato Junior - Cody Soyland - Dmitry Savintsev - Hayden B - Tomasz Janiszewski - Ville Skyttä </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xODAuMiIsInVwZGF0ZWRJblZlciI6IjM5LjE4MC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Summary
This is a refactor of the bundle verification logic that replaces verifyNewBundle with a re-written library function
cosign.VerifyNewBundle
, which accepts a simplified set of arguments, usingCheckOpts
to supply the majority of the configuration. It has been moved out of thecli
package into thecosign
package and made public.This is partially extracted from #3889.
Release Note
Documentation