# AppArmor profile for the Oneleet Agent GUI.
#
# Ubuntu 23.10+ (enforced by default since 24.04) restricts unprivileged
# user namespaces via AppArmor. The Electron/Chromium sandbox needs to
# create user namespaces, so without this profile the Agent refuses to
# start ("The SUID sandbox helper binary was found, but is not configured
# correctly").
#
# This profile does not confine the application — it exists solely to
# grant the userns permission, mirroring the profiles Ubuntu ships for
# Chrome and other Electron apps in /etc/apparmor.d/.
#
# Installed to /etc/apparmor.d/oneleet-agent by the package's
# post-install script (resources/linux/scripts/postinstall.sh).
abi <abi/4.0>,
include <tunables/global>

profile oneleet-agent /opt/Oneleet/oneleet-agent flags=(unconfined) {
  userns,

  # Site-specific additions and overrides. See local/README for details.
  include if exists <local/oneleet-agent>
}
