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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/pkexec
profile pkexec @{exec_path} {
  include <abstractions/base>
  include <abstractions/app/pkexec>

  capability sys_nice,

  signal send set=(term, kill) peer=polkit-agent-helper,

  ptrace read,

  @{exec_path} mr,

  @{bin}/*       PUx,
  @{lib}/**      PUx,
  /opt/*/**      PUx,
  /usr/share/**  PUx,

  /etc/default/locale r,

        @{PROC}/@{pid}/fdinfo/@{int} r,
        @{PROC}/@{pid}/stat r,
  owner @{PROC}/@{pid}/fd/ r,

  include if exists <local/pkexec>
}

# vim:syntax=apparmor
