Agent: Accept tuple as tags to HostExploiter publish events methods
This commit is contained in:
parent
95b3556cd0
commit
8e161f0fd9
|
@ -3,7 +3,7 @@ import threading
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from ipaddress import IPv4Address
|
from ipaddress import IPv4Address
|
||||||
from typing import Dict, Sequence
|
from typing import Dict, Sequence, Tuple
|
||||||
|
|
||||||
from common.agent_events import ExploitationEvent, PropagationEvent
|
from common.agent_events import ExploitationEvent, PropagationEvent
|
||||||
from common.event_queue import IAgentEventQueue
|
from common.event_queue import IAgentEventQueue
|
||||||
|
@ -132,7 +132,7 @@ class HostExploiter:
|
||||||
self,
|
self,
|
||||||
target: str,
|
target: str,
|
||||||
propagation_success: bool,
|
propagation_success: bool,
|
||||||
tags: frozenset = frozenset(),
|
tags: Tuple[str] = tuple(),
|
||||||
error_message: str = "",
|
error_message: str = "",
|
||||||
):
|
):
|
||||||
propagation_event = PropagationEvent(
|
propagation_event = PropagationEvent(
|
||||||
|
@ -141,7 +141,7 @@ class HostExploiter:
|
||||||
success=propagation_success,
|
success=propagation_success,
|
||||||
exploiter_name=self.__class__.__name__,
|
exploiter_name=self.__class__.__name__,
|
||||||
error_message=error_message,
|
error_message=error_message,
|
||||||
tags=tags,
|
tags=frozenset(tags),
|
||||||
)
|
)
|
||||||
self.agent_event_queue.publish(propagation_event)
|
self.agent_event_queue.publish(propagation_event)
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ class HostExploiter:
|
||||||
self,
|
self,
|
||||||
target: str,
|
target: str,
|
||||||
exploitation_success: bool,
|
exploitation_success: bool,
|
||||||
tags: frozenset = frozenset(),
|
tags: Tuple[str] = tuple(),
|
||||||
error_message: str = "",
|
error_message: str = "",
|
||||||
):
|
):
|
||||||
exploitation_event = ExploitationEvent(
|
exploitation_event = ExploitationEvent(
|
||||||
|
@ -158,6 +158,6 @@ class HostExploiter:
|
||||||
success=exploitation_success,
|
success=exploitation_success,
|
||||||
exploiter_name=self.__class__.__name__,
|
exploiter_name=self.__class__.__name__,
|
||||||
error_message=error_message,
|
error_message=error_message,
|
||||||
tags=tags,
|
tags=frozenset(tags),
|
||||||
)
|
)
|
||||||
self.agent_event_queue.publish(exploitation_event)
|
self.agent_event_queue.publish(exploitation_event)
|
||||||
|
|
Loading…
Reference in New Issue