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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/sulogin
profile sulogin /{,usr/}{,s}bin/sulogin flags=(complain) {
  include <abstractions/base>
  include <abstractions/nameservice-strict>

  capability sys_admin,

  @{exec_path} mr,

  # The shell is not confined on purpose.
  @{bin}/@{shells}     rUx,

  /etc/shadow r,

  @{PROC}/consoles r,

  /dev/ r,
  /dev/tty@{int} rw,

  include if exists <local/sulogin>
}