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

include <tunables/global>

@{exec_path} = @{lib}/snapd/snap-device-helper
@{att} = ""
profile snap-device-helper /{,usr/}lib{,exec,32,64}/snapd/snap-device-helper flags=(complain) {
  include <abstractions/base-strict>

  capability bpf,
  capability dac_read_search,
  capability setgid,
  capability sys_resource,

  @{exec_path} mr,

  @{sys}/fs/bpf/snap/ w,

  include if exists <local/snap-device-helper>
}

# vim:syntax=apparmor
