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

include <tunables/global>

@{exec_path} = @{bin}/aa-status @{bin}/apparmor_status
profile aa-status @{exec_path} {
  include <abstractions/base>
  include <abstractions/consoles>

  capability dac_read_search,
  capability sys_ptrace,

  ptrace (read),

  @{exec_path} mr,

  @{sys}/kernel/security/apparmor/profiles r,
  @{sys}/module/apparmor/parameters/enabled r,

        @{PROC}/ r,
        @{PROC}/@{pids}/attr/apparmor/current r,
        @{PROC}/@{pids}/attr/current r,
  owner @{PROC}/@{pid}/mounts r,

  /dev/tty@{int} rw,

  include if exists <local/aa-status>
}
