hashicorp / go-secure-stdlib

Mozilla Public License 2.0
64 stars 24 forks source link

plugincontainer: Support plugins in rootless runtime with nonroot user #107

Closed tomhjp closed 11 months ago

tomhjp commented 12 months ago

Support running as non-root container users under rootless container runtimes.

tomhjp commented 12 months ago

Note: After some offline feedback, this is still a bit of a work in progress. @mickael-hc pointed out the 0o777 folder could be taken over, so I tried to fix that by ensuring it's inside a more limited folder in ce76700, but for some reason that broke the rootless mlock tests.

tomhjp commented 11 months ago

Just pushed some updates that switch from a 0o777 folder to using the DAC_OVERRIDE capability instead. I don't think I'd want to support that for runc, because runc will require that rootlesskit on the host has the capability itself (and it's a very powerful capability), but it seems more reasonable for runsc which doesn't need that because AFAIU it has its own userspace implementation instead of relying on the real underlying kernel.

tomhjp commented 11 months ago

Thanks! It took me a while to fully convince myself of the need for GroupAdd and Rootless together. For reference, this paper (attached for posterity) had the most thorough explanation I could find for putting the full picture together.

POSIX Access Control Lists on Linux, Andreas Grunbacher.pdf