OpenCTI-Platform / opencti

Open Cyber Threat Intelligence Platform
https://opencti.io
Other
6.45k stars 947 forks source link

Prevent opencti application to start when rabbitMq management API configuration is badly configured. #9098

Open aHenryJard opened 1 day ago

aHenryJard commented 1 day ago

Description

The application does not start when rabbitMQ amqp configuration is not correct. But the application is starting when the HTTP API management for rabbitMq is badly configured. And then the app is raising errors on many places like ingestionManager.

Impact: RSS, CSV, and taxii feed at least. Connector screen maybe also.

Environment

  1. OS (where OpenCTI server runs): { e.g. Mac OS 10, Windows 10, Ubuntu 16.4, etc. }
  2. OpenCTI version: { e.g. OpenCTI 1.0.2 }
  3. OpenCTI client: { e.g. frontend or python }
  4. Other environment details:

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. put a bad port number for rabbitmq:port_management
  2. start app
  3. create some ingestions or start some connectors

Expected Output

Do not start if rabbitMq management API cannot be requested.

Actual Output

Start and do many errors and strange behavior.

Additional information

Implementation note: I think the best is maybe to create a test method with any HTTP call to rabbitMq API for example GET /api/whoami

https://github.com/OpenCTI-Platform/opencti/blob/a0a51218d07a907070816b59eb6d16250307c162/opencti-platform/opencti-graphql/src/database/rabbitmq.js#L293-L302

To be tested also on a new platform first start.

Screenshots (optional)