Agent: Accept tuple as tags to HostExploiter publish events methods

This commit is contained in:
Ilija Lazoroski 2022-10-04 15:45:41 +02:00 committed by Kekoa Kaaikala
parent 95b3556cd0
commit 8e161f0fd9
1 changed files with 5 additions and 5 deletions

View File

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