-
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
Podman pull not decrypting the image unless I explicitly specify the key-provider #18196
Comments
If this is a regression please specify the last working version? |
The above results are with version Before this we were using version Since version v4.4.2 now has the encryption-decryption feature, we now wanted to use this version, but with this we are facing the above mentioned bug. |
@mtrmac PTAL |
I think I found the problem. So consider two functions
f2:
The only difference is in 2nd line of code. f1 is used podman. This small difference in these functions is cause of the discrepancy between podman & buildah's behaviour w.r.t decrypting image. Explanation why the difference between f1 and f2 matters: If --decryption-key flag is not passed, f1 returns nil while f2 returns decryptConfig object with empty string for decryption keys. Now ultimately if you trace a lot of function calls, you reach at this line of code. Here:
This also means we can pass just
This is incorrect from my side. We merged the above branch into v4.3.0 before this review comment by @mtrmac was resolved. So in our internal podman patch we were using f2 and not f1, and hence decryption while pulling of image was happening automatically. |
Thanks. I think the above is the correct behavior: it must be possible to copy an image (e.g. using (I’m also fairly suspicious of external environment, like environment variables, silently affecting operations — especially in a security context — although I recognize it’s sometimes very practical.) Admittedly, for a So, if that config file can be used by passing a valid |
We want to share these functions with Podman, Podman currently has a slightly different version which is causing errors. Fixing: containers/podman#18196 Signed-off-by: Daniel J Walsh <[email protected]>
We want to share these functions with Podman, Podman currently has a slightly different version which is correct, so use correct version in Buildah and vendor it into Podman. Fixing: containers/podman#18196 Signed-off-by: Daniel J Walsh <[email protected]>
Even if we use function |
We want to share these functions with Podman, Podman currently has a slightly different version which is correct, so use correct version in Buildah and vendor it into Podman. Fixing: containers/podman#18196 Signed-off-by: Daniel J Walsh <[email protected]>
I don’t know how much of that is an intentional feature of the encryption library, and how much is an unintended implementation artifact; AFAICS https://github.com/containers/ocicrypt/blob/main/docs/keyprovider.md doesn’t say and I don’t know of any other documentation. @lumjjb WDYT? |
A non-nil but empty decryption configuration seems to be valid enough to trigger decryption in some configurations, per containers/podman#18196 . Like in Skopeo and Podman, only decrypt when the user explicitly instructs us to (e.g. not triggering decryption based on environment variables). Signed-off-by: Miloslav Trmač <[email protected]>
as i recall, the intention is to be able to let the implementation choose and the use of nil was a mechanism to display intent. That probably was not documented well here, apologies. Also + @stefanberger who may also have context/comments. |
A non-nil but empty decryption configuration seems to be valid enough to trigger decryption in some configurations, per containers/podman#18196 . Like in Skopeo and Podman, only decrypt when the user explicitly instructs us to (e.g. not triggering decryption based on environment variables). Signed-off-by: Miloslav Trmač <[email protected]>
|
A non-nil but empty decryption configuration seems to be valid enough to trigger decryption in some configurations, per containers/podman#18196 . Like in Skopeo and Podman, only decrypt when the user explicitly instructs us to (e.g. not triggering decryption based on environment variables). Signed-off-by: Miloslav Trmač <[email protected]>
We want to share these functions with Podman, Podman currently has a slightly different version which is correct, so use correct version in Buildah and vendor it into Podman. Fixing: containers/podman#18196 Signed-off-by: Daniel J Walsh <[email protected]>
A non-nil but empty decryption configuration seems to be valid enough to trigger decryption in some configurations, per containers/podman#18196 . Like in Skopeo and Podman, only decrypt when the user explicitly instructs us to (e.g. not triggering decryption based on environment variables). Signed-off-by: Miloslav Trmač <[email protected]>
We want to share these functions with Podman, Podman currently has a slightly different version which is correct, so use correct version in Buildah and vendor it into Podman. Fixing: containers/podman#18196 Signed-off-by: Daniel J Walsh <[email protected]>
A non-nil but empty decryption configuration seems to be valid enough to trigger decryption in some configurations, per containers/podman#18196 . Like in Skopeo and Podman, only decrypt when the user explicitly instructs us to (e.g. not triggering decryption based on environment variables). Signed-off-by: Miloslav Trmač <[email protected]>
We want to share these functions with Podman, Podman currently has a slightly different version which is correct, so use correct version in Buildah and vendor it into Podman. Fixing: containers/podman#18196 Signed-off-by: Daniel J Walsh <[email protected]>
A friendly reminder that this issue had no activity for 30 days. |
@rhatdan This is your own containers/buildah#4746 + a Podman change to use that shared implementation. |
A non-nil but empty decryption configuration seems to be valid enough to trigger decryption in some configurations, per containers/podman#18196 . Like in Skopeo and Podman, only decrypt when the user explicitly instructs us to (e.g. not triggering decryption based on environment variables). Signed-off-by: Miloslav Trmač <[email protected]>
We want to share these functions with Podman, Podman currently has a slightly different version which is correct, so use correct version in Buildah and vendor it into Podman. Fixing: containers/podman#18196 Signed-off-by: Daniel J Walsh <[email protected]>
We want to share these functions with Podman, Podman currently has a slightly different version which is correct, so use correct version in Buildah and vendor it into Podman. Fixing: containers/podman#18196 Signed-off-by: Daniel J Walsh <[email protected]>
We want to share these functions with Podman, Podman currently has a slightly different version which is correct, so use correct version in Buildah and vendor it into Podman. Fixing: containers/podman#18196 Signed-off-by: Daniel J Walsh <[email protected]>
Issue Description
Podman pull not automatically decrypting the image while pulling the images unless I explicitly provide the provider as flag
--decryption-key provider:simplecrypt
. This wasn't required previously with podman.With buildah & skopeo decryption still is happening automatically without explicitly specifying the provider using flag
--decryption-key provider:simplecrypt
Steps to reproduce the issue
Steps to reproduce the issue
ocirypt.conf
like belowPull an image
$ podman pull docker.io/library/alpine:latest
Encrypt this image:
Describe the results you received
This is failing:
Describe the results you expected
I would expect the command
OCICRYPT_KEYPROVIDER_CONFIG=/path/to/ocicrypt.conf podman pull oci-archive:encrypted
to work.podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
No
Additional environment details
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: