# 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}/at @{bin}/atq @{bin}/atrm @{bin}/batch
profile at @{exec_path} {
  include <abstractions/base>
  include <abstractions/consoles>
  include <abstractions/nameservice-strict>

  capability fsetid,

  signal (send) set=(hup) peer=atd,

  @{exec_path} mr,

  /etc/at.deny r,
  /etc/at.allow r,

  /var/spool/cron/atjobs/{,*} rwk,
  /var/spool/cron/atspool/{,*} rwk,

  @{run}/atd.pid r,

  @{PROC}/@{pid}/loginuid r,

  include if exists <local/at>
}

# vim:syntax=apparmor
