TPM within Containers
Eduardo Falcão <eduardolfalcao at gmail.com>
Hello everyone
Does anyone know any tutorial to deploy TPM-enabled containers?
I was looking for some example with vTPM, instead of simulation tools like IBM and others.
In addition, it seems that enabling IMA in containers is a challenging task...
I came across 2 papers, "Container-IMA: A privacy-preserving Integrity Measurement Architecture for Containers" and " Integrity verification of docker containers for a lightweight cloud environment", but there is no tutorial on how to deploy such a container.
Any help is appreciated.
Best regards.
Steffen Schwebel
Hello,
Although I havent really looked into this, Id assume you would need to expose the device to the container, like you would do with any other
Alternatively, assuming your USB device is available with drivers working, etc. on the host in /dev/bus/usb, you can mount this in the container using privileged mode and the volumes option. For example:
docker run -t -i --privileged -v /dev/bus/usb:/dev/bus/usb ubuntu bash
So, maybe something along the lines of
docker run -t -i --privileged -v /dev/tpm0:/dev/tpm0 ubuntu bash
might be worthwile to take a look at
Regards,
Steffen Schwebel
Quoted 14 lines · Eduardo Falcão
Hello everyone
Does anyone know any tutorial to deploy TPM-enabled containers?
I was looking for some example with vTPM, instead of simulation tools like IBM and others.
In addition, it seems that enabling IMA in containers is a challenging task...
I came across 2 papers, "Container-IMA: A privacy-preserving Integrity Measurement Architecture for Containers" and " Integrity verification of docker containers for a lightweight cloud environment", but there is no tutorial on how to deploy such a container.Any help is appreciated.
Best regards.
_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
Signature · 34 lines
Steffen Schwebel Mail: s.schwebel(a)uvensys.de uvensys GmbH Firmensitz und Sitz der Gesellschaft: uvensys GmbH Schorbachstraße 11 35510 Butzbach HRB: AG Friedberg, 7780 USt-Id: DE282879294 Geschäftsführer: Dr. Thomas Licht, t.licht(a)uvensys.de Volker Lieder, v.lieder(a)uvensys.de Mail: info(a)uvensys.de Internet: www.uvensys.de Durchwahl: 06403 789 36 22 Hotline: 06403 789 36 88 Zentrale: 06403 789 36 00 Fax: 06403 789 36 99 ========================================================== Jegliche Stellungnahmen und Meinungen dieser E-Mail sind alleine die des Autors und nicht notwendigerweise die der Firma. Falls erforderlich, können Sie eine gesonderte schriftliche Bestätigung anfordern. Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. If verification is required please request a hard-copy version.
Max Halldén <max.hallden at wisi.se>
Hi,
I haven't tried anything tpm-related in docker, but consider using --device /dev/tpm0:/dev/tpm0 to avoid having to run the container in privileged mode.
Not sure what your use-case is for vTPM, but if you just want to share the tpm I think it should work as long as you access it via tpm2-abrmd or /dev/tpmrm0.
Regards,
Max
Quoted 34 lines · Steffen Schwebel
Hello,
Although I havent really looked into this, Id assume you would need to expose the device to the container, like you would do with any other
Alternatively, assuming your USB device is available with drivers working, etc. on the host in
/dev/bus/usb, you can mount this in the container using privileged mode and the volumes option. For example:docker run -t -i --privileged -v /dev/bus/usb:/dev/bus/usb ubuntu bash
So, maybe something along the lines of
docker run -t -i --privileged -v /dev/tpm0:/dev/tpm0 ubuntu bash
might be worthwile to take a look at
Regards,
Steffen SchwebelQuoted 14 lines · Eduardo Falcão
Hello everyone
Does anyone know any tutorial to deploy TPM-enabled containers?
I was looking for some example with vTPM, instead of simulation tools like IBM and others.
In addition, it seems that enabling IMA in containers is a challenging task...
I came across 2 papers, "Container-IMA: A privacy-preserving Integrity Measurement Architecture for Containers" and " Integrity verification of docker containers for a lightweight cloud environment", but there is no tutorial on how to deploy such a container.Any help is appreciated.
Best regards.
_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
Luke Hinds
Take a look at our CI (you just need to ignore the rust specific tests)
https://github.com/keylime/rust-keylime/commit/2added70c8b7b7f06f318ee27ed76549301afcf0
Quoted 21 lines · On Thu, 12 Nov 2020, 01:30 Eduardo Falcão, <eduardolfalcao(a)gmail.com> wrote:
Hello everyone
Does anyone know any tutorial to deploy TPM-enabled containers? I was looking for some example with vTPM, instead of simulation tools like IBM and others.
In addition, it seems that enabling IMA in containers is a challenging task...
I came across 2 papers, "Container-IMA: A privacy-preserving Integrity Measurement Architecture for Containers" and " Integrity verification of docker containers for a lightweight cloud environment", but there is no tutorial on how to deploy such a container.Any help is appreciated.
Best regards.
_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
nicolasoliver03 at gmail.com
I got a gist for that :)
It is using the TPM2 PKCS#11 module inside the container, and accessing the TPM resource manager with the --device option
https://gist.github.com/dnoliver/388303c94639b763e9f120e2cbcccf8f
[test(a)fedora-server ~]$ docker run --rm -ti --device /dev/tpmrm0 ubuntu bash
As today (the last time I checked), IMA does not play well with containers. For example, lets say that you have a binary in your container "/usr/bin/test". Once you pull the image, that binary will be stored in something like "/var/lib/docker/images/overlayfs/..../<layer hash>/usr/bin/test". When you start a container from that image, and call the binary, IMA will measure "/usr/bin/test" (the path in the container instead of the path in the host OS). This means that the remote verifier will not know if the digest reported is related to a file loaded by the host OS or loaded by the container.
So now, I have a policy to prevent measuring anything from a container based on a SELinux label:
cat >> /etc/ima/ima-policy << EOFdont_measure obj_type=container_share_tdont_measure obj_type=container_var_lib_tdont_measure obj_type=container_file_t
EOF
We more or less described how everything can play together here https://info.mirantis.com/whitepaper-intel-docker-enterprise-secure-containers. The idea is not to make IMA measure the container, but to extend the hardware root of trust with other means:
1. IMA will measure (and appraise) the container engine and configuration (dockerd, daemon.json, etc)
2. dockerd verify signatures in the images and containers (Docker Content Trust)
3. Containers will only run if they have the correct signature.
Matthew Giassa
I've setup a docker-in-docker debug environment for secure and/or measured boot. The idea is pretty straightforward:
- Top-level docker container (dind-top).
- 2nd level docker container running TPM simulator. Uses volume mount to expose the Unix domain socket it uses for IPC to "dind-top". Container named "dind-tpm".
- 2nd level docker container running an ubuntu VM via QEMU/KVM. the Unix domain socket visible in "dind-top" and "dind-tpm" is exposed via volume mount to this container (i.e. "dind-qemu"), and the path to the socket (within "dind-qemu") is passed to qemu as a CLi arg.
Net result is a completely virtualized dev env for secure and/or measured boot. Had to put a fair bit of work into the other pieces (i.e. custom kernel, tying all the docker + VM logic together, creating baseline VM with debootstrap, etc.).