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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/aa-notify
profile aa-notify @{exec_path} {
  include <abstractions/base>
  include <abstractions/bus-session>
  include <abstractions/consoles>
  include <abstractions/nameservice-strict>
  include <abstractions/python>

  capability setgid,
  capability setuid,
  capability sys_ptrace,

  ptrace read,

  @{exec_path} mr,

  @{bin}/ r,

  /usr/share/terminfo/** r,

  @{etc_ro}/inputrc r,
  @{etc_ro}/inputrc.keys r,
  /etc/apparmor.d/{,**} r,
  /etc/apparmor/*.conf r,

  /var/log/audit/audit.log r,

  owner @{HOME}/.inputrc r,
  owner @{HOME}/.terminfo/@{int}/dumb r,

  owner @{tmp}/@{rand8} rw,
  owner @{tmp}/apparmor-bugreport-@{rand8}.txt rw,

  @{PROC}/ r,
  @{PROC}/@{pid}/stat r,
  @{PROC}/@{pid}/cmdline r,

  include if exists <local/aa-notify>
}

# vim:syntax=apparmor
