-
Notifications
You must be signed in to change notification settings - Fork 550
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: add COSIGN_EXPERIMENTAL=1 for verify-bloba #2254
Conversation
/hold Most of these cases do no require the flag. |
Codecov Report
@@ Coverage Diff @@
## main #2254 +/- ##
==========================================
+ Coverage 28.40% 28.57% +0.16%
==========================================
Files 131 131
Lines 7832 7852 +20
==========================================
+ Hits 2225 2244 +19
+ Misses 5309 5302 -7
- Partials 298 306 +8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
cmd/cosign/cli/verify.go
Outdated
|
||
# Verify a simple blob and message | ||
cosign verify-blob --key cosign.pub --signature sig msg | ||
COSIGN_EXPERIMENTAL=1 cosign verify-blob --key cosign.pub --signature sig msg |
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.
no flag required for all examples with a key
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.
+1, including the KMS ones. Anything without --certificate
I think
cmd/cosign/cli/verify.go
Outdated
|
||
# Verify a signature against a certificate | ||
cosign verify-blob --cert <cert> --signature $sig <blob> | ||
COSIGN_EXPERIMENTAL=1 cosign verify-blob --cert <cert> --signature $sig <blob> |
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.
Can we update to --certificate
?
|
||
# Verify a signature against a certificate | ||
cosign verify-blob --cert <cert> --signature $sig <blob> | ||
COSIGN_EXPERIMENTAL=1 cosign verify-blob --cert <cert> --signature $sig <blob> | ||
`, |
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.
@asraa Should we use the list you made of all possible flag combos (cert/key, experimental/no experimental, bundle, expired/unexpired cert) and have an example for each of these with more explanation?
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.
+1
Further, I'd like to see some organization and explanation. Right now, the text is just a laundry list of "if X, then Y"
We should explain unset COSIGN_EXPERIMENTAL
and COSIGN_EXPERIMENTAL=1
separately (I don't 100% understand the current behavior so please correct me, indicated uncertainty with "?")
Here's a braindump, maybe should move into Google Doc (feel free to copy it)
no experimental
Check the signature on a blob against the given key or certificate.
Keys
blah
Certificates
-
--certificate
and--certificate-chain
example:The provided certificate (and all of the certificates in the chain(?) must be unexpired right now.
NOTE: this just accepts whatever the last certificate of the chain is as your root. If you want to check that it matches a fixed root certificate, use keyless mode and
SIGSTORE_ROOT_FILE
(except we don't want people to do that? what do we tell these people?) -
--certificate
no chainChecks that the certificate is signed by Fulcio (must be unexpired). Will that ever work?
Bundles
-
--bundle
If
--bundle
is provided, use the given Rekor bundle (see ...) to check that the time of the signature was while the certificate (and its ancestors??) were valid (without--bundle
, the certificate must be currently valid).Works for keys and certs both.
What happens if the bundle has a conflicting chain?
-
--bundle
+ certs, no chainIf there's a bundle use that to get the chain up to Fulcio?
experimental
Keys
Same as above, but we check that signatures are in Rekor (I think?)
If --bundle
provided, check that against Rekor (offline).
Certs
-
--certificate
and--certificate-chain
: Like the keyfull version, except instead of automatically trusting the certificate chain, we check that the root matches Fulcio's cert.If you'd like to BYO-root, set
SIGSTORE_ROOT_FILE
and we'll compare the root of the chain against that.We hit Rekor online.
-
--certificate
, no chain: this would only work if signed by the root directly, which probably won't be the case (maybe if you BYO-root?)
Bundles
-
--keys
Same as above, don't hit Rekor. -
--certificate
and--certificate-chain
and--bundle
. Same as above, don't hit rekorTODO: what if bundle has a conflicting cert/chain?
-
--certificate
and--bundle
: Same, but use a chain from bundle. Fails if bundle has no chain.TODO: what happens if the bundle has a conflicting cert?
-
--bundle
: Same, but use cert/chain from bundle. Fails if bundle has no cert/chain.TODO: if the bundle just provides a key, do we trust it?
|
||
# Verify a simple blob with remote signature URL, both http and https schemes are supported | ||
cosign verify-blob --key cosign.pub --signature http://host/my.sig | ||
COSIGN_EXPERIMENTAL=1 cosign verify-blob --key cosign.pub --signature http://host/my.sig | ||
|
||
# Verify a signature from an environment variable |
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.
let's axe this example? it's just explaining how the environment variables work in a shell, I think
|
||
# Verify a signature from an environment variable | ||
cosign verify-blob --key cosign.pub --signature $sig msg | ||
COSIGN_EXPERIMENTAL=1 cosign verify-blob --key cosign.pub --signature $sig msg | ||
|
||
# verify a signature with public key provided by URL |
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.
Can we combine this with the "signature from URL" example?
cmd/cosign/cli/verify.go
Outdated
|
||
# verify a signature with public key provided by URL | ||
cosign verify-blob --key https://host.for/<FILE> --signature $sig msg | ||
COSIGN_EXPERIMENTAL=1 cosign verify-blob --key https://host.for/<FILE> --signature $sig msg | ||
|
||
# Verify a signature against a payload from another process using process redirection |
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.
IMO, axe this example. Maybe we can move it to the docs/
directory of the Cosign repo. Or even a "useful tricks" section at the bottom of this doc.
|
||
# Verify a signature against a payload from another process using process redirection | ||
cosign verify-blob --key cosign.pub --signature $sig <(git rev-parse HEAD) | ||
COSIGN_EXPERIMENTAL=1 cosign verify-blob --key cosign.pub --signature $sig <(git rev-parse HEAD) | ||
|
||
# Verify a signature against Azure Key Vault |
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 would like to combine all the KMS examples. It'd be nice to list the syntax for each, but I don't need it in the full context.
cmd/cosign/cli/verify.go
Outdated
|
||
# Verify a simple blob and message | ||
cosign verify-blob --key cosign.pub --signature sig msg | ||
COSIGN_EXPERIMENTAL=1 cosign verify-blob --key cosign.pub --signature sig msg |
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.
+1, including the KMS ones. Anything without --certificate
I think
cmd/cosign/cli/verify.go
Outdated
|
||
# verify a signature with public key provided by URL | ||
cosign verify-blob --key https://host.for/<FILE> --signature $sig msg | ||
COSIGN_EXPERIMENTAL=1 cosign verify-blob --key https://host.for/<FILE> --signature $sig msg |
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.
s/$sig/<sig>
|
||
# Verify a signature against a certificate | ||
cosign verify-blob --cert <cert> --signature $sig <blob> | ||
COSIGN_EXPERIMENTAL=1 cosign verify-blob --cert <cert> --signature $sig <blob> | ||
`, |
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.
+1
Further, I'd like to see some organization and explanation. Right now, the text is just a laundry list of "if X, then Y"
We should explain unset COSIGN_EXPERIMENTAL
and COSIGN_EXPERIMENTAL=1
separately (I don't 100% understand the current behavior so please correct me, indicated uncertainty with "?")
Here's a braindump, maybe should move into Google Doc (feel free to copy it)
no experimental
Check the signature on a blob against the given key or certificate.
Keys
blah
Certificates
-
--certificate
and--certificate-chain
example:The provided certificate (and all of the certificates in the chain(?) must be unexpired right now.
NOTE: this just accepts whatever the last certificate of the chain is as your root. If you want to check that it matches a fixed root certificate, use keyless mode and
SIGSTORE_ROOT_FILE
(except we don't want people to do that? what do we tell these people?) -
--certificate
no chainChecks that the certificate is signed by Fulcio (must be unexpired). Will that ever work?
Bundles
-
--bundle
If
--bundle
is provided, use the given Rekor bundle (see ...) to check that the time of the signature was while the certificate (and its ancestors??) were valid (without--bundle
, the certificate must be currently valid).Works for keys and certs both.
What happens if the bundle has a conflicting chain?
-
--bundle
+ certs, no chainIf there's a bundle use that to get the chain up to Fulcio?
experimental
Keys
Same as above, but we check that signatures are in Rekor (I think?)
If --bundle
provided, check that against Rekor (offline).
Certs
-
--certificate
and--certificate-chain
: Like the keyfull version, except instead of automatically trusting the certificate chain, we check that the root matches Fulcio's cert.If you'd like to BYO-root, set
SIGSTORE_ROOT_FILE
and we'll compare the root of the chain against that.We hit Rekor online.
-
--certificate
, no chain: this would only work if signed by the root directly, which probably won't be the case (maybe if you BYO-root?)
Bundles
-
--keys
Same as above, don't hit Rekor. -
--certificate
and--certificate-chain
and--bundle
. Same as above, don't hit rekorTODO: what if bundle has a conflicting cert/chain?
-
--certificate
and--bundle
: Same, but use a chain from bundle. Fails if bundle has no chain.TODO: what happens if the bundle has a conflicting cert?
-
--bundle
: Same, but use cert/chain from bundle. Fails if bundle has no cert/chain.TODO: if the bundle just provides a key, do we trust it?
0601020
to
1357e32
Compare
I tried to address some of the reviews. Can you please take a look at @znewman01? Thx |
1357e32
to
8ae1b01
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 have a couple of minor issues, but otherwise I think this looks good. We may want to totally rework the docs here, but that can happen later.
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
8ae1b01
to
4e729c3
Compare
Signed-off-by: Batuhan Apaydın batuhan.apaydin@trendyol.com
Summary
Release Note
Documentation