docs: recommend per-binary AppArmor profile for rootlesskit on Ubuntu 24.04 - #7142
Open
shashankvarma499 wants to merge 1 commit into
Open
shashankvarma499 wants to merge 1 commit into
shashankvarma499 wants to merge 1 commit into
Conversation
Document a per-binary AppArmor profile for rootlesskit as the preferred fix for the Ubuntu 24.04 unprivileged-userns restriction, instead of the system-wide kernel.apparmor_restrict_unprivileged_userns=0 sysctl, which re-opens the attack surface the restriction was introduced to close. Keep the sysctl as a documented fallback. Fixes moby#7073 Signed-off-by: Shashank Varma <324153016+shashankvarma499@users.noreply.github.com>
AkihiroSuda
reviewed
Sep 14, 2026
| $ sudo systemctl restart apparmor.service | ||
| ``` | ||
|
|
||
| This is the approach [rootlesskit's own CI](https://github.com/rootless-containers/rootlesskit/blob/master/.github/workflows/main.yaml) |
Member
There was a problem hiding this comment.
This doesn't seem worth mentioning.
(Was this written by an AI?)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
docs/rootless.mdcurrently recommends disabling the AppArmor unprivilegeduser-namespace restriction system-wide (
kernel.apparmor_restrict_unprivileged_userns=0)in two places: the "Ubuntu, 24.04 or later" distribution hint and the
fork/exec /proc/self/exe: permission deniedtroubleshooting entry.That sysctl turns the restriction off for every unprivileged binary on the
host, which is exactly the attack surface Ubuntu 24.04 introduced the
restriction to close.
Why
buildkitdis launched viarootlesskit, and it isrootlesskit(notbuildkitd itself) that actually creates the user namespace. A per-binary
AppArmor profile can grant
usernstorootlesskitalone, leaving therestriction in place for everything else. This mirrors what
rootlesskit's own CI
does.
Changes
the note that the profile path and file name must match where
rootlesskitis actually installed).
Fixes #7073