Unable to use SELinux port rules with custom contexts #26100
gucci-on-fleek
started this conversation in
General
Replies: 2 comments 4 replies
-
I'm not sure if this is expected behavior. WDYT? @Luap99 and @sbrivio-rh |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is expected, the custom policy from The fact the we run pasta as container_runtime_t is actually sort of a bug, it should run under pasta_t but there are some policy issues we would need to fix first: https://bugs.passt.top/show_bug.cgi?id=81 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Issue Description
I'm trying to use a custom SELinux policy to limit which services are allowed to bind to specific ports, but this doesn't seem to work with Podman.
When running rootless, it looks like Podman is trying to run pasta in the
container_runtime_t
context instead of the context set with--security-opt=label=type:
. When running as root, Podman itself is trying to bind the port in thecontainer_runtime_t
context instead of the context set with--security-opt=label=type:
.Steps to reproduce the issue
First, install the following SELinux policy:
Now, confirm that only processes with the
local_test_container.process
type are allowed to bind to port 9124:Now try running the same commands in a container as a regular user:
And as root:
Describe the results you received
(described inline above, repeated again here)
When rootless, Podman returns the following error message:
and the audit log shows the following messages:
When run as root, Podman returns the following error message:
and the audit log shows the following message:
Describe the results you expected
I expected that Podman would allow binding to port 9124 and would return no error messages.
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
The transcripts and logs above are from Fedora 41:
I also tested on Fedora 42 and got the same results:
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions