apparmor.d/profiles/networkctl

63 lines
1.6 KiB
Text
Raw Normal View History

# vim:syntax=apparmor
# ------------------------------------------------------------------
#
2021-01-10 16:35:07 +01:00
# Copyright (C) 2020-2021 Mikhail Morfikov
#
# 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-12-10 22:33:39 +01:00
include <tunables/global>
@{exec_path} = /{usr/,}bin/networkctl
profile networkctl @{exec_path} flags=(complain) {
2020-12-10 22:33:39 +01:00
include <abstractions/base>
# To be able to manage network interfaces,
capability net_admin,
# Needed? (#FIXME#)
audit deny capability sys_resource,
audit deny capability sys_module,
signal send peer=child-pager,
2020-12-10 22:33:39 +01:00
network inet dgram,
network inet6 dgram,
network netlink raw,
@{exec_path} mr,
/{usr/,}bin/pager rPx -> child-pager,
/{usr/,}bin/less rPx -> child-pager,
/{usr/,}bin/more rPx -> child-pager,
@{sys}/devices/**/net/**/uevent r,
2020-10-25 10:23:34 +01:00
@{run}/systemd/netif/links/[0-9]* r,
@{run}/systemd/netif/state r,
2020-12-10 22:33:39 +01:00
owner @{PROC}/@{pid}/cgroup r,
owner @{PROC}/@{pid}/stat r,
@{PROC}/sys/kernel/random/boot_id r,
/etc/udev/hwdb.bin r,
# To be able to read logs
2020-10-25 10:23:34 +01:00
@{run}/log/ r,
/{run,var}/log/journal/ r,
/{run,var}/log/journal/[0-9a-f]*/ r,
/{run,var}/log/journal/[0-9a-f]*/user-[0-9a-f]*.journal* r,
/{run,var}/log/journal/[0-9a-f]*/system.journal* r,
/{run,var}/log/journal/[0-9a-f]*/system@[0-9a-f]*.journal* r,
/var/lib/dbus/machine-id r,
/etc/machine-id r,
2020-12-10 22:33:39 +01:00
include if exists <local/networkctld>
}