From 4952a544c009a073965af89fe82a9121a1ca2bb1 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Mon, 15 Aug 2022 11:15:46 +0200 Subject: [PATCH] Agent: Accept IEventQueue in SSHCollector constructor --- .../ssh_collector/ssh_credential_collector.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/monkey/infection_monkey/credential_collectors/ssh_collector/ssh_credential_collector.py b/monkey/infection_monkey/credential_collectors/ssh_collector/ssh_credential_collector.py index cf18a8efc..04c9e65c2 100644 --- a/monkey/infection_monkey/credential_collectors/ssh_collector/ssh_credential_collector.py +++ b/monkey/infection_monkey/credential_collectors/ssh_collector/ssh_credential_collector.py @@ -2,6 +2,7 @@ import logging from typing import Dict, Iterable, Sequence from common.credentials import Credentials, SSHKeypair, Username +from common.event_queue import IEventQueue from infection_monkey.credential_collectors.ssh_collector import ssh_handler from infection_monkey.i_puppet import ICredentialCollector from infection_monkey.telemetry.messengers.i_telemetry_messenger import ITelemetryMessenger @@ -14,8 +15,9 @@ class SSHCredentialCollector(ICredentialCollector): SSH keys credential collector """ - def __init__(self, telemetry_messenger: ITelemetryMessenger): + def __init__(self, telemetry_messenger: ITelemetryMessenger, event_queue: IEventQueue): self._telemetry_messenger = telemetry_messenger + self._event_queue = event_queue def collect_credentials(self, _options=None) -> Sequence[Credentials]: logger.info("Started scanning for SSH credentials")