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

include <tunables/global>

@{exec_path} = @{bin}/pkcs11-register
profile pkcs11-register @{exec_path} {
  include <abstractions/base>

  @{exec_path} mr,

  /etc/opensc.conf r,

  owner @{HOME}/.mozilla/firefox/*/pkcs11.txt rw,
  owner @{HOME}/.mozilla/firefox/profiles.ini r,
  owner @{HOME}/.pki/nssdb/pkcs11.txt r,
  owner @{HOME}/.thunderbird/*/pkcs11.txt rw,
  owner @{HOME}/.thunderbird/profiles.ini r,

  include if exists <local/pkcs11-register>
}