General profiles update.

This commit is contained in:
Alexandre Pujol 2021-04-29 21:02:28 +01:00
parent 559020861b
commit 0c494ed2ba
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
31 changed files with 61 additions and 36 deletions

View File

@ -9,12 +9,15 @@
# Allow to receive some signals
signal (receive) peer=top,
signal (receive) peer=htop,
signal (receive) set=(term,cont) peer=systemd,
signal (receive) set=(term,kill,stop,cont) peer=systemd-shutdown,
signal (receive) set=(term,kill) peer=openbox,
signal (receive) set=(hup) peer=xinit,
signal (receive) set=(term,kill) peer=su,
signal (receive) peer=sudo,
ptrace (readby) peer=systemd-coredump,
# Allow to write a user defined fifo log devices
owner /dev/log-xsession w,
owner /dev/log-gnupg w,

View File

@ -18,6 +18,8 @@ profile accounts-daemon @{exec_path} {
capability sys_ptrace,
deny capability sys_nice,
ptrace (read) peer=unconfined,
@{exec_path} mr,
owner /var/lib/AccountsService/ r,

View File

@ -10,6 +10,9 @@ include <tunables/global>
profile glib-compile-schemas @{exec_path} {
include <abstractions/base>
network inet stream,
network inet6 stream,
@{exec_path} mr,
/usr/share/glib-2.0/schemas/{,*} r,

View File

@ -24,11 +24,14 @@ profile gdm-session-worker @{exec_path} flags=(attach_disconnected) {
capability sys_nice,
capability sys_tty_config,
signal (send) set=hup peer=gsd-*,
signal (receive) set=term peer=gdm,
signal (send) set=hup peer=dbus-daemon,
signal (send) set=hup peer=gjs-console,
signal (send) set=hup peer=gnome-*,
signal (send) set=hup peer=gsd-*,
signal (send) set=hup peer=ibus-*,
signal (send) set=hup peer=xwayland,
signal (send) set=term peer=gdm-wayland-session,
signal (receive) set=term peer=gdm,
network netlink raw,

View File

@ -13,8 +13,8 @@ profile gnome-session-binary @{exec_path} flags=(attach_disconnected) {
include <abstractions/nameservice-strict>
signal (send) set=(term) peer=gsd-*,
signal (receive) set=(term, hup) peer=gdm*,
signal (receive) set=(term) peer=gdm-wayland-session,
signal (receive) set=(term) peer=gdm,
@{exec_path} mr,

View File

@ -10,7 +10,7 @@ include <tunables/global>
profile gsd-a11y-settings @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
signal (receive) set=term peer=gdm,
signal (receive) set=(term, hup) peer=gdm*,
@{exec_path} mr,

View File

@ -12,7 +12,7 @@ profile gsd-color @{exec_path} flags=(attach_disconnected) {
include <abstractions/fonts>
include <abstractions/gtk>
signal (receive) set=term peer=gdm,
signal (receive) set=(term, hup) peer=gdm*,
@{exec_path} mr,

View File

@ -10,7 +10,7 @@ include <tunables/global>
profile gsd-datetime @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
signal (receive) set=term peer=gdm,
signal (receive) set=(term, hup) peer=gdm*,
@{exec_path} mr,

View File

@ -11,7 +11,7 @@ profile gsd-housekeeping @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
include <abstractions/thumbnails-cache-read>
signal (receive) set=term peer=gdm,
signal (receive) set=(term, hup) peer=gdm*,
@{exec_path} mr,

View File

@ -12,7 +12,7 @@ profile gsd-keyboard @{exec_path} flags=(attach_disconnected) {
include <abstractions/fonts>
include <abstractions/gtk>
signal (receive) set=term peer=gdm,
signal (receive) set=(term, hup) peer=gdm*,
@{exec_path} mr,

View File

@ -13,7 +13,7 @@ profile gsd-media-keys @{exec_path} flags=(attach_disconnected) {
include <abstractions/fonts>
include <abstractions/gtk>
signal (receive) set=term peer=gdm,
signal (receive) set=(term, hup) peer=gdm*,
network netlink raw,

View File

@ -15,7 +15,7 @@ profile gsd-power @{exec_path} flags=(attach_disconnected) {
network netlink raw,
signal (receive) set=term peer=gdm,
signal (receive) set=(term, hup) peer=gdm*,
@{exec_path} mr,

View File

@ -14,7 +14,7 @@ profile gsd-print-notifications @{exec_path} flags=(attach_disconnected) {
network inet stream,
network inet6 stream,
signal (receive) set=term peer=gdm,
signal (receive) set=(term, hup) peer=gdm*,
signal (send) set=(hup) peer=gsd-printer,
@{exec_path} mr,

View File

@ -10,7 +10,7 @@ include <tunables/global>
profile gsd-printer @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
signal (receive) set=term peer=gdm,
signal (receive) set=(term, hup) peer=gdm*,
signal (receive) set=(hup) peer=gsd-print-notifications,
@{exec_path} mr,

View File

@ -10,7 +10,7 @@ include <tunables/global>
profile gsd-rfkill @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
signal (receive) set=term peer=gdm,
signal (receive) set=(term, hup) peer=gdm*,
network netlink raw,

View File

@ -10,7 +10,7 @@ include <tunables/global>
profile gsd-screensaver-proxy @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
signal (receive) set=term peer=gdm,
signal (receive) set=(term, hup) peer=gdm*,
@{exec_path} mr,

View File

@ -10,7 +10,7 @@ include <tunables/global>
profile gsd-sharing @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
signal (receive) set=term peer=gdm,
signal (receive) set=(term, hup) peer=gdm*,
@{exec_path} mr,

View File

@ -10,7 +10,7 @@ include <tunables/global>
profile gsd-smartcard @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
signal (receive) set=term peer=gdm,
signal (receive) set=(term, hup) peer=gdm*,
@{exec_path} mr,

View File

@ -10,7 +10,7 @@ include <tunables/global>
profile gsd-sound @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
signal (receive) set=term peer=gdm,
signal (receive) set=(term, hup) peer=gdm*,
@{exec_path} mr,

View File

@ -13,7 +13,7 @@ profile gsd-wacom @{exec_path} flags=(attach_disconnected) {
include <abstractions/fonts>
include <abstractions/gtk>
signal (receive) set=term peer=gdm,
signal (receive) set=(term, hup) peer=gdm*,
@{exec_path} mr,

View File

@ -28,6 +28,8 @@ profile tracker-extract @{exec_path} {
owner @{MOUNTS}/*/{,**} r,
owner /tmp/*/{,**} r,
owner @{PROC}/@{pid}/fd/ r,
include <abstractions/dconf>
owner @{run}/user/@{uid}/dconf/ rw,
owner @{run}/user/@{uid}/dconf/user rw,

View File

@ -13,6 +13,9 @@ profile pacdiff @{exec_path} {
capability dac_read_search,
capability mknod,
network inet stream,
network inet6 stream,
@{exec_path} mr,
/{usr/,}bin/pacman-conf rPx,

View File

@ -10,6 +10,9 @@ include <tunables/global>
profile pacman-conf @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
network inet stream,
network inet6 stream,
@{exec_path} mr,
/etc/pacman.conf r,

View File

@ -18,8 +18,8 @@ profile child-systemctl {
include <abstractions/consoles>
include <abstractions/wutmp>
capability sys_ptrace,
capability net_admin,
capability sys_ptrace,
ptrace (read),

View File

@ -27,7 +27,7 @@ profile systemd-machined @{exec_path} flags=(complain) {
/etc/machine-id r,
@{run}/systemd/machines/{,**} r,
@{run}/systemd/machines/{,**} rw,
@{run}/systemd/userdb/io.systemd.Machine rw,
include if exists <local/systemd-machined>

View File

@ -21,6 +21,8 @@ profile adb @{exec_path} {
@{exec_path} mrix,
/usr/share/scrcpy/scrcpy-server r,
owner /tmp/adb.[0-9]*.log rw,
owner @{HOME}/.android/ rw,

View File

@ -1,5 +1,6 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2018-2021 Mikhail Morfikov
# 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
@ -11,14 +12,13 @@ profile polkitd @{exec_path} {
include <abstractions/base>
include <abstractions/nameservice-strict>
# Tu run as polkitd:nogroup
capability setuid,
capability setgid,
# Needed?
capability sys_ptrace,
audit deny capability net_admin,
ptrace (read) peer=unconfined,
@{exec_path} mr,
@{PROC}/@{pids}/stat r,

View File

@ -1,5 +1,6 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2018-2021 Mikhail Morfikov
# 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
@ -12,19 +13,12 @@ profile rtkit-daemon @{exec_path} {
include <abstractions/base>
include <abstractions/nameservice-strict>
# To raise process nice and set scheduling policies (real-time) and priorities
capability sys_nice,
# To chroot /proc/
capability sys_chroot,
# To run daemon as rtkit:rtkit
capability dac_read_search,
capability setgid,
capability setuid,
# The two are visible in systemd service, but it doesn't seem they're needed
#capability dac_read_search,
#capability sys_ptrace,
capability sys_chroot,
capability sys_nice,
capability sys_ptrace,
@{exec_path} mr,

View File

@ -1,5 +1,6 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2020-2021 Mikhail Morfikov
# 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
@ -12,5 +13,13 @@ profile udisksctl @{exec_path} {
@{exec_path} mr,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/pager rPx -> child-pager,
/{usr/,}bin/less rPx -> child-pager,
/{usr/,}bin/more rPx -> child-pager,
/dev/tty rw,
include if exists <local/udisksctl>
}

View File

@ -23,6 +23,7 @@ profile udisksd @{exec_path} flags=(attach_disconnected) {
# Error mounting /dev/sd* at /media/*/*: Operation not permitted.
capability sys_admin,
capability chown,
capability dac_read_search,
capability dac_override,

View File

@ -7,7 +7,7 @@ abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}bin/xdg-open
profile xdg-open @{exec_path} {
profile xdg-open @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/app-launcher-user>