Skip to content

Commit e1dabb5

Browse files
committed
Agent: Pass Island address to payload plugins
Issue #3411 PR #3556
1 parent b0a2c7b commit e1dabb5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

monkey/infection_monkey/monkey.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ def _build_puppet(self, operating_system: OperatingSystem) -> IPuppet:
430430
create_plugin,
431431
),
432432
AgentPluginType.PAYLOAD: PayloadPluginFactory(
433-
self._agent_id, self._agent_event_publisher, create_plugin
433+
self._agent_id, self._agent_event_publisher, self._island_address, create_plugin
434434
),
435435
}
436436
plugin_registry = PluginRegistry(

monkey/infection_monkey/plugin/payload_plugin_factory.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from serpentarium import SingleUsePlugin
44

55
from common.event_queue import IAgentEventPublisher
6-
from common.types import AgentID
6+
from common.types import AgentID, SocketAddress
77

88
from .i_plugin_factory import IPluginFactory
99

@@ -13,9 +13,11 @@ def __init__(
1313
self,
1414
agent_id: AgentID,
1515
agent_event_publisher: IAgentEventPublisher,
16+
island_server_address: SocketAddress,
1617
create_plugin: Callable[..., SingleUsePlugin],
1718
):
1819
self._agent_id = agent_id
20+
self._island_server_address = island_server_address
1921
self._agent_event_publisher = agent_event_publisher
2022
self._create_plugin = create_plugin
2123

@@ -24,4 +26,5 @@ def create(self, plugin_name: str) -> SingleUsePlugin:
2426
plugin_name=plugin_name,
2527
agent_id=self._agent_id,
2628
agent_event_publisher=self._agent_event_publisher,
29+
island_server_address=self._island_server_address,
2730
)

0 commit comments

Comments
 (0)