# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2023-2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only

  abi <abi/4.0>,

  dbus send bus=system path=/org/freedesktop
       interface=org.freedesktop.DBus.ObjectManager
       member=GetManagedObjects
       peer=(name="{@{busname},org.freedesktop.NetworkManager}", label=NetworkManager),

  dbus send bus=system path=/org/freedesktop/NetworkManager{,/**}
       interface=org.freedesktop.DBus.Properties
       member={Get,GetAll}
       peer=(name="{@{busname},org.freedesktop.NetworkManager}", label=NetworkManager),

  dbus send bus=system path=/org/freedesktop/NetworkManager
       interface=org.freedesktop.NetworkManager
       member={GetDevices,GetPermissions}
       peer=(name="{@{busname},org.freedesktop.NetworkManager}", label=NetworkManager),

  dbus send bus=system path=/org/freedesktop/NetworkManager/Settings
       interface=org.freedesktop.NetworkManager.Settings
       member=ListConnections
       peer=(name="{@{busname},org.freedesktop.NetworkManager}", label=NetworkManager),

  dbus send bus=system path=/org/freedesktop/NetworkManager/Settings/@{int}
       interface=org.freedesktop.NetworkManager.Settings.Connection
       member=GetSettings
       peer=(name="{@{busname},org.freedesktop.NetworkManager}", label=NetworkManager),

  dbus send bus=system path=/org/freedesktop/NetworkManager
       interface=org.freedesktop.DBus.Introspectable
       member=Introspect
       peer=(name="{@{busname},org.freedesktop.NetworkManager}", label=NetworkManager),

  dbus receive bus=system path=/org/freedesktop
       interface=org.freedesktop.DBus.ObjectManager
       member=InterfacesAdded
       peer=(name="{@{busname},org.freedesktop.NetworkManager}", label=NetworkManager),

  dbus receive bus=system path=/org/freedesktop/NetworkManager{,/**}
       interface=org.freedesktop.DBus.Properties
       member=PropertiesChanged
       peer=(name="{@{busname},org.freedesktop.NetworkManager}", label=NetworkManager),

  dbus receive bus=system path=/org/freedesktop/NetworkManager
       interface=org.freedesktop.DBus.Properties
       member=CheckPermissions
       peer=(name="{@{busname},org.freedesktop.NetworkManager}", label=NetworkManager),

  dbus receive bus=system path=/org/freedesktop/NetworkManager
       interface=org.freedesktop.NetworkManager
       member=CheckPermissions
       peer=(name="{@{busname},org.freedesktop.NetworkManager}", label=NetworkManager),

  dbus receive bus=system path=/org/freedesktop/NetworkManager
       interface=org.freedesktop.NetworkManager
       member={CheckPermissions,DeviceAdded,DeviceRemoved,StateChanged}
       peer=(name="{@{busname},org.freedesktop.NetworkManager}", label=NetworkManager),

  dbus receive bus=system path=/org/freedesktop/NetworkManager/Settings/@{int}
       interface=org.freedesktop.NetworkManager.Settings.Connection
       member=Updated
       peer=(name="{@{busname},org.freedesktop.NetworkManager}", label=NetworkManager),

  include if exists <abstractions/bus/org.freedesktop.NetworkManager.d>

# vim:syntax=apparmor
