From 8e161f0fd9ee45f8a983234da0793b69a41bd017 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Tue, 4 Oct 2022 15:45:41 +0200 Subject: [PATCH] Agent: Accept tuple as tags to HostExploiter publish events methods --- monkey/infection_monkey/exploit/HostExploiter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/monkey/infection_monkey/exploit/HostExploiter.py b/monkey/infection_monkey/exploit/HostExploiter.py index 9490b8706..f910cfa49 100644 --- a/monkey/infection_monkey/exploit/HostExploiter.py +++ b/monkey/infection_monkey/exploit/HostExploiter.py @@ -3,7 +3,7 @@ import threading from abc import abstractmethod from datetime import datetime from ipaddress import IPv4Address -from typing import Dict, Sequence +from typing import Dict, Sequence, Tuple from common.agent_events import ExploitationEvent, PropagationEvent from common.event_queue import IAgentEventQueue @@ -132,7 +132,7 @@ class HostExploiter: self, target: str, propagation_success: bool, - tags: frozenset = frozenset(), + tags: Tuple[str] = tuple(), error_message: str = "", ): propagation_event = PropagationEvent( @@ -141,7 +141,7 @@ class HostExploiter: success=propagation_success, exploiter_name=self.__class__.__name__, error_message=error_message, - tags=tags, + tags=frozenset(tags), ) self.agent_event_queue.publish(propagation_event) @@ -149,7 +149,7 @@ class HostExploiter: self, target: str, exploitation_success: bool, - tags: frozenset = frozenset(), + tags: Tuple[str] = tuple(), error_message: str = "", ): exploitation_event = ExploitationEvent( @@ -158,6 +158,6 @@ class HostExploiter: success=exploitation_success, exploiter_name=self.__class__.__name__, error_message=error_message, - tags=tags, + tags=frozenset(tags), ) self.agent_event_queue.publish(exploitation_event)