Skip to content

Commit

Permalink
Agent: Pass Island address to payload plugins
Browse files Browse the repository at this point in the history
Issue #3411
PR #3556
  • Loading branch information
shreyamalviya authored and ilija-lazoroski committed Aug 7, 2023
1 parent bd3f643 commit 00fa994
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion monkey/infection_monkey/monkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def _build_puppet(self, operating_system: OperatingSystem) -> IPuppet:
create_plugin,
),
AgentPluginType.PAYLOAD: PayloadPluginFactory(
self._agent_id, self._agent_event_publisher, create_plugin
self._agent_id, self._agent_event_publisher, self._island_address, create_plugin
),
}
plugin_registry = PluginRegistry(
Expand Down
5 changes: 4 additions & 1 deletion monkey/infection_monkey/plugin/payload_plugin_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from serpentarium import SingleUsePlugin

from common.event_queue import IAgentEventPublisher
from common.types import AgentID
from common.types import AgentID, SocketAddress

from .i_plugin_factory import IPluginFactory

Expand All @@ -13,9 +13,11 @@ def __init__(
self,
agent_id: AgentID,
agent_event_publisher: IAgentEventPublisher,
island_server_address: SocketAddress,
create_plugin: Callable[..., SingleUsePlugin],
):
self._agent_id = agent_id
self._island_server_address = island_server_address
self._agent_event_publisher = agent_event_publisher
self._create_plugin = create_plugin

Expand All @@ -24,4 +26,5 @@ def create(self, plugin_name: str) -> SingleUsePlugin:
plugin_name=plugin_name,
agent_id=self._agent_id,
agent_event_publisher=self._agent_event_publisher,
island_server_address=self._island_server_address,
)

0 comments on commit 00fa994

Please sign in to comment.