apparmor.d/profiles/sddm-xsession
2021-04-01 16:17:47 +01:00

137 lines
2.8 KiB
Plaintext

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2019-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /etc/sddm/Xsession
profile sddm-xsession @{exec_path} {
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/nameservice-strict>
include <abstractions/bash>
@{exec_path} r,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/rm rix,
/{usr/,}bin/touch rix,
/{usr/,}bin/{,e}grep rix,
/{usr/,}bin/cat rix,
/{usr/,}bin/which rix,
/{usr/,}bin/id rix,
/{usr/,}bin/chmod rix,
/{usr/,}bin/date rix,
/{usr/,}bin/gawk rix,
/{usr/,}bin/tempfile rix,
/{usr/,}bin/mktemp rix,
/{usr/,}bin/ r,
/{usr/,}bin/zsh rix,
/{usr/,}bin/tcsh rix,
/{usr/,}bin/csh rix,
/{usr/,}bin/fish rix,
/usr/local/bin/ r,
/etc/X11/Xsession rPx,
/{usr/,}bin/dbus-update-activation-environment rCx -> dbus,
/{usr/,}bin/gpgconf rCx -> gpg,
/{usr/,}bin/run-parts rCx -> run-parts,
/{usr/,}bin/udevadm rCx -> udevadm,
/{usr/,}bin/flatpak rPUx,
/{usr/,}bin/xrdb rPx,
/{usr/,}bin/numlockx rPx,
/{usr/,}bin/xhost rPx,
# Allowed GUI sessions to start
#/{usr/,}bin/openbox-session rPx,
#/{usr/,}bin/openbox rPx,
/{usr/,}bin/ssh-agent rPx,
owner /tmp/xsess-env-* rw,
owner /tmp/file* rw,
/etc/default/{,*} r,
/etc/X11/{,**} r,
owner @{PROC}/@{pid}/loginuid r,
# Xsession logs
owner @{HOME}/.local/share/sddm/xorg-session.log w,
owner @{HOME}/.xsession-errors w,
/etc/zsh/* r,
profile run-parts {
include <abstractions/base>
/{usr/,}bin/run-parts mr,
/etc/X11/Xsession.d/ r,
/etc/X11/Xresources/ r,
# file_inherit
owner @{HOME}/.xsession-errors w,
}
profile dbus {
include <abstractions/base>
/{usr/,}bin/dbus-update-activation-environment mr,
# file_inherit
owner @{HOME}/.xsession-errors w,
}
profile gpg {
include <abstractions/base>
/{usr/,}bin/gpgconf mr,
/{usr/,}bin/gpg-agent rix,
owner @{HOME}/.gnupg/ rw,
owner @{HOME}/.gnupg/** rwkl -> @{HOME}/.gnupg/**,
@{PROC}/@{pid}/fd/ r,
}
profile udevadm {
include <abstractions/base>
/{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]* r,
@{sys}/bus/ r,
@{sys}/bus/*/devices/ r,
@{sys}/class/ r,
@{sys}/class/*/ r,
@{sys}/devices/**/uevent r,
@{run}/udev/data/* r,
}
include if exists <local/sddm-xsession>
}