-
Notifications
You must be signed in to change notification settings - Fork 565
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 option to verify local image #1159
Conversation
cc @priyawadhwa |
b22f444
to
df43b65
Compare
cc @dlorenc - FYI, this should allow for offline verification too |
Amazing!!! |
return errors.Wrapf(err, "resolving attachment type %s for image %s", c.Attachment, img) | ||
} | ||
if c.LocalImage { | ||
verified, bundleVerified, err := cosign.VerifyLocalImageSignatures(ctx, img, co) |
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.
A single directory can contain multiple images -- I'd consider making LocalImage
a string that points to the path instead of a bool and use img
to address the image within that path.
The UX here gets a little funky -- for a directory with a single image, you probably want to just default to it and not require users to pass it as an arg as well.
@priyawadhwa might have some ideas here.
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 think we overwrite the directory every time we run cosign save
so only a single image should be allowed at the moment -- eventually if we add support for multiple images in a directory then we'll need to figure out what the UX would look like
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.
Thanks for pointing this out! I agree that since we don't support persisting multiple images in a single directory, this shouldn't be an issue for now.
For the future, I like the approach of specifying the image along with the path by flag.
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.
nice, this looks great!
This builds on the previous work to support saving an image and its signature for airgapped environments. This adds a flag, --local-image, to verify a persisted image using the on-disk sig. Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
5221ae2
to
b9206d4
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.
lgtm!
This builds on the previous work to support saving an image and its signature for airgapped environments. This adds a flag,
--local-image
, to verify a signed image from disk.Example:
With
--verbose
, we see no network calls.Ref #1015
Release Note