Allow sshd_session_t to launch containers - #479
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideExtend the existing sshd_launch_containers SELinux boolean so that the new sshd_session_t domain (used by OpenSSH 9.8+ for post-auth session handling and forwarding) can also launch/communicate with containers, and wrap the policy in optional_policy so it safely compiles on systems without sshd_session_t (pre-9.8). File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Code Review
This pull request updates the SELinux policy in container.te to support OpenSSH 9.8+, which splits sshd into a listener and a post-auth session (sshd-session). It adds an optional policy block allowing sshd_session_t to transition to the container runtime domain when the sshd_launch_containers tunable is enabled. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Tests failed. @containers/packit-build please check. |
|
/packit retest-failed |
|
@inknos thanks. Has this been tested on the podman-py side via something like https://packit.dev/posts/testing-farm-triggering/ and/or locally? If not, would you mind doing this on a test PR on podman-py? |
|
ELN rootless tests failed on not finding user fedora. Unrelated to the PR. That needs to be fixed on the podman side. |
Fedora ELN Testing Farm instances use cloud-user (UID 1000) as the default user, not fedora. This causes rootless podman tests to fail with "fedora user not found" errors. Combine the RHEL and Fedora ELN adjust rules since both use cloud-user for rootless testing. Fixes rootless test failures on Fedora ELN compose in Testing Farm. Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
OpenSSH 9.8+ split sshd into sshd (listener) + sshd-session (post-auth session handling). All forwarding now runs as sshd_session_t instead of sshd_t. Extend the sshd_launch_containers boolean to cover sshd_session_t so SSH -L forwarding to container runtime sockets is not denied by SELinux. Wrapped in optional_policy so it compiles on systems without the sshd-session split (OpenSSH < 9.8). Fixes: containers#478 Signed-off-by: Nicola Sella <nsella@redhat.com>
e93e752 to
87432c7
Compare
|
for the tests, I rebased on #480 |
I can try with packit |
|
I believe this should be in selinux-policy, along with the definition of the tunable. @zpytela PTAL |
@rhatdan are you opposed to merging this here? Can we defer transfer to selinux-policy? |
It should rather be in selinux-policy and we discussed that earlier, but it was kind-of postponed since it requires sync of 2 components and delivering to 2+ releases which also includes reverting the change in the other ones. |
|
Ok I will merge, and once we release this in selinux-policy, we can revert. |
OpenSSH 9.8+ split sshd into sshd (listener) + sshd-session (post-auth session handling). All forwarding now runs as sshd_session_t instead of sshd_t. Extend the sshd_launch_containers boolean to cover sshd_session_t so SSH -L forwarding to container runtime sockets is not denied by SELinux.
Wrapped in optional_policy so it compiles on systems without the sshd-session split (OpenSSH < 9.8).
Fixes: #478
Summary by Sourcery
Extend SELinux container policy so sshd_session_t can launch containers when the sshd_launch_containers boolean is enabled, while preserving compatibility with OpenSSH versions without sshd-session.
Bug Fixes:
Enhancements: