chore: improve warning message when signing or verifying with tag#497
chore: improve warning message when signing or verifying with tag#497priteshbandi merged 1 commit intonotaryproject:mainfrom
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #497 +/- ##
==========================================
+ Coverage 29.57% 29.61% +0.03%
==========================================
Files 26 26
Lines 1515 1513 -2
==========================================
Hits 448 448
+ Misses 1050 1048 -2
Partials 17 17
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
patrickzheng200
left a comment
There was a problem hiding this comment.
Looks like there's a DCO failure. And should we remove cmd/notation/notation from this PR since it's a binary file?
|
@priteshbandi any reason behind this change? |
Hi Yi, thanks for reviewing. Here are the reasons:
|
|
IIRC, the |
In both sign and verify we are displaying what image digest was signed so that user can use digest for subsequent operations. |
|
It is a bit different between
|
Either Sign or Verify the gravity of warning should be same because in both the scenarios the impact is severe. Should we just omit line |
I think omitting the |
784f44c to
8c9c62f
Compare
… tag Signed-off-by: Pritesh Bandi <pritesb@amazon.com>
shizhMSFT
left a comment
There was a problem hiding this comment.
LGTM. It makes sense to write all warnings to stderr instead of stdout.
|
Definitely, we need to make sure that the users understand that they are signing a particular content addressed by a digest. |
|
One may argue the motivation to verify a content addressed by a known digest. It is about authenticity. For example, Alice wants to pull an image with digest |
…taryproject#497) ### Old ➜ notation git:(main) ✗ ./notation sign $IMAGE Warning: Always sign the artifact using digest(`@sha256:...`) rather than a tag(`:v1`) because tags are mutable and a tag reference can point to a different artifact than the one signed. Resolved artifact tag `v1` to digest `sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059` before signing. Successfully signed localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 ➜ notation git:(main) ✗ ./notation verify $IMAGE Resolved artifact tag `v1` to digest `sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059` before verification. Warning: The resolved digest may not point to the same signed artifact, since tags are mutable. Successfully verified signature for localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 ### New ➜ notation git:(main) ✗ ./notation sign $IMAGE Warning: Always sign the artifact using digest(@sha256:...) rather than a tag(:v1) because tags are mutable and a tag reference can point to a different artifact than the one signed. Successfully signed localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 ➜ notation git:(main) ✗ ./notation verify $IMAGE Warning: Always verify the artifact using digest(@sha256:...) rather than a tag(:v1) because resolved digest may not point to the same signed artifact, as tags are mutable. Successfully verified signature for localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 Signed-off-by: Pritesh Bandi <pritesb@amazon.com>
…taryproject#497) ### Old ➜ notation git:(main) ✗ ./notation sign $IMAGE Warning: Always sign the artifact using digest(`@sha256:...`) rather than a tag(`:v1`) because tags are mutable and a tag reference can point to a different artifact than the one signed. Resolved artifact tag `v1` to digest `sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059` before signing. Successfully signed localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 ➜ notation git:(main) ✗ ./notation verify $IMAGE Resolved artifact tag `v1` to digest `sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059` before verification. Warning: The resolved digest may not point to the same signed artifact, since tags are mutable. Successfully verified signature for localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 ### New ➜ notation git:(main) ✗ ./notation sign $IMAGE Warning: Always sign the artifact using digest(@sha256:...) rather than a tag(:v1) because tags are mutable and a tag reference can point to a different artifact than the one signed. Successfully signed localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 ➜ notation git:(main) ✗ ./notation verify $IMAGE Warning: Always verify the artifact using digest(@sha256:...) rather than a tag(:v1) because resolved digest may not point to the same signed artifact, as tags are mutable. Successfully verified signature for localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 Signed-off-by: Pritesh Bandi <pritesb@amazon.com>
…taryproject#497) ### Old ➜ notation git:(main) ✗ ./notation sign $IMAGE Warning: Always sign the artifact using digest(`@sha256:...`) rather than a tag(`:v1`) because tags are mutable and a tag reference can point to a different artifact than the one signed. Resolved artifact tag `v1` to digest `sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059` before signing. Successfully signed localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 ➜ notation git:(main) ✗ ./notation verify $IMAGE Resolved artifact tag `v1` to digest `sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059` before verification. Warning: The resolved digest may not point to the same signed artifact, since tags are mutable. Successfully verified signature for localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 ### New ➜ notation git:(main) ✗ ./notation sign $IMAGE Warning: Always sign the artifact using digest(@sha256:...) rather than a tag(:v1) because tags are mutable and a tag reference can point to a different artifact than the one signed. Successfully signed localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 ➜ notation git:(main) ✗ ./notation verify $IMAGE Warning: Always verify the artifact using digest(@sha256:...) rather than a tag(:v1) because resolved digest may not point to the same signed artifact, as tags are mutable. Successfully verified signature for localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 Signed-off-by: Pritesh Bandi <pritesb@amazon.com>
…taryproject#497) ### Old ➜ notation git:(main) ✗ ./notation sign $IMAGE Warning: Always sign the artifact using digest(`@sha256:...`) rather than a tag(`:v1`) because tags are mutable and a tag reference can point to a different artifact than the one signed. Resolved artifact tag `v1` to digest `sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059` before signing. Successfully signed localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 ➜ notation git:(main) ✗ ./notation verify $IMAGE Resolved artifact tag `v1` to digest `sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059` before verification. Warning: The resolved digest may not point to the same signed artifact, since tags are mutable. Successfully verified signature for localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 ### New ➜ notation git:(main) ✗ ./notation sign $IMAGE Warning: Always sign the artifact using digest(@sha256:...) rather than a tag(:v1) because tags are mutable and a tag reference can point to a different artifact than the one signed. Successfully signed localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 ➜ notation git:(main) ✗ ./notation verify $IMAGE Warning: Always verify the artifact using digest(@sha256:...) rather than a tag(:v1) because resolved digest may not point to the same signed artifact, as tags are mutable. Successfully verified signature for localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 Signed-off-by: Pritesh Bandi <pritesb@amazon.com>
…taryproject#497) ### Old ➜ notation git:(main) ✗ ./notation sign $IMAGE Warning: Always sign the artifact using digest(`@sha256:...`) rather than a tag(`:v1`) because tags are mutable and a tag reference can point to a different artifact than the one signed. Resolved artifact tag `v1` to digest `sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059` before signing. Successfully signed localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 ➜ notation git:(main) ✗ ./notation verify $IMAGE Resolved artifact tag `v1` to digest `sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059` before verification. Warning: The resolved digest may not point to the same signed artifact, since tags are mutable. Successfully verified signature for localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 ### New ➜ notation git:(main) ✗ ./notation sign $IMAGE Warning: Always sign the artifact using digest(@sha256:...) rather than a tag(:v1) because tags are mutable and a tag reference can point to a different artifact than the one signed. Successfully signed localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 ➜ notation git:(main) ✗ ./notation verify $IMAGE Warning: Always verify the artifact using digest(@sha256:...) rather than a tag(:v1) because resolved digest may not point to the same signed artifact, as tags are mutable. Successfully verified signature for localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059 Signed-off-by: Pritesh Bandi <pritesb@amazon.com>
Old
➜ notation git:(main) ✗ ./notation sign $IMAGE
Warning: Always sign the artifact using digest(
@sha256:...) rather than a tag(:v1) because tags are mutable and a tag reference can point to a different artifact than the one signed.Resolved artifact tag
v1to digestsha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059before signing.Successfully signed localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059
➜ notation git:(main) ✗ ./notation verify $IMAGE
Resolved artifact tag
v1to digestsha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059before verification.Warning: The resolved digest may not point to the same signed artifact, since tags are mutable.
Successfully verified signature for localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059
New
➜ notation git:(main) ✗ ./notation sign $IMAGE
Warning: Resolved artifact tag
v1to digestsha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059before signing. Always sign the artifact using digest(@sha256:...) rather than a tag(:v1) because tags are mutable and a tag reference can point to a different artifact than the one signed.Successfully signed localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059
➜ notation git:(main) ✗ ./notation verify $IMAGE
Warning: Resolved artifact tag
v1to digestsha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059before verification. The resolved digest may not point to the same signed artifact, since tags are mutable.Successfully verified signature for localhost:6000/net-monitor@sha256:36ca4d6834ed680362327811238b97c687e77c5cf4a04a74d0853d3c0c17e059