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

verify: remove extra calls to rekor for verify and verify-blob #1694

Merged
merged 3 commits into from Mar 31, 2022

Conversation

asraa
Copy link
Contributor

@asraa asraa commented Mar 31, 2022

Signed-off-by: Asra Ali asraa@google.com

Summary

Removes extra calls to Rekor during verification:

  1. When verifying a blob, we retrieve the entry UUIDs (by an artifact hash search), and then call verifyRekorEntry, which then takes the (cert, pubkey, artifact) and makes a call to rekor to get the entry. Instead, we pass the entry since we already have it.

  2. Distangles VerifyTLogEntry from inside of FindTlogEntry. Users can call this directly. This means that we don't need to FindTlogEntry to verify it if we already have it, which saves the call from (1).

  3. In both verify and verify-blob, we call verifyRekorEntry, which has ANOTHER call to GetTlogEntry after FindTlogEntry to get the actual entry, we already got it! Refactored FindTlogEntry to give you back the... entry.

  4. Move the UUID verification into functions that are asking for an entry by UUID (e.g. when you get or find an entry)

Ticket Link

Fixes

Release Note


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

asraa commented Mar 31, 2022

cc @rohankh532 this makes VerifyTLogEntry public, see the verify-blob commands for usage

@codecov-commenter
Copy link

codecov-commenter commented Mar 31, 2022

Codecov Report

Merging #1694 (c577826) into main (b099136) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1694      +/-   ##
==========================================
- Coverage   29.43%   29.37%   -0.06%     
==========================================
  Files         141      141              
  Lines        8413     8429      +16     
==========================================
  Hits         2476     2476              
- Misses       5668     5684      +16     
  Partials      269      269              
Impacted Files Coverage Δ
cmd/cosign/cli/verify/verify_blob.go 10.49% <0.00%> (-0.14%) ⬇️
pkg/cosign/tlog.go 4.31% <0.00%> (-0.24%) ⬇️
pkg/cosign/verify.go 18.45% <0.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b099136...c577826. Read the comment docs.

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

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

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

nice!

@dlorenc dlorenc merged commit ac682db into sigstore:main Mar 31, 2022
@github-actions github-actions bot added this to the v1.7.0 milestone Mar 31, 2022
mlieberman85 pushed a commit to mlieberman85/cosign that referenced this pull request May 6, 2022
…ore#1694)

* remove extra calls to rekor for verify-blob

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

* fix hex output for uuid

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

* fix lint

Signed-off-by: Asra Ali <asraa@google.com>
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