-
Notifications
You must be signed in to change notification settings - Fork 57
Description
Currently, CLONE_NEWUSER is gated on CAP_SYS_ADMIN when kernel.unprivileged_userns_clone = 0; I understand why (any vulnerability in user namespaces, which is what the setting exists to guard against, would lead to immediate escalation to admin anyway), but it means that there's no easy way to narrow down a system's overall attack surface by allowing a specific few processes that use the functionality to use CLONE_NEWUSER without implicitly running all their code with CAP_SYS_ADMIN or allowing arbitrary unprivileged processes to use userns. After writing NixOS/nixpkgs#84522 (comment) I figured I'd open this to at least see if there's any appetite for this.
I guess this is something that could be accomplished via SELinux, and would be out of scope if so?