2020-09-12 17:19:23 +02:00
|
|
|
# vim:syntax=apparmor
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
#
|
2021-01-10 16:35:07 +01:00
|
|
|
# Copyright (C) 2020-2021 Mikhail Morfikov
|
2020-09-12 17:19:23 +02:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of version 2 of the GNU General Public
|
|
|
|
# License published by the Free Software Foundation.
|
|
|
|
#
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
|
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
|
|
|
|
|
|
|
@{exec_path} = /{usr/,}bin/geany
|
|
|
|
profile geany @{exec_path} {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/gtk>
|
|
|
|
include <abstractions/fonts>
|
|
|
|
include <abstractions/fontconfig-cache-read>
|
|
|
|
include <abstractions/freedesktop.org>
|
|
|
|
include <abstractions/enchant>
|
|
|
|
include <abstractions/nameservice-strict>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# To edit system files as root.
|
|
|
|
capability dac_read_search,
|
|
|
|
capability dac_override,
|
|
|
|
|
|
|
|
deny capability sys_nice,
|
|
|
|
|
2021-03-13 09:47:36 +01:00
|
|
|
network inet stream,
|
|
|
|
network inet6 stream,
|
2021-01-10 16:35:07 +01:00
|
|
|
|
2020-09-12 17:19:23 +02:00
|
|
|
@{exec_path} mr,
|
|
|
|
|
2021-02-13 15:00:16 +01:00
|
|
|
/{usr/,}bin/{,ba,da}sh rix,
|
|
|
|
|
2020-09-12 17:19:23 +02:00
|
|
|
# For the sorting feature
|
2021-02-13 15:00:16 +01:00
|
|
|
/{usr/,}bin/sort rix,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# When geany is run as root, it wants to exec dbus-launch, and hence it creates the two following
|
|
|
|
# root processes:
|
|
|
|
# dbus-launch --autolaunch e0a30ad97cd6421c85247839ccef9db2 --binary-syntax --close-stderr
|
|
|
|
# /usr/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session
|
|
|
|
#
|
|
|
|
# Should this be allowed? Geany works fine without this.
|
|
|
|
#/{usr/,}bin/dbus-launch rCx -> dbus,
|
|
|
|
#/{usr/,}bin/dbus-send rCx -> dbus,
|
|
|
|
deny /{usr/,}bin/dbus-launch rx,
|
|
|
|
deny /{usr/,}bin/dbus-send rx,
|
|
|
|
|
|
|
|
owner @{PROC}/@{pid}/fd/ r,
|
2020-10-13 16:47:49 +02:00
|
|
|
owner @{PROC}/@{pid}/mountinfo r,
|
|
|
|
owner @{PROC}/@{pid}/mounts r,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
/usr/share/geany/{,**} r,
|
|
|
|
|
|
|
|
owner @{HOME}/.config/geany/{,**} rw,
|
|
|
|
|
|
|
|
owner /{run/,}user/[0-9]*/geany/geany_socket.[0-9a-f]* rw,
|
|
|
|
|
|
|
|
# To read/write files in the system. The read permission is granted for all files, the write
|
|
|
|
# permission only for the owner. Also, dirs like /dev/, /proc/, /sys/ are not included in
|
|
|
|
# the list.
|
|
|
|
/ r,
|
|
|
|
/boot/ r,
|
|
|
|
/boot/** r,
|
|
|
|
owner /boot/** rw,
|
|
|
|
/etc/ r,
|
|
|
|
/etc/** r,
|
|
|
|
owner /etc/** rw,
|
|
|
|
/efi/ r,
|
|
|
|
/efi/** r,
|
|
|
|
owner /efi/** rw,
|
|
|
|
/home/ r,
|
|
|
|
/home/** r,
|
|
|
|
owner /home/** rw,
|
|
|
|
/lost+found/ r,
|
|
|
|
/lost+found/** r,
|
|
|
|
owner /lost+found/** rw,
|
|
|
|
/media/ r,
|
|
|
|
/media/** r,
|
|
|
|
owner /media/** rw,
|
|
|
|
/mnt/ r,
|
|
|
|
/mnt/** r,
|
|
|
|
owner /mnt/** rw,
|
|
|
|
/opt/ r,
|
|
|
|
/opt/** r,
|
|
|
|
owner /opt/** rw,
|
|
|
|
/root/ r,
|
|
|
|
/root/** r,
|
|
|
|
owner /root/** rw,
|
|
|
|
/run/ r,
|
|
|
|
/run/** r,
|
|
|
|
owner /run/** rw,
|
|
|
|
/srv/ r,
|
|
|
|
/srv/** r,
|
|
|
|
owner /srv/** rw,
|
|
|
|
/tmp/ r,
|
|
|
|
/tmp/** r,
|
|
|
|
owner /tmp/** rw,
|
|
|
|
/usr/ r,
|
|
|
|
/usr/** r,
|
|
|
|
owner /usr/** rw,
|
|
|
|
/var/ r,
|
|
|
|
/var/** r,
|
|
|
|
owner /var/** rw,
|
|
|
|
|
|
|
|
|
|
|
|
profile dbus {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/nameservice-strict>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
/{usr/,}bin/dbus-launch mr,
|
|
|
|
/{usr/,}bin/dbus-send mr,
|
|
|
|
/{usr/,}bin/dbus-daemon rPUx,
|
|
|
|
|
|
|
|
# for dbus-launch
|
|
|
|
owner @{HOME}/.dbus/session-bus/[0-9a-f]*-[0-9] w,
|
|
|
|
|
|
|
|
@{HOME}/.Xauthority r,
|
|
|
|
}
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/geany>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|