apparmor.d/apparmor.d/groups/ssh/ssh-agent
2021-05-06 16:44:49 +01:00

51 lines
1.3 KiB
Plaintext

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2018-2021 Mikhail Morfikov
# 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}bin/ssh-agent
profile ssh-agent @{exec_path} {
include <abstractions/base>
include <abstractions/openssl>
signal (receive) set=term peer=cockpit-bridge,
signal (receive) set=term peer=gnome-keyring-daemon,
@{exec_path} mr,
owner /tmp/ssh-*/ rw,
owner /tmp/ssh-*/agent.* rw,
# When SSH agent is not used with GPG
/{usr/,}bin/openbox-session rPx,
/{usr/,}bin/startkde rPUx,
/{usr/,}bin/sway rPUx,
/{usr/,}bin/enlightenment_start rPUx,
# SSH keys
owner @{HOME}/@{XDG_SSH_DIR}/ rw,
owner @{HOME}/@{XDG_SSH_DIR}/* r,
owner @{HOME}/@{XDG_PROJECTS_DIR}/**/ssh/{,*} r,
# When started via systemd
@{run}/user/@{uid}/openssh_agent rw,
# askpass apps
#/{usr/,}lib/ssh/x11-ssh-askpass rPUx,
#/{usr/,}bin/ksshaskpass rPUx,
/{usr/,}bin/kwalletaskpass rPUx,
# file_inherit
owner /dev/tty[0-9]* rw,
owner @{HOME}/.xsession-errors w,
@{run}/user/@{uid}/keyring/.ssh rw,
@{run}/user/@{uid}/ssh-agent.[0-9A-Z]* w,
include if exists <local/ssh-agent>
}