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):
        data = json.loads(request.data)
        should_encrypt = data["should_encrypt"]

        plaintext_config = ConfigService.get_config()

        config_export = plaintext_config
        if should_encrypt:
            password = data["password"]
            plaintext_config = json.dumps(plaintext_config)
            config_export = encrypt_string(plaintext_config, password)

        return {"config_export": config_export, "encrypted": should_encrypt}
Ejemplo n.º 3
0
    def post(self):
        data = json.loads(request.data)
        should_encrypt = data["should_encrypt"]

        plaintext_config = ConfigService.get_config()

        config_export = plaintext_config
        if should_encrypt:
            password = data["password"]
            plaintext_config = json.dumps(plaintext_config)

            pb_encryptor = PasswordBasedStringEncryptor(password)
            config_export = pb_encryptor.encrypt(plaintext_config)

        return {"config_export": config_export, "encrypted": should_encrypt}
Ejemplo n.º 4
0
 def get(self):
     return jsonify(
         schema=ConfigService.get_config_schema(),
         configuration=ConfigService.get_config(False, True),
     )