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

abi <abi/3.0>,

include <tunables/global>

@{exec_path} = @{bin}/pkttyagent
profile pkttyagent @{exec_path} {
  include <abstractions/base>
  include <abstractions/bus-system>
  include <abstractions/bus/org.freedesktop.PolicyKit1>
  include <abstractions/consoles>
  include <abstractions/nameservice-strict>

  capability sys_nice,
  capability audit_write,

  ptrace (read),
  signal (send,receive),

  @{exec_path} mr,

  @{lib}/polkit-[0-9]/polkit-agent-helper-[0-9]  rPx,
  @{lib}/polkit-agent-helper-[0-9]               rPx,

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

  /dev/tty rw,

  include if exists <local/pkttyagent>
}
