Agent: Add IIslandAPIClient

This commit is contained in:
Mike Salvatore 2022-09-19 07:45:30 -04:00
parent b432a9f567
commit ca1bc06c55
3 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1 @@
from .i_island_api_client import IIslandAPIClient

View File

@ -0,0 +1,12 @@
from abc import ABC, abstractmethod
class IIslandAPIClient(ABC):
@abstractmethod
def __init__(self, island_server: str):
"""
Construct and API client and connect it to the island
:param island_server: String representing the island ip address and port
:raises IslandAPIError: If connection was unsuccessful
"""

View File

@ -9,6 +9,7 @@ from common.agent_configuration.agent_sub_configurations import (
) )
from common.credentials import Credentials, LMHash, NTHash from common.credentials import Credentials, LMHash, NTHash
from infection_monkey.exploit.log4shell_utils.ldap_server import LDAPServerFactory from infection_monkey.exploit.log4shell_utils.ldap_server import LDAPServerFactory
from infection_monkey.island_api_client import IIslandAPIClient
from infection_monkey.transport import IslandAPIClient, IslandAPIRequestFailedError from infection_monkey.transport import IslandAPIClient, IslandAPIRequestFailedError
from monkey_island.cc.event_queue import IslandEventTopic, PyPubSubIslandEventQueue from monkey_island.cc.event_queue import IslandEventTopic, PyPubSubIslandEventQueue
from monkey_island.cc.models import Report from monkey_island.cc.models import Report
@ -331,5 +332,6 @@ IslandEventTopic.CLEAR_SIMULATION_DATA
IslandEventTopic.RESET_AGENT_CONFIGURATION IslandEventTopic.RESET_AGENT_CONFIGURATION
# TODO: Remove after #2292 is closed # TODO: Remove after #2292 is closed
IslandAPIClient IIslandAPIClient
IslandApiClient
IslandAPIRequestFailedError IslandAPIRequestFailedError