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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{etc_ro}/needrestart/hook.d/*
@{att} = ""
profile needrestart-hook /{,usr/}etc/needrestart/hook.d/* flags=(complain) {
  include <abstractions/base-strict>
  include <abstractions/consoles>
  include <abstractions/perl>

  @{exec_path} mr,
  @{sh_path} rix,

  @{bin}/dpkg-query   px,

  /tmp/ r,

  include if exists <local/needrestart-hook>
}

# vim:syntax=apparmor
