apparmor.d/profiles/ip

56 lines
1.5 KiB
Text
Raw Normal View History

# vim:syntax=apparmor
# ------------------------------------------------------------------
#
2021-01-10 16:35:07 +01:00
# Copyright (C) 2019-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>
# When "ip netns" is issued, the following error will be printed:
# "Failed name lookup - disconnected path" error=-13 profile="ip" name="".
@{exec_path} = /{usr/,}bin/ip
profile ip @{exec_path} flags=(attach_disconnected) {
2020-12-10 22:33:39 +01:00
include <abstractions/base>
# To be able to manage network interfaces.
capability net_admin,
# Needed?
2020-12-24 13:55:12 +01:00
#capability sys_admin,
audit deny capability sys_module,
2020-12-10 22:33:39 +01:00
network netlink raw,
@{exec_path} mrix,
mount options=(rw, rshared) -> /{var/,}run/netns/,
mount options=(rw, rslave) -> /,
mount options=(rw, bind) / -> /{var/,}run/netns/*,
mount options=(rw, bind) /etc/netns/firefox/resolv.conf -> /etc/resolv.conf,
mount fstype=sysfs -> /sys/,
2020-10-25 10:23:34 +01:00
umount @{run}/netns/*,
umount /sys/,
/etc/iproute2/{,**} r,
/ r,
2020-10-25 10:23:34 +01:00
owner @{run}/netns/ rw,
@{run}/netns/* rw,
/etc/netns/*/ r,
owner @{PROC}/@{pid}/cgroup r,
owner @{PROC}/@{pid}/net/dev_mcast r,
owner @{PROC}/@{pid}/net/igmp{,6} r,
owner @{PROC}/sys/net/ipv{4,6}/route/flush w,
2020-12-10 22:33:39 +01:00
include if exists <local/ip>
}