Agent: Accept IEventQueue in SSHCollector constructor

This commit is contained in:
Ilija Lazoroski 2022-08-15 11:15:46 +02:00
parent d09c1a689e
commit 4952a544c0
1 changed files with 3 additions and 1 deletions

View File

@ -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")