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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{lib}/gcr-ssh-agent
profile gcr-ssh-agent @{exec_path} {
  include <abstractions/base>

  @{exec_path} mr,

  @{bin}/ssh-agent  rPx,
  @{bin}/ssh-add    rix,

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

  owner @{run}/user/@{uid}/ssh-askpass.@{rand6}/{,*} rw,

  include if exists <local/gcr-ssh-agent>
}

# vim:syntax=apparmor
