Sign and verify with rekorv2#1432
Conversation
334e1b2 to
983bfa6
Compare
|
|
last commit: Made sure we support the same signature algorithms in verification that we support with rekor v1 entries (we should support a bit more but that's another PR) |
If signingconfig contains rekor v2, let's start preferring it Make sure we test the status quo (no rekor v2 in signing config) and the case where there is a rekor v2 in signing config. Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
This is current staging trust root and signing config, with just the rekor v2 instance added to signing config $ TRUSTCONFIG=test/assets/trust_config/staging-but-sign-with-rekor-v2.json $ sigstore --trust-config $TRUSTCONFIG sign README.md Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
This code is originally from Ramon, updated by Jussi
$ TRUSTCONFIG=test/assets/trust_config/staging-but-sign-with-rekor-v2.json
$ sigstore --trust-config $TRUSTCONFIG sign README.md
$ sigstore --staging verify identity \
--cert-identity jku@goto.fi \
--cert-oidc-issuer https://github.com/login/oauth
README.md
OK: README.md
Co-authored-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
This makes the code quite a bit uglier: we will likely want to refactor... Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
These are fairly basic for now. Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
This reverts commit d7ddd50. Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
We can handle not just the key extraction but getting the whole v2.Verifier for the certificate: both v002 types need it. Also make private methods private and improve docstrings Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
This change affects the signing certificate verification in rekor v2 entries: * Support all ECDSA keys listed in https://github.com/sigstore/architecture-docs/blob/main/algorithm-registry.md * Don't support other algorithms yet since the actual signature verification does not support them currently Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
|
Rebased on main after #1422 was merged: I will do a final self-review and mark this ready for review EDIT looks fine to me. The beginnings of conformance tests are in sigstore/sigstore-conformance#216 -- that PR is pending a sigstore-python release (or at least merging of this PR) |
|
Also, a future work item is concurrent rekor requests:
(alternative to parallelizing is to talk rekor-tiles project into providing api for creating multiple entries... But that'll still require client changes) |
I think we can get a lot more coverage without writing new tests in #1441 |
| @pytest.fixture | ||
| def staging_with_rekorv2() -> tuple[ | ||
| type[SigningContext], type[Verifier], IdentityToken | ||
| ]: |
There was a problem hiding this comment.
In #1441, we could add another param specific for this "alpha" instance.
|
@di @woodruffw can you take a pass over this? I’ve reviewed it, it looks functionally good, though I can’t speak to how pythonic it is. |
|
LGTM -- I did a pass over the verifier bits and nothing stood out to me 🙂 |
|
Thanks all: I think I will merge this today.
I'll file a tracking issue for next release so we don't drop the ball on those |
Start signing and verifying with rekor v2 (when signingconfig / trustedroot instruct to do so).
This is a continuation of #1414 (although does not use any direct commits from there). The verifier.py changes are mostly from @ramonpetgrave64
Contents:
verify_dsse()andverify_artifact()now handle v002 entry types_validate_*_v001_entry_body()methods are just the existing code path refactored to separate methods_validate_*_v002_entry_body()methods are the new validation code--trust-config staging-but-sign-with-rekor-v2.jsonNotes:
--experimentalflag for a release if this seems useful -- but I think I would prefer no new flags