-
Notifications
You must be signed in to change notification settings - Fork 86
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
doc: update notation sign and verify spec for metadata #498
Changes from 3 commits
9eebe91
c7c5128
e205408
765ca1d
38d9917
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,6 +16,17 @@ Warning: The resolved digest may not point to the same signed artifact, since ta | |||||
Successfully verified signature for <registry>/<repository>@<digest> | ||||||
``` | ||||||
|
||||||
The signed descriptor may have user defined metadata attached. If the signature for the OCI artifact contains any metadata, the output message is as follows: | ||||||
|
||||||
```text | ||||||
Successfully verified signature for <registry>/<repository>@<digest> | ||||||
|
||||||
The artifact is signed with the following user metadata. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
KEY VALUE | ||||||
<key> <value> | ||||||
``` | ||||||
|
||||||
## Outline | ||||||
|
||||||
```text | ||||||
|
@@ -25,11 +36,12 @@ Usage: | |||||
notation verify [flags] <reference> | ||||||
|
||||||
Flags: | ||||||
-h, --help help for verify | ||||||
-p, --password string password for registry operations (default to $NOTATION_PASSWORD if not specified) | ||||||
--plain-http registry access via plain HTTP | ||||||
--plugin-config strings {key}={value} pairs that are passed as it is to a plugin, if the verification is associated with a verification plugin, refer plugin documentation to set appropriate values | ||||||
-u, --username string username for registry operations (default to $NOTATION_USERNAME if not specified) | ||||||
-h, --help help for verify | ||||||
-p, --password string password for registry operations (default to $NOTATION_PASSWORD if not specified) | ||||||
--plain-http registry access via plain HTTP | ||||||
--plugin-config strings {key}={value} pairs that are passed as it is to a plugin, if the verification is associated with a verification plugin, refer plugin documentation to set appropriate values | ||||||
-u, --username string username for registry operations (default to $NOTATION_USERNAME if not specified) | ||||||
-m, --user-metadata strings user defined {key}={value} pairs that must be present in the signature for successful verification if provided | ||||||
``` | ||||||
|
||||||
## Usage | ||||||
|
@@ -113,13 +125,59 @@ An example of output messages for a successful verification: | |||||
Successfully verified signature for localhost:5000/net-monitor@sha256:b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9 | ||||||
``` | ||||||
|
||||||
### Verify signatures on an OCI artifact with user metadata | ||||||
|
||||||
Use the `--user-metadata` flag to verify that provided key-value pairs are present in the payload of the valid signature. | ||||||
|
||||||
```shell | ||||||
# Verify signatures on the supplied OCI artifact identified by the digest and verify that io.wabbit-networks.buildId=123 is present in the signed payload | ||||||
notation verify --user-metadata io.wabbit-networks.buildId=123 localhost:5000/net-monitor@sha256:b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9 | ||||||
``` | ||||||
|
||||||
An example of output messages for a successful verification: | ||||||
|
||||||
```text | ||||||
Successfully verified signature for localhost:5000/net-monitor@sha256:b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9 | ||||||
|
||||||
The artifact is signed with the following user metadata. | ||||||
|
||||||
KEY VALUE | ||||||
io.wabbit-networks.buildId 123 | ||||||
``` | ||||||
|
||||||
An example of output messages for an unsuccessful verification: | ||||||
|
||||||
```text | ||||||
Error: signature verification failed for all the signatures associated with localhost:5000/net-monitor@sha256:b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the verification failure is due to metadata, there should be error log like you shared under the debug logging. "Error: specified metadata is not present in the signature." |
||||||
``` | ||||||
|
||||||
An example of output messages for an unsuccessful verification with verbose logging enabled: | ||||||
|
||||||
```text | ||||||
INFO Checking whether signature verification should be skipped or not | ||||||
INFO Check over. Trust policy is not configured to skip signature verification | ||||||
INFO Processing signature with digest: sha256:dbb22c0686b714ccbb53e4579771ee0f9ab9d37cd77cadb767549322742979f3 | ||||||
INFO User Metadata flag is present. Checking signature metadata for specified values. | ||||||
Error: signature verification failed for all the signatures associated with localhost:5000/net-monitor@sha256:b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9 | ||||||
``` | ||||||
|
||||||
An example of output messages for an unsuccessful verification with debug logging enabled: | ||||||
|
||||||
```text | ||||||
... | ||||||
INFO User Metadata flag is present. Checking signature metadata for specified values. | ||||||
DEBU[2023-01-05T11:35:07-08:00] Verifying that metadata { "io.wabbit-networks.buildId":"123" } is present in signature metadata. | ||||||
DEBU[2023-01-05T11:35:07-08:00] Signature metadata: { "io.wabbit-networks.buildId":"321" } | ||||||
DEBU[2023-01-05T11:35:07-08:00] Error: specified metadata is not present in the signature. | ||||||
Error: signature verification failed for all the signatures associated with localhost:5000/net-monitor@sha256:b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9 | ||||||
``` | ||||||
|
||||||
### Verify signatures on an OCI artifact identified by a tag | ||||||
|
||||||
A tag is resolved to a digest first before verification. | ||||||
|
||||||
```shell | ||||||
# Prerequisites: Signatures are stored in a registry referencing the signed OCI artifact | ||||||
|
||||||
# Verify signatures on an OCI artifact identified by the tag | ||||||
notation verify localhost:5000/net-monitor:v1 | ||||||
``` | ||||||
|
@@ -130,4 +188,4 @@ An example of output messages for a successful verification: | |||||
Resolved artifact tag `v1` to digest `sha256:b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9` before verification. | ||||||
Warning: The resolved digest may not point to the same signed artifact, since tags are mutable. | ||||||
Successfully verified signature for localhost:5000/net-monitor@sha256:b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9 | ||||||
``` | ||||||
``` |
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.