OpenCTI-Platform / connectors

OpenCTI Connectors
https://www.opencti.io
Apache License 2.0
341 stars 370 forks source link

MISP Connector failing to connect when using docker swarm #2082

Closed blockanz closed 2 months ago

blockanz commented 2 months ago

Description

I am playing around with using a docker swarm instead of a single node. Successfully imported my environment variables and .yml file into portainer and deployed the swarm. For some reason I am seeing the following errors when MISP connector is trying to connect to my MISP server (which worked fine on a single node not in swarm config).

ERROR Something went wrong (403): {'name': 'Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.', 'message': 'Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.', 'url': '/servers/getVersion'} | timestamp=2024-04-25T22:16:50.552370Z name=pymisp /usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py:1103: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.16.105'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings warnings.warn( ERROR Something went wrong (403): {'name': 'Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.', 'message': 'Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.', 'url': '/servers/getPyMISPVersion.json'} | timestamp=2024-04-25T22:16:50.570359Z name=pymisp /usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py:1103: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.16.105'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings warnings.warn( ERROR Something went wrong (403): {'name': 'Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.', 'message': 'Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.', 'url': '/users/view/me'} | timestamp=2024-04-25T22:16:50.590742Z name=pymisp Terminated

Environment

  1. OS - UBUNTU 22.04
  2. OpenCTI version: 6.0.10
  3. OpenCTI client: frontend
  4. Other environment details:

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. Import docker-compose.yml to portainer
  2. import .env to portainer
  3. deploy stack across 3 nodes with portainer

Additional information

Below is my yml for MISP

connector-misp: image: opencti/connector-misp:6.0.10 environment:

blockanz commented 2 months ago

Ignore above. Somehow an additional character was imported with my config which was appended to my API key. Removing that has resolved the issue