feat(profile): add some new profile.

This commit is contained in:
Alexandre Pujol 2024-05-07 17:25:43 +01:00
parent 239d5efe63
commit fe1e3c3be8
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
10 changed files with 264 additions and 0 deletions

View File

@ -0,0 +1,26 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/gnome-text-editor
profile gnome-text-editor @{exec_path} {
include <abstractions/base>
include <abstractions/bus/org.freedesktop.FileManager1>
include <abstractions/common/gnome>
include <abstractions/user-read-strict>
include <abstractions/user-write-strict>
@{exec_path} mr,
owner @{user_share_dirs}/org.gnome.TextEditor/{,**} rw,
owner @{PROC}/@{pid}/mountinfo r,
deny @{user_share_dirs}/gvfs-metadata/* r,
include if exists <local/gnome-text-editor>
}

View File

@ -0,0 +1,20 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{lib}/tracker-writeback
profile tracker-writeback @{exec_path} {
include <abstractions/base>
include <abstractions/bus-session>
include <abstractions/gnome-strict>
#aa:dbus own bus=session name=org.freedesktop.Tracker3.Writeback
@{exec_path} mr,
include if exists <local/tracker-writeback>
}

View File

@ -0,0 +1,16 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{lib}/{,gvfs/}gvfsd-wsdd
profile gvfsd-wsdd @{exec_path} {
include <abstractions/base>
@{exec_path} mr,
include if exists <local/gvfsd-wsdd>
}

View File

@ -0,0 +1,20 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/nm-priv-helper
profile nm-priv-helper @{exec_path} {
include <abstractions/base>
capability dac_override,
#aa:dbus own bus=system name=org.freedesktop.nm_priv_helper
@{exec_path} mr,
include if exists <local/nm-priv-helper>
}

View File

@ -0,0 +1,21 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{lib}/systemd/systemd-network-generator
profile systemd-network-generator @{exec_path} {
include <abstractions/base>
include <abstractions/common/systemd>
capability net_admin,
@{exec_path} mr,
owner @{run}/systemd/network/{,**} rw,
include if exists <local/systemd-network-generator>
}

View File

@ -0,0 +1,36 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/alacarte
profile alacarte @{exec_path} {
include <abstractions/base>
include <abstractions/dconf-write>
include <abstractions/desktop>
include <abstractions/python>
@{exec_path} mr,
@{bin}/python3.@{int} rix,
@{lib}/python3.@{int}/site-packages/Alacarte/{,**/}__pycache__/*.cpython-@{int}.*.pyc.@{int} w,
/usr/share/alacarte/{,**} r,
/usr/share/desktop-directories/{,**} r,
/etc/xdg/menus/{,**} r,
owner @{user_config_dirs}/menus/{,**} r,
owner @{user_share_dirs}/applications/{,**} rw,
owner @{user_share_dirs}/desktop-directories/{,**} r,
owner @{tmp}/gdkpixbuf-xpm-tmp.@{rand6} rw,
owner @{PROC}/@{pid}/mounts r,
include if exists <local/alacarte>
}

View File

@ -0,0 +1,32 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/at @{bin}/atq @{bin}/atrm @{bin}/batch
profile at @{exec_path} {
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/nameservice-strict>
capability fsetid,
signal (send) set=(hup) peer=atd,
@{exec_path} mr,
/etc/at.deny r,
/etc/at.allow r,
/var/spool/cron/atjobs/{,*} rwk,
/var/spool/cron/atspool/{,*} rwk,
@{run}/atd.pid r,
@{PROC}/@{pid}/loginuid r,
include if exists <local/at>
}

View File

@ -0,0 +1,63 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/metadata-cleaner
profile metadata-cleaner @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
include <abstractions/dconf-write>
include <abstractions/desktop>
include <abstractions/graphics>
include <abstractions/nameservice-strict>
include <abstractions/python>
include <abstractions/user-read-strict>
include <abstractions/user-write-strict>
@{exec_path} mr,
@{bin}/python3.@{int} rix,
@{bin}/bwrap rCx -> bwrap,
@{open_path} rPx -> child-open-help,
/usr/share/metadata-cleaner/{,**} r,
/usr/share/metadata-cleaner/src/metadatacleaner/{,*/}__pycache__/ w,
/usr/share/poppler/{,**} r,
/etc/httpd/conf/mime.types r,
/etc/mime.types r,
owner @{tmp}/@{hex64}.png r,
owner @{tmp}/@{hex64}.png w,
owner @{tmp}/@{rand8} rw,
owner @{tmp}/tmp@{rand4}_*/{,**} rw,
owner @{tmp}/tmp@{rand8}/{,**} rw,
@{run}/mount/utab r,
owner @{PROC}/@{pid}/cmdline r,
owner @{PROC}/@{pid}/mounts r,
owner @{PROC}/@{pid}/mountinfo r,
deny owner @{user_share_dirs}/gvfs-metadata/* r,
deny owner @{user_cache_dirs}/thumbnails/** r,
profile bwrap flags=(attach_disconnected) {
include <abstractions/base>
include <abstractions/common/bwrap>
include <abstractions/perl>
signal (receive) set=(kill) peer=metadata-cleaner,
@{bin}/bwrap mr,
@{bin}/vendor_perl/exiftool rix,
include if exists <local/metadata-cleaner_bwrap>
}
include if exists <local/metadata-cleaner>
}

View File

@ -0,0 +1,20 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/switcherooctl
profile switcherooctl @{exec_path} {
include <abstractions/base>
include <abstractions/bus-system>
include <abstractions/python>
#aa:dbus own bus=system name=net.hadess.SwitcherooControl
@{exec_path} mr,
include if exists <local/switcherooctl>
}

View File

@ -28,10 +28,12 @@ akonadi_newmailnotifier_agent complain
akonadi_notes_agent complain akonadi_notes_agent complain
akonadi_sendlater_agent complain akonadi_sendlater_agent complain
akonadi_unifiedmailbox_agent complain akonadi_unifiedmailbox_agent complain
alacarte complain
anacron complain anacron complain
appimagelauncherd complain appimagelauncherd complain
apport attach_disconnected,complain apport attach_disconnected,complain
apt-helper complain apt-helper complain
at complain
at-spi-bus attach_disconnected,complain at-spi-bus attach_disconnected,complain
at-spi2-registryd attach_disconnected,complain at-spi2-registryd attach_disconnected,complain
atd complain atd complain
@ -114,6 +116,7 @@ flatpak-portal attach_disconnected,complain
flatpak-session-helper attach_disconnected,complain flatpak-session-helper attach_disconnected,complain
flatpak-system-helper complain flatpak-system-helper complain
flatpak-validate-icon complain flatpak-validate-icon complain
foliate attach_disconnected,complain
fuse-overlayfs complain fuse-overlayfs complain
fusermount complain fusermount complain
gcr-ssh-agent complain gcr-ssh-agent complain
@ -137,6 +140,7 @@ gnome-session complain
gnome-software complain gnome-software complain
gnome-system-monitor attach_disconnected,complain gnome-system-monitor attach_disconnected,complain
gnome-terminal-server complain gnome-terminal-server complain
gnome-text-editor complain
gnome-tweaks complain gnome-tweaks complain
grub-bios-setup complain grub-bios-setup complain
grub-editenv complain grub-editenv complain
@ -170,6 +174,7 @@ gsd-wwan complain
gsettings complain gsettings complain
gvfs-udisks2-volume-monitor attach_disconnected,complain gvfs-udisks2-volume-monitor attach_disconnected,complain
gvfsd-dav complain gvfsd-dav complain
gvfsd-wsdd complain
hostnamectl complain hostnamectl complain
ibus-engine-table complain ibus-engine-table complain
ibus-memconf complain ibus-memconf complain
@ -214,6 +219,7 @@ landscape-sysinfo.wrapper complain
language-validate attach_disconnected,complain language-validate attach_disconnected,complain
last complain last complain
lastlog complain lastlog complain
libreoffice complain
libvirt-dbus complain libvirt-dbus complain
libvirtd attach_disconnected,complain libvirtd attach_disconnected,complain
lightdm attach_disconnected,complain lightdm attach_disconnected,complain
@ -230,6 +236,7 @@ lvmpolld complain
man complain man complain
mate-notification-daemon complain mate-notification-daemon complain
mdevctl complain mdevctl complain
metadata-cleaner attach_disconnected,complain
mke2fs complain mke2fs complain
ModemManager attach_disconnected,complain ModemManager attach_disconnected,complain
mount attach_disconnected,complain mount attach_disconnected,complain
@ -241,6 +248,7 @@ networkctl attach_disconnected,complain
networkd-dispatcher complain networkd-dispatcher complain
nm-online complain nm-online complain
nm-openvpn-service-openvpn-helper complain nm-openvpn-service-openvpn-helper complain
nm-priv-helper complain
nmap complain nmap complain
nmcli complain nmcli complain
nvidia-detector complain nvidia-detector complain
@ -297,6 +305,7 @@ steam-game attach_disconnected,complain
steam-gameoverlayui complain steam-gameoverlayui complain
steam-reaper complain steam-reaper complain
sulogin complain sulogin complain
switcherooctl complain
swtpm complain swtpm complain
swtpm_ioctl complain swtpm_ioctl complain
swtpm_localca complain swtpm_localca complain
@ -363,6 +372,7 @@ systemd-userwork attach_disconnected,complain
systemd-vconsole-setup complain systemd-vconsole-setup complain
systemsettings complain systemsettings complain
terminator complain terminator complain
tracker-writeback complain
udev-dmi-memory-id complain udev-dmi-memory-id complain
udisksctl complain udisksctl complain
udisksd attach_disconnected,complain udisksd attach_disconnected,complain