# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2022 Jeroen Rijken
# 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}/grub-mount
profile grub-mount @{exec_path} {
  include <abstractions/base>
  include <abstractions/consoles>
  include <abstractions/disks-read>

  capability sys_admin,

  mount fstype=fuse.grub-mount -> /var/lib/os-prober/mount/,
  umount /var/lib/os-prober/mount/,

  @{exec_path} mr,

  / r,
  /var/lib/os-prober/mount/ r,

  /dev/fuse rw,

  include if exists <local/grub-mount>
}

# vim:syntax=apparmor
