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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{lib}/systemd/systemd-update-utmp
profile systemd-update-utmp @{exec_path} flags=(attach_disconnected) {
  include <abstractions/base>
  include <abstractions/common/systemd>
  include <abstractions/wutmp>

  capability audit_write,
  capability net_admin,

  network netlink raw,

  unix (bind) type=stream addr=@@{udbus}/bus/systemd-update-/,

  @{exec_path} mr,

  @{run}/host/container-manager r,
  @{run}/systemd/private rw,

  include if exists <local/systemd-update-utmp>
}

# vim:syntax=apparmor
