Synapse icon indicating copy to clipboard operation
Synapse copied to clipboard

Add docker support

Open arnydo opened this issue 7 years ago • 4 comments

Adding basic Dockerfile to build a containerized version of Synapse.

arnydo avatar Nov 15 '18 19:11 arnydo

So I've tried dockerizing Synapse using these instructions but when I curl to 0.0.0.0:5000/ews2case I get the error Success:False. Now when I look into the log file it gives me back the following errors.

ERROR :: Failed to create case from email Traceback (most recent call last): File "/opt/Synapse/workflows/thehive4py/api.py", line 82, in __find_rows return requests.post(req, params=params, json=data, proxies=self.proxies, auth=self.auth, verify=self.cert) File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 116, in post return request('post', url, data=data, json=json, **kwargs) File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 524, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 631, in send adapter = self.get_adapter(url=request.url) File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 722, in get_adapter raise InvalidSchema("No connection adapters were found for '%s'" % url) requests.exceptions.InvalidSchema: No connection adapters were found for '0.0.0.0:9000/api/case/_search'

KleinLorenz avatar Apr 29 '19 12:04 KleinLorenz

Did you update the configuration file to point to your Hive and with the correct API key?

arnydo avatar Apr 29 '19 14:04 arnydo

Hi, thanks for the response! Yes I actually have a working system when running my synapse instance on the host machine but I'm in the process of dockerizing everything and when I docker my synapse with the exact configuration I can't get it to work. Currently I've toyed around with it a bit and now I'm getting the following error:

Traceback (most recent call last): File "/opt/Synapse/workflows/Ews2Case.py", line 41, in connectEws esCaseId = theHiveConnector.searchCaseByDescription(conversationId) File "/opt/Synapse/workflows/objects/TheHiveConnector.py", line 40, in searchCaseByDescription response = self.theHiveApi.find_cases(query=query, range=range, sort=sort) File "/opt/Synapse/workflows/thehive4py/api.py", line 235, in find_cases return self.__find_rows("/api/case/_search", **attributes) File "/opt/Synapse/workflows/thehive4py/api.py", line 84, in __find_rows raise TheHiveException("Error: {}".format(e)) thehive4py.exceptions.TheHiveException: Error: HTTPConnectionPool(host='127.0.0.1', port=9000): Max retries exceeded with url: /api/case/_search?range=all (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f17e06ebe80>: Failed to establish a new connection: [Errno 111] Connection refused'))

I've tried making a network to put all containers in since I thought they couldn't communicate properly but that didn't seem to resolve the issue.

KleinLorenz avatar Apr 29 '19 14:04 KleinLorenz

Hi @KleinLorenz can you provide your current docker-compose.yml file which includes thehive and synapse? Can you also provide docker inspect output?

8ear avatar Aug 30 '20 08:08 8ear