Skip to content
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

enable container_manage_cgroup SELinux boolean by default #397

Closed
miabbott opened this issue Feb 21, 2020 · 12 comments
Closed

enable container_manage_cgroup SELinux boolean by default #397

miabbott opened this issue Feb 21, 2020 · 12 comments

Comments

@miabbott
Copy link
Member

Currently, if users want to run a container with systemd started inside of the container, they need to enable the container_manage_cgroup SELinux boolean on their host.

And because the ergonomics of configuring a persistent SELinux policy change are not great on FCOS, this seems like a use case we would like to enable for users out of the box.

@rhatdan
Copy link

rhatdan commented Feb 25, 2020

For Coreos, this needs to be on by default since it can not be permanently enabled on the system.
Another option would be for users who wanted to enable this feature at boot time, by setting the boolean at boot.

# setsebool container_manage_cgroup 1

This would work now. Note no -P flag, since I believe recompiling and installing the policy might break on a coreos system.

@jamescassell
Copy link
Collaborator

Doesn't cgroup v2 avoid the need for this? What are the security implications of setting this?

@rhatdan
Copy link

rhatdan commented Feb 25, 2020

No cgroup V2 does not fix this sadly. I have to get back to the upstream developers to see if anyone has made progress.

This basically means from an SELinux point of view. containers can modify the cgroup file system if they can get to it.

@dustymabe dustymabe added the meeting topics for meetings label Feb 26, 2020
@dustymabe
Copy link
Member

I'm +1 as I already needed to do this for one of my servers.. Here's a comment with the unit I used: #368 (comment)

@dustymabe
Copy link
Member

This basically means from an SELinux point of view. containers can modify the cgroup file system if they can get to it.

It looks like the security implications are described in a little more detail here: https://bugzilla.redhat.com/show_bug.cgi?id=1806038#c8

In light of that I'm rethinking my earlier +1 here.

@jlebon
Copy link
Member

jlebon commented Mar 4, 2020

This was discussed in today's community meeting:

16:55:01 <jlebon> #agreed due to the security implications, we would rather
keep container_manage_cgroup off. we should discuss with SELinux folks
on a better path. meanwhile, we should document how to enable it for those
who really want it

@rhatdan
Copy link

rhatdan commented Mar 4, 2020

I am looking into adding a type for running systemd based containers. The question would be whether or not we want to force users to figure out the label, or just add this to the selinux stack.

@dustymabe
Copy link
Member

@rhatdan - sent you an email to try to coordinate a time to discuss this.

@jlebon - so the remaining step is to add documentation for now. We'll consider coreos/fedora-coreos-config#291 and then add documentation after that is considered.

@dustymabe dustymabe removed the meeting topics for meetings label Mar 5, 2020
@harshblog150
Copy link

@rhatdan i checked "container_manage_cgroup" for my container-
gives "getsebool: SELinux is disabled" so i tried run "setsebool -P container_manage_cgroup 1" inside container, it gives Error:
"bash setsebool: command not found."

@rhatdan
Copy link

rhatdan commented Apr 27, 2020

If SELinux is disabled on the host, then this will not effect anything.

@dustymabe
Copy link
Member

@harshblog150 Also, I think you need to run those commands directly on the host itself. Here is an example of automating it: #368 (comment)

@dustymabe
Copy link
Member

The container_manage_cgroup boolean is no longer needed. Running systemd in a container should work without setting this boolean now. See:

dustymabe added a commit to dustymabe/fedora-coreos-config that referenced this issue Dec 9, 2022
jlebon pushed a commit to coreos/fedora-coreos-config that referenced this issue Dec 9, 2022
HuijingHei pushed a commit to HuijingHei/fedora-coreos-config that referenced this issue Oct 10, 2023
HuijingHei pushed a commit to HuijingHei/fedora-coreos-config that referenced this issue Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants