-
Notifications
You must be signed in to change notification settings - Fork 64
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
Lack of 'range' field in fcontext causes error in go-linux.NewContext() #24
Comments
We probably should handle this in opencontainers/selinux, but the benefit of SELinux and Containers falls quite a bit without MCS/MLS Container Separation. We rely on the forth field to keep containers separate. Is there a targeted policy available for gentoo that supports the MCS/MLS Field? |
Patch to allow you to use selinux on non MCS machines #25 |
@rhatdan Oh thank you for quick reply and advice.
Currently no, probably. I've confirmed the fourth field is present at mls settings and disappear at targeted settings. Though I can do it myself manually, I don't think it is a good idea. I'd like to communicate with Gentoo SELinux project team about this topic with the benefit of container separation with the MLS/MCS field in targeted mode. At last thank you again for quick action to fix it!! |
Could you apply the patches to your podman to see if it actually fixes your issue? |
Works fine. Thanks!! |
add workaround for opencontainers/selinux#24
This issue is fixed. |
Hi I enjoy my container life with podman and have an issue on Gentoo with SELinux targeted environment.
Here is the output of running container from the podman tutorial.
It seems that the environment which doesn't have the 'range' field (like 's0') in fcontext is not considered in the go-linux.NewContext() (and ReserveLabel() below)
In the Gentoo's SELinux instruction labeling fcontext with targeted type doesn't provide the 'range' field because it isn't MLS/MCS type.
kenya888@xps13 ~/ctr $ LANG=C ls -lZ total 0 drwxr-xr-x. 1 kenya888 wheel unconfined_u:object_r:user_home_t 42 Feb 6 20:50 lib drwxr-xr-x. 1 kenya888 wheel unconfined_u:object_r:user_home_t 0 Feb 6 20:49 run
I know it doesn't occur in Fedora/RHEL because they are always provided with 'range' fcontext.
Should I label it to my system even if I don't use the field? I cannot find right information that this field is always needed as SELinux spec.
We can easily reproduce this issue with the code as following.
The text was updated successfully, but these errors were encountered: