From 4e520c135faa93344e4496246f3e0a92b4c4a1e0 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Mon, 6 Jun 2022 14:12:37 +0200 Subject: [PATCH] Island: Add IAgentBinaryRepository Issue #1974 --- .../monkey_island/cc/repository/__init__.py | 1 + .../repository/i_agent_binary_repository.py | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 monkey/monkey_island/cc/repository/i_agent_binary_repository.py diff --git a/monkey/monkey_island/cc/repository/__init__.py b/monkey/monkey_island/cc/repository/__init__.py index ed332bdd2..e3cf5c2fc 100644 --- a/monkey/monkey_island/cc/repository/__init__.py +++ b/monkey/monkey_island/cc/repository/__init__.py @@ -1 +1,2 @@ from .file_storage import FileRetrievalError, IFileRepository, LocalStorageFileRepository +from .i_agent_binary_repository import IAgentBinaryRepository diff --git a/monkey/monkey_island/cc/repository/i_agent_binary_repository.py b/monkey/monkey_island/cc/repository/i_agent_binary_repository.py new file mode 100644 index 000000000..a1d858e05 --- /dev/null +++ b/monkey/monkey_island/cc/repository/i_agent_binary_repository.py @@ -0,0 +1,24 @@ +import abc +from typing import BinaryIO + + +class IAgentBinaryRepository(metaclass=abc.ABCMeta): + """ + A repository that retrieves the agent binaries + """ + + @abc.abstractmethod + def get_linux_binary(self) -> BinaryIO: + """ + Retrieve linux agent binary + + :return: A file-like object that represents the linux agent binary + """ + + @abc.abstractmethod + def get_windows_binary(self) -> BinaryIO: + """ + Retrieve windows agent binary + + :return: A file-like object that represents the windows agent binary + """