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

include <tunables/global>

@{exec_path} = @{bin}/yadifad
profile yadifad @{exec_path} {
  include <abstractions/base>
  include <abstractions/nameservice-strict>
  include <abstractions/nis>

  capability dac_override,
  capability chown,
  capability setgid,
  capability setuid,

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

  @{exec_path} mr,

  /etc/yadifa/yadifad.conf               r,

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

  owner /var/lib/yadifa/{,**}       rw,

  owner @{run}/yadifa/{,*}    rw,
  owner @{run}/yadifa/yadifad.pid   rwk,

  include if exists <local/yadifad>
}
