Ejemplo n.º 1
0
 def apply_to_monkey_config():
     """
     Applies ATT&CK matrix to the monkey configuration
     :return:
     """
     attack_techniques = AttackConfig.get_technique_values()
     monkey_config = ConfigService.get_config(False, True, True)
     monkey_schema = ConfigService.get_config_schema()
     AttackConfig.set_arrays(attack_techniques, monkey_config, monkey_schema)
     AttackConfig.set_booleans(attack_techniques, monkey_config, monkey_schema)
     ConfigService.update_config(monkey_config, True)
Ejemplo n.º 2
0
 def post(self):
     config_json = json.loads(request.data)
     if 'reset' in config_json:
         ConfigService.reset_config()
     else:
         if not ConfigService.update_config(config_json, should_encrypt=True):
             abort(400)
     return self.get()
Ejemplo n.º 3
0
 def import_config(config_json):
     if not ConfigService.update_config(config_json, should_encrypt=True):
         raise InvalidConfigurationError