# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2023-2024 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/systemd-cryptsetup-generator
@{att} = /att/systemd-generator-cryptsetup/
profile systemd-generator-cryptsetup /{,usr/}lib{,exec,32,64}/systemd/system-generators/systemd-cryptsetup-generator  flags=(attach_disconnected,attach_disconnected.path=@{att},complain) {
  include <abstractions/attached/base>
  include <abstractions/attached/consoles>
  include <abstractions/common/systemd>

  ptrace read peer=@{p_systemd},

  @{exec_path} mr,

  /etc/crypttab r,

  @{run}/systemd/generator/{,**} rw,

  @{PROC}/@{pid}/cgroup r,

  include if exists <local/systemd-generator-cryptsetup>
}

# vim:syntax=apparmor
