From 3adb1d5b071b5f7ac86e3b39d3b353ba6d4cfdac Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 17 Dec 2021 08:12:37 -0500 Subject: [PATCH] Agent: Add IPayload interface --- monkey/infection_monkey/payload/i_payload.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 monkey/infection_monkey/payload/i_payload.py diff --git a/monkey/infection_monkey/payload/i_payload.py b/monkey/infection_monkey/payload/i_payload.py new file mode 100644 index 000000000..b63910eea --- /dev/null +++ b/monkey/infection_monkey/payload/i_payload.py @@ -0,0 +1,14 @@ +import abc +import threading +from typing import Dict + + +class IPayload(metaclass=abc.ABCMeta): + @abc.abstractmethod + def run(self, options: Dict, interrupt: threading.Event): + """ + Runs the payload + :param Dict options: A dictionary containing options that modify the behavior of the payload + :param threading.Event interrupt: A threading.Event object that signals the payload to stop + executing and clean itself up. + """