-
Notifications
You must be signed in to change notification settings - Fork 1
Support encryption of image layers (imgcrypt) #18
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
Comments
UpdatePodmanI started by setting up Podman and trying its encryption. It turns out that the Ubuntu 22.04 release is Podman 3.4.4, and the On imgcryptI can confirm what I've said before: this library only works directly with the I have been creating an image with Going back to the testing, surprisingly, I've been getting inconsistent and rather nonsensical results in terms of allowing me to run an encrypted image without providing and key, as if it was unencrypted. I've double- and triple-checked several times if the images are actually encrypted, deleted them and encrypted them again and the results still don't make sense. I need to test more to take any more conclusions QuestionsSimultaneously, I have been searching online and I have been seeing strong push-back against storing secret / inaccessible stuff in an image:
I have, however, seen an image being encrypted and the constraints that that puts on running it. In that same line of thinking, many questions arose beyond the initial description of this issue:
|
Hi @gsilva00 , thank you for the in depth analysis.
Can't you create a VM for this test with a newer distro and Podman version? Check Vagrant and VirtualBox. They work great together. Also just a note that users might not have the latest Podman version, so we have to account for that. As to your questions, it really depends on what the Robotair costumer wants to do with it, so we should prepare it for the majority of scenarios. Nevertheless, for the time being and for the scope of this action, we just want to support image/layer encryption through Rigel, to the extent that it is possible for an initial Proof-of-Concept. The fine details about the multitude of ways in which an encryption/decryption can be performed and the management of their associated keys can come at a later stage. However, please document all findings in that regard as to help us tailor the approach. |
@gsilva00 This is used for the encryption this is one solution which can be used for encryption. Also check out this video from dockercon I can briefly answer some of your questions based on my understanding of the codemeter.
We will encrypt the application code that is in the container and will be encrypted using the CI pipelines. Also refer this |
@gsilva00 , after the Easter break, please update the status of this issue. |
UpdatePodmanBy setting up a Ubuntu 24.04.2 LTS VM, I was able to use the Podman encryption and decryption features (added in v4.4.0-RC1), as 4.9.3 is available for it and only 3.4.4 for my host's Ubuntu 22.04.5 LTS. Podman does not allow for Encryption At-Rest (encrypting and storing the container). However, Podman allows for: Encryption in transitWe encrypt the image/layer as we're pushing the image to a registry with the # Can also add --encrypt-layer=[layerIndex] to the push command to specify the layer to encrypt (instead of the whole image).
# The layer index can be negative - works exactly in the same way as Python's negative indexing.
# --encrypt-layer=[-1] refers to the topmost / most recently created layer
$ podman push --encryption-key=[protocol:keyfile] [image] And the image stays encrypted in the registry. Then we provide the decryption key with the and
SecretsPasswords, API keys, certificates, etc. stored in a protected directory in the host and that can be mounted at runtime so that containers have a read-only access to them at runtime. This allows for:
About the DockerCon19 videoThis is the presentation of IBM's proposal for a New Mediatype for Encrypted Layers of a Container Image by Brandon Lum. This proposal started 7+ years ago and is still a work in-progress for Docker CLI's implementation as per this PR (which is related to this issue) and its related issues/PRs (which I won't mention to avoid polluting their references meaninglessly). Containerd's imgcrypt
This also allows for encryption and decryption of an image, both in entirety and per layer, as mentioned before. As a non-core subproject of containerd, its encryption features are not included in the main project, which means that Docker has no access to them, even if
Integration into RigelFrom what I can understand, given that there is no Docker CLI integration, due to waiting on ongoing replacement of Moby's backend with ConclusionIn terms of the end goal of this issue, any of the encryption/secret solutions described only address the first out of the 2 discussed approaches:
Given these problems, how can I progress with the actual implementation? Which of these tools other than Docker can be integrated with the Rigel pipeline? And how? |
Hi @gsilva00 , thanks for the very in-depth analysis. One question: is the encryption in transit exclusive to Podman, i.e., it is not available in Docker? If it is exclusive to Podman, I would say it is not something we should support, as the majority of the user base will be most likely using Docker. As per your concluding question, I would say that we should focus on topic 2, i.e., implementing the secrets feature allowing users to store sensitive data in a protected directory. |
Hi, Both the encryption in transit and the secret feature are exclusive to Podman. Docker has a similar feature to Podman Secrets called Docker Secrets. |
Hi @gsilva00. Thanks, agreed.
Have you checked build-level secrets? I thought this is what you were referring to. |
I hadn't checked that yet! It does seems more promising. |
In favor of new SSH model implemented in the commits until now
…18 - To allow for earlier (ASAP) abort operation when errors occur in the build process of such a crucial part of the image (the dependencies of the ROS application). Not worth wasting time on the rest of the build if this fails. - Additionally, changed addition of hostnames to 'known_hosts' to gather all hostnames before outputting. This allows duplicate checking across docker_run and rosinstall, removing redundant outputs.
Currently all code contained within images generated by Rigel can be accessed.
This is not ideal as ROS applications may contain sensitive data (like access credentials), proprietary algorithms (e.g., for navigation), AI models (e.g., for object detection), etc.
Therefore, a mechanism to encrypt the layers of generated container images is ideal, thus safeguarding any intellectual property. There are already tools such as imgcrypt that can be used to do just this.
The goal of this issue is therefore to assess how this encryption mechanism works and to integrate it with the existing Rigel
rigel.core.BuildXPlugin
plugin.The text was updated successfully, but these errors were encountered: