-
Notifications
You must be signed in to change notification settings - Fork 525
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
selinux cap query - control_t and cache_t #4401
Comments
Hey, @kevin-littlejohn can you please clarify if your intrusion detection container is actually long-lived? Or, does the container load the eBPF program and exits? If the former, a host container would be best since long-lived bootstrap containers will block your boot. As for the |
The plan was to use the bootstrap container to launch the long-running ids container - so bootstrap effectively calls "nerdctl run" on the appropriate container. That means the ids has to run in the host-containerd not the orchestrated containerd, but I'm ok with that - if anything, it means it's a little less obvious that it's running, which is good. I believe the container is attempting to create something in the container /run (this is a vendor container and it all happens within a binary, so I'm a little constrained on what I can see happening). But those files are part of an overlay that is marked cache_t I think. I seem to be able to hack around the /run restriction, but then it tries to write to another directory in it's own container and hits similar restrictions - so I'm playing whack-a-mole. Are containers run in host/bootstrap meant to be read-only? |
Hi @kevin-littlejohn, is it possible for you to share user-data file? Also Can you share journalctl -k logs? Can you see any
No. |
This command will execute in a bootstrap container, and it does create the expected file in the host's
Thus Here's what the path
Here's the host's
And from a process running on the host, to demonstrate that the container's
The |
userdata file just runs a container I've previously setup as bootstrap. That container tho, has a script that does some dodgy things, but fundamentally:
Given that bootstrap containers aren't meant to be read-only, most of this shouldn't be needed, but I'm getting the following: Feb 18 01:56:33 ip-10-53-18-21.ap-southeast-1.compute.internal audit[1432]: AVC avc: denied { write } for pid=1432 comm="falcon-sensor" name="CrowdStrike" dev="overlay" ino=12634894 scontext=system_u:system_r:control_t:s0-s0:c0.c1023 tcontext=system_u:object_r:cache_t:s0 tclass=dir permissive=0 This is an attempt by the falcon binary to write to /opt/CrowdStrike within the container. I previously got similar errors for /opt/CrowdStrike/falconstore and /var/log and /run, which is why those are mounted above. |
Hey @kevin-littlejohn, given your use case it seems like host containers are a better fit for what you are trying to accomplish (run a privileged container prior to the orchestrated workloads). May I ask what limitations host containers have that prevented you from using them for your need? To give you an idea of what's going on, since you are |
Is there a way to mount a host directory to a host container directory? The vendor container wants to cache an agent ID (effectively a host ID) in a host directory, needs that dir mounted, and is failing because of that. |
Hey @kevin-littlejohn, I see you are trying to use the To clarify a few things, the # This is the admin host container
[root@admin]# touch /run/test
[root@admin]# touch /tmp/test
[root@admin]# touch /var/run/test1
[root@admin]# It is odd that the |
Hiya,
Trying to start some containers during bootstrap time, as a way to ensure they're always running/started before everything else/not in with the normal orchestrated containers. It's failing because bootstrap appears to run as control_t in selinux, and the containers I'm running want to create a file in /run inside the container which is cache_t, and only runtime_s are allowed to write to cache_t.
Any chance the selinux policy could be tweaked to allow control_t to write to cache_t, or does that create other issues?
Fwiw, the container I'm wanting to run is an intrusion detection thing using eBPF, on a non-containerised host we'd just run it at host level, but on here it makes sense (to me, anyway) to run it privileged in the host containerd. If there's a better way to do this, also open to that., but the idea is to make it as simple as possible for people using bottlerocket, we just want to provide a bootstrap container and say "put this in your userdata.toml".
Thanks,
The text was updated successfully, but these errors were encountered: