-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Signed image save #6265
Comments
Thanks for your report. Signatures don’t quite work the way the process above assumes: what is signed isn’t a “abstract image”, but a specific representation of an image. So, it does not really make sense to sign the image stored locally (as an overlay set of filesystem trees of uncompressed files) and then expect to publish/reuse the image. E.g. every push to a registry will compress the image, changing the representation and invalidate the signatures. And the “docker archive” format used by default by ( Basically signatures only make sense when used together with registries. (You can run a temporary registry in a container, backed by a volume, and transfer the backing volume to a different computer and run a temporary registry there. That’s going to be more efficient than docker-archive anyway.) A few specific comments.
Signatures are created on registry manifests; the (docker-archive) format does not have registry manifests (c/image currently creates a fake one for purposes of interoperability with the rest of the code, but even that isn’t a guaranteed behavior of the library), so there is nothing to sign in the docker-archive format and even if it made sense for a locally-built image (which is questionable), and even if it were contained in the docker-archive format (which isn’t the case), no way to ensure that a signature will work once the image is transferred using a docker-archive. It might happen to work for you right now with some specific versions of the code involved but that’s accidental and may break any time.
https://github.com/containers/image/blob/master/docs/containers-transports.5.md ?
Yeah, that’s arguably a Podman bug / missing feature. Right now you can just set
That kind of enforcement does not currently exist. (It only really matters if a key is removed from
That’s interesting.
Podman completely loses the name:tag@digest when referring to images by the resolved immutable ID. That might eventually be a problem when we want to add a “verify image signature before starting it”. Moving to Podman, both to hard-code ignoring the containers-storage policy on push/save, and to discuss the loss of name:tag@digest. |
A friendly reminder that this issue had no activity for 30 days. |
@vrothberg Could you look at this problem? |
Sorry, I won't find time for that in the foreseeable future. |
@QiWang19 PTAL |
@QiWang19 Did you ever get a chance to look at this? |
I have a related question... I'm running into a similar problem and would like to programatically add an accept clause to /etc/containers/policy.json for containers-storage transport. I don't see a way to add/modify a transport other than "docker" using basically, want to add the following to policy.json from cli without resorting to some awful sed/jq/... hack:
|
Current |
I have (ahem) "a workaround" in my automation right now that I'm not proud of:
This duplicates the "docker-daemon" transport policy (which is insecureAcceptAnything in my case) to a new "containers-storage" transport policy for better or worse. I'd certainly like to upvote the idea of adding support for |
@QiWang19 Any new thoughts on this? |
A friendly reminder that this issue had no activity for 30 days. |
@QiWang19 What is the scoop on this? |
I didn't work on this. |
@ashley-cui Interested in taking a look at this? |
A friendly reminder that this issue had no activity for 30 days. |
@ashley-cui Did you get a chance to look at this? |
Haven't gotten to look at it, might find time soon |
A friendly reminder that this issue had no activity for 30 days. |
@ashley-cui Reminder... |
A friendly reminder that this issue had no activity for 30 days. |
Any new on this? The issue came up again for us -- we're still using
Would be nice to be able to use |
A friendly reminder that this issue had no activity for 30 days. |
@vrothberg @mtrmac PTAL |
A friendly reminder that this issue had no activity for 30 days. |
@vrothberg @mtrmac @lsm5 Any thoughts? |
A friendly reminder that this issue had no activity for 30 days. |
Time keeps on ticking, ticking, ticking... |
Unless priorities change, I won't see this on my pipeline for a long time. |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
I'm trying to implement setup where every image is signed and every time image is run, I want to be able to move images from one host to another without registry (using podman image save, podman image load and keep signatures intact).
I'm using buildah to create an image and sign it. I use rootless setup with podman / buildah.
But it seems I am not able to save a image as policy denies it even if signature seems to be okay when tested by hand.
It would also help if there was a documentation of all required transports at: docs/containers-policy.json.5.md
If policy has:
"default": [{"type": "reject"}]
Then I need to define containers-storage transport to get this deny. Otherwise
podman image save
ends with:So all possible transports should be supported, not just those listed.
I can also run images when only policy is:
I would assume it should deny running any image then. You can test this with your own image.
I'm submitting this issue here as it mainly is about setting /etc/containers/policy.json and interpreting it.
/etc/containers/policy.json
$key is fingerprint of key for of /etc/pki/rpm-gpg/DEB-GPG-KEY-local-2020.asc
And its keyring is at "$HOME"/.debgpg.
If I import key, I can verify signature by hand:
Save with debugging
The text was updated successfully, but these errors were encountered: