From bb760c7e8ae7d22a04470c0013b1f48ebaff6704 Mon Sep 17 00:00:00 2001 From: vakarisz Date: Mon, 21 Feb 2022 10:58:58 +0200 Subject: [PATCH] Island: fix detection if credential is a keypair --- .../processing/credentials/credentials_parser.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/monkey/monkey_island/cc/services/telemetry/processing/credentials/credentials_parser.py b/monkey/monkey_island/cc/services/telemetry/processing/credentials/credentials_parser.py index e237f0139..cd738f4b4 100644 --- a/monkey/monkey_island/cc/services/telemetry/processing/credentials/credentials_parser.py +++ b/monkey/monkey_island/cc/services/telemetry/processing/credentials/credentials_parser.py @@ -36,8 +36,9 @@ def parse_credentials(credentials: dict): def is_ssh_keypair(credential: dict) -> bool: return bool( - filter( - lambda secret: secret["credential_type"] == CredentialsType.SSH_KEYPAIR, - credential["secrets"], - ) + [ + secret + for secret in credential["secrets"] + if secret["credential_type"] == CredentialsType.SSH_KEYPAIR + ] )