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
|
|
|
|
|
|
|
@{SYNC_FOLDER}=/media/*/cloud_storage
|
|
|
|
|
|
|
|
@{exec_path} = /{usr/,}bin/megasync
|
|
|
|
profile megasync @{exec_path} {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/consoles>
|
|
|
|
include <abstractions/X>
|
|
|
|
include <abstractions/gtk>
|
|
|
|
include <abstractions/freedesktop.org>
|
|
|
|
include <abstractions/fonts>
|
|
|
|
include <abstractions/fontconfig-cache-read>
|
|
|
|
include <abstractions/dri-enumerate>
|
|
|
|
include <abstractions/mesa>
|
|
|
|
include <abstractions/nameservice-strict>
|
|
|
|
include <abstractions/qt5-compose-cache-write>
|
|
|
|
include <abstractions/qt5-settings-write>
|
|
|
|
include <abstractions/user-download-strict>
|
|
|
|
include <abstractions/openssl>
|
|
|
|
include <abstractions/ssl_certs>
|
|
|
|
include <abstractions/deny-root-dir-access>
|
|
|
|
|
|
|
|
network inet dgram,
|
|
|
|
network inet6 dgram,
|
|
|
|
network inet stream,
|
|
|
|
network inet6 stream,
|
|
|
|
network netlink dgram,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{exec_path} mrix,
|
|
|
|
|
2020-12-09 10:30:52 +01:00
|
|
|
/{usr/,}bin/{,ba,da}sh rix,
|
|
|
|
/{usr/,}bin/{,e}grep rix,
|
|
|
|
/{usr/,}bin/gawk rix,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-09 10:30:52 +01:00
|
|
|
/{usr/,}bin/xrdb rPx,
|
|
|
|
/{usr/,}bin/xdg-mime rPx,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-09 10:30:52 +01:00
|
|
|
/{usr/,}bin/xdg-open rCx -> open,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# Megasync home files
|
|
|
|
owner @{HOME}/ r,
|
|
|
|
owner "@{HOME}/.local/share/data/Mega Limited/" rw,
|
|
|
|
owner "@{HOME}/.local/share/data/Mega Limited/**" rwkl -> "@{HOME}/.local/share/data/Mega Limited/MEGAsync/#[0-9]*[0-9]",
|
|
|
|
|
|
|
|
# To configure Qt5 settings (theme, font, icons, etc.) under DE/WM without Qt integration
|
|
|
|
owner @{HOME}/.config/qt5ct/{,**} r,
|
|
|
|
/usr/share/qt5ct/** r,
|
|
|
|
|
|
|
|
owner @{HOME}/.config/QtProject.conf r,
|
|
|
|
|
|
|
|
# Sync folder
|
|
|
|
#/ r,
|
|
|
|
#/media/ r,
|
|
|
|
#/media/*/ r,
|
|
|
|
owner @{SYNC_FOLDER}/ r,
|
|
|
|
owner @{SYNC_FOLDER}/** rwl -> @{SYNC_FOLDER}/**,
|
|
|
|
|
|
|
|
# Proc filesystem
|
|
|
|
deny owner @{PROC}/@{pid}/cmdline r,
|
|
|
|
deny @{PROC}/sys/kernel/random/boot_id r,
|
|
|
|
owner @{PROC}/@{pid}/mounts r,
|
|
|
|
owner @{PROC}/@{pid}/mountinfo r,
|
|
|
|
|
|
|
|
/etc/fstab r,
|
|
|
|
|
|
|
|
# Autostart
|
|
|
|
owner @{HOME}/.config/autostart/#[0-9]*[0-9] rw,
|
|
|
|
owner @{HOME}/.config/autostart/megasync.desktop rwl -> @{HOME}/.config/autostart/#[0-9]*[0-9],
|
|
|
|
|
|
|
|
/dev/shm/#[0-9]*[0-9] rw,
|
|
|
|
|
|
|
|
/etc/machine-id r,
|
|
|
|
/var/lib/dbus/machine-id r,
|
|
|
|
|
|
|
|
/usr/share/hwdata/pnp.ids r,
|
|
|
|
|
|
|
|
# Allowed apps to open
|
|
|
|
/{usr/,}lib/firefox/firefox rPx,
|
|
|
|
/{usr/,}bin/spacefm rPx,
|
|
|
|
|
|
|
|
# file_inherit
|
|
|
|
owner /dev/tty[0-9]* rw,
|
|
|
|
|
|
|
|
|
|
|
|
profile open {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/xdg-open>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
/{usr/,}bin/xdg-open mr,
|
|
|
|
|
2021-02-13 15:00:16 +01:00
|
|
|
/{usr/,}bin/{,ba,da}sh rix,
|
|
|
|
/{usr/,}bin/gawk rix,
|
|
|
|
/{usr/,}bin/readlink rix,
|
|
|
|
/{usr/,}bin/basename rix,
|
|
|
|
|
2020-12-09 10:30:52 +01:00
|
|
|
owner @{HOME}/ r,
|
|
|
|
owner "@{HOME}/.local/share/data/Mega Limited/MEGAsync/" r,
|
|
|
|
|
|
|
|
owner @{run}/user/[0-9]*/ r,
|
|
|
|
|
2020-09-12 17:19:23 +02:00
|
|
|
# Allowed apps to open
|
|
|
|
/{usr/,}lib/firefox/firefox rPx,
|
|
|
|
/{usr/,}bin/spacefm rPx,
|
|
|
|
|
|
|
|
# file_inherit
|
|
|
|
owner "@{HOME}/.local/share/data/Mega Limited/MEGAsync/logs/MEGAsync.log" rw,
|
|
|
|
owner @{HOME}/.xsession-errors w,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/megasync>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|