-
Notifications
You must be signed in to change notification settings - Fork 374
failure when selinux-enabled #784
Comments
Hi @vbatts This is a known missing feature right now, which has been discussed recently, but there indeed seems to be little evidence or trail here on github. @xzr - do you remember if/where we got to with selinux kata discussion? |
@grahamwhaley I think the consensus was that "someone will implement it when they have a chance" :P |
Well, I created kata-containers/documentation#253, but it is very slim. I had a look around at the docker docs and a few bits of the code (dockerd, runc), but I am finding it hard to locate anything meaty or definitive on how this is currently handled (architecturally for instance). Any pointers on what that setting actually enables and where most welcome @vbatts ;-), so we can use those in future 'how and where do we enable this' discussions. |
the most of it is ensuring that the filesystem view of the container and the execution of commands are done in the correct selinux context. @rhatdan can give more pointers. Some host filesystems handle the selinux context better than others (i.e. btrfs doesn't have "native" support, so it requires a recursive |
Same issue with podman. Workaround: |
Could you give me the AVC messages you are seeing? |
@rhatdan Here it is with log level set to
For now, I have interpreted this as "not supported" |
@rhatdan Here is what I can find in
|
Looks like kata has to be rebuilt with SELinux support. Or at least to ignore the label when built without SELinux support. |
@rhatdan - as noted earlier in the thread, the kata limitations document says kata does not currently support the selinux option. It's not quite as simple as rebuild Kata to turn it on or ignore it - it's not coded up in kata.... Now, if somebody wants to undertake coding up selinux support in kata - that'd be great, and I'm sure there are folks who would help discuss and review :-) |
I would just warn in Kata that this is not currently supported. There is no mechanism for Podman to know, and forcing users to understand the difference is difficult, and perhaps impossible. |
Yes, it does. See also related Bugzilla |
Ok, then I guess podman does not send down a label in that case. The difficult thing is this is hard for users to understand. IE Some containers run fine with SELinux enabled, but kata fails. One question I would have is what is the label of the procesess running the VM. If it is running qemu? What is the label We really should get this labeled correctly, so we could take advantage of SELinux separation on VMs. |
Providing you the info asked in December:
|
So this means that podman executed qemu-kvm directly. |
@rhatdan, I don't see any particular AVC, but basically the same log as pointed by @c3d in this comment #784 (comment) |
Can we get Kata to just warn rather then throw an error? I don't want to put something into Podman to identify which container runtimes support which features. I would figure there are other parts of the OCI that kata ignores, since it does not currently implement this. |
If we really want to examine what I believe kata should be doing with SELinux is to launch the qemu (or what ever process launches the VM, with an SELinux label. In the best senario it could launch the process as svirt_t:MCS, which it could figure out by calling virtual_domain_context(), and then launching with the MCS label in the OCI Spec. This might not work, though, since the image label might not be correct. |
Sure, we have to work on getting SELinux implemented. But we are going to need a different strategy to get this going, mainly because the container_t label will only work for Namespace based containers, and will not work for KVM based containers. I hope to have some more time to try to play with Kata and SELinux. |
network: Add grpc method to add static arp neighbors
Description of problem
running docker with selinux enabled (
/etc/docker/daemon.json
of"selinux-enabled": true,
) and on a centos7 host with selinux enabled.Expected result
a shell
Actual result
Meta details
Running
kata-collect-data.sh
version1.3.0-rc1 (commit 22aedc4)
at2018-09-25.04:51:31.258811160-0400
.Runtime is
/bin/kata-runtime
.kata-env
Output of "
/bin/kata-runtime kata-env
":Runtime config files
Runtime default config files
Runtime config file contents
Config file
/etc/kata-containers/configuration.toml
not foundOutput of "
cat "/usr/share/defaults/kata-containers/configuration.toml"
":Image details
Initrd details
No initrd
Logfiles
Runtime logs
No recent runtime problems found in system journal.
Proxy logs
No recent proxy problems found in system journal.
Shim logs
No recent shim problems found in system journal.
Container manager details
Have
docker
Docker
Output of "
docker version
":Output of "
docker info
":Output of "
systemctl show docker
":No
kubectl
Packages
No
dpkg
Have
rpm
Output of "
rpm -qa|egrep "(cc-oci-runtimecc-runtimerunv|kata-proxy|kata-runtime|kata-shim|kata-containers-image|linux-container|qemu-)"
":The text was updated successfully, but these errors were encountered: