Replies: 2 comments
-
|
Hi @mikn We're interested in understanding the challenges you're facing and exploring potential ways to extend the Bottlerocket SELinux policy without the need to fork the entire policy. Your insights and SELinux policy files would be very helpful as we investigate approaches. Could you please share the SELinux policy you've been working on? Having access to your policy definitions would allow us to better understand your specific requirements and explore options that may work for your use case. Please let me know if you have any other questions. I'm happy to discuss further and see how we can assist. |
Beta Was this translation helpful? Give feedback.
-
|
Hi! Sorry for being slow here. But yes, that would be an amazing improvement as we are currently (still) carrying the entire SELinux policy package. We added a new cil file like this: Then in |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Okay, so we introduced a new SELinux domain for Firecracker. We are using the jailer and doing the transition after the jailer to
container_kvm_t.We stumbled on the fact that the
firecrackerprocess started by the jailer is the one setting up the tun device required for network connections. This, for reasons I am less clear about, results in atun_socketbeing created in theruntime_tdomain (the domain thatcontainerd, all the way to thejailerhas), that Firecracker wants to relabel back tocontainer_kvm_t.There is a
neverallowstatement in the SELinux policy here: https://github.com/bottlerocket-os/bottlerocket-core-kit/blob/develop/packages/selinux-policy/rules.cil#L340 which does not allow me to allow this specific relabeling as container_kvm_t ends up being an untrusted domain (as it should).I am not great at CIL and I am not great at SELinux, but I could not for my life figure out how or why this
tun_socketrequires to make the transition fromruntime_ttocontainer_kvm_tand doesn't get created in thecontainer_kvm_tdomain right away.My only guess is that it is because "the other end" of the TUN device is picked up by the containerd shim process, which is in the
runtime_tdomain (to then be wired together with the CNI), but tbf the documentation abouttun_socketin the SELinux context is relatively limited.I, for now, unblocked myself by commenting out this
neverallowstatement and explicitly allowing this transition - but it does feel quite hacky and I am sure there is a better way.In the context of Bottlerocket, do you have any recommendations in how to figure this out? Perhaps, for someone who is actually decent at CIL and SELinux this has a very obvious solution?
Beta Was this translation helpful? Give feedback.
All reactions