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

abi <abi/3.0>,

include <tunables/global>

@{exec_path} = @{bin}/findmnt
profile findmnt @{exec_path} flags=(attach_disconnected,complain) {
  include <abstractions/base>
  include <abstractions/consoles>
  include <abstractions/disks-read>

  capability dac_read_search,
  capability sys_rawio,

  @{exec_path} mr,

  /etc/fstab r,
  /etc/mtab r,
  
  @{PROC}/@{pids}/mountinfo r,

  # File Inherit
  deny unix (receive) type=stream,

  include if exists <local/findmnt>
}

# vim:syntax=apparmor
