apparmor.d/profiles/dhclient

55 lines
1.3 KiB
Text
Raw Normal View History

# vim:syntax=apparmor
# ------------------------------------------------------------------
#
2021-01-10 16:35:07 +01:00
# Copyright (C) 2018-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/,}sbin/dhclient
profile dhclient @{exec_path} {
2020-12-10 22:33:39 +01:00
include <abstractions/base>
include <abstractions/nameservice-strict>
include <abstractions/openssl>
# To remove the following errors:
# dhclient[]: Open a socket for LPF: Operation not permitted
capability net_raw,
# To remove the following errors:
# dhclient[]: Can't bind to dhcp address: Permission denied
capability net_bind_service,
# Needed?
2020-12-24 13:55:12 +01:00
audit deny capability net_admin,
audit deny capability sys_module,
2020-12-10 22:33:39 +01:00
network inet dgram,
network inet6 dgram,
network netlink raw,
network packet raw,
@{exec_path} mr,
# To run dhclient scripts
/{usr/,}sbin/dhclient-script rPx,
/etc/dhclient.conf r,
/etc/dhcp/{,**} r,
/var/lib/dhcp{,3}/dhclient* rw,
2020-10-25 10:23:34 +01:00
owner @{run}/dhclient*.pid rw,
owner @{run}/dhclient*.lease* rw,
owner @{PROC}/@{pid}/task/@{tid}/comm rw,
2020-12-10 22:33:39 +01:00
include if exists <local/dhclient>
}