Agent: Add load_plugin function to IPuppet

This commit is contained in:
Shreya Malviya 2021-12-14 20:19:29 +05:30 committed by Mike Salvatore
parent cd8a4d4b1f
commit fa2d2fdec2
1 changed files with 14 additions and 0 deletions

View File

@ -4,12 +4,18 @@ from collections import namedtuple
from enum import Enum
from typing import Dict
from infection_monkey.puppet.plugin_type import PluginType
class PortStatus(Enum):
OPEN = 1
CLOSED = 2
class UnknownPluginError(Exception):
pass
ExploiterResultData = namedtuple("ExploiterResultData", ["result", "info", "attempts"])
PingScanData = namedtuple("PingScanData", ["response_received", "os"])
PortScanData = namedtuple("PortScanData", ["port", "status", "banner", "service"])
@ -18,6 +24,14 @@ PostBreachData = namedtuple("PostBreachData", ["command", "result"])
class IPuppet(metaclass=abc.ABCMeta):
@abc.abstractmethod
def load_plugin(self, plugin: object, plugin_type: PluginType) -> None:
"""
Loads a plugin into the puppet.
:param object plugin: The plugin object to load
:param PluginType plugin_type: The type of plugin being loaded
"""
@abc.abstractmethod
def run_sys_info_collector(self, name: str) -> Dict:
"""