# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2025 Zane Zakraisek <zakraise@eng.utah.edu>
# SPDX-License-Identifier: GPL-2.0-only

abi <abi/4.0>,

include <tunables/global>

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

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

  @{exec_path} mr,

  #User keytab file
  /var/lib/krb5/user/@{uid}/client.keytab r,

  #Credentials cache
  /tmp/krb5cc_* rwk,
  /tmp/tkt* rwk,

  include if exists <local/kinit>
}

# vim:syntax=apparmor
