Repository navigation
cmd/initContainer: Unbreak access to CA certificates in sshd(8) sessions - #1695
Conversation
|
✔️ unit-test SUCCESS in 2m 19s |
86a09ed to
8b442c0
Compare
|
✔️ unit-test SUCCESS in 2m 07s |
When a Toolbx container is set up to use the p11-kit-client.so PKCS containers#11 module instead of the usual p11-kit-trust.so module, the P11_KIT_SERVER_ADDRESS environment variable must be set inside the container, so that it can communicate with the host operating system. Currently, this works as described above with the 'enter' and 'run' commands, but not within child sessions started by an sshd(8) [1] instance running inside a container, because P11_KIT_SERVER_ADDRESS is absent. To make this work, sshd(8) [1] must be configured [2] to set P11_KIT_SERVER_ADDRESS in its child sessions. If sshd(8) uses the /etc/ssh/sshd_config.d directory for configuration, then the entry point will automatically do this from now on. This requires at least OpenSSH 8.2, which added support for the 'Include' directive in sshd_config(5) [2,3], and the directive must be used to include the configuration from /etc/ssh/sshd_config.d. Otherwise, the user will have to do it themself. eg., Ubuntu 16.04 Xenial Xerus and 18.04 Bionic Beaver don't use /etc/ssh/sshd_config.d because their OpenSSH is too old [4,5]. Note that the permissions of the /etc/ssh/sshd_config.d directory and its contents differ across operating system distributions. OSes within the Fedora family use 0700 for the directory and 0600 for its contents. Arch Linux and Ubuntu use 0755 and 0644. The entry point tries to follow the permissions used by the distribution. Fallout from 5ed2442 [1] https://man7.org/linux/man-pages/man8/sshd.8.html [2] https://man7.org/linux/man-pages/man5/sshd_config.5.html [3] OpenSSH commit c2bd7f74b0e0f3a3 openssh/openssh-portable@c2bd7f74b0e0f3a3 https://bugzilla.mindrot.org/show_bug.cgi?id=2468 [4] https://code.launchpad.net/~git-ubuntu-import/ubuntu/+source/openssh/+git/openssh/+ref/ubuntu/xenial-updates [5] https://code.launchpad.net/~git-ubuntu-import/ubuntu/+source/openssh/+git/openssh/+ref/ubuntu/bionic-updates containers#626 containers#1674
8b442c0 to
f1f7d9c
Compare
The error is the same as we have seen recently on Fedora Rawhide: It seems unrelated, and is probably due to some change in Fedora Rawhide. |
|
✔️ unit-test SUCCESS in 2m 08s |
When a Toolbx container is set up to use the
p11-kit-client.soPKCS #11module instead of the usual
p11-kit-trust.somodule, theP11_KIT_SERVER_ADDRESSenvironment variable must be set inside thecontainer, so that it can communicate with the host operating system.
Currently, this works as described above with the
enterandruncommands, but not within child sessions started by an
sshd(8)[1]instance running inside a container, because
P11_KIT_SERVER_ADDRESSisabsent.
To make this work,
sshd(8)[1] must be configured [2] to setP11_KIT_SERVER_ADDRESSin its child sessions.If
sshd(8)uses the/etc/ssh/sshd_config.ddirectory for configuration,then the entry point will automatically do this from now on. This
requires at least OpenSSH 8.2, which added support for the
Includedirective in
sshd_config(5)[2,3], and the directive must be used toinclude the configuration from
/etc/ssh/sshd_config.d.Otherwise, the user will have to do it themself. eg., Ubuntu 16.04
Xenial Xerus and 18.04 Bionic Beaver don't use
/etc/ssh/sshd_config.dbecause their OpenSSH is too old [4,5].
Note that the permissions of the
/etc/ssh/sshd_config.ddirectory andits contents differ across operating system distributions. OSes within
the Fedora family use
0700for the directory and0600for its contents.Arch Linux and Ubuntu use
0755and0644. The entry point tries tofollow the permissions used by the distribution.
Fallout from 5ed2442
[1] https://man7.org/linux/man-pages/man8/sshd.8.html
[2] https://man7.org/linux/man-pages/man5/sshd_config.5.html
[3] OpenSSH commit c2bd7f74b0e0f3a3
openssh/openssh-portable@c2bd7f74b0e0f3a3
https://bugzilla.mindrot.org/show_bug.cgi?id=2468
[4] https://code.launchpad.net/~git-ubuntu-import/ubuntu/+source/openssh/+git/openssh/+ref/ubuntu/xenial-updates
[5] https://code.launchpad.net/~git-ubuntu-import/ubuntu/+source/openssh/+git/openssh/+ref/ubuntu/bionic-updates
#626
#1674