Agent: Add InfectionMonkey._agent_id attribute

This commit is contained in:
Mike Salvatore 2022-09-28 15:08:59 -04:00
parent 21f01292f7
commit a1516535f9
1 changed files with 3 additions and 2 deletions

View File

@ -111,6 +111,7 @@ class InfectionMonkey:
self._singleton = SystemSingleton() self._singleton = SystemSingleton()
self._opts = self._get_arguments(args) self._opts = self._get_arguments(args)
self._agent_id = get_agent_id()
self._agent_event_serializer_registry = self._setup_agent_event_serializers() self._agent_event_serializer_registry = self._setup_agent_event_serializers()
@ -122,7 +123,7 @@ class InfectionMonkey:
server_address=self._island_address, island_api_client=self._island_api_client server_address=self._island_address, island_api_client=self._island_api_client
) )
self._control_channel = ControlChannel( self._control_channel = ControlChannel(
str(self._island_address), get_agent_id(), self._island_api_client str(self._island_address), self._agent_id, self._island_api_client
) )
self._register_agent() self._register_agent()
@ -176,7 +177,7 @@ class InfectionMonkey:
def _register_agent(self): def _register_agent(self):
agent_registration_data = AgentRegistrationData( agent_registration_data = AgentRegistrationData(
id=get_agent_id(), id=self._agent_id,
machine_hardware_id=get_machine_id(), machine_hardware_id=get_machine_id(),
start_time=agent_process.get_start_time(), start_time=agent_process.get_start_time(),
# parent_id=parent, # parent_id=parent,