# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2023 Jeroen Rijken
# Copyright (C) 2025 Jose Maldonado
# SPDX-License-Identifier: GPL-2.0-only

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{sbin}/rpcbind
@{att} = ""
profile rpcbind /{,usr/}{,s}bin/rpcbind flags=(complain) {
  include <abstractions/base-strict>
  include <abstractions/hosts_access>
  include <abstractions/nameservice-strict>

  capability setgid,
  capability setuid,

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

  @{exec_path} rm,

  /etc/netconfig r,

  @{run}/rpcbind.lock rwkl,
  @{run}/rpcbind.sock rw,
  @{run}/rpcbind/*.xdr rwkl,
  @{run}/systemd/notify w,

  include if exists <local/rpcbind>
}

# vim:syntax=apparmor
