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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/nproc
@{att} = /att/nproc/
profile nproc /{,usr/}bin/nproc flags=(attach_disconnected,attach_disconnected.path=@{att}) {
  include <abstractions/attached/base>
  include <abstractions/cgroup-limits>
  include <abstractions/attached/consoles>

  @{exec_path} mr,

  # file_inherit
  deny network netlink raw,
  deny owner @{user_config_dirs}/** rw,
  deny /dev/ptmx rw,

  include if exists <local/nproc>
}

# vim:syntax=apparmor
