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

  @{exec_path} mr,

  @{sys}/devices/system/cpu/{,**} r,
  @{sys}/devices/system/node/ r,
  @{sys}/devices/system/node/node@{int}/cpumap r,
  @{sys}/firmware/dmi/tables/DMI r,
  @{sys}/kernel/cpu_byteorder r,

  @{PROC}/ r,
  @{PROC}/bus/pci/devices r,
  @{PROC}/sys/kernel/osrelease r,

  /dev/tty@{int} rw,

  deny network unix stream,

  include if exists <local/lscpu>
}
