Skip to content

Separate CAP_* for CLONE_NEWUSER? #36

@emilazy

Description

@emilazy

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions