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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/fstrim
profile fstrim @{exec_path} {
  include <abstractions/base>
  include <abstractions/disks-write>

  capability dac_override,
  capability sys_admin,

  @{exec_path} mr,

  /etc/fstab r,

  @{HOMEDIRS}/ r,
  @{MOUNTDIRS}/ r,
  @{MOUNTS}/ r,
  / r,
  /boot/ r,
  /boot/efi/ r,
  /var/ r,

  include if exists <local/fstrim>
}

# vim:syntax=apparmor
