apparmor.d/apparmor.d/groups/apps/signal-desktop
2023-03-02 17:50:45 +00:00

84 lines
2.7 KiB
Text

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2018-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{SIGNAL_INSTALLDIR} = "/opt/Signal{, Beta}"
@{SIGNAL_HOMEDIR} = "@{user_config_dirs}/Signal{, Beta}"
#@{exec_path} = @{SIGNAL_INSTALLDIR}/signal-desktop{,-beta} # (#FIXME#)
@{exec_path} = "/opt/Signal{, Beta}/signal-desktop{,-beta}" # (#FIXME#)
profile signal-desktop @{exec_path} {
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/opencl-intel>
include <abstractions/gtk>
include <abstractions/freedesktop.org>
include <abstractions/fonts>
include <abstractions/fontconfig-cache-read>
include <abstractions/audio>
include <abstractions/mesa>
include <abstractions/nameservice-strict>
include <abstractions/user-download-strict>
include <abstractions/chromium-common>
# Needed?
deny capability sys_ptrace,
network inet dgram,
network inet6 dgram,
network inet stream,
network inet6 stream,
network netlink raw,
@{exec_path} mrix,
# Signal installation dir (#FIXME#)
@{SIGNAL_INSTALLDIR}/ r,
@{SIGNAL_INSTALLDIR}/** r,
@{SIGNAL_INSTALLDIR}/libnode.so mr,
@{SIGNAL_INSTALLDIR}/libffmpeg.so mr,
@{SIGNAL_INSTALLDIR}/{swiftshader/,}libGLESv2.so mr,
@{SIGNAL_INSTALLDIR}/{swiftshader/,}libEGL.so mr,
@{SIGNAL_INSTALLDIR}/chrome-sandbox rPx,
@{SIGNAL_INSTALLDIR}/resources/app.asar.unpacked/node_modules/**.node mr,
@{SIGNAL_INSTALLDIR}/resources/app.asar.unpacked/node_modules/**.so mr,
@{SIGNAL_INSTALLDIR}/resources/app.asar.unpacked/node_modules/**.so.[0-9]* mr,
# Signal home dirs
@{SIGNAL_HOMEDIR}/ rw,
@{SIGNAL_HOMEDIR}/** rwk,
# Signal wants the /tmp/ dir to be mounted with the "exec" flag. If this is not acceptable in
# your system, use the TMPDIR variable to set some other tmp dir.
owner @{SIGNAL_HOMEDIR}/tmp/.org.chromium.Chromium.* mrw,
@{sys}/devices/system/cpu/cpufreq/policy[0-9]/cpuinfo_max_freq r,
@{sys}/devices/pci[0-9]*/**/{irq,vendor,device} r,
@{sys}/devices/virtual/tty/tty[0-9]/active r,
@{sys}/fs/cgroup/** r,
@{PROC}/ r,
owner @{PROC}/@{pid}/fd/ r,
deny owner @{PROC}/@{pid}/oom_{,score_}adj rw,
owner @{PROC}/@{pids}/task/ r,
owner @{PROC}/@{pids}/task/@{tid}/status r,
@{PROC}/@{pids}/stat r,
owner @{PROC}/@{pids}/statm r,
deny owner @{PROC}/@{pid}/cmdline r,
@{PROC}/sys/kernel/yama/ptrace_scope r,
@{PROC}/sys/fs/inotify/max_user_watches r,
@{PROC}/vmstat r,
/var/lib/dbus/machine-id r,
/etc/machine-id r,
# No new privs
/{usr/,}bin/xdg-settings rPx,
/{usr/,}bin/getconf rix,
include if exists <local/signal-desktop>
}