refractor: move more profiles to groups.
This commit is contained in:
parent
33681e14f2
commit
8ba3dbd90f
38 changed files with 3 additions and 2 deletions
69
apparmor.d/groups/bluetooth/blueman
Normal file
69
apparmor.d/groups/bluetooth/blueman
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2021-2022 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/blueman-*
|
||||
profile blueman @{exec_path} flags=(attach_disconnected) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/audio-client>
|
||||
include <abstractions/bus-session>
|
||||
include <abstractions/dconf-write>
|
||||
include <abstractions/desktop>
|
||||
include <abstractions/fontconfig-cache-read>
|
||||
include <abstractions/nameservice-strict>
|
||||
include <abstractions/python>
|
||||
include <abstractions/thumbnails-cache-read>
|
||||
include <abstractions/user-download-strict>
|
||||
|
||||
network inet stream,
|
||||
network inet6 stream,
|
||||
network netlink raw,
|
||||
network bluetooth raw,
|
||||
|
||||
ptrace (read) peer=gjs-console,
|
||||
|
||||
#aa:dbus own bus=session name=org.blueman.Applet
|
||||
#aa:dbus own bus=session name=org.blueman.Manager
|
||||
|
||||
@{exec_path} mrix,
|
||||
|
||||
@{sh_path} rix,
|
||||
@{open_path} rix,
|
||||
|
||||
/usr/share/blueman/{,**} r,
|
||||
|
||||
/var/lib/blueman/network.state r,
|
||||
|
||||
owner @{HOME}/ r,
|
||||
owner @{HOME}/bluetooth*/ r,
|
||||
owner @{HOME}/bluetooth*/* rw,
|
||||
|
||||
owner @{user_cache_dirs}/blueman-tray-@{int} rw,
|
||||
owner @{user_cache_dirs}/blueman-services-@{int} rw,
|
||||
owner @{user_cache_dirs}/blueman-adapters-@{int} rw,
|
||||
owner @{user_cache_dirs}/blueman-manager-@{int} rw,
|
||||
owner @{user_cache_dirs}/blueman-applet-@{int} rw,
|
||||
|
||||
owner @{user_cache_dirs}/obexd/ rw,
|
||||
owner @{user_cache_dirs}/obexd/* rw,
|
||||
|
||||
@{PROC}/@{pids}/cmdline r,
|
||||
owner @{PROC}/@{pid}/fd/ r,
|
||||
owner @{PROC}/@{pid}/mounts r,
|
||||
|
||||
/dev/dri/card@{int} rw,
|
||||
/dev/rfkill r,
|
||||
/dev/shm/ r,
|
||||
/dev/tty rw,
|
||||
|
||||
deny owner @{user_share_dirs}/gvfs-metadata/{,*} r,
|
||||
|
||||
include if exists <local/blueman>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
51
apparmor.d/groups/bluetooth/blueman-mechanism
Normal file
51
apparmor.d/groups/bluetooth/blueman-mechanism
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{lib}/blueman-mechanism @{lib}/blueman/blueman-mechanism
|
||||
profile blueman-mechanism @{exec_path} flags=(attach_disconnected) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice-strict>
|
||||
include <abstractions/python>
|
||||
|
||||
capability mknod,
|
||||
capability net_admin,
|
||||
capability sys_nice,
|
||||
|
||||
network inet stream,
|
||||
network inet6 stream,
|
||||
network netlink raw,
|
||||
|
||||
#aa:dbus own bus=system name=org.blueman.Mechanism
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{lib}/ r,
|
||||
|
||||
/var/lib/blueman/network.state rw,
|
||||
|
||||
owner @{PROC}/@{pid}/fd/ r,
|
||||
owner @{PROC}/@{pid}/mounts r,
|
||||
|
||||
/dev/rfkill rw,
|
||||
|
||||
# For network AP
|
||||
#@{bin}/ip rix,
|
||||
#@{bin}/xtables-nft-multi rix,
|
||||
#@{bin}/dnsmasq rPx,
|
||||
#@{bin}/dhclient rPx,
|
||||
# @{PROC}/sys/net/ipv4/ip_forward w,
|
||||
# @{PROC}/sys/net/ipv4/conf/ r,
|
||||
# @{PROC}/sys/net/ipv4/conf/*/forwarding w,
|
||||
#owner @{run}/blueman-iptables rw,
|
||||
#owner @{run}/blueman-netconfig rw,
|
||||
|
||||
include if exists <local/blueman-mechanism>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
26
apparmor.d/groups/bluetooth/blueman-rfcomm-watcher
Normal file
26
apparmor.d/groups/bluetooth/blueman-rfcomm-watcher
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{lib}/blueman-mechanism @{lib}/blueman/blueman-rfcomm-watcher
|
||||
profile blueman-rfcomm-watcher @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/python>
|
||||
|
||||
@{exec_path} r,
|
||||
|
||||
@{lib}/ r,
|
||||
|
||||
owner @{PROC}/@{pid}/mounts r,
|
||||
|
||||
owner @{HOME}/.Xauthority r,
|
||||
|
||||
include if exists <local/blueman-rfcomm-watcher>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
19
apparmor.d/groups/bluetooth/bluemoon
Normal file
19
apparmor.d/groups/bluetooth/bluemoon
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/bluemoon
|
||||
profile bluemoon @{exec_path} {
|
||||
include <abstractions/base>
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
include if exists <local/bluemoon>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
25
apparmor.d/groups/bluetooth/bluetoothctl
Normal file
25
apparmor.d/groups/bluetooth/bluetoothctl
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2015-2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/bluetoothctl
|
||||
profile bluetoothctl @{exec_path} {
|
||||
include <abstractions/base>
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/etc/inputrc r,
|
||||
|
||||
owner @{user_cache_dirs}/ rw,
|
||||
owner @{user_cache_dirs}/.bluetoothctl_history rw,
|
||||
owner @{user_cache_dirs}/.bluetoothctl_history-@{pid}.tmp rw,
|
||||
|
||||
include if exists <local/bluetoothctl>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
66
apparmor.d/groups/bluetooth/bluetoothd
Normal file
66
apparmor.d/groups/bluetooth/bluetoothd
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2015-2022 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{lib}/bluetooth/bluetoothd
|
||||
profile bluetoothd @{exec_path} flags=(attach_disconnected) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/bus-system>
|
||||
include <abstractions/bus/org.freedesktop.hostname1>
|
||||
|
||||
# Needed for configuring HCI interfaces
|
||||
capability net_admin,
|
||||
capability net_bind_service,
|
||||
|
||||
network bluetooth raw,
|
||||
network bluetooth seqpacket,
|
||||
network bluetooth stream,
|
||||
network alg seqpacket,
|
||||
network netlink raw,
|
||||
|
||||
#aa:dbus own bus=system name=org.bluez
|
||||
|
||||
dbus send bus=system path=/{,MediaEndpoint}
|
||||
interface=org.freedesktop.DBus.ObjectManager
|
||||
member=GetManagedObjects
|
||||
peer=(name=@{busname}),
|
||||
|
||||
dbus send bus=system path=/
|
||||
interface=org.freedesktop.DBus.ObjectManager
|
||||
member=InterfacesRemoved
|
||||
peer=(name=org.freedesktop.DBus),
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{lib}/@{multiarch}/bluetooth/plugins/*.so mr,
|
||||
|
||||
/etc/bluetooth/{,*.conf} r,
|
||||
|
||||
/var/lib/bluetooth/{,**} rw,
|
||||
|
||||
@{run}/sdp rw,
|
||||
owner @{run}/systemd/notify w,
|
||||
@{run}/udev/data/+hid:* r, # for HID-Compliant Keyboard
|
||||
|
||||
@{sys}/devices/@{pci}/rfkill@{int}/name r,
|
||||
@{sys}/devices/@{pci}/**/{uevent,name} r,
|
||||
@{sys}/devices/platform/**/rfkill/**/name r,
|
||||
@{sys}/devices/virtual/dmi/id/chassis_type r,
|
||||
@{sys}/devices/virtual/misc/uhid/**/uevent r,
|
||||
|
||||
@{PROC}/sys/kernel/hostname r,
|
||||
|
||||
/dev/uhid rw,
|
||||
/dev/uinput rw,
|
||||
/dev/rfkill rw,
|
||||
/dev/hidraw@{int} rw,
|
||||
|
||||
include if exists <local/bluetoothd>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
26
apparmor.d/groups/bluetooth/obex-folder-listing
Normal file
26
apparmor.d/groups/bluetooth/obex-folder-listing
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/obex-folder-listing
|
||||
profile obex-folder-listing @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/private-files-strict>
|
||||
include <abstractions/user-download-strict>
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
owner @{HOME}/ r,
|
||||
owner @{HOME}/**/ r,
|
||||
owner @{MOUNTS}/ r,
|
||||
owner @{MOUNTS}/**/ r,
|
||||
|
||||
include if exists <local/obex-folder-listing>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
60
apparmor.d/groups/bluetooth/obexautofs
Normal file
60
apparmor.d/groups/bluetooth/obexautofs
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/obexautofs
|
||||
profile obexautofs @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/devices-usb>
|
||||
|
||||
network bluetooth seqpacket,
|
||||
network bluetooth stream,
|
||||
network bluetooth raw,
|
||||
network netlink raw,
|
||||
|
||||
mount fstype=fuse.obexautofs -> @{HOME}/*/,
|
||||
mount fstype=fuse.obexautofs -> @{HOME}/*/*/,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{bin}/fusermount{,3} rCx -> fusermount,
|
||||
|
||||
owner @{HOME}/*/ r,
|
||||
owner @{HOME}/*/*/ r,
|
||||
|
||||
@{sys}/devices/@{pci}/usb@{int}/bConfigurationValue r,
|
||||
@{sys}/devices/@{pci}/usb@{int}/**/bConfigurationValue r,
|
||||
@{sys}/devices/@{pci}/usb@{int}/{uevent,busnum,devnum,speed,descriptors} r,
|
||||
@{sys}/devices/@{pci}/usb@{int}/**/{uevent,busnum,devnum,speed,descriptors} r,
|
||||
|
||||
/dev/fuse rw,
|
||||
|
||||
profile fusermount {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice-strict>
|
||||
|
||||
capability sys_admin,
|
||||
|
||||
mount fstype={fuse,fuse.obexautofs} -> @{HOME}/*/,
|
||||
mount fstype={fuse,fuse.obexautofs} -> @{HOME}/*/*/,
|
||||
|
||||
@{bin}/fusermount{,3} mr,
|
||||
|
||||
/etc/fuse.conf r,
|
||||
|
||||
@{PROC}/@{pid}/mounts r,
|
||||
|
||||
/dev/fuse rw,
|
||||
|
||||
include if exists <local/obexautofs_fusermount>
|
||||
}
|
||||
|
||||
include if exists <local/obexautofs>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
24
apparmor.d/groups/bluetooth/obexctl
Normal file
24
apparmor.d/groups/bluetooth/obexctl
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/obexctl
|
||||
profile obexctl @{exec_path} {
|
||||
include <abstractions/base>
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/etc/inputrc r,
|
||||
|
||||
owner @{user_cache_dirs}/.obexctl_history rw,
|
||||
owner @{user_cache_dirs}/.obexctl_history-@{pid}.tmp rw,
|
||||
|
||||
include if exists <local/obexctl>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
37
apparmor.d/groups/bluetooth/obexd
Normal file
37
apparmor.d/groups/bluetooth/obexd
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{lib}/bluetooth/obexd
|
||||
profile obexd @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/bus-system>
|
||||
include <abstractions/bus-session>
|
||||
include <abstractions/user-download-strict>
|
||||
|
||||
network bluetooth stream,
|
||||
network bluetooth seqpacket,
|
||||
|
||||
#aa:dbus own bus=session name=org.bluez.obex
|
||||
|
||||
dbus receive bus=system path=/org/bluez/obex/@{uuid}
|
||||
interface=org.bluez.Profile1
|
||||
member=Release
|
||||
peer=(name=:*, label=bluetoothd),
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
owner @{user_cache_dirs}/ rw,
|
||||
owner @{user_cache_dirs}/obexd/{,**} rw,
|
||||
|
||||
owner @{HOME}/bluetooth/* rw,
|
||||
|
||||
include if exists <local/obexd>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
57
apparmor.d/groups/bluetooth/obexfs
Normal file
57
apparmor.d/groups/bluetooth/obexfs
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/obexfs
|
||||
profile obexfs @{exec_path} {
|
||||
include <abstractions/base>
|
||||
|
||||
network bluetooth raw,
|
||||
network bluetooth seqpacket,
|
||||
network bluetooth stream,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{bin}/fusermount{,3} rCx -> fusermount,
|
||||
|
||||
owner @{HOME}/*/ r,
|
||||
owner @{HOME}/*/*/ r,
|
||||
|
||||
mount fstype=fuse.obexfs -> @{HOME}/*/,
|
||||
mount fstype=fuse.obexfs -> @{HOME}/*/*/,
|
||||
|
||||
/dev/fuse rw,
|
||||
|
||||
|
||||
profile fusermount {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice-strict>
|
||||
|
||||
# To mount anything:
|
||||
capability sys_admin,
|
||||
|
||||
network bluetooth stream,
|
||||
|
||||
@{bin}/fusermount{,3} mr,
|
||||
|
||||
/etc/fuse.conf r,
|
||||
|
||||
/dev/fuse rw,
|
||||
|
||||
mount fstype={fuse,fuse.obexfs} -> @{HOME}/*/,
|
||||
mount fstype={fuse,fuse.obexfs} -> @{HOME}/*/*/,
|
||||
|
||||
@{PROC}/@{pid}/mounts r,
|
||||
|
||||
include if exists <local/obexfs_fusermount>
|
||||
}
|
||||
|
||||
include if exists <local/obexfs>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
19
apparmor.d/groups/bluetooth/obexpush-atd
Normal file
19
apparmor.d/groups/bluetooth/obexpush-atd
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/obexpush_atd
|
||||
profile obexpush-atd @{exec_path} {
|
||||
include <abstractions/base>
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
include if exists <local/obexpush-atd>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
30
apparmor.d/groups/bluetooth/obexpushd
Normal file
30
apparmor.d/groups/bluetooth/obexpushd
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/obexpushd
|
||||
profile obexpushd @{exec_path} {
|
||||
include <abstractions/base>
|
||||
|
||||
# For listening on tcp/*:650
|
||||
capability net_bind_service,
|
||||
|
||||
network bluetooth stream,
|
||||
network irda stream,
|
||||
network inet stream,
|
||||
network inet6 stream,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
# For receiving files
|
||||
owner @{HOME}/bluetooth/* w,
|
||||
|
||||
include if exists <local/obexpushd>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
43
apparmor.d/groups/filesystem/mke2fs
Normal file
43
apparmor.d/groups/filesystem/mke2fs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2019-2021 Mikhail Morfikov
|
||||
# Copyright (C) 2023-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/mke2fs @{bin}/mkfs.ext2 @{bin}/mkfs.ext3 @{bin}/mkfs.ext4
|
||||
profile mke2fs @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/disks-write>
|
||||
include <abstractions/user-download-strict>
|
||||
|
||||
capability sys_rawio,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
# To check for badblocks
|
||||
@{sh_path} rix,
|
||||
@{bin}/badblocks rPx,
|
||||
|
||||
/usr/share/file/misc/magic.mgc r,
|
||||
|
||||
/etc/mke2fs.conf r,
|
||||
|
||||
# A place for file images
|
||||
owner @{user_img_dirs}/{,**} rwk,
|
||||
|
||||
# For virt-resize
|
||||
owner /var/tmp/.guestfs-@{int}/** rwk,
|
||||
|
||||
owner @{run}/blkid/blkid.tab{,-@{rand6}} rw,
|
||||
owner @{run}/blkid/blkid.tab.old rwl -> @{run}/blkid/blkid.tab,
|
||||
|
||||
@{PROC}/swaps r,
|
||||
owner @{PROC}/@{pid}/mounts r,
|
||||
|
||||
include if exists <local/mke2fs>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
32
apparmor.d/groups/filesystem/mkfs-btrfs
Normal file
32
apparmor.d/groups/filesystem/mkfs-btrfs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2019-2021 Mikhail Morfikov
|
||||
# Copyright (C) 2023-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/mkfs.btrfs
|
||||
profile mkfs-btrfs @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/disks-write>
|
||||
|
||||
capability sys_admin,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/dev/btrfs-control rw,
|
||||
|
||||
# A place for file images
|
||||
owner @{user_img_dirs}/{,**} rwk,
|
||||
|
||||
@{run}/blkid/blkid.* rw,
|
||||
|
||||
@{PROC}/swaps r,
|
||||
owner @{PROC}/@{pid}/mounts r,
|
||||
|
||||
include if exists <local/mkfs-btrfs>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
26
apparmor.d/groups/filesystem/mkfs-fat
Normal file
26
apparmor.d/groups/filesystem/mkfs-fat
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2019-2021 Mikhail Morfikov
|
||||
# Copyright (C) 2023-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/{mkfs.fat,mkfs.msdos,mkfs.vfat,mkdosfs}
|
||||
profile mkfs-fat @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/disks-write>
|
||||
include <abstractions/user-download-strict>
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
# A place for file images
|
||||
owner @{user_img_dirs}/{,**} rwk,
|
||||
|
||||
owner @{PROC}/@{pid}/mounts r,
|
||||
|
||||
include if exists <local/mkfs-fat>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
24
apparmor.d/groups/filesystem/mkntfs
Normal file
24
apparmor.d/groups/filesystem/mkntfs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2019-2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/{mkntfs,mkfs.ntfs}
|
||||
profile mkntfs @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/disks-write>
|
||||
|
||||
capability sys_admin,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
owner @{PROC}/@{pids}/mounts r,
|
||||
|
||||
include if exists <local/mkntfs>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
28
apparmor.d/groups/filesystem/mkswap
Normal file
28
apparmor.d/groups/filesystem/mkswap
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2019-2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/mkswap
|
||||
profile mkswap @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/disks-write>
|
||||
|
||||
capability mknod,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
owner /swapfile rw,
|
||||
owner /swap/swapfile rw,
|
||||
|
||||
@{PROC}/swaps r,
|
||||
owner @{PROC}/@{pid}/mounts r,
|
||||
|
||||
include if exists <local/mkswap>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
72
apparmor.d/groups/filesystem/mount
Normal file
72
apparmor.d/groups/filesystem/mount
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2019-2022 Mikhail Morfikov
|
||||
# Copyright (C) 2022-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# Copyright (C) 2022 Jeroen Rijken
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/mount
|
||||
profile mount @{exec_path} flags=(attach_disconnected) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/consoles>
|
||||
include <abstractions/disks-write>
|
||||
include <abstractions/nameservice-strict>
|
||||
|
||||
capability chown,
|
||||
capability dac_read_search,
|
||||
capability setgid,
|
||||
capability setuid,
|
||||
capability sys_admin,
|
||||
capability sys_rawio,
|
||||
|
||||
mount,
|
||||
|
||||
network inet stream,
|
||||
network inet6 stream,
|
||||
|
||||
ptrace (read),
|
||||
|
||||
signal (receive) set=(term, kill),
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{bin}/lowntfs-3g rPx,
|
||||
@{bin}/mount.* rPx,
|
||||
@{bin}/ntfs-3g rPx,
|
||||
@{bin}/sshfs rPx,
|
||||
|
||||
/etc/fstab r,
|
||||
|
||||
/var/lib/snapd/snaps/*.snap r,
|
||||
|
||||
# Mount points
|
||||
@{HOME}/ rw,
|
||||
@{HOME}/*/ rw,
|
||||
@{HOME}/*/*/ rw,
|
||||
@{MOUNTS}/ rw,
|
||||
@{MOUNTS}/*/ rw,
|
||||
@{MOUNTS}/*/*/ rw,
|
||||
|
||||
# Mount iso/img files
|
||||
owner @{user_img_dirs}/{,**} rwk,
|
||||
|
||||
@{run}/ r,
|
||||
owner @{run}/mount/ rw,
|
||||
owner @{run}/mount/utab{,.*} rwk,
|
||||
|
||||
/tmp/sanity-squashfs-@{int} rw,
|
||||
/tmp/syscheck-squashfs-@{int} rw,
|
||||
|
||||
@{PROC}/@{pid}/mountinfo r,
|
||||
|
||||
# The special /dev/loop-control file can be used to create and destroy loop
|
||||
# devices or to find the first available loop device.
|
||||
/dev/loop-control rw,
|
||||
|
||||
include if exists <local/mount>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
58
apparmor.d/groups/filesystem/mount-cifs
Normal file
58
apparmor.d/groups/filesystem/mount-cifs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2020-2022 Mikhail Morfikov
|
||||
# Copyright (C) 2022-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/mount.cifs
|
||||
profile mount-cifs @{exec_path} flags=(complain) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice-strict>
|
||||
|
||||
capability sys_admin,
|
||||
capability setpcap,
|
||||
|
||||
network inet dgram,
|
||||
network inet stream,
|
||||
network inet6 dgram,
|
||||
network inet6 stream,
|
||||
network netlink raw,
|
||||
|
||||
mount fstype=cifs -> @{HOME}/*/,
|
||||
mount fstype=cifs -> @{HOME}/*/*/,
|
||||
mount fstype=cifs -> @{MOUNTDIRS}/,
|
||||
mount fstype=cifs -> @{MOUNTS}/,
|
||||
mount fstype=cifs -> @{MOUNTS}/*/,
|
||||
mount fstype=cifs -> @{MOUNTS}/*/*/,
|
||||
|
||||
umount @{HOME}/*/,
|
||||
umount @{HOME}/*/*/,
|
||||
umount @{MOUNTDIRS}/,
|
||||
umount @{MOUNTS}/,
|
||||
umount @{MOUNTS}/*/,
|
||||
umount @{MOUNTS}/*/*/,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{bin}/systemd-ask-password rPUx,
|
||||
|
||||
/etc/fstab r,
|
||||
/etc/sync-credentials r,
|
||||
|
||||
owner @{HOME}/.smbcredentials r,
|
||||
|
||||
# Mount points
|
||||
@{HOME}/*/ r,
|
||||
@{HOME}/*/*/ r,
|
||||
@{MOUNTDIRS}/ r,
|
||||
@{MOUNTS}/ r,
|
||||
@{MOUNTS}/*/ r,
|
||||
@{MOUNTS}/*/*/ r,
|
||||
|
||||
include if exists <local/mount-cifs>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
74
apparmor.d/groups/filesystem/mount-nfs
Normal file
74
apparmor.d/groups/filesystem/mount-nfs
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2019-2022 Mikhail Morfikov
|
||||
# Copyright (C) 2022-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/mount.nfs
|
||||
profile mount-nfs @{exec_path} flags=(complain) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice-strict>
|
||||
|
||||
# To be able to mount anything
|
||||
capability sys_admin,
|
||||
|
||||
capability chown,
|
||||
capability setgid,
|
||||
capability setuid,
|
||||
capability net_bind_service,
|
||||
|
||||
network inet dgram,
|
||||
network inet6 dgram,
|
||||
network inet stream,
|
||||
network inet6 stream,
|
||||
|
||||
# Allow to mount smb/cifs disks only under the /media/ dirs
|
||||
mount fstype=nfs -> @{MOUNTDIRS}/,
|
||||
mount fstype=nfs -> @{MOUNTS}/,
|
||||
mount fstype=nfs -> @{MOUNTS}/*/,
|
||||
mount fstype=nfs -> /,
|
||||
mount fstype=nfs -> /*/,
|
||||
|
||||
umount @{MOUNTDIRS}/,
|
||||
umount @{MOUNTS}/,
|
||||
umount @{MOUNTS}/*/,
|
||||
umount /,
|
||||
umount /*/,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{sh_path} rix,
|
||||
@{bin}/flock rix,
|
||||
@{bin}/start-statd rix,
|
||||
@{bin}/systemctl rCx -> systemctl,
|
||||
|
||||
/etc/fstab r,
|
||||
/etc/netconfig r,
|
||||
/etc/nfsmount.conf rk,
|
||||
/etc/rpc r,
|
||||
|
||||
# Mount points
|
||||
@{MOUNTDIRS}/ r,
|
||||
@{MOUNTS}/ r,
|
||||
@{MOUNTS}/*/ r,
|
||||
|
||||
owner @{run}/mount/utab.lock wk,
|
||||
owner @{run}/mount/utab{,.*} rw,
|
||||
owner @{run}/rpc.statd.lock wk,
|
||||
|
||||
owner @{PROC}/@{pid}/mountinfo r,
|
||||
|
||||
profile systemctl {
|
||||
include <abstractions/base>
|
||||
include <abstractions/app/systemctl>
|
||||
|
||||
include if exists <local/mount-nfs_systemctl>
|
||||
}
|
||||
|
||||
include if exists <local/mount-nfs>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
48
apparmor.d/groups/filesystem/mount-zfs
Normal file
48
apparmor.d/groups/filesystem/mount-zfs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2022-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/mount.zfs
|
||||
profile mount-zfs @{exec_path} flags=(complain) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice-strict>
|
||||
|
||||
capability dac_read_search,
|
||||
capability sys_admin, # To mount anything.
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/dev/pts/@{int} rw,
|
||||
|
||||
@{MOUNTDIRS}/ r,
|
||||
@{MOUNTS}/ r,
|
||||
@{MOUNTS}/*/ r,
|
||||
|
||||
mount fstype=zfs -> @{MOUNTDIRS}/,
|
||||
mount fstype=zfs -> @{MOUNTS}/,
|
||||
mount fstype=zfs -> @{MOUNTS}/*/,
|
||||
mount fstype=zfs -> /,
|
||||
mount fstype=zfs -> /**/,
|
||||
mount fstype=zfs -> /tmp/zfsmnt.*/,
|
||||
mount fstype=zfs -> /tmp/zfsmnt.*/*/,
|
||||
|
||||
umount @{MOUNTDIRS}/,
|
||||
umount @{MOUNTS}/,
|
||||
umount @{MOUNTS}/*/,
|
||||
umount /,
|
||||
umount /*/,
|
||||
umount /tmp/zfsmnt.*/,
|
||||
umount /tmp/zfsmnt.*/*/,
|
||||
|
||||
@{PROC}/@{pids}/mounts r,
|
||||
|
||||
/dev/zfs rw,
|
||||
|
||||
include if exists <local/mount-zfs>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
28
apparmor.d/groups/firewall/firewall-applet
Normal file
28
apparmor.d/groups/firewall/firewall-applet
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2022 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/firewall-applet
|
||||
profile firewall-applet @{exec_path} flags=(attach_disconnected) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/consoles>
|
||||
include <abstractions/dconf-write>
|
||||
include <abstractions/desktop>
|
||||
include <abstractions/python>
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{bin}/ r,
|
||||
@{bin}/python3.@{int} r,
|
||||
|
||||
owner @{PROC}/@{pid}/cmdline r,
|
||||
owner @{PROC}/@{pid}/mounts r,
|
||||
|
||||
include if exists <local/firewall-applet>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
29
apparmor.d/groups/firewall/firewall-config
Normal file
29
apparmor.d/groups/firewall/firewall-config
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/firewall-config
|
||||
profile firewall-config @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/dconf-write>
|
||||
include <abstractions/desktop>
|
||||
include <abstractions/python>
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{open_path} rPx -> child-open-help,
|
||||
|
||||
/usr/share/firewalld/__pycache__/ rw,
|
||||
|
||||
/usr/share/firewalld/{,**} r,
|
||||
|
||||
owner @{PROC}/@{pid}/mounts r,
|
||||
|
||||
include if exists <local/firewall-config>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
74
apparmor.d/groups/firewall/firewalld
Normal file
74
apparmor.d/groups/firewall/firewalld
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2023-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/firewalld
|
||||
profile firewalld @{exec_path} flags=(attach_disconnected) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/app/kmod>
|
||||
include <abstractions/bus-session>
|
||||
include <abstractions/bus-system>
|
||||
include <abstractions/bus/org.freedesktop.NetworkManager>
|
||||
include <abstractions/bus/org.freedesktop.PolicyKit1>
|
||||
include <abstractions/nameservice-strict>
|
||||
|
||||
capability dac_read_search,
|
||||
capability mknod,
|
||||
capability net_admin,
|
||||
capability net_raw,
|
||||
capability setpcap,
|
||||
capability sys_module,
|
||||
|
||||
network inet raw,
|
||||
network inet6 raw,
|
||||
network netlink raw,
|
||||
|
||||
#aa:dbus own bus=system name=org.fedoraproject.FirewallD1
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{bin}/ r,
|
||||
@{bin}/alts rix,
|
||||
@{bin}/ebtables-legacy rix,
|
||||
@{bin}/ebtables-legacy-restore rix,
|
||||
@{bin}/false rix,
|
||||
@{bin}/ipset rix,
|
||||
@{bin}/kmod rix,
|
||||
@{bin}/modprobe rix,
|
||||
@{bin}/xtables-legacy-multi rix,
|
||||
@{bin}/xtables-nft-multi rix,
|
||||
|
||||
/usr/local/lib/python3.@{int}/dist-packages/ r,
|
||||
|
||||
/usr/share/iproute2/{,**} r,
|
||||
/usr/share/libalternatives/{,**} r,
|
||||
|
||||
/etc/firewalld/{,**} rw,
|
||||
/etc/iproute2/group r,
|
||||
/etc/iproute2/rt_realms r,
|
||||
|
||||
/var/lib/ebtables/lock rwk,
|
||||
|
||||
/var/log/firewalld rw,
|
||||
|
||||
@{run}/firewalld/{,*} rw,
|
||||
@{run}/modprobe.d/{,*.conf} r,
|
||||
@{run}/xtables.lock rwk,
|
||||
|
||||
@{sys}/module/compression r,
|
||||
@{sys}/module/*/initstate r,
|
||||
|
||||
@{PROC}/sys/kernel/modprobe r,
|
||||
@{PROC}/sys/net/ipv{4,6}/ip_forward rw,
|
||||
owner @{PROC}/@{pid}/fd/ r,
|
||||
owner @{PROC}/@{pid}/mounts r,
|
||||
owner @{PROC}/@{pids}/net/ip_tables_names r,
|
||||
|
||||
include if exists <local/firewalld>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
36
apparmor.d/groups/firewall/nft
Normal file
36
apparmor.d/groups/firewall/nft
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2019-2021 Mikhail Morfikov
|
||||
# Copyright (C) 2022-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/nft
|
||||
profile nft @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice-strict>
|
||||
|
||||
capability net_admin,
|
||||
|
||||
network netlink raw,
|
||||
|
||||
ptrace (read),
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/usr/share/iproute2/{,**} r,
|
||||
|
||||
/etc/iproute2/** r,
|
||||
/etc/nftables.conf r,
|
||||
/etc/nftables/{,**} r,
|
||||
|
||||
@{PROC}/1/environ r,
|
||||
@{PROC}/cmdline r,
|
||||
@{PROC}/sys/kernel/osrelease r,
|
||||
|
||||
include if exists <local/nft>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
62
apparmor.d/groups/firewall/ufw
Normal file
62
apparmor.d/groups/firewall/ufw
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2024 EricLin <ericlin050914@gmail.com>
|
||||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/ufw
|
||||
profile ufw @{exec_path} flags=(attach_disconnected) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/attached/consoles>
|
||||
include <abstractions/nameservice-strict>
|
||||
include <abstractions/python>
|
||||
|
||||
capability dac_read_search,
|
||||
capability net_admin,
|
||||
capability net_raw,
|
||||
capability sys_ptrace,
|
||||
|
||||
network inet dgram,
|
||||
network inet raw,
|
||||
network inet6 dgram,
|
||||
network inet6 raw,
|
||||
network netlink raw,
|
||||
|
||||
ptrace read,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{bin}/ r,
|
||||
@{bin}/cat ix,
|
||||
@{bin}/env r,
|
||||
@{bin}/python3.@{int} ix,
|
||||
@{bin}/sysctl ix,
|
||||
@{bin}/xtables-legacy-multi ix,
|
||||
@{bin}/xtables-nft-multi ix,
|
||||
@{lib}/ufw/ufw-init ix,
|
||||
|
||||
/etc/default/ufw rw,
|
||||
/etc/ufw/ rw,
|
||||
/etc/ufw/** rwk,
|
||||
|
||||
@{run}/xtables.lock rwk,
|
||||
owner @{run}/ufw.lock rwk,
|
||||
|
||||
owner @{tmp}/@{word8} rw,
|
||||
owner @{tmp}/tmp@{word8} rw,
|
||||
owner /var/tmp/@{word8} rw,
|
||||
owner /var/tmp/tmp@{word8} rw,
|
||||
|
||||
@{PROC}/@{pid}/fd/ r,
|
||||
@{PROC}/@{pid}/net/ip_tables_names r,
|
||||
@{PROC}/@{pid}/stat r,
|
||||
@{PROC}/sys/net/ipv{4,6}/** rw,
|
||||
@{PROC}/sys/kernel/modprobe r,
|
||||
|
||||
include if exists <local/ufw>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
54
apparmor.d/groups/freedesktop/boltd
Normal file
54
apparmor.d/groups/freedesktop/boltd
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2022-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{lib}/boltd
|
||||
profile boltd @{exec_path} flags=(attach_disconnected) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/bus-system>
|
||||
include <abstractions/bus/org.freedesktop.PolicyKit1>
|
||||
include <abstractions/nameservice-strict>
|
||||
|
||||
capability net_admin,
|
||||
|
||||
network netlink raw,
|
||||
|
||||
#aa:dbus own bus=system name=org.freedesktop.bolt
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/var/lib/boltd/{,**} rw,
|
||||
|
||||
owner @{run}/boltd/{,**} rw,
|
||||
|
||||
@{att}/@{run}/systemd/notify w,
|
||||
|
||||
@{run}/udev/data/+thunderbolt:* r,
|
||||
|
||||
@{sys}/bus/ r,
|
||||
@{sys}/bus/thunderbolt/devices/ r,
|
||||
@{sys}/bus/wmi/devices/ r,
|
||||
@{sys}/class/ r,
|
||||
@{sys}/devices/@{pci}/@{uuid}/uevent r,
|
||||
@{sys}/devices/@{pci}/device r,
|
||||
@{sys}/devices/@{pci}/domain@{int}/ r,
|
||||
@{sys}/devices/@{pci}/domain@{int}/{security,uevent} r,
|
||||
@{sys}/devices/@{pci}/domain@{int}/**/ r,
|
||||
@{sys}/devices/@{pci}/domain@{int}/**/{authorized,generation} r,
|
||||
@{sys}/devices/@{pci}/domain@{int}/**/{boot,rx_lanes,rx_speed,tx_lanes,tx_speed} r,
|
||||
@{sys}/devices/@{pci}/domain@{int}/**/{uevent,unique_id} r,
|
||||
@{sys}/devices/@{pci}/domain@{int}/**/{vendor,device}_name r,
|
||||
@{sys}/devices/@{pci}/domain@{int}/boot_acl rw,
|
||||
@{sys}/devices/@{pci}/domain@{int}/iommu_dma_protection r,
|
||||
@{sys}/devices/platform/**/uevent r,
|
||||
@{sys}/devices/platform/*/wmi_bus/wmi_bus-*/@{uuid}/force_power rw,
|
||||
@{sys}/devices/virtual/dmi/id/{sys_vendor,product_version,product_name} r,
|
||||
|
||||
include if exists <local/boltd>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
80
apparmor.d/groups/freedesktop/wireplumber
Normal file
80
apparmor.d/groups/freedesktop/wireplumber
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/wireplumber
|
||||
profile wireplumber @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/audio-client>
|
||||
include <abstractions/audio-server>
|
||||
include <abstractions/bus-session>
|
||||
include <abstractions/bus-system>
|
||||
include <abstractions/bus/org.freedesktop.RealtimeKit1>
|
||||
include <abstractions/bus/org.freedesktop.UPower>
|
||||
include <abstractions/devices-usb>
|
||||
include <abstractions/nameservice-strict>
|
||||
include <abstractions/video>
|
||||
|
||||
network bluetooth raw,
|
||||
network bluetooth seqpacket,
|
||||
network bluetooth stream,
|
||||
network netlink raw,
|
||||
|
||||
#aa:dbus own bus=session name=org.freedesktop.ReserveDevice1.Audio@{int}
|
||||
|
||||
dbus receive bus=session
|
||||
interface=org.freedesktop.DBus.Introspectable
|
||||
member=Introspect
|
||||
peer=(name=:*, label=gnome-shell),
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/opt/intel/oneapi/{compiler,lib,mkl}/**/ r,
|
||||
/opt/intel/oneapi/{compiler,lib,mkl}/**.so* mr,
|
||||
|
||||
/usr/share/alsa-card-profile/{,**} r,
|
||||
/usr/share/spa-*/bluez@{int}/{,*} r,
|
||||
/usr/share/wireplumber/{,**} r,
|
||||
|
||||
owner @{desktop_local_dirs}/ w,
|
||||
owner @{desktop_local_dirs}/state/ w,
|
||||
owner @{desktop_local_dirs}/state/wireplumber/{,**} rw,
|
||||
|
||||
owner @{HOME}/.local/ w,
|
||||
owner @{user_state_dirs}/ w,
|
||||
owner @{user_state_dirs}/wireplumber/{,**} rw,
|
||||
owner @{user_config_dirs}/wireplumber/{,**} r,
|
||||
|
||||
owner @{run}/user/@{uid}/pipewire-@{int} rw,
|
||||
|
||||
@{run}/systemd/users/@{uid} r,
|
||||
|
||||
@{run}/udev/data/c14:@{int} r, # Open Sound System (OSS)
|
||||
@{run}/udev/data/c81:@{int} r, # For video4linux
|
||||
@{run}/udev/data/c116:@{int} r, # For ALSA
|
||||
@{run}/udev/data/c@{dynamic}:@{int} r, # For dynamic assignment range 234 to 254, 384 to 511
|
||||
|
||||
@{sys}/bus/ r,
|
||||
@{sys}/bus/media/devices/ r,
|
||||
@{sys}/devices/@{pci}/video4linux/video@{int}/uevent r,
|
||||
@{sys}/devices/**/device:*/{,**/}path r,
|
||||
@{sys}/devices/**/sound/**/pcm_class r,
|
||||
@{sys}/devices/**/sound/**/uevent r,
|
||||
@{sys}/devices/system/node/ r,
|
||||
@{sys}/devices/system/node/node@{int}/meminfo r,
|
||||
@{sys}/devices/virtual/dmi/id/bios_vendor r,
|
||||
@{sys}/devices/virtual/dmi/id/product_name r,
|
||||
@{sys}/devices/virtual/dmi/id/sys_vendor r,
|
||||
|
||||
owner @{PROC}/@{pid}/task/@{tid}/comm rw,
|
||||
|
||||
/dev/media@{int} rw,
|
||||
|
||||
include if exists <local/wireplumber>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
27
apparmor.d/groups/usb/lsusb
Normal file
27
apparmor.d/groups/usb/lsusb
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2019-2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/lsusb @{bin}/lsusb.py
|
||||
profile lsusb @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/consoles>
|
||||
include <abstractions/devices-usb-read>
|
||||
|
||||
capability net_admin,
|
||||
|
||||
network netlink raw,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/etc/udev/hwdb.bin r,
|
||||
|
||||
include if exists <local/lsusb>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
37
apparmor.d/groups/usb/usb-devices
Normal file
37
apparmor.d/groups/usb/usb-devices
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2019-2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/usb-devices
|
||||
profile usb-devices @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/consoles>
|
||||
include <abstractions/devices-usb>
|
||||
|
||||
capability dac_override,
|
||||
capability dac_read_search,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{sh_path} rix,
|
||||
@{bin}/{,e}grep rix,
|
||||
@{bin}/basename rix,
|
||||
@{bin}/cat rix,
|
||||
@{bin}/sed rix,
|
||||
@{bin}/cut rix,
|
||||
@{bin}/find rix,
|
||||
@{bin}/readlink rix,
|
||||
@{bin}/sort rix,
|
||||
|
||||
# For shell pwd
|
||||
/root/ r,
|
||||
|
||||
include if exists <local/usb-devices>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
41
apparmor.d/groups/usb/usbguard
Normal file
41
apparmor.d/groups/usb/usbguard
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2018-2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/usbguard
|
||||
profile usbguard @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/consoles>
|
||||
include <abstractions/devices-usb>
|
||||
|
||||
capability chown,
|
||||
capability fowner,
|
||||
capability dac_override,
|
||||
|
||||
# Needed to create policy (usbguard generate-policy)
|
||||
network netlink dgram,
|
||||
|
||||
unix (send, receive, connect) type=stream peer=(label="usbguard-daemon",addr=@@{int}),
|
||||
|
||||
#aa:dbus own bus=system name=org.usbguard1
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/etc/usbguard/*.conf rw,
|
||||
/etc/usbguard/IPCAccessControl.d/{,*} rw,
|
||||
|
||||
/dev/shm/qb-usbguard-{request,response,event}-@{int}-@{int}-@{int}-{header,data} rw,
|
||||
/dev/shm/qb-@{int}-@{int}-@{int}-*/qb-{request,response,event}-usbguard-{header,data} rw,
|
||||
|
||||
# For "usbguard generate-policy"
|
||||
@{sys}/devices/@{pci}/uevent r,
|
||||
|
||||
include if exists <local/usbguard>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
48
apparmor.d/groups/usb/usbguard-applet-qt
Normal file
48
apparmor.d/groups/usb/usbguard-applet-qt
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2018-2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/usbguard-applet-qt
|
||||
profile usbguard-applet-qt @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/X>
|
||||
include <abstractions/gtk>
|
||||
include <abstractions/fonts>
|
||||
include <abstractions/fontconfig-cache-read>
|
||||
include <abstractions/freedesktop.org>
|
||||
include <abstractions/mesa>
|
||||
include <abstractions/qt5>
|
||||
include <abstractions/qt5-compose-cache-write>
|
||||
include <abstractions/dri-enumerate>
|
||||
include <abstractions/nameservice-strict>
|
||||
|
||||
# Needed?
|
||||
ptrace (read),
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
owner @{user_config_dirs}/USBGuard/ rw,
|
||||
owner @{user_config_dirs}/USBGuard/* rwkl -> @{user_config_dirs}/USBGuard/#@{int},
|
||||
|
||||
/dev/shm/#@{int} rw,
|
||||
/dev/shm/qb-usbguard-{request,response,event}-@{int}-@{int}-@{int}-{header,data} rw,
|
||||
/dev/shm/qb-@{int}-@{int}-@{int}-*/qb-{request,response,event}-usbguard-{header,data} rw,
|
||||
|
||||
owner @{run}/user/@{uid}/sni-qt_usbguard-applet-qt_@{int}-[a-zA-Z0-9]*/{,**} rw,
|
||||
|
||||
owner @{PROC}/@{pid}/cmdline r,
|
||||
|
||||
/usr/share/hwdata/pnp.ids r,
|
||||
|
||||
/var/lib/dbus/machine-id r,
|
||||
/etc/machine-id r,
|
||||
|
||||
include if exists <local/usbguard-applet-qt>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
44
apparmor.d/groups/usb/usbguard-daemon
Normal file
44
apparmor.d/groups/usb/usbguard-daemon
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2018-2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/usbguard-daemon
|
||||
profile usbguard-daemon @{exec_path} flags=(attach_disconnected) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice-strict>
|
||||
include <abstractions/devices-usb>
|
||||
|
||||
capability chown,
|
||||
capability fowner,
|
||||
capability dac_override,
|
||||
|
||||
network netlink dgram,
|
||||
|
||||
unix (bind, listen) type=stream,
|
||||
unix (connect) type=stream peer=(label=usbguard-dbus, addr=none),
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/etc/usbguard/{,**} r,
|
||||
/etc/usbguard/*.conf rw,
|
||||
|
||||
owner @{run}/usbguard.pid rwk,
|
||||
|
||||
/var/log/usbguard/usbguard-audit.log rw,
|
||||
|
||||
/dev/shm/ r,
|
||||
/dev/shm/qb-usbguard-{request,response,event}-@{int}-@{int}-@{int}-{header,data} rw,
|
||||
/dev/shm/qb-@{int}-@{int}-*/ rw,
|
||||
/dev/shm/qb-@{int}-@{int}-@{int}-*/qb-{request,response,event}-usbguard-{header,data} rw,
|
||||
|
||||
@{sys}/devices/@{pci}/uevent r,
|
||||
|
||||
include if exists <local/usbguard-daemon>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
27
apparmor.d/groups/usb/usbguard-dbus
Normal file
27
apparmor.d/groups/usb/usbguard-dbus
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2018-2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/usbguard-dbus
|
||||
profile usbguard-dbus @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/bus-system>
|
||||
|
||||
# Needed?
|
||||
deny capability sys_nice,
|
||||
|
||||
unix (send, receive, connect) type=stream peer=(label=usbguard-daemon, addr=@@{int}),
|
||||
|
||||
@{exec_path} mr,
|
||||
/dev/shm/qb-usbguard-{request,response,event}-@{int}-@{int}-@{int}-{header,data} rw,
|
||||
/dev/shm/qb-@{int}-@{int}-@{int}-*/qb-{request,response,event}-usbguard-{header,data} rw,
|
||||
|
||||
include if exists <local/usbguard-dbus>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
24
apparmor.d/groups/usb/usbguard-notifier
Normal file
24
apparmor.d/groups/usb/usbguard-notifier
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/usbguard-notifier
|
||||
profile usbguard-notifier @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice-strict>
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/dev/shm/qb-usbguard-{request,response,event}-@{int}-@{int}-@{int}-{header,data} rw,
|
||||
/dev/shm/qb-@{int}-@{int}-@{int}-*/qb-{request,response,event}-usbguard-{header,data} rw,
|
||||
|
||||
owner @{PROC}/@{pid}/loginuid r,
|
||||
|
||||
include if exists <local/usbguard-notifier>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
38
apparmor.d/groups/utils/dmesg
Normal file
38
apparmor.d/groups/utils/dmesg
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2019-2022 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/dmesg
|
||||
profile dmesg @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/consoles>
|
||||
|
||||
capability dac_read_search,
|
||||
capability syslog,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{sh_path} rix,
|
||||
@{pager_path} rPx -> child-pager,
|
||||
|
||||
/usr/share/terminfo/** r,
|
||||
|
||||
@{PROC}/sys/kernel/pid_max r,
|
||||
|
||||
/dev/kmsg r,
|
||||
|
||||
deny @{bin}/{,*/} r,
|
||||
deny /{usr/,}local/{,s}bin/ r,
|
||||
deny /var/lib/flatpak/exports/bin/ r,
|
||||
deny @{HOME}/.go/bin/ r,
|
||||
deny @{user_bin_dirs}/ r,
|
||||
|
||||
include if exists <local/dmesg>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
44
apparmor.d/groups/utils/whereis
Normal file
44
apparmor.d/groups/utils/whereis
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2022 Jeroen Rijken
|
||||
# Copyright (C) 2022-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{bin}/whereis
|
||||
profile whereis @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/consoles>
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{bin}/{,*/} r,
|
||||
@{lib}/ r,
|
||||
@{lib}/go-*/bin/ r,
|
||||
/usr/{local/,}games/ r,
|
||||
/usr/include/ r,
|
||||
/usr/local/{,etc/,lib/} r,
|
||||
/usr/local/{s,}bin/{,*/} r,
|
||||
/usr/share/ r,
|
||||
/usr/share/info/{**,} r,
|
||||
/usr/share/man/{**,} r,
|
||||
/usr/src/{**,} r,
|
||||
|
||||
/opt/ r,
|
||||
/opt/**/bin/ r,
|
||||
/opt/**/lib/ r,
|
||||
|
||||
@{etc_ro}/ r,
|
||||
|
||||
/snap/bin/ r,
|
||||
/var/lib/flatpak/exports/bin/ r,
|
||||
|
||||
owner @{HOME}/{.,}go/bin/ r,
|
||||
owner @{user_bin_dirs}/ r,
|
||||
|
||||
include if exists <local/whereis>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
Loading…
Add table
Add a link
Reference in a new issue