# apparmor.d - Full set of apparmor profiles # Copyright (C) 2021 Alexandre Pujol # Copyright (C) 2022 Jeroen Rijken # SPDX-License-Identifier: GPL-2.0-only abi , include @{exec_path} = /{usr/,}lib/systemd/systemd-logind profile systemd-logind @{exec_path} flags=(attach_disconnected,complain) { include include include include include include capability chown, capability dac_override, capability dac_read_search, capability fowner, capability sys_admin, capability sys_tty_config, network netlink raw, dbus (send,receive) bus=system path=/org/freedesktop/login[0-9]{,/**} interface=org.freedesktop.{DBus.Properties,DBus.Introspectable,login[0-9].*}, dbus (send,receive) bus=system path=/org/freedesktop/systemd[0-9] interface=org.freedesktop.systemd[0-9].Manager member={StartUnit,StartTransientUnit,Subscribe,JobRemoved,UnitRemoved,Reloading,Subscribe,StopUnit}, dbus (send,receive) bus=system path=/org/freedesktop/systemd[0-9]/{unit,job}/** interface=org.freedesktop.DBus.Properties member={Get,PropertiesChanged}, dbus send bus=system path=/org/freedesktop/DBus interface=org.freedesktop.DBus member={GetConnectionCredentials,GetConnectionUnixProcessID,GetConnectionUnixUser,RequestName}, dbus send bus=system path=/org/freedesktop/PolicyKit[0-9]/Authority interface=org.freedesktop.PolicyKit[0-9].Authority member=CheckAuthorization, dbus send bus=system path=/org/freedesktop/systemd[0-9]/unit/** interface=org.freedesktop.systemd[0-9].Scope member=Abandon, dbus receive bus=system path=/org/freedesktop/systemd[0-9] interface=org.freedesktop.DBus.Properties member=PropertiesChanged, dbus receive bus=system path=/ interface=org.freedesktop.DBus.Properties member=Get, dbus bind bus=system name=org.freedesktop.login[0-9], @{exec_path} mr, /etc/machine-id r, /etc/systemd/logind.conf r, /etc/systemd/sleep.conf r, /swapfile r, /boot/{,**} r, /var/lib/systemd/linger/ r, @{run}/.#nologin* rw, @{run}/host/container-manager r, @{run}/nologin rw, @{run}/utmp rk, @{run}/udev/tags/master-of-seat/ r, @{run}/udev/tags/power-switch/ r, @{run}/udev/tags/uaccess/ r, @{run}/udev/static_node-tags/uaccess/ r, @{run}/udev/data/+backlight:intel_backlight r, @{run}/udev/data/+drm:card[0-9]-* r, # for screen outputs @{run}/udev/data/+input* r, # for mouse, keyboard, touchpad @{run}/udev/data/+pci* r, @{run}/udev/data/c10:[0-9]* r, @{run}/udev/data/c116:[0-9]* r, # for ALSA @{run}/udev/data/c13:[0-9]* r, # for /dev/input/* @{run}/udev/data/c21:[0-9]* r, @{run}/udev/data/c226:[0-9]* r, # for /dev/dri/card* @{run}/udev/data/c21:[0-9]* r, @{run}/udev/data/c23[0-9]:[0-9]* r, @{run}/udev/data/c24[0-9]:[0-9]* r, @{run}/udev/data/c29:[0-9]* r, @{run}/udev/data/c50[0-9]:[0-9]* r, @{run}/udev/data/c51[0-9]:[0-9]* r, @{run}/systemd/inhibit/ rw, @{run}/systemd/inhibit/.#* rw, @{run}/systemd/inhibit/[0-9]*{,.ref} rw, @{run}/systemd/journal/socket rw, @{run}/systemd/notify rw, @{run}/systemd/seats/ rw, @{run}/systemd/seats/.#seat* rw, @{run}/systemd/seats/seat[0-9]* rw, @{run}/systemd/sessions/{,*} rw, @{run}/systemd/sessions/*.ref rw, @{run}/systemd/shutdown/.#scheduled* rw, @{run}/systemd/shutdown/scheduled rw, @{run}/systemd/users/ rw, @{run}/systemd/users/.#* rw, @{run}/systemd/users/@{uid} rw, @{sys}/class/drm/ r, @{sys}/devices/** r, @{sys}/devices/**/brightness rw, @{sys}/devices/virtual/tty/tty[0-9]*/active r, @{sys}/firmware/efi/efivars/LoaderEntries-@{uuid} r, @{sys}/firmware/efi/efivars/LoaderFeatures-@{uuid} r, @{sys}/firmware/efi/efivars/OsIndications-@{uuid} r, @{sys}/firmware/efi/efivars/OsIndicationsSupported-@{uuid} r, @{sys}/fs/cgroup/memory.max r, @{sys}/fs/cgroup/memory/memory.limit_in_bytes r, @{sys}/module/vt/parameters/default_utf8 r, @{sys}/power/{state,resume_offset,resume,disk} r, @{PROC}/@{pid}/cgroup r, @{PROC}/@{pid}/comm r, @{PROC}/@{pid}/fd/ r, @{PROC}/@{pid}/mountinfo r, @{PROC}/@{pid}/sessionid r, @{PROC}/@{pid}/stat r, @{PROC}/1/cmdline r, @{PROC}/swaps r, @{PROC}/sysvipc/{shm,sem,msg} r, /dev/dri/card[0-9]* rw, /dev/input/event[0-9]* rw, # Input devices (keyboard, mouse, etc) /dev/mqueue/ r, /dev/shm/{,**/} rw, /dev/tty[0-9]* rw, include if exists }