General update

Signed-off-by: Jeroen Rijken <jeroen.rijken@xs4all.nl>
This commit is contained in:
Jeroen Rijken 2024-02-11 15:37:24 +01:00 committed by Alex
parent 40b171ee94
commit 4c5a21145a
26 changed files with 227 additions and 15 deletions

View file

@ -16,6 +16,7 @@
# Files explorer
@{bin}/nautilus rPx,
@{bin}/dolphin rPx,
# Browsers
@{bin}/chromium rPx,

View file

@ -14,7 +14,12 @@
dbus send bus=system path=/org/freedesktop/NetworkManager
interface=org.freedesktop.NetworkManager
member=GetPermissions
member={GetDevices,GetPermissions}
peer=(name=:*, label=NetworkManager),
dbus send bus=system path=/org/freedesktop/NetworkManager/Settings
interface=org.freedesktop.NetworkManager.Settings
member=ListConnections
peer=(name=:*, label=NetworkManager),
dbus send bus=system path=/org/freedesktop/NetworkManager/Settings/@{int}
@ -22,6 +27,16 @@
member=GetSettings
peer=(name=:*, label=NetworkManager),
dbus send bus=system path=/org/freedesktop/NetworkManager/ActiveConnection/@{int}
interface=org.freedesktop.DBus.Properties
member=GetAll
peer=(name=:*, label=NetworkManager),
dbus send bus=system path=/org/freedesktop/NetworkManager/Devices/@{int}
interface=org.freedesktop.DBus.Properties
member=GetAll
peer=(name=:*, label=NetworkManager),
dbus receive bus=system path=/org/freedesktop/NetworkManager{,/**}
interface=org.freedesktop.DBus.Properties
member=PropertiesChanged

View file

@ -15,10 +15,11 @@
dbus send bus=system path=/org/freedesktop/UPower/devices/DisplayDevice
interface=org.freedesktop.DBus.Properties
member={Get,GetAll}
peer=(name=org.freedesktop.UPower, label=upowerd),
dbus send bus=system path=/org/freedesktop/UPower/devices/DisplayDevice
peer=(name=:*, label=upowerd),
dbus receive bus=system path=/org/freedesktop/UPower/devices/{mouse_hidpp_battery_0,battery_BAT0}
interface=org.freedesktop.DBus.Properties
member={Get,GetAll}
member=PropertiesChanged
peer=(name=:*, label=upowerd),
include if exists <abstractions/bus/org.freedesktop.UPower.d>

View file

@ -14,10 +14,12 @@ profile apt-overlay @{exec_path} {
@{exec_path} mr,
@{bin}/apt rPx,
@{bin}/apt-get rPx,
@{bin}/ruby* mrix,
@{bin}/apt-overlay r,
owner @{bin}/env r,
@{lib}/ruby/{,**} r,
@{lib}/locale/locale-archive r,

View file

@ -0,0 +1,21 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Jeroen Rijken <jeroen.rijken@xs4all.nl>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /etc/cron.{hourly,daily,weekly,monthly}/ntp
profile cron-ntp @{exec_path} {
include <abstractions/base>
@{exec_path} r,
@{shells_path} rix,
@{bin}/cat rix,
@{bin}/grep rix,
@{bin}/sed rix,
include if exists <local/cron-ntp>
}

View file

@ -9,6 +9,7 @@ include <tunables/global>
@{exec_path} = @{bin}/plymouth
profile plymouth @{exec_path} {
include <abstractions/base>
include <abstractions/fonts>
include <abstractions/consoles>
unix (send, receive, connect) type=stream peer=(addr="@/org/freedesktop/plymouthd"),

View file

@ -9,6 +9,7 @@ include <tunables/global>
@{exec_path} = @{lib}/xdg-desktop-portal
profile xdg-desktop-portal @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
include <abstractions/app-open>
include <abstractions/bus-session>
include <abstractions/bus-system>
include <abstractions/bus/net.hadess.PowerProfiles>

View file

@ -9,6 +9,8 @@ include <tunables/global>
@{exec_path} = @{lib}/kauth/{,libexec/}backlighthelper
profile kauth-backlighthelper @{exec_path} {
include <abstractions/base>
include <abstractions/bus-system>
include <abstractions/bus/org.freedesktop.PolicyKit1>
include <abstractions/nameservice-strict>
include <abstractions/qt5>
@ -26,8 +28,10 @@ profile kauth-backlighthelper @{exec_path} {
@{sys}/devices/@{pci}/drm/card@{int}/**/{max_brightness,actual_brightness} r,
@{sys}/devices/@{pci}/drm/card@{int}/**/{uevent,type,enabled} r,
@{sys}/devices/@{pci}/drm/card@{int}/**/brightness rw,
@{sys}/devices/@{pci}/intel_backlight/{max_,}brightness rw,
@{sys}/devices/@{pci}/intel_backlight/type r,
/dev/tty r,
include if exists <local/kauth-backlighthelper>
}
}

View file

@ -30,6 +30,7 @@ profile kcminit @{exec_path} {
owner @{user_config_dirs}/kdedefaults/kcminputrc r,
owner @{user_config_dirs}/kgammarc r,
owner @{user_config_dirs}/touchpadrc r,
owner @{user_config_dirs}/touchpadxlibinputrc r,
owner @{user_config_dirs}/Trolltech.conf.lock rwk,
owner @{user_config_dirs}/Trolltech.conf{,.@{rand6}} rwl,
@ -39,6 +40,8 @@ profile kcminit @{exec_path} {
owner /tmp/.touchpaddefaults wl,
owner /tmp/.touchpaddefaults.lock rwk,
@{run}/user/@{uid}/xauth_@{rand6} rl,
@{PROC}/sys/kernel/random/boot_id r,
/dev/tty r,

View file

@ -14,6 +14,9 @@ profile kded5 @{exec_path} {
include <abstractions/bus/org.bluez>
include <abstractions/consoles>
include <abstractions/dconf-write>
include <abstractions/bus/org.bluez>
include <abstractions/bus/org.freedesktop.NetworkManager>
include <abstractions/bus/org.freedesktop.PolicyKit1>
include <abstractions/graphics>
include <abstractions/gtk>
include <abstractions/kde-strict>
@ -29,16 +32,42 @@ profile kded5 @{exec_path} {
signal (send) set=hup peer=xsettingsd,
dbus receive bus=system path=/org/freedesktop/NetworkManager/SecretAgent
interface=org.freedesktop.NetworkManager.SecretAgent
member=CancelGetSecrets
peer=(label=NetworkManager),
dbus receive bus=system path=/org/freedesktop/NetworkManager/SecretAgent
interface=org.freedesktop.NetworkManager.SecretAgent
member=CancelGetSecrets
peer=(label=NetworkManager),
dbus receive bus=system path=/org/freedesktop/NetworkManager/AccessPoint/@{int}
interface=org.freedesktop.DBus.Properties
member=PropertiesChanged
peer=(label=NetworkManager),
dbus receive bus=system path=/org/freedesktop/NetworkManager/Devices/@{int}
interface=org.freedesktop.DBus.Properties
member={PropertiesChanged,AccessPointAdded,AccessPointRemoved}
peer=(label=NetworkManager),
dbus send bus=system path=/org/freedesktop/NetworkManager/AgentManager
interface=org.freedesktop.NetworkManager.AgentManager
peer=(label=NetworkManager),
@{exec_path} mrix,
@{bin}/kcminit rPx,
@{bin}/pgrep rCx -> pgrep,
@{bin}/python3.@{int} rix,
@{bin}/setxkbmap rix,
@{bin}/xrdb rPx,
@{bin}/xsettingsd rPx,
@{lib}/drkonqi rPx,
@{lib}/kf5/kconf_update rPx,
@{lib}/utempter/utempter rPx,
@{lib}/{,@{multiarch}/}libexec/kf5/kconf_update rPx,
@{lib}/{,@{multiarch}/}utempter/utempter rPx,
/usr/share/kconf_update/ r,
/usr/share/kded5/{,**} r,
@ -113,6 +142,7 @@ profile kded5 @{exec_path} {
owner /tmp/plasma-csd-generator.@{rand6}/{,**} rw,
@{PROC}/ r,
@{PROC}/@{pids}/cmdline/ r,
@{PROC}/@{pids}/fd/ r,
@{PROC}/@{pids}/fd/info/@{int} r,

View file

@ -0,0 +1,67 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Jeroen Rijken
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/konsole
profile konsole @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
include <abstractions/audio>
include <abstractions/bus-accessibility>
include <abstractions/bus-session>
include <abstractions/consoles>
include <abstractions/dri>
include <abstractions/kde-strict>
include <abstractions/nameservice-strict>
include <abstractions/ubuntu-xterm>
ptrace (read),
signal (send) set=(hup),
@{exec_path} mr,
@{bin}/@{shells} rUx,
@{lib}/@{multiarch}/utempter/utempter rPUx,
/usr/share/color-schemes/{,**} r,
/usr/share/konsole/{,**} r,
/etc/xdg/konsolerc r,
/etc/xdg/ui/ui_standards.rc r,
owner @{HOME}/@{XDG_SSH_DIR}/config r,
owner @{user_config_dirs}/#@{int} rwl,
owner @{user_config_dirs}/konsolerc{,**} rw,
owner @{user_config_dirs}/konsolerc.@{rand6} rwl,
owner @{user_config_dirs}/konsolerc.lock rwlk,
owner @{user_config_dirs}/konsolesshconfig rw,
owner @{user_config_dirs}/konsolesshconfig.@{rand6} rwl,
owner @{user_config_dirs}/konsolesshconfig.lock rwk,
owner @{user_config_dirs}/konsolerc.@{rand6} rwl,
owner @{user_cache_dirs}/icon-cache.kcache rw,
owner @{user_cache_dirs}/mesa_shader_cache/index rw,
owner @{user_share_dirs}/konsole/{,**} rw,
# Required including abstractions/audio for sending notifications
/usr/share/knotifications5/plasma_workspace.notifyrc r,
/usr/share/sounds/** r,
owner /tmp/#@{int} rw,
owner /tmp/konsole.@{rand6} rw,
@{sys}/devices/system/node/ r,
@{sys}/devices/system/node/node@{int}/meminfo r,
owner @{PROC}/@{pid}/cmdline r,
owner @{PROC}/@{pid}/stat r,
@{PROC}/sys/dev/i915/perf_stream_paranoid r,
@{PROC}/sys/kernel/core_pattern r,
include if exists <local/konsole>
}

View file

@ -11,6 +11,7 @@ include <tunables/global>
@{exec_path} += @{lib}/@{multiarch}/libexec/kscreenlocker_greet
profile kscreenlocker-greet @{exec_path} {
include <abstractions/base>
include <abstractions/bus/org.freedesktop.UPower>
include <abstractions/fontconfig-cache-read>
include <abstractions/graphics>
include <abstractions/kde-strict>

View file

@ -20,10 +20,14 @@ profile ksmserver @{exec_path} flags=(attach_disconnected,mediate_deleted) {
@{bin}/rm rix,
@{lib}/@{multiarch}/libexec/DiscoverNotifier rPx,
@{lib}/@{multiarch}/libexec/kscreenlocker_greet rPx,
@{lib}/DiscoverNotifier rPUx, # TODO: rPx,
@{lib}/drkonqi rPx,
@{lib}/kscreenlocker_greet rPx,
@{lib}/thunderbird/thunderbird.sh rPx,
@{user_bin_dirs}/** rPUx,
/usr/share/color-schemes/{,**} r,
/usr/share/knotifications5/*.notifyrc r,

View file

@ -8,17 +8,27 @@ abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/kstart
profile kstart @{exec_path} flags=(complain,attach_disconnected) {
profile kstart @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
include <abstractions/bus-accessibility>
include <abstractions/dri>
include <abstractions/fontconfig-cache-read>
include <abstractions/kde-strict>
include <abstractions/kde-open5>
include <abstractions/nameservice-strict>
@{exec_path} mr,
@{bin}/** rPUx,
@{bin}/konsole rPx,
@{bin}/konsole rPUx,
/var/lib/flatpak/exports/share/mime/ r,
owner @{user_cache_dirs}/mesa_shader_cache/index rw,
owner @{user_share_dirs}/kservices5/ r,
owner @{user_share_dirs}/kservices5/ServiceMenus/ r,
@{PROC}/sys/dev/i915/perf_stream_paranoid r,
include if exists <local/kstart>
}

View file

@ -50,6 +50,7 @@ profile plasmashell @{exec_path} flags=(mediate_deleted) {
@{bin}/ksysguardd rix,
@{bin}/plasma-discover rPUx,
@{bin}/xrdb rPx,
@{lib}/@{multiarch}/libexec/kf5/kioslave5 rPx,
/usr/share/akonadi/firstrun/{,*} r,
/usr/share/akonadi/plugins/serializer/{,*.desktop} r,

View file

@ -27,6 +27,11 @@ profile sddm-xsession @{exec_path} {
@{bin}/date rix,
@{bin}/fish rix,
@{bin}/id rix,
@{bin}/gpgconf rCx -> gpg,
@{bin}/stat rix,
@{bin}/tail rix,
@{bin}/mv rix,
@{bin}/locale-check rPx,
@{bin}/mktemp rix,
@{bin}/rm rix,
@{bin}/tcsh rix,

View file

@ -16,8 +16,13 @@ profile nm-online @{exec_path} {
interface=org.freedesktop.NetworkManager.Connection.Active
member=StateChanged
peer=(name=:*, label=NetworkManager),
dbus send bus=system path=/org/freedesktop/NetworkManager/Settings/@{int}
interface=org.freedesktop.NetworkManager.Settings.Connection
member=GetSettings
peer=(name=:*, label=NetworkManager),
@{exec_path} mr,
include if exists <local/nm-online>
}
}

View file

@ -0,0 +1,16 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2023 Jeroen Rijken
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/rpcbind
profile rpcbind @{exec_path} flags=(complain) {
include <abstractions/base>
@{exec_path} rm,
include if exists <local/rpcbind>
}

View file

@ -1,6 +1,6 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
# Copyright (C) 2022 Jeroen Rijken
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# Copyright (C) 2024 Jeroen Rijken
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
@ -31,6 +31,11 @@ profile systemd-logind @{exec_path} flags=(attach_disconnected,complain) {
# dbus: talk bus=system name=org.freedesktop.systemd1 label="@{systemd}"
dbus receive bus=system path=/org/freedesktop/login@{int}{,/seat/auto,session/_@{int}}
interface=org.freedesktop.DBus.Introspectable
member=Introspect
peer=(label=ksmserver-logout-greeter),
dbus send bus=system path=/org/freedesktop/systemd1
interface=org.freedesktop.systemd1.Manager
peer=(name=org.freedesktop.systemd1),

View file

@ -10,6 +10,8 @@ include <tunables/global>
profile flatpak @{exec_path} flags=(attach_disconnected,mediate_deleted,complain) {
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/bus-session>
include <abstractions/bus/org.freedesktop.Accounts>
include <abstractions/dconf-write>
include <abstractions/freedesktop.org>
include <abstractions/nameservice-strict>
@ -79,6 +81,7 @@ profile flatpak @{exec_path} flags=(attach_disconnected,mediate_deleted,complain
owner @{run}/user/@{uid}/.flatpak/** rwlk -> @{run}/user/@{uid}/.flatpak/**,
owner @{run}/user/@{uid}/app/ w,
owner @{run}/user/@{uid}/app/*/ w,
owner @{run}/user/@{uid}/systemd/private rw,
@{sys}/module/nvidia/version r,

View file

@ -23,10 +23,14 @@ include <tunables/global>
profile flatpak-app flags=(attach_disconnected,mediate_deleted) {
include <abstractions/base>
include <abstractions/bwrap-app>
include <abstractions/bus-system>
include <abstractions/bus/org.freedesktop.NetworkManager>
capability dac_override,
capability dac_read_search,
capability net_admin,
# When bwrap is setup with setuid privileges, it needs the setuid capability.
capability setuid,
capability setpcap,
capability sys_admin,
capability sys_ptrace,

View file

@ -57,6 +57,7 @@ profile fwupdmgr @{exec_path} flags=(attach_disconnected,complain) {
owner /var/cache/private/fwupdmgr/fwupd/lvfs-metadata.xml.gz{,.asc}.* rw,
owner /var/cache/private/fwupdmgr/fwupd/lvfs-metadata.xml.gz{,.asc} rw,
/var/lib/flatpak/exports/share/mime/mime.cache r,
owner @{user_cache_dirs}/ rw,
@{user_cache_dirs}/dconf/user rw,
@ -67,6 +68,7 @@ profile fwupdmgr @{exec_path} flags=(attach_disconnected,complain) {
owner @{PROC}/@{pid}/fd/ r,
/dev/i2c-@{int} rw,
/dev/tty rw,
profile dbus {

View file

@ -20,10 +20,14 @@ profile im-launch @{exec_path} {
@{bin}/gsettings rPx,
@{bin}/locale rix,
@{bin}/sed rix,
@{bin}/sleep rix,
@{bin}/startplasma-x11 rPx,
@{bin}/true rix,
@{bin}/uim-toolbar-gtk3 rPUx,
@{bin}/uim-xim rPUx,
@{lib}/gnome-session-binary rPx,
@{HOME}/.xsession-errors rw,
/usr/share/im-config/{,**} r,
/etc/default/im-config r,

View file

@ -11,6 +11,7 @@ include <tunables/global>
profile ip @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/nameservice-strict>
capability bpf,
capability net_admin,
@ -19,7 +20,7 @@ profile ip @{exec_path} flags=(attach_disconnected) {
network netlink raw,
mount options=(rw, rshared) -> /{var/,}run/netns/,
mount options=(rw, bind, rshared) -> /{var/,}run/netns/,
mount options=(rw, rslave) -> /,
mount options=(rw, bind) / -> /{var/,}run/netns/*,
mount options=(rw, bind) /etc/netns/firefox/resolv.conf -> /etc/resolv.conf,
@ -36,6 +37,7 @@ profile ip @{exec_path} flags=(attach_disconnected) {
/etc/iproute2/{,**} r,
/etc/netns/*/ r,
owner @{run}/netns/ rwk,
@{run}/netns/* rw,
owner @{run}/netns/ rw,

View file

@ -80,12 +80,13 @@ profile thunderbird @{exec_path} {
# Allowed apps to open
@{bin}/engrampa rPx,
@{bin}/firefox{,.sh,-esr,-bin} rPx,
@{bin}/geany rPx,
@{bin}/qpdfview rPx,
@{bin}/viewnior rPUx,
@{lib}/firefox{,.sh,-esr,-bin}/firefox{,.sh,-esr,-bin} rPx,
/opt/firefox{,.sh,-esr,-bin}/firefox{,.sh,-esr,-bin} rPx,
@{brave_path} rPx,
@{chrome_path} rPx,
@{firefox_path} rPx,
@{opera_path} rPx,
/usr/share/@{name}/{,**} r,
/usr/share/gvfs/remote-volume-monitors/{,*} r,

View file

@ -38,6 +38,9 @@
@{pci_bus}=pci@{h}@{h}@{h}@{h}:@{h}@{h}
@{pci}=@{pci_bus}/**/
# hci devices
@{hci_id}=dev_@{c}@{c}_@{c}@{c}_@{c}@{c}_@{c}@{c}_@{c}@{c}_@{c}@{c}
# Date and time
@{date}=[0-2][0-9][0-9][0-9]-[01][0-9]-[0-3][0-9]
@{time}={[0-2],}[0-9]-[0-5][0-9]-[0-6][0-9]