mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 22:05:27 +00:00
profiles: Add profile for bwrap utility
This adds a bwrap profile to allow it to function on a system with user namespace restrictions enabled. The child task of bwrap will enter into a profile without capabilities thus preventing bwrap from being able to be used to arbitrarily by-pass user namespace restrictions. This profile does prevent applications launch with privilege (eg. sudo bwrap ...) from functioning so it may break some use cases. Note: The unpriv_bwrap profile is deliberately stacked against the bwrap profile due to bwraps uses of no-new-privileges. Fixes: https://bugs.launchpad.net/ubuntu/+source/pageedit/+bug/2046844 Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
34
profiles/apparmor.d/bwrap-userns-restrict
Normal file
34
profiles/apparmor.d/bwrap-userns-restrict
Normal file
@@ -0,0 +1,34 @@
|
||||
# This profile allows almost everything and only exists to allow
|
||||
# bwrap to work on a system with user namespace restrictions
|
||||
# being enforced.
|
||||
# bwrap is allowed access to user namespaces and capabilities
|
||||
# within the user namespace, but its children do not have
|
||||
# capabilities, blocking bwrap from being able to be used to
|
||||
# arbitrarily by-pass the user namespace restrictions.
|
||||
#
|
||||
# Note: the bwrap child is stacked against the bwrap profile due to
|
||||
# bwraps used of no-new-privs
|
||||
|
||||
profile bwrap /usr/bin/bwrap flags=(attach_disconnected) {
|
||||
allow capability,
|
||||
allow file rwlkm /{**,},
|
||||
allow network,
|
||||
allow unix,
|
||||
allow ptrace,
|
||||
allow signal,
|
||||
allow mqueue,
|
||||
allow io_uring,
|
||||
allow userns,
|
||||
allow mount,
|
||||
allow umount,
|
||||
allow pivot_root,
|
||||
allow dbus,
|
||||
allow px /** -> bwrap//&unpriv_bwrap,
|
||||
|
||||
}
|
||||
|
||||
profile unpriv_bwrap flags=(attach_disconnected) {
|
||||
allow all,
|
||||
audit deny capability,
|
||||
}
|
||||
|
Reference in New Issue
Block a user