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

Encryption check failing for zstd-compressed images #60

Closed
ttttodorov opened this issue Sep 29, 2022 · 2 comments · Fixed by #81
Closed

Encryption check failing for zstd-compressed images #60

ttttodorov opened this issue Sep 29, 2022 · 2 comments · Fixed by #81
Assignees
Labels
bug Something isn't working security Security improvement
Milestone

Comments

@ttttodorov
Copy link

ttttodorov commented Sep 29, 2022

zstd is in the process of being formalized in the OCI images spec and is yet to be supported by e.g. Moby regarding distribution via image registries. Containerd already provides support for it via using the newly introduced MediaType application/vnd.oci.image.layer.v1.tar+zstd .

The current Kanto container management component uses imgcrypt's library to perform a mandatory image encryption check based on the image's metadata and the configuration provided for using the image. Trying to spin up even a simple container using a non-encrypted zstd-compressed image, though, currently fails with the following error:

Error: rpc error: code = Unknown desc = you are not authorized to use this image: bad/unhandled MediaType application/vnd.oci.image.layer.v1.tar+zstd in encryptChildren

To reproduce the issue one can use skopeo to change the compression of a simple hello-world image and then push it to a private/local registry, e.g.:

  1. Use skopeo copy to create a zstd-compressed image and push it locally:
$ skopeo copy --dest-compress-format=zstd docker://hello-world docker://<some-plain-http-local-ip:port>/hello-world-zstd:latest --dest-tls-verify=false
  1. Use skopeo inspect to check the result pushed image compression:
$ skopeo inspect --raw docker://<some-plain-http-local-ip:port>/hello-world-zstd:latest --tls-verify=false | jq -r '.layers[].mediaType'
@e-grigorov e-grigorov added the task Single unit of work label Sep 29, 2022
@konstantina-gramatova konstantina-gramatova changed the title zstd support in container management Encryption images check failing for zstd compressed images Sep 29, 2022
@konstantina-gramatova konstantina-gramatova added bug Something isn't working and removed task Single unit of work labels Sep 29, 2022
@konstantina-gramatova konstantina-gramatova changed the title Encryption images check failing for zstd compressed images Encryption images check failing for zstd-compressed images Sep 29, 2022
@konstantina-gramatova konstantina-gramatova changed the title Encryption images check failing for zstd-compressed images Encryption check failing for zstd-compressed images Sep 29, 2022
@konstantina-gramatova konstantina-gramatova added this to the M3 milestone Sep 29, 2022
@k-gostev
Copy link
Contributor

k-gostev commented Oct 5, 2022

I can check this, please assign me to this issue if possible.

edit:
Looks like there is no handling for application/vnd.oci.image.layer.v1.tar+zstd in the cryptChildren(...) method in the imgcrypt library, so it goes in the default case, hence the error that is observed. Also, I could not find any issue issue on this topic or any relevant documentation.

@e-grigorov e-grigorov added the security Security improvement label Oct 6, 2022
@k-gostev
Copy link
Contributor

k-gostev commented Oct 7, 2022

I have opened an issue in contained/imgcrypt: containerd/imgcrypt#95

k-gostev pushed a commit to bosch-io/container-management that referenced this issue Oct 24, 2022
@konstantina-gramatova konstantina-gramatova linked a pull request Oct 25, 2022 that will close this issue
k-gostev pushed a commit to bosch-io/container-management that referenced this issue Oct 25, 2022
k-gostev pushed a commit to bosch-io/container-management that referenced this issue Oct 25, 2022
konstantina-gramatova pushed a commit that referenced this issue Oct 26, 2022
[#60] Bump imgcrypt version to 1.1.7

Signed-off-by: Kristiyan Gostev <[email protected]>
k-gostev pushed a commit to bosch-io/container-management that referenced this issue Oct 27, 2022
[eclipse-kanto#60] Bump imgcrypt version to 1.1.7

Signed-off-by: Kristiyan Gostev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working security Security improvement
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants