# 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/3.0>,

include <tunables/global>

@{exec_path} = @{lib}/update-notifier/package-system-locked
profile package-system-locked @{exec_path} flags=(attach_disconnected) {
  include <abstractions/base>

  capability dac_read_search,
  capability sys_ptrace,
  capability syslog,

  network inet dgram,
  network inet6 dgram,

  # mqueue r type=posix /,

  ptrace (read),

  @{exec_path} mr,

  @{sh_path}         rix,
  @{bin}/fuser       rix,

        @{PROC}/ r,
        @{PROC}/@{pids}/fd/ r,
        @{PROC}/@{pids}/maps r,
        @{PROC}/swaps r,
  owner @{PROC}/@{pid}/mounts r,
  owner @{PROC}/@{pid}/net/unix r,
  owner @{PROC}/@{pid}/stat r,

  include if exists <local/package-system-locked>
}

# vim:syntax=apparmor
