OpenCTI-Platform / opencti

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

Unable to Install Open CTI on Docker and Manual Install #869

Closed MarcoGeek closed 4 years ago

MarcoGeek commented 4 years ago

New Bee to Open CTI and looking for some quick help.

While deploying through Docker getting below message all the time:

root@opencti_server:~/opt/docker# docker-compose --compatibility up ERROR: Invalid interpolation format for "environment" option in service "connector-export-file-stix": "CONNECTOR_ID=${4d1ead8e-2641-425b-a1e5-1f8c23d793d5}" root@opencti_server:~/opt/docker# nano docker-compose.yml root@opencti_server:~/opt/docker# nano docker-compose.yml root@opencti_server:~/opt/docker# docker-compose --compatibility up ERROR: Invalid interpolation format for "environment" option in service "opencti": "APPADMINEMAIL=${admin@opencti.local}" root@opencti_server:~/opt/docker# nano docker-compose.yml root@opencti_server:~/opt/docker# docker-compose --compatibility up WARNING: The guest variable is not set. Defaulting to a blank string. ERROR: Invalid interpolation format for "environment" option in service "connector-import-file-pdf-observables": "CONNECTOR_ID=${6071c91c-e403-4be9-9149-bc7dd142b466}"

While doing manual download getting database error stating rabbitq is down.

can some one assist. I would really appreciate or share me on the docker where to make the change. I am I am doing something silly but cant figure it out for last one week. Thanks in advance.

vxsh4d0w commented 4 years ago

Please share your .env file and docker-compose.yml

MarcoGeek commented 4 years ago

version: '3' services: grakn: image: graknlabs/grakn:1.7.2 ports:

vxsh4d0w commented 4 years ago

edit the .env file and fill it like in this following example: OPENCTI_ADMIN_EMAIL=admin@blabla.xxx OPENCTI_ADMIN_PASSWORD=Your_Password OPENCTI_ADMIN_TOKEN=Generated_UUID MINIO_ACCESS_KEY=NYour Access Key MINIO_SECRET_KEY=Your secret key RABBITMQ_DEFAULT_USER=guest RABBITMQ_DEFAULT_PASS=guest CONNECTOR_EXPORT_FILE_STIX_ID=Generated_UUID CONNECTOR_EXPORT_FILE_CSV_ID=Generated_UUID CONNECTOR_IMPORT_FILE_STIX_ID=Generated_UUID CONNECTOR_IMPORT_FILE_PDF_OBSERVABLES_ID=Generated_UUID CONNECTOR_OPENCTI_ID=Generated_UUID CONNECTOR_MITRE_ID=Generated_UUID CONNECTOR_MITRE_ATTACK_ID=Generated_UUID CONNECTOR_CYBER_THREAT_COALITION_ID=Generated_UUID and so on...

and then edit the docker-compose.yml file filling the field CONNECTOR_ID= with the name assigned to each uuid within the .env file. This means, for example:

or

connector-opencti: image: opencti/connector-opencti:3.3.2 environment:

So your docker-compose file will contain all info set within the .env file. I hope it's clear. This should fix your issue.

MarcoGeek commented 4 years ago

In my docker folder all I have is below file. I dont have .env file. I am only editing docker-compose.yml. Am I doing something stupid herE?

docker-compose-dev.yml docker-compose.yml docker-compose.yml.save docker-compose.yml.save.1 README.md

vxsh4d0w commented 4 years ago

Try ls -la command.

MarcoGeek commented 4 years ago

Great thanks. I have added all the info in .env file. And on the docker-compose.yml all the variable are already there that point to .env. should I change anything on docker-compose.yml file. any hard coded value. I tried to add APPADMINTOKEN=${987654321}" and resulted the below error. Please help last time .

root@opencti_server:~/opt/docker# docker-compose --compatibility up ERROR: Invalid interpolation format for "environment" option in service "opencti": "APPADMINTOKEN=${987654321}" root@opencti_server:~/opt/docker#

vxsh4d0w commented 4 years ago

APPADMINTOKEN=${OPENCTI_ADMIN_TOKEN} that means the same UID you used for all connectors (each connector has this value OPENCTI_TOKEN=$...)

MarcoGeek commented 4 years ago

Amazing. It is now installing I guess. Thank You. I will update once all goes well.

MarcoGeek commented 4 years ago

OK. It is keep running anf throwing the below error. How long does it take to complete? I am running docker on ubuntu 18.04

OpenCTI API is not reachable. Waiting for OpenCTI API to etc..

vxsh4d0w commented 4 years ago

Try to check each running container with: sudo docker ps

then sudo docker logs name_container

I suggest you to check opencti and grakn sudo docker logs opencti sudo docker logs grakn

Sometimes Grakn fails to start so in case of Grakn fail use sudo docker-compose restart name_of_container

in case of grakn

sudo docker-compose restart grakn

at the end you have just to wait a couple of minutes and try to reach Opencti via web

MarcoGeek commented 4 years ago

ok Everything was going well.. All checks were done. Untill Worker_1. Now I have the error that the API is not reachable. I dont think it is that difficult to install untill I am missing soemething. I change the port from 8080 to 4000. Anything else needs to be looked upon?

MarcoGeek commented 4 years ago

Its aways be like this. For docker ends up with Database error and Grakn is down. Even if it is running and for manual install it would same database error and rabbitmq is down. something someh were is broken,

$ node --max_old_space_size=8192 build/index.js {"error":{"name":"DatabaseError","_error":{},"_showLocations":false,"_showPath":false,"time_thrown":"2020-10-07T08:39:59.134Z","data":{"reason":"Grakn seems down","category":"technical"},"internalData":{}},"level":"error","message":"[OPENCTI] GraphQL initialization fail","timestamp":"2020-10-07T08:39:59.135Z"} error Command failed with exit code 1.