Enable signing and verifying image without registry access#4014
Open
bkabrda wants to merge 1 commit intosigstore:mainfrom
Open
Enable signing and verifying image without registry access#4014bkabrda wants to merge 1 commit intosigstore:mainfrom
bkabrda wants to merge 1 commit intosigstore:mainfrom
Conversation
Signed-off-by: Slavek Kabrda <bkabrda@redhat.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4014 +/- ##
==========================================
- Coverage 40.10% 36.44% -3.66%
==========================================
Files 155 209 +54
Lines 10044 13371 +3327
==========================================
+ Hits 4028 4873 +845
- Misses 5530 7875 +2345
- Partials 486 623 +137 ☔ View full report in Codecov by Sentry. |
eiffel-fl
reviewed
Jul 15, 2025
Contributor
eiffel-fl
left a comment
There was a problem hiding this comment.
Hi,
We are also interested in having images signed locally, I tested it and it works fine:
$ docker inspect my-image (remotes/slavek/sign-verify-image-no-registry) %
[
{
"Id": "sha256:85857b24b2493982a0e55f68a0e95df8a4926dea2a736cdede57a3c9eb2a784e",
"RepoTags": [
"my-image:latest"
],
"RepoDigests": [],
...
$ ./cosign sign --key cosign.key --yes --tlog-upload=false --upload=false my-image@sha256:85857b24b2493982a0e55f68a0e95df8a4926dea2a736cdede57a3c9eb2a784e --output-signature my-image.sig --output-payload my-image.pld --output-certificate my-image.cert
Enter password for private key:
Certificate wrote in the file my-image.cert
$ ./cosign verify --insecure-ignore-tlog=true --key cosign.pub my-image@sha256:85857b24b2493982a0e55f68a0e95df8a4926dea2a736cdede57a3c9eb2a784e --signature my-image.sig --payload my-image.pld --certificate my-image.cert
WARNING: Skipping tlog verification is an insecure practice that lacks of transparency and auditability verification for the signature.
Verification for index.docker.io/library/my-image@sha256:85857b24b2493982a0e55f68a0e95df8a4926dea2a736cdede57a3c9eb2a784e --
The following checks were performed on each of these signatures:
- The cosign claims were validated
- The signatures were verified against the specified public key
[{"critical":{"identity":{"docker-reference":"index.docker.io/library/my-image"},"image":{"docker-manifest-digest":"sha256:85857b24b2493982a0e55f68a0e95df8a4926dea2a736cdede57a3c9eb2a784e"},"type":"cosign container image signature"},"optional":null}]I am wondering if this would make sense to have the offline signing in a separate commit or even a separate PR as it seems easier than offline verifying?
@codysoyland what do you think about this?
Best regards,
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3832.
This PR essentially enables:
--upload=falseflag even if the image registry is (temporarily) unavailable.I tried my best to test all the code paths that go through this function, but to be honest there are so many that I'm not 100 % everything is still correct - a thorough review would be appreciated.
Release Note
--upload=false.Documentation
I don't believe this PR requires documentation change.