apparmor.d/profiles/syncthing
2021-04-01 16:17:47 +01:00

71 lines
1.4 KiB
Plaintext

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2020-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{SYNC_DIR} = @{HOME}/Sync/
@{SYNC_DIR} += /media/*/syncthing/
@{exec_path} = /{usr/,}bin/syncthing
profile syncthing @{exec_path} {
include <abstractions/base>
include <abstractions/nameservice-strict>
include <abstractions/ssl_certs>
include <abstractions/deny-root-dir-access>
network inet dgram,
network inet6 dgram,
network inet stream,
network inet6 stream,
network netlink raw,
@{exec_path} mrix,
/{usr/,}bin/xdg-open rCx -> open,
/{usr/,}bin/ip rix,
owner @{HOME}/ r,
owner @{HOME}/.config/syncthing/ rw,
owner @{HOME}/.config/syncthing/** rwk,
@{SYNC_DIR}/{,**} rw,
/etc/mime.types r,
@{PROC}/sys/net/core/somaxconn r,
@{sys}/kernel/mm/transparent_hugepage/hpage_pmd_size r,
# Silecne the noise
deny /etc/ssl/certs/java/ r,
profile open {
include <abstractions/base>
include <abstractions/xdg-open>
/{usr/,}bin/xdg-open mr,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/gawk rix,
/{usr/,}bin/readlink rix,
/{usr/,}bin/basename rix,
owner @{HOME}/ r,
owner @{run}/user/[0-9]*/ r,
# Allowed apps to open
/{usr/,}lib/firefox/firefox rPUx,
# file_inherit
owner @{HOME}/.xsession-errors w,
}
include if exists <local/syncthing>
}