-
Notifications
You must be signed in to change notification settings - Fork 47
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
Su not working in container with udica generated policy #69
Comments
Hi @jpf91 , You're correct that udica cannot detect what commands you execute inside the container, so this use-case cannot be automated. Can you please also share the whole usecase? Running su inside the container, I'm not sure if it make sense to confine container then. Thanks, |
Hi Lukas, thanks for the response. I'll elaborate a bit on the usecase: I wanted to test the "run services in containers" approach to run a sabnzbd container. Sabnzbd seemed to be a good test, as there's also no fedora package for it. Sabnzbd is essentially a data download program and in order to get a volume to store downloads into the container, I have to label it as So too summarize: The use case is moving services into containers(*). But the default container policy is too restrictive, so I need (*) The container image on docker hub was originally written for docker, so it uses |
What AVCs are you seeing? Is this because udica removes capabiltiies, IE setuid? |
This is easy to recreate. This works as expected:
But while that container is running, use
There are no AVC messages generated. The official docker image for Nextcloud fails with this In case you can't tell by the shell prompts, I did this rootless. |
Thank you for reporting the issue. My testing shows 2 AVCs (normally hidden by dontaudit rules): Udica policy with the following additional rules worked properly in enforcing: I could add a new template with the rules, but it is easy to work around using |
Describe the bug
When a container is run in a udica generated policy,
su
command does not work.To Reproduce
Steps to reproduce the behavior:
podman run --security-opt label=type:container-sabnzbd.process -it debian:buster /bin/sh
su
=>su: System error
Expected behavior
Su should work as expected, like when not specifying
-security-opt label=type:container-sabnzbd.process
.Solution
Udica seems to need the
(allow process process ( netlink_audit_socket ( nlmsg_read nlmsg_relay nlmsg_tty_audit )))
rule of container-selinux. Adding this rule fixes the problem, I'm not sure though whether it's possible to auto-detect when it is required.The text was updated successfully, but these errors were encountered: