diff --git a/functions/extensions/cortex-responders/Shuffle/requirements.txt b/functions/extensions/cortex-responders/Shuffle/requirements.txt new file mode 100644 index 00000000..6aabc3cf --- /dev/null +++ b/functions/extensions/cortex-responders/Shuffle/requirements.txt @@ -0,0 +1,2 @@ +cortexutils +requests diff --git a/functions/extensions/cortex-responders/Shuffle/shuffle.json b/functions/extensions/cortex-responders/Shuffle/shuffle.json index ef2610dd..db755b49 100644 --- a/functions/extensions/cortex-responders/Shuffle/shuffle.json +++ b/functions/extensions/cortex-responders/Shuffle/shuffle.json @@ -5,7 +5,7 @@ "url": "https://github.com/frikky/shuffle", "license": "AGPL-V3", "description": "Execute a workflow in Shuffle", - "dataTypeList": ["thehive:case", "thehive:alert"], + "dataTypeList": ["thehive:case", "thehive:alert", "thehive:case_artifact"], "command": "Shuffle/shuffle.py", "baseConfig": "Shuffle", "configurationItems": [ @@ -24,6 +24,14 @@ "multi": false, "required": true }, + { + "name": "verifyssl", + "description": "Verify SSL certificate", + "type": "boolean", + "multi": false, + "required": true, + "defaultValue": true + }, { "name": "workflow_id", "description": "The ID of the workflow to execute", diff --git a/functions/extensions/cortex-responders/Shuffle/shuffle.py b/functions/extensions/cortex-responders/Shuffle/shuffle.py index 0816ca53..bc643eb3 100644 --- a/functions/extensions/cortex-responders/Shuffle/shuffle.py +++ b/functions/extensions/cortex-responders/Shuffle/shuffle.py @@ -1,28 +1,26 @@ - -#!/usr/bin/env python -# encoding: utf-8 +#!/usr/bin/env python3 +#encoding: utf-8 from cortexutils.responder import Responder import requests class Shuffle(Responder): - def __init__(self): - Responder.__init__(self) - self.api_key = self.get_param("config.api_key", "") - self.url = self.get_param("config.url", "") - self.workflow_id = self.get_param("config.workflow_id", "") + def __init__(self): + Responder.__init__(self) + self.api_key = self.get_param("config.api_key", "") + self.url = self.get_param("config.url", "") + self.workflow_id = self.get_param("config.workflow_id", "") + self.verify = self.get_param('config.verifyssl', True, None) - def run(self): - Responder.run(self) + def run(self): + Responder.run(self) + parsed_url = "%s/api/v1/workflows/%s/execute" % (self.url, self.workflow_id) + headers = { + "Authorization": "Bearer %s" % self.api_key + } + requests.post(parsed_url, headers=headers,verify=self.verify) - parsed_url = "%s/api/v1/workflows/%s/execute" % (self.url, self.workflow_id) - headers = { - "Authorization": "Bearer %s" % self.api_key - } - requests.post(parsed_url, headers=headers) - - self.report({'message': 'message sent'}) + self.report({'message': 'message sent'}) if __name__ == '__main__': Shuffle().run() -