-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(full): add default bwrap profiles.
On full system policy, use the new bwrap profile (and bwrap-app) to confine sandboxed application. It is not enabled by default as the sandbox profile is quite large. Also integrate with the gnome app that use bwrap as sandbox manager. Update other related profiles See Full system policy #252
- Loading branch information
Showing
8 changed files
with
146 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# apparmor.d - Full set of apparmor profiles | ||
# Copyright (C) 2023 Alexandre Pujol <[email protected]> | ||
# SPDX-License-Identifier: GPL-2.0-only | ||
|
||
# Default profile for bwrap. | ||
|
||
abi <abi/3.0>, | ||
|
||
include <tunables/global> | ||
|
||
@{exec_path} = @{bin}/bwrap | ||
profile bwrap @{exec_path} flags=(attach_disconnected,mediate_deleted) { | ||
include <abstractions/base> | ||
include <abstractions/bwrap-app> | ||
include <abstractions/dbus> | ||
include <abstractions/fontconfig-cache-write> | ||
|
||
capability dac_override, | ||
capability dac_read_search, | ||
capability net_admin, | ||
capability setpcap, | ||
capability sys_admin, | ||
capability sys_ptrace, | ||
capability sys_resource, | ||
|
||
network inet dgram, | ||
network inet6 dgram, | ||
network inet stream, | ||
network inet6 stream, | ||
network netlink raw, | ||
|
||
mount, | ||
umount, | ||
|
||
pivot_root oldroot=/newroot/ -> /newroot/, | ||
pivot_root oldroot=/tmp/oldroot/ -> /tmp/, | ||
|
||
ptrace peer=bwrap//&bwrap-app, | ||
|
||
signal peer=bwrap//&bwrap-app, | ||
signal (receive) set=(kill), | ||
|
||
@{bin}/** rm, | ||
@{lib}/** rm, | ||
/opt/*/** rm, | ||
/usr/share/*/* rm, | ||
|
||
@{bin}/** Px -> bwrap//&bwrap-app, | ||
@{bin}/xdg-dbus-proxy Px -> bwrap//&xdg-dbus-proxy, | ||
@{lib}/** Px -> bwrap//&bwrap-app, | ||
/opt/*/** Px -> bwrap//&bwrap-app, | ||
/usr/share/*/* Px -> bwrap//&bwrap-app, | ||
|
||
/usr/.ref rk, | ||
|
||
/bindfile@{rand6} rw, | ||
/newroot/{,**} rw, | ||
/tmp/newroot/ w, | ||
/tmp/oldroot/ w, | ||
|
||
owner /var/cache/ w, | ||
|
||
owner @{run}/ld-so-cache-dir/* rw, | ||
|
||
@{PROC}/sys/kernel/overflowgid r, | ||
@{PROC}/sys/kernel/overflowuid r, | ||
@{PROC}/sys/user/max_user_namespaces w, | ||
owner @{PROC}/@{pid}/gid_map rw, | ||
owner @{PROC}/@{pid}/setgroups rw, | ||
owner @{PROC}/@{pid}/uid_map rw, | ||
|
||
include if exists <usr/bwrap.d> | ||
include if exists <local/bwrap> | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# apparmor.d - Full set of apparmor profiles | ||
# Copyright (C) 2023 Alexandre Pujol <[email protected]> | ||
# SPDX-License-Identifier: GPL-2.0-only | ||
|
||
# Default profile for user sandboxed application | ||
|
||
abi <abi/3.0>, | ||
|
||
include <tunables/global> | ||
|
||
profile bwrap-app flags=(attach_disconnected,mediate_deleted) { | ||
include <abstractions/base> | ||
include <abstractions/bwrap-app> | ||
include <abstractions/fontconfig-cache-write> | ||
|
||
network inet dgram, | ||
network inet6 dgram, | ||
network inet stream, | ||
network inet6 stream, | ||
network netlink raw, | ||
|
||
ptrace peer=bwrap//&bwrap-app, | ||
|
||
signal peer=bwrap//&bwrap-app, | ||
|
||
@{bin}/** rmix, | ||
@{lib}/** rmix, | ||
/opt/*/** rmix, | ||
/usr/share/*/* rmix, | ||
|
||
owner /var/cache/ w, | ||
|
||
include if exists <usr/bwrap-app.d> | ||
include if exists <local/bwrap-app> | ||
} |
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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