-
Notifications
You must be signed in to change notification settings - Fork 49
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(backport/1.0): make client shard aware when verifying entries on inactive shards #286
fix(backport/1.0): make client shard aware when verifying entries on inactive shards #286
Conversation
Signed-off-by: Asra Ali <asraa@google.com>
5a3660f
to
9501f6e
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.
I realize it's not completely new, but I think it's a bit unfortunate that rekor clients like slsa-verifier need to have logic for sharding. It feels like clients are being exposed to too many implementation details and that's making things brittle.
main_test.go
Outdated
@@ -308,7 +308,7 @@ func Test_runVerify(t *testing.T) { | |||
name: "rekor upload bypassed", | |||
artifact: "binary-linux-amd64-no-tlog-upload", | |||
source: "github.com/slsa-framework/example-package", | |||
err: pkg.ErrorRekorSearch, | |||
err: pkg.ErrorNoValidRekorEntries, |
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.
A bunch of other tests seem to be generating this error. I'm not sure if that's intentional, but you may need to update other tests.
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.
Figured it out! It turns out it was a problem in the UUID lengths returned that was hairy:
old entries (like the ones in these tests) were added when the UUID lengths of rekor were 64 chars. that was causing verification errors now when trying to extract tree IDs from full UUIDs (now 80 chars) in order to perform the verifyRootHash
that broke when rotating shards.
Now I use the full 80 char UUID that was returned from GetLogEntryByUUID
I completely agree: sharding was meant to be internal client, but it wasn't: things are getting better (the return UUID sharding comparisons eventually can be removed) but seem like they won't be stable until after GA. It's been a pain to deal with this logic and debug. I should be able to clean up this logic when GA does give us a stable client though. For e.g. we will no longer need to fetch the root hash and search shards for the correct one: a root hash will be returned with the entry. I'm hesitant to make some of these changes prematurely though, because rekor keeps rolling back versions :| |
Signed-off-by: Asra Ali <asraa@google.com>
Signed-off-by: Asra Ali <asraa@google.com>
It's a bit unclear from the outside what is GA and what isn't with regard to Rekor and that translates to slsa-github-generator since we rely on the public Rekor.
Completely understandable. We need to work with what we have currently. |
No description provided.