Skip to content
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

Add warning to use digest instead of tags to other cosign commands #2650

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

priyawadhwa
Copy link
Contributor

fixes #2047 for 2.0

Signed-off-by: Priya Wadhwa [email protected]


const TagReferenceMessage string = `Image reference %s uses a tag, not a digest, to identify the image to sign.

This can lead you to sign a different image than the intended one. Please use a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you want to keep the indentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! bad copy paste

@priyawadhwa priyawadhwa merged commit 35bf1fe into sigstore:main Jan 24, 2023
@priyawadhwa priyawadhwa deleted the discourage branch January 24, 2023 18:28
@github-actions github-actions bot added this to the v1.14.0 milestone Jan 24, 2023
uralsemih pushed a commit to uralsemih/cosign that referenced this pull request Jan 29, 2023
Comment on lines +43 to +46
if _, ok := srcRef.(name.Digest); !ok {
msg := fmt.Sprintf(ui.TagReferenceMessage, srcImg)
ui.Warnf(ctx, msg)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the better recommendation to copy multi-arch images with signature if not using tag?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I think that copy and save may have been collateral damage here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dmitris pushed a commit to dmitris/cosign that referenced this pull request Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discourage signing references to images that aren't digests
5 participants