-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-apparmor-profile
67 lines (62 loc) · 2.37 KB
/
docker-apparmor-profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# systemctl-mqtt - MQTT client triggering & reporting shutdown on systemd-based systems
#
# Copyright (C) 2020 Fabian Peter Hammerle <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <tunables/global>
profile systemctl-mqtt flags=(attach_disconnected) {
#include <abstractions/base>
network inet,
# https://jlk.fjfi.cvut.cz/arch/manpages/man/apparmor.d.5#Access_Modes
/systemctl-mqtt/ r,
/systemctl-mqtt/** r,
/systemctl-mqtt/.venv/lib/python3.8/site-packages/_dbus_bindings.so m,
/systemctl-mqtt/.venv/lib/python3.8/site-packages/_dbus_glib_bindings.so m,
/systemctl-mqtt/.venv/lib/python3.8/site-packages/gi/_gi.cpython-38-*-linux-gnu.so m,
/systemctl-mqtt/.venv/lib/python3.8/site-packages/gi/_gi_cairo.cpython-38-*-linux-gnu.so m,
# https://presentations.nordisch.org/apparmor/#/25
/systemctl-mqtt/.venv/bin/systemctl-mqtt rix,
/etc/** r,
/usr/lib/** rm,
/var/** r,
deny /bin/** rwklx,
deny @{PROC}/** rwklx,
deny /sys/** rwklx,
# https://gitlab.com/apparmor/apparmor/-/wikis/AppArmorDBus
#include <abstractions/dbus-strict>
dbus (send, receive)
bus=system
path=/org/freedesktop/login1
interface=org.freedesktop.DBus.Introspectable
member=Introspect
peer=(label=unconfined),
dbus (send)
bus=system
path=/org/freedesktop/login1
interface=org.freedesktop.login1.Manager
member={Inhibit,ListInhibitors,ScheduleShutdown,LockSessions}
peer=(label=unconfined),
dbus (receive)
bus=system
path=/org/freedesktop/login1
interface=org.freedesktop.login1.Manager
member=PrepareForShutdown
peer=(label=unconfined),
dbus (send)
bus=system
path=/org/freedesktop/login1
interface=org.freedesktop.DBus.Properties
member=Get
peer=(label=unconfined),
}