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

abi <abi/3.0>,

include <tunables/global>

@{exec_path} = @{bin}/landscape-sysinfo
profile landscape-sysinfo @{exec_path} {
  include <abstractions/base>
  include <abstractions/nameservice-strict>
  include <abstractions/python>

  capability dac_override,
  capability kill,
  capability sys_ptrace,

  network inet dgram,
  network inet6 dgram,
  network netlink raw,

  ptrace (read),

  @{exec_path} mr,

  @{bin}/who rix,

  /var/log/landscape/{,**} rw,

  @{run}/utmp rwk,

  @{sys}/class/hwmon/ r,
  @{sys}/class/thermal/ r,
  @{sys}/devices/virtual/thermal/thermal_zone@{int}/temp r,

        @{PROC}/ r,
        @{PROC}/@{pids}/cmdline r,
        @{PROC}/@{pids}/stat r,
        @{PROC}/@{pids}/status r,
        @{PROC}/uptime r,
  owner @{PROC}/@{pid}/fd/ r,
  owner @{PROC}/@{pid}/mounts r,

  /dev/tty@{int} rw,

  include if exists <local/landscape-sysinfo>
}

# vim:syntax=apparmor
