Skip to content
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

Fix e2e test failure, add test for local bundle without rekor bundle #2248

Merged
merged 2 commits into from Sep 14, 2022

Conversation

haydentherapper
Copy link
Contributor

@haydentherapper haydentherapper commented Sep 14, 2022

Signed-off-by: Hayden Blauzvern hblauzvern@google.com

Summary

This fixes the behavior of verify-blob when the local bundle does not contain a Rekor bundle (for example, signed without experimental mode). In this case, verify-blob will still run using the local bundle for the cert/sig information.

If it does not contain one and we require a timestamp for cert validity, we fail. Adds a test for a short-lived cert with a bundle missing rekor bundle and no experimental fails. But if experimental is on, we can succeed.

Release Note

  • fix: Fixesverify-blob to handle local bundles that do not contain Rekor bundles.

Documentation

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
cpanato
cpanato previously approved these changes Sep 14, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 14, 2022

Codecov Report

Merging #2248 (fb51ab0) into main (58a96ba) will increase coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2248      +/-   ##
==========================================
+ Coverage   28.35%   28.39%   +0.03%     
==========================================
  Files         131      131              
  Lines        7839     7839              
==========================================
+ Hits         2223     2226       +3     
+ Misses       5315     5313       -2     
+ Partials      301      300       -1     
Impacted Files Coverage Δ
cmd/cosign/cli/verify/verify_blob.go 44.44% <0.00%> (+0.65%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@haydentherapper
Copy link
Contributor Author

@asraa I'm not 100% this is the right behavior. This is the case where we provide a local bundle (without experimental, so no rekor lookup) with just a signature (and it could optionally contain a cert too, but in the test, we pass a key), and the local bundle has no rekor bundle.

This is probably actually a valid use-case, that you use the local bundle just to hold the verification material.

@asraa
Copy link
Contributor

asraa commented Sep 14, 2022

@asraa I'm not 100% this is the right behavior. This is the case where we provide a local bundle (without experimental, so no rekor lookup) with just a signature (and it could optionally contain a cert too, but in the test, we pass a key), and the local bundle has no rekor bundle.

Ugh. I see this case.
Unfortunately we CAN produce a bundle out of experimental mode:

if ko.BundlePath != "" {

So I think this should technically pass?

Copy link
Contributor

@asraa asraa left a comment

Choose a reason for hiding this comment

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

Fortunately this is a correctness issue, not a security concern...

But this really clobbers the verify Rekor Bundle logic. That I guess, should actually refer to the rekor bundle inside the local bundle.

@haydentherapper
Copy link
Contributor Author

Can we just add a check for experimental flag when verifying with a Rekor bundle? I think that’s the simplest fix.

@asraa
Copy link
Contributor

asraa commented Sep 14, 2022

Can we just add a check for experimental flag when verifying with a Rekor bundle? I think that’s the simplest fix.

Simplest fix would be that verifyRekorBundle only executes when there is a bundle inside the local bundle, IMO!

@haydentherapper
Copy link
Contributor Author

That sounds good!

Signed-off-by: Asra Ali <asraa@google.com>
@asraa
Copy link
Contributor

asraa commented Sep 14, 2022

Done! Updated description and release note @cpanato @haydentherapper

@cpanato
Copy link
Member

cpanato commented Sep 14, 2022

going to merge this to check the post submit jobs and if they are green will release it

@cpanato cpanato merged commit a780d68 into sigstore:main Sep 14, 2022
@github-actions github-actions bot added this to the v1.12.0 milestone Sep 14, 2022
@haydentherapper haydentherapper deleted the temp-e2e-fix branch January 10, 2023 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants