2021-04-01 17:17:47 +02:00
|
|
|
# apparmor.d - Full set of apparmor profiles
|
|
|
|
# Copyright (C) 2015-2020 Mikhail Morfikov
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
abi <abi/3.0>,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include <tunables/global>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2021-04-19 16:20:32 +02:00
|
|
|
@{TORRENT_DIR} = @{MOUNTS}/*/torrent
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{exec_path} = /{usr/,}bin/qbittorrent-nox
|
|
|
|
profile qbittorrent-nox @{exec_path} {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/nameservice-strict>
|
|
|
|
include <abstractions/openssl>
|
|
|
|
include <abstractions/ssl_certs>
|
|
|
|
|
|
|
|
network inet dgram,
|
|
|
|
network inet6 dgram,
|
|
|
|
network inet stream,
|
|
|
|
network inet6 stream,
|
2020-12-24 13:55:12 +01:00
|
|
|
network netlink dgram,
|
|
|
|
network netlink raw,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{exec_path} mr,
|
|
|
|
|
|
|
|
# Qbittorrent home dirs
|
2021-04-01 18:21:33 +02:00
|
|
|
owner @{user_config_dirs}/qBittorrent/ rw,
|
|
|
|
owner @{user_config_dirs}/qBittorrent/** rwkl -> @{user_config_dirs}/qBittorrent/#[0-9]*[0-9],
|
2022-01-08 13:41:21 +01:00
|
|
|
owner @{user_share_dirs}/qBittorrent/ rw,
|
|
|
|
owner @{user_share_dirs}/qBittorrent/** rwl -> @{user_share_dirs}/data/qBittorrent/**/#[0-9]*[0-9],
|
|
|
|
# Old dir, not recommended to use:
|
|
|
|
deny owner @{user_share_dirs}/data/qBittorrent/ rw,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# Cache dir
|
2021-04-01 18:20:05 +02:00
|
|
|
owner @{user_cache_dirs}/ rw,
|
|
|
|
owner @{user_cache_dirs}/#[0-9]*[0-9] rw,
|
|
|
|
owner @{user_cache_dirs}/qBittorrent/{,**} rw,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# Torrent files
|
2021-04-19 16:20:32 +02:00
|
|
|
@{MOUNTS}/ r,
|
|
|
|
owner @{MOUNTS}/*/ r,
|
2020-09-12 17:19:23 +02:00
|
|
|
owner @{TORRENT_DIR}/ r,
|
|
|
|
owner @{TORRENT_DIR}/** rw,
|
|
|
|
|
|
|
|
/dev/disk/by-label/ r,
|
|
|
|
|
|
|
|
/dev/shm/#[0-9]*[0-9] rw,
|
|
|
|
|
|
|
|
owner @{PROC}/@{pid}/mountinfo r,
|
|
|
|
owner @{PROC}/@{pid}/mounts r,
|
|
|
|
deny @{PROC}/sys/kernel/random/boot_id r,
|
|
|
|
|
|
|
|
|
|
|
|
/var/lib/dbus/machine-id r,
|
|
|
|
/etc/machine-id r,
|
|
|
|
|
|
|
|
/usr/share/mime/mime.cache r,
|
|
|
|
/usr/share/mime/types r,
|
2021-04-01 18:23:34 +02:00
|
|
|
owner @{user_share_dirs}/mime/mime.cache r,
|
|
|
|
owner @{user_share_dirs}/mime/types r,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# TMP
|
|
|
|
owner /tmp/qtsingleapp-qBitto-* rw,
|
|
|
|
owner /tmp/qtsingleapp-qBitto-*-lockfile rwk,
|
|
|
|
owner /tmp/.qBittorrent/ rw,
|
2022-01-08 13:41:21 +01:00
|
|
|
owner /tmp/.qBittorrent/* rwl -> /tmp/.qBittorrent/*,
|
2020-09-12 17:19:23 +02:00
|
|
|
owner /tmp/mozilla_*/*.torrent rw,
|
2021-09-07 01:24:39 +02:00
|
|
|
owner /tmp/*.torrent rw,
|
2020-09-12 17:19:23 +02:00
|
|
|
owner /tmp/.*/{,s} rw,
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/qbittorrent-nox>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|