# 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>,

include <tunables/global>

@{exec_path} = @{lib}/apt/apt-helper
profile apt-helper @{exec_path} {
  include <abstractions/base>
  include <abstractions/common/apt>

  @{exec_path} mr,

  @{bin}/nm-online rPx,
  @{bin}/systemctl rCx -> systemctl,
  @{lib}/systemd/systemd-networkd-wait-online rPx,

  owner @{PROC}/@{pid}/fd/ r,

  profile systemctl {
    include <abstractions/base>
    include <abstractions/app/systemctl>

    capability net_admin,

    include if exists <local/apt-helper_systemctl>
  }

  include if exists <local/apt-helper>
}

# vim:syntax=apparmor
