# 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}/systemd/system-generators/sshd-socket-generator
@{att} = /att/systemd-generator-sshd-socket/
profile systemd-generator-sshd-socket /{,usr/}lib{,exec,32,64}/systemd/system-generators/sshd-socket-generator flags=(attach_disconnected,attach_disconnected.path=@{att},complain) {
  include <abstractions/attached/base>
  include <abstractions/nameservice-strict>

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

  ptrace read peer=@{p_systemd},

  @{exec_path} mr,

  @{etc_ro}/ssh/sshd_config r,
  @{etc_ro}/ssh/sshd_config.d/{,*} r,

  @{run}/systemd/generator/ssh.socket.d/{,*} rw,

  include if exists <local/systemd-generator-sshd-socket>
}

# vim:syntax=apparmor
