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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{lib}/{openssh,ssh}/sshd-auth
@{att} = ""
profile sshd-auth /{,usr/}lib{,exec,32,64}/{openssh,ssh}/sshd-auth flags=(complain) {
  include <abstractions/base-strict>
  include <abstractions/nameservice-strict>

  capability dac_override,
  capability setgid,
  capability setuid,
  capability sys_chroot,

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

  unix type=stream peer=(label=sshd-session),

  @{exec_path} mr,
  @{sbin}/sshd.hmac r,

  /etc/gss/mech.d/{,*} r,

  include if exists <local/sshd-auth>
}

# vim:syntax=apparmor
