|
| 1 | +# Installation |
| 2 | + |
| 3 | +## Deployment options: |
| 4 | +* Docker-compose for classic server deployment |
| 5 | +* (Future) Docker for serverless deployment (ex: AWS Fargate) |
| 6 | + |
| 7 | +We suggest you to clone the project, configure the required environment variables and run `docker-compose up` using the docker-compose file that is embedded in the project. |
| 8 | + |
| 9 | +That file leverages a public docker image that is available in Docker Hub: certego/intelowl |
| 10 | + |
| 11 | +## Deployment Info |
| 12 | +Main components of the web application: |
| 13 | +* Django |
| 14 | +* Rabbit-MQ |
| 15 | +* Celery (for async calls and crons) |
| 16 | +* Nginx |
| 17 | +* Uwsgi |
| 18 | +* Flower (optional) |
| 19 | + |
| 20 | +All these components are managed by docker-compose |
| 21 | + |
| 22 | +Database: PostgreSQL |
| 23 | + |
| 24 | +## Deployment preparation |
| 25 | +### Environment configuration |
| 26 | +Before running the project, you must populate some environment variables in a file to provide the required configuration. |
| 27 | +In the project you can find a template file named `env_file_app_template`. |
| 28 | +You have to create a new file named `env_file_app` from that template and modify it with your own configuration. |
| 29 | + |
| 30 | +Required variables to run the image: |
| 31 | +* DJANGO_SECRET: random 50 chars key, must be unique, generate it randomly |
| 32 | +* DB_HOST, DB_PORT, DB_USER, DB_PASSWORD: PostgreSQL configuration |
| 33 | + |
| 34 | +Optional variables needed to enable specific analyzers: |
| 35 | +* ABUSEIPDB_KEY: AbuseIPDB API key |
| 36 | +* GSF_KEY: Google Safe Browsing API key |
| 37 | +* OTX_KEY: Alienvault OTX API key |
| 38 | +* CIRCL_CREDENTIALS: CIRCL PDNS credentials in the format: `user|pass` |
| 39 | +* VT_KEY: VirusTotal API key |
| 40 | +* HA_KEY: HybridAnalysis API key |
| 41 | +* INTEZER_KEY: Intezer API key |
| 42 | +* FIRST_MISP_API: FIRST MISP API key |
| 43 | +* FIRST_MISP_URL: FIRST MISP URL |
| 44 | +* CUCKOO_URL: your cuckoo instance URL |
| 45 | + |
| 46 | +### Database configuration |
| 47 | +Before running the project, you must populate the basic configuration for PostgreSQL. |
| 48 | +In the project you can find a template file named `env_file_postgres_template`. |
| 49 | +You have to create a new file named `env_file_postgres` from that template and modify it with your own configuration. |
| 50 | + |
| 51 | +Required variables (we need to insert some of the values we have put in the previous configuration): |
| 52 | +* POSTGRES_PASSWORD (same as DB_PASSWORD) |
| 53 | +* POSTGRES_USER (same as DB_USER) |
| 54 | +* POSTGRES_DB -> default `intel_owl_db` |
| 55 | + |
| 56 | +If you prefer to use an external PostgreSQL instance, you should just remove the relative image from the `docker-compose.yml` file and provide the configuration to connect to your controlled instance/s. |
| 57 | + |
| 58 | +### Web server configuration |
| 59 | +By default Intel Owl provides basic configuration for: |
| 60 | +* Nginx (`intel_owl_nginx_http` or `intel_owl_nginx_https`) |
| 61 | +* Uwsgi (`intel_owl.ini`) |
| 62 | + |
| 63 | +You can find them in the `configuration` directory. |
| 64 | + |
| 65 | +By default, the project would use the default deployment configuration and HTTP only. |
| 66 | + |
| 67 | +I suggest you to change these configuration files based on your needs and mount them as volumes by changing the `docker-compose.yml` file. |
| 68 | + |
| 69 | +In case you enable HTTPS, remember to set the environment variable `HTTPS_ENABLED` as "enabled" to increment the security of the application. |
| 70 | + |
| 71 | +### Analyzers configuration |
| 72 | +In the file `analyzers_config.json` there is the configuration for all the available analyzers you can run. |
| 73 | +For a complete list of all current available analyzer please look at: [Usage](https://github.com/certego/IntelOwl/blob/master/docs/Usage.md) |
| 74 | + |
| 75 | +You may want to change this configuration to add new analyzers or to change the configuration of some of them. |
| 76 | + |
| 77 | +The name of the analyzers can be changed at every moment based on your wishes. |
| 78 | +You just need to remember that it's important that you keep at least the following keys in the analyzers dictionaries to let them run correctly: |
| 79 | +* `type`: can be `file` or `observable`. It specifies what the analyzer should analyze |
| 80 | +* `python_module`: name of the task that the analyzer must launch |
| 81 | + |
| 82 | +For a full description of the available keys, check the [Usage](https://github.com/certego/IntelOwl/blob/master/docs/Usage.md) page |
| 83 | + |
| 84 | +### Rebuilding the project |
| 85 | +If you make some code changes and you like to rebuild the project, launch the following command from the project directory: |
| 86 | + |
| 87 | +`docker build --tag=<your_tag> .` |
| 88 | + |
| 89 | +Then, you should provide your own image in the `docker-compose.yml` file. |
| 90 | + |
| 91 | + |
| 92 | +## AWS support |
| 93 | +At the moment there's a basic support for some of the AWS services. More is coming in the future. |
| 94 | + |
| 95 | +### Secrets |
| 96 | +If you would like to run this project on AWS, I'd suggest you to use the "Secrets Manager" to store your credentials. In this way your secrets would be better protected. |
| 97 | + |
| 98 | +This project supports this kind of configuration. Instead of adding the variables to the environment file, you should just add them with the same name on the AWS Secrets Manager and Intel Owl will fetch them transparently. |
| 99 | + |
| 100 | +Obviously, you should have created and managed the permissions in AWS in advance and accordingly to your infrastructure requirements. |
| 101 | + |
| 102 | +Also, you need to set the environment variable `AWS_SECRETS` to `True` to enable this mode. |
| 103 | + |
| 104 | +You can customize the AWS Region changing the environment variable `AWS_REGION`. |
| 105 | + |
| 106 | +### SQS |
| 107 | +If you like, you could use AWS SQS instead of Rabbit-MQ to manage your queues. |
| 108 | +In that case, you should change the parameter `CELERY_BROKER_URL` to `sqs://` and give your instances on AWS the proper permissions to access it. |
| 109 | + |
| 110 | +Also, you need to set the environment variable `AWS_SQS` to `True` to activate the additional required settings. |
| 111 | + |
| 112 | +### ... More coming |
| 113 | + |
| 114 | + |
| 115 | +## Run |
| 116 | +After having properly configured the environment files as suggested previously, you can run the image. |
| 117 | +The project uses `docker-compose`. You have to move to the project main directory to properly run it. |
| 118 | + |
| 119 | +`docker-compose up` |
| 120 | + |
| 121 | + |
| 122 | +## After deployment |
| 123 | +### Users creation |
| 124 | +You may want to run `docker exec -ti intel_owl_uwsgi python3 manage.py createsuperuser` after first run to create a superuser. |
| 125 | +Then you can add other users directly from the Django Admin Interface after having logged with the superuser account. |
0 commit comments