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

abi <abi/3.0>,

include <tunables/global>

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

  capability dac_override,
  capability dac_read_search,

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

  @{exec_path} mr,

  owner @{HOME}/.digrc r,
  owner @{HOME}/batch_mode.dig  r,
  owner @{HOME}/tsig.key        r,
  
  /tmp/batch_mode.dig       r,
  
  owner @{PROC}/@{pids}/task/@{tid}/comm rw,

  include if exists <local/dig>
}

# vim:syntax=apparmor
