示例#1
0
 def get(self):
     return current_app.response_class(
         json.dumps({"configuration": AttackConfig.get_config()},
                    indent=None,
                    separators=(",", ":"),
                    sort_keys=False) + "\n",
         mimetype=current_app.config['JSONIFY_MIMETYPE'])
示例#2
0
 def post(self):
     """
     Based on request content this endpoint either resets ATT&CK configuration or updates it.
     :return: Technique types dict with techniques on reset and nothing on update
     """
     config_json = json.loads(request.data)
     if 'reset_attack_matrix' in config_json:
         AttackConfig.reset_config()
         return jsonify(configuration=AttackConfig.get_config()['properties'])
     else:
         AttackConfig.update_config({'properties': json.loads(request.data)})
         AttackConfig.apply_to_monkey_config()
         return {}
示例#3
0
 def get(self):
     return jsonify(configuration=AttackConfig.get_config()['properties'])