diff --git a/monkey/infection_monkey/exploit/HostExploiter.py b/monkey/infection_monkey/exploit/HostExploiter.py index 1327fd26d..a6d53a02f 100644 --- a/monkey/infection_monkey/exploit/HostExploiter.py +++ b/monkey/infection_monkey/exploit/HostExploiter.py @@ -24,6 +24,16 @@ class HostExploiter: def _EXPLOITED_SERVICE(self): pass + @property + @abstractmethod + def _exploiter_tags(self) -> Tuple[str, ...]: + pass + + @property + @abstractmethod + def _propagation_tags(self) -> Tuple[str, ...]: + pass + def __init__(self): self.exploit_info = { "display_name": self._EXPLOITED_SERVICE, @@ -140,7 +150,7 @@ class HostExploiter: success=exploitation_success, exploiter_name=self.__class__.__name__, error_message=error_message, - tags=frozenset(tags), + tags=frozenset(tags or self._exploiter_tags), ) self.agent_event_queue.publish(exploitation_event) @@ -156,6 +166,6 @@ class HostExploiter: success=propagation_success, exploiter_name=self.__class__.__name__, error_message=error_message, - tags=frozenset(tags), + tags=frozenset(tags or self._propagation_tags), ) self.agent_event_queue.publish(propagation_event)