# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2019-2022 Mikhail Morfikov
# 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}/dmesg
profile dmesg @{exec_path} {
  include <abstractions/base>
  include <abstractions/consoles>

  capability dac_read_search,
  capability syslog,

  @{exec_path} mr,

  @{sh_path}    rix,
  @{pager_path} rPx -> child-pager,

  /usr/share/terminfo/** r,

  @{PROC}/sys/kernel/pid_max r,

  /dev/kmsg r,

  deny @{bin}/{,*/} r,
  deny /{usr/,}local/{,s}bin/ r,
  deny /var/lib/flatpak/exports/bin/ r,
  deny @{HOME}/.go/bin/ r,
  deny @{user_bin_dirs}/ r,

  include if exists <local/dmesg>
}

# vim:syntax=apparmor
