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

podman pull: support decrypting images #15163

Closed
ningmingxiao opened this issue Aug 3, 2022 · 19 comments
Closed

podman pull: support decrypting images #15163

ningmingxiao opened this issue Aug 3, 2022 · 19 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue

Comments

@ningmingxiao
Copy link

No description provided.

@ningmingxiao ningmingxiao changed the title will podman support to decryp timage like skopeo? will podman support to decrypt image like skopeo? Aug 3, 2022
@mheon
Copy link
Member

mheon commented Aug 3, 2022

Can you clarify what you're asking? What's the specific Skopeo command you're asking about?

@ningmingxiao
Copy link
Author

I want podman can auto decrypt an encrypted image,when use podman run with an encrypted image.

@rhatdan
Copy link
Member

rhatdan commented Aug 3, 2022

Could you show an example of what is going wrong?

@vrothberg
Copy link
Member

Skopeo has flags for {de,en}crypting images (e.g.,--encrypt-layer). Those are currently marked as experimental in Skopeo. @lumjjb @mtrmac what do you think on adding support for that in Podman as well?

@rhatdan
Copy link
Member

rhatdan commented Aug 4, 2022

I would think Podman should just handle it when pulling an image, I would figure if I pull an encrypted image, I would be prompted for the decryption key, and then store the image in containers storage.

Adding a --encrypt flag to podman push, would seem to be a nice enhancement.

@vrothberg vrothberg added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 4, 2022
@vrothberg vrothberg changed the title will podman support to decrypt image like skopeo? podman pull: support decrypting images Aug 4, 2022
@vrothberg
Copy link
Member

containers/common/libimage already supports that, so it would be a Podman-only change. I do not know whether we want to limit support to the local client or if want to extend it to remote client as well.

@vrothberg
Copy link
Member

@baude PTAL

@rhatdan
Copy link
Member

rhatdan commented Aug 4, 2022

In a perfect world, I would do both, but sending the decryption key in a protocol, might be a bit risky.

@vrothberg
Copy link
Member

We're sending credentials over the wire as well - I think we assume the connection is secure. If users opt-out from a secure connection, they probably know what they are doing.

@lumjjb
Copy link

lumjjb commented Aug 4, 2022

I'm not sure how this plays into the architecture, but we did a daemon based configuration, with a set of keys for cri-o, not sure how it would map for podman

@rhatdan
Copy link
Member

rhatdan commented Aug 7, 2022

The podman service should be able to use that configuration or one similar.

The question would be, should a user be prompted for a decryption key, or do they need to prepopulate the keys using some other tool into a configuration directory.

@vrothberg
Copy link
Member

I think we can start with providing keys on the CLI via flags as done in Skopeo. If there's a need for a permanent configuration, we can look into something similar to the CRI-O configuration.

@mtrmac
Copy link
Collaborator

mtrmac commented Aug 9, 2022

For pull, this is just a matter of exposing the options to supply keys.

The current code does not actually allow interactively prompting for keys; software could always read the manifest to see if it contains encrypted layers, and prompt before actually starting a pull, or maybe we could build some interactive callbacks.

But I’m not immediately sold on the interactivity — AFAIK keys are typically not passphrases, so the users would be entering … paths to local files? Possibly using some algorithm prefix syntax or PKCS#11 hardware identification? I vaguely recall containers/ocicrypt is actually a protocol switch over 5 or so very different encryption mechanisms… My intuitive impression with absolutely no data is that using a decryption key would almost never be a one-time operation that warrants interactivity: The key would be provisioned on the relevant computer and then used repeatedly over time. That strongly suggests “non-interactive, possibly only automated” to me.


I’d expect push to work just as easily — one thing to check is pushing a Docker-formatted image (because encryption would require conversion to OCI). Reading the code, I think that is supposed to work already, but it would be worth at least a smoke-test.

@mtrmac
Copy link
Collaborator

mtrmac commented Aug 9, 2022

In a perfect world, I would do both, but sending the decryption key in a protocol, might be a bit risky.

Read https://github.com/containers/ocicrypt/blob/main/docs/keyprovider.md#encrpytingdecrypting-examples — the key providing mechanisms are not really designed to be handed off to a different machine.

It’s an interesting thought to take advantage of that, and have the remote server actually provide a specialized “Podman client” key provider; then the remote client would start some kind of “decryption server” that allows using keys remotely, using the actual users’ configuration, and ask the remote server to connect back to the “decryption server” to perform operations. That would allow supporting arbitrary ocicrypt configurations (if that matters), and the actual encryption keys could never leave the client (including possibly being hardware-protected).

But that seems like quite a lot of work for a niche feature. I’d start with just not supporting this on remote. (FWIW signing does not currently support remote either, at least simple signing runs into similar GPG configuration complexity issues, and sigstore will eventually get complex with Fulcio-required interactivity.)

@github-actions
Copy link

github-actions bot commented Sep 9, 2022

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Sep 12, 2022

@ashley-cui PTAL

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@vrothberg
Copy link
Member

I think we can close given #16329 added support for it.

@mtrmac
Copy link
Collaborator

mtrmac commented Jan 19, 2023

Yes, let’s.

@mtrmac mtrmac closed this as completed Jan 19, 2023
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 3, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue
Projects
None yet
Development

No branches or pull requests

7 participants