2021-04-01 17:17:47 +02:00
|
|
|
# apparmor.d - Full set of apparmor profiles
|
|
|
|
# Copyright (C) 2017-2021 Mikhail Morfikov
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
abi <abi/3.0>,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include <tunables/global>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{exec_path} = /{usr/,}bin/xinit
|
|
|
|
profile xinit @{exec_path} {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/nameservice-strict>
|
|
|
|
include <abstractions/deny-root-dir-access>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{exec_path} mr,
|
|
|
|
|
|
|
|
signal (receive) set=(usr1) peer=xorg,
|
|
|
|
|
|
|
|
signal (send) set=(term, kill) peer=xorg,
|
|
|
|
signal (send) set=(hup),
|
|
|
|
|
|
|
|
/etc/X11/xinit/xinitrc rix,
|
|
|
|
/etc/X11/xinit/xserverrc rix,
|
|
|
|
|
2020-12-09 10:30:52 +01:00
|
|
|
/{usr/,}bin/ r,
|
2020-09-12 17:19:23 +02:00
|
|
|
/{usr/,}bin/rm rix,
|
|
|
|
/{usr/,}bin/touch rix,
|
|
|
|
/{usr/,}bin/{,e}grep rix,
|
|
|
|
/{usr/,}bin/sed rix,
|
|
|
|
/{usr/,}bin/which rix,
|
|
|
|
/{usr/,}bin/cat rix,
|
|
|
|
/{usr/,}bin/tempfile rix,
|
|
|
|
/{usr/,}bin/date rix,
|
|
|
|
/{usr/,}bin/chmod rix,
|
|
|
|
/{usr/,}bin/head rix,
|
|
|
|
/{usr/,}bin/gawk rix,
|
|
|
|
/{usr/,}bin/id rix,
|
2020-10-13 16:47:49 +02:00
|
|
|
/{usr/,}bin/tail rix,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
/{usr/,}bin/dbus-update-activation-environment rix,
|
|
|
|
|
|
|
|
/{usr/,}bin/gpgconf rCx -> gpg,
|
|
|
|
/{usr/,}bin/run-parts rCx -> run-parts,
|
|
|
|
/{usr/,}bin/udevadm rCx -> udevadm,
|
|
|
|
|
|
|
|
/{usr/,}bin/xrdb rPx,
|
|
|
|
/{usr/,}bin/numlockx rPx,
|
|
|
|
/{usr/,}bin/xhost rPx,
|
|
|
|
/{usr/,}bin/glxinfo rPx,
|
|
|
|
/{usr/,}bin/flatpak rPUx,
|
|
|
|
|
|
|
|
# Allowed GUI sessions to start
|
|
|
|
/{usr/,}bin/openbox-session rPx,
|
|
|
|
/{usr/,}bin/enlightenment_start rPUx,
|
|
|
|
/{usr/,}bin/sway rPUx,
|
|
|
|
/{usr/,}bin/ssh-agent rPx,
|
|
|
|
|
|
|
|
owner /tmp/file* rw,
|
|
|
|
|
|
|
|
/{usr/,}bin/X rPx,
|
|
|
|
/{usr/,}bin/Xorg rPx,
|
|
|
|
|
|
|
|
/etc/X11/{,**} r,
|
|
|
|
|
|
|
|
/etc/default/{,*} r,
|
|
|
|
|
|
|
|
# Xsession logs
|
2020-12-09 10:30:52 +01:00
|
|
|
owner @{HOME}/ r,
|
2020-09-12 17:19:23 +02:00
|
|
|
owner @{HOME}/.xsession-errors w,
|
|
|
|
|
|
|
|
owner @{HOME}/.Xauthority r,
|
|
|
|
|
|
|
|
|
|
|
|
profile run-parts {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
/{usr/,}bin/run-parts mr,
|
|
|
|
|
|
|
|
/etc/X11/Xsession.d/ r,
|
|
|
|
/etc/X11/Xresources/ r,
|
|
|
|
|
|
|
|
# file_inherit
|
|
|
|
owner /dev/tty[0-9]* rw,
|
|
|
|
owner @{HOME}/.xsession-errors w,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
profile gpg {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
/{usr/,}bin/gpgconf mr,
|
|
|
|
|
|
|
|
/{usr/,}bin/gpg-agent rix,
|
|
|
|
|
|
|
|
owner @{HOME}/.gnupg/ rw,
|
|
|
|
owner @{HOME}/.gnupg/** rwkl -> @{HOME}/.gnupg/**,
|
|
|
|
|
|
|
|
@{PROC}/@{pid}/fd/ r,
|
|
|
|
|
|
|
|
# file_inherit
|
|
|
|
owner /dev/tty[0-9]* rw,
|
|
|
|
owner @{HOME}/.xsession-errors w,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
profile udevadm {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
/{usr/,}bin/udevadm mr,
|
|
|
|
|
|
|
|
/etc/udev/udev.conf r,
|
|
|
|
|
|
|
|
owner @{PROC}/@{pid}/stat r,
|
|
|
|
@{PROC}/cmdline r,
|
|
|
|
@{PROC}/1/sched r,
|
|
|
|
@{PROC}/1/environ r,
|
|
|
|
@{PROC}/sys/kernel/osrelease r,
|
|
|
|
|
|
|
|
@{sys}/firmware/efi/efivars/SecureBoot-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]* r,
|
|
|
|
|
|
|
|
@{sys}/bus/ r,
|
|
|
|
@{sys}/bus/*/devices/ r,
|
|
|
|
@{sys}/class/ r,
|
|
|
|
@{sys}/class/*/ r,
|
|
|
|
@{sys}/devices/**/uevent r,
|
2020-10-25 10:23:34 +01:00
|
|
|
@{run}/udev/data/* r,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# file_inherit
|
|
|
|
owner /dev/tty[0-9]* rw,
|
|
|
|
owner @{HOME}/.xsession-errors w,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/xinit>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|