# 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} = @{bin}/firecfg
profile firecfg @{exec_path} flags=(attach_disconnected) {
  include <abstractions/base>
  include <abstractions/nameservice-strict>

  capability dac_read_search,
  capability mknod,
  capability setgid,
  capability setuid,

  @{exec_path} mr,

  @{sh_path}         rix,
  @{bin}/apparmor_parser rPx,

  /etc/login.defs r,
  /etc/firejail/firejail.users r,
  /etc/firejail/firecfg.config r,

  /usr/local/bin/ r,
  /usr/local/bin/* rw,

  # freedesktop.org-strict
  /usr/share/applications/ r,
  /usr/share/applications/*.desktop r,
  @{user_share_dirs}/applications/ r,

  @{user_share_dirs}/applications/*.desktop rw,

  /dev/tty rw,

  include if exists <local/firecfg>
}

# vim:syntax=apparmor
