# 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}/seahorse
profile seahorse @{exec_path} {
  include <abstractions/base>
  include <abstractions/bus-accessibility>
  include <abstractions/bus-session>
  include <abstractions/bus-system>
  include <abstractions/bus/org.a11y>
  include <abstractions/bus/org.freedesktop.Avahi>
  include <abstractions/bus/org.freedesktop.portal.Desktop>
  include <abstractions/bus/org.freedesktop.secrets>
  include <abstractions/dconf-write>
  include <abstractions/gnome-strict>
  include <abstractions/p11-kit>
  include <abstractions/ssl_certs>

  dbus bind bus=session name=org.gnome.seahorse.Application,
  dbus receive bus=session path=/org/gnome/seahorse/Application
       interface=org.gnome.Shell.SearchProvider2
       peer=(name=:*),

  @{exec_path} mr,

  @{bin}/gpgconf  rPx,
  @{bin}/gpg{,2}  rPx,
  @{bin}/gpgsm    rPx,

  @{open_path}    rPx -> child-open-help,

  /etc/pki/trust/blocklist/ r,
  /etc/gcrypt/hwf.deny r,

  owner @{HOME}/@{XDG_SSH_DIR}/{,**} r,

  owner @{PROC}/@{pid}/fd/ r,

  include if exists <local/seahorse>
}
