diff --git a/apparmor.d/groups/ssh/ssh-keygen b/apparmor.d/groups/ssh/ssh-keygen new file mode 100644 index 00000000..b4cf2297 --- /dev/null +++ b/apparmor.d/groups/ssh/ssh-keygen @@ -0,0 +1,23 @@ +# apparmor.d - Full set of apparmor profiles +# Copyright (C) 2022 Roman Beslik +# SPDX-License-Identifier: GPL-2.0-only + +abi , + +include + +@{exec_path} = /{usr/,}bin/ssh-keygen + +profile ssh-keygen @{exec_path} { + include + include + include + include # for entering a passphrase for a key + + @{exec_path} mr, + + owner @{HOME}/@{XDG_SSH_DIR}/ w, + owner @{HOME}/@{XDG_SSH_DIR}/*_*{,.pub} rw, + + include if exists +}