Skip to content

Support containers launched with user namespace#7

Merged
nbdd0121 merged 3 commits intomainfrom
userns
Oct 11, 2024
Merged

Support containers launched with user namespace#7
nbdd0121 merged 3 commits intomainfrom
userns

Conversation

@nbdd0121
Copy link
Contributor

@nbdd0121 nbdd0121 commented Oct 3, 2024

By default Docker/k8s run the root user inside the container as the root user of the host. This means that there's syscall filtering and path masking necessary to prevent the root of inside container from escaping. This negatively affects Nix sandboxing inside containers, because syscalls it rely on are blocked.

User namespaces also the root user inside a container to be mapped to a non-root user -- this would make all filtering and masking unnecessary (and is what rootless containers use). When we enable userns, we can then disable filtering/masking without compromising security, and then enable Nix sandbox.

Copy link

@pamaury pamaury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ok to me but I don't know enough about the details of namespaces to give some detailed feedback.

@nbdd0121 nbdd0121 merged commit 7059bf7 into main Oct 11, 2024
@nbdd0121 nbdd0121 deleted the userns branch October 11, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants