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

# This profile is designed to be used in a child profile to limit what
# confined application can invoke via xdg-open helper.

# Instead of allowing the run of all software in @{bin}/, the purpose of
# this profile is to list all GUI program that can open resources.

# Ultimatelly, only sandbox manager program like bwrap, snap, flatpak, firejail
# should be present here. Until this day, this profile will be a controlled mess.

# Note: This profile does not specify an attachment path because it is
# intended to be used only via "px -> child-open" exec transitions
# from other profiles.

abi <abi/4.0>,

include <tunables/global>

@{att} = /att/child-open/
profile child-open  flags=(attach_disconnected,attach_disconnected.path=@{att},mediate_deleted,complain) {
  include <abstractions/attached/base>
  include <abstractions/app-open>
  include <abstractions/app/open>

  include if exists <usr/child-open.d>
  include if exists <local/child-open>
}

# vim:syntax=apparmor
