From 6208b5e92015e77ce3a8dc3c23d5cad56c96deb1 Mon Sep 17 00:00:00 2001 From: Franz Bettag Date: Tue, 19 May 2020 13:34:55 +0000 Subject: [PATCH 1/2] Updates authorized_key.py to be used with FIDO2 security keys. Last try had a space at the end for some weird reason. --- plugins/modules/authorized_key.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/modules/authorized_key.py b/plugins/modules/authorized_key.py index d39f885..cc6682f 100644 --- a/plugins/modules/authorized_key.py +++ b/plugins/modules/authorized_key.py @@ -392,6 +392,7 @@ def parsekey(module, raw_key, rank=None): 'ecdsa-sha2-nistp521', 'ssh-dss', 'ssh-rsa', + 'sk-ecdsa-sha2-nistp256@openssh.com', ] options = None # connection options From 00f97908d7f6b2f17766a426261de6a9b38149de Mon Sep 17 00:00:00 2001 From: Franz Bettag Date: Sun, 31 May 2020 18:14:55 +0000 Subject: [PATCH 2/2] Updates authorized_key.py with all current ssh key types --- changelogs/fragments/17_authorized_keys.yml | 3 +++ plugins/modules/authorized_key.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/17_authorized_keys.yml diff --git a/changelogs/fragments/17_authorized_keys.yml b/changelogs/fragments/17_authorized_keys.yml new file mode 100644 index 0000000..ab430fa --- /dev/null +++ b/changelogs/fragments/17_authorized_keys.yml @@ -0,0 +1,3 @@ +--- +bugfixes: +- authorized_keys - Added FIDO2 security keys (https://github.com/ansible-collections/ansible.posix/issues/17). diff --git a/plugins/modules/authorized_key.py b/plugins/modules/authorized_key.py index cc6682f..2959249 100644 --- a/plugins/modules/authorized_key.py +++ b/plugins/modules/authorized_key.py @@ -386,13 +386,14 @@ def parsekey(module, raw_key, rank=None): ''' VALID_SSH2_KEY_TYPES = [ - 'ssh-ed25519', + 'sk-ecdsa-sha2-nistp256@openssh.com', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', 'ecdsa-sha2-nistp521', + 'sk-ssh-ed25519@openssh.com', + 'ssh-ed25519', 'ssh-dss', 'ssh-rsa', - 'sk-ecdsa-sha2-nistp256@openssh.com', ] options = None # connection options