Skip to main content

Cyware Threat Intelligence eXchange

Deployment Procedure

Review the Prerequisites before you start the deployment. The steps to deploy the CTIX application and database services are:

Download Installer Package

To download the latest version of the CTIX installer package, run the following command:

wget https://packages.cyware.com/repository/cyware/installer/ctix/installer-ctix-release-latest.zip

Note

To download a previous version of the CTIX installer package, contact the Cyware team for the download URL.

Extract Installer Package

To extract the CTIX installer package, run the following command:

unzip installer-ctix-release-latest.zip

After extracting the installer package, run the following command to go to the CTIX installer folder to proceed with the deployment:

cd ctix-installer
[root@ip-10-xx-x-64 bin]# unzip installer-ctix-release-latest.zip
Archive:  installer-ctix-release-latest.zip
  inflating: ctix-installer/ansible.cfg
  inflating: ctix-installer/build-docker.yml
  inflating: ctix-installer/deploy-ctix.yml
  inflating: ctix-installer/deploy-db-stack.yml
  inflating: ctix-installer/deploy/deploy-ctix/defaults/main.yml
  inflating: ctix-installer/deploy/deploy-ctix/tasks/main.yml
  inflating: ctix-installer/deploy/deploy-ctix/templates/ctix-stack.yml.j2
  inflating: ctix-installer/deploy/deploy-ctix/templates/tenant.env.j2
  inflating: ctix-installer/deploy/deploy-db-stack/defaults/main.yml
  inflating: ctix-installer/deploy/deploy-db-stack/tasks/main.yml
  inflating: ctix-installer/deploy/deploy-db-stack/templates/db-stack.yml.j2
  inflating: ctix-installer/deploy/deploy-db-stack/templates/kafka.env.j2
  inflating: ctix-installer/deploy/deploy-db-stack/templates/pgbouncer.env.j2
  inflating: ctix-installer/deploy/deploy-db-stack/templates/postgres-init-user-db.sql.j2
  inflating: ctix-installer/deploy/deploy-db-stack/templates/postgres.conf.j2
  inflating: ctix-installer/deploy/deploy-db-stack/templates/redis.conf.j2
  inflating: ctix-installer/deploy/deploy-db-stack/templates/zookeeper.env.j2
  inflating: ctix-installer/fetch-client-vars.yml
  inflating: ctix-installer/run-setup.yml
  inflating: ctix-installer/setup-docker.yml
  inflating: ctix-installer/setup-monitoring.yml
  inflating: ctix-installer/setup/docker-network/tasks/main.yml
  inflating: ctix-installer/setup/docker-swarm/tasks/init.yml
  inflating: ctix-installer/setup/docker-swarm/tasks/main.yml
  inflating: ctix-installer/setup/docker-swarm/tasks/update.yml
  inflating: ctix-installer/setup/docker/defaults/main.yml
  inflating: ctix-installer/setup/docker/files/daemon.json
  inflating: ctix-installer/setup/docker/files/docker-8.repo
  inflating: ctix-installer/setup/docker/files/docker-9.repo
  inflating: ctix-installer/setup/docker/files/docker.repo
  inflating: ctix-installer/setup/docker/tasks/main.yml
  inflating: ctix-installer/setup/monitoring-stack/defaults/main.yml
  inflating: ctix-installer/setup/monitoring-stack/tasks/main.yml
  inflating: ctix-installer/setup/monitoring-stack/templates/ctix.yml.j2
  inflating: ctix-installer/setup/monitoring-stack/templates/filebeat.yml.dev.j2
  inflating: ctix-installer/setup/monitoring-stack/templates/filebeat.yml.j2
  inflating: ctix-installer/setup/monitoring-stack/templates/monitoring.yml.j2
  inflating: ctix-installer/swarm-init.yml
  inflating: ctix-installer/test.yml
  inflating: ctix-installer/vars/ctix/hosts
  inflating: ctix-installer/vars/ctix/vars.yml
Update Hosts File

The hosts file includes the IP addresses of the servers on which you want to deploy the CTIX application and database services. In a one-tier deployment architecture, enter the same server IP address in the swarm_managers and swarm_workers variables. To deploy the services in different servers, you can enter the IP addresses of all the servers in the hosts file.

To update the hosts file, do the following:

  1. Run the following command to open the hosts file:

    sudo vi vars/ctix/hosts
  2. Enter the IP address of the machines on which you want to deploy the CTIX application and database services. You can host the services on multiple machines based on your requirements. For example, for a two-tier deployment, you can host the app and background services on one server and the database services on another server.

  3. Save and exit.

Update Vars File

The vars.yml file includes variables, such as base path, database passwords, and endpoints, that are needed for the CTIX application and database services.

To update the vars.yml file, do the following:

  1. Run the following command to open the vars.yml file:

    sudo vi vars/ctix/vars.yml
  2. Update the respective values, such as base and log paths, database URLs and passwords, and more.

  3. Save and exit.

Install Docker and Set up Cluster

The CTIX application and database services run as Docker containers. You must install Docker on all servers where you want to deploy the CTIX services.

To install Docker on all servers, do the following on the installer server:

  1. Run the following command to download the Docker dependencies:

    yum install https://packages.cyware.com/repository/cyware-yum-hosted/libselinux-python-2.9-2.1.module_el8.2.0+308+f56412f1.x86_64.rpm
  2. Run the following command to install Docker and set up the cluster:

    ansible-playbook -i vars/ctix/hosts run-setup.yml -e"client=ctix" -u <ssh-user>
 root@ip-10-xx-x-64 ctix-installer]# ansible-playbook -i vars/ctix/hosts run-setup.yml -e"client=ctix" -u centos

PLAY [all] *****************************************************************************************************************************************************************************************

TASK [Gathering Facts] *****************************************************************************************************************************************************************************
ok: [10.xx.x.64]

TASK [setup/docker : Start AWS CSOL deployment] ****************************************************************************************************************************************************
skipping: [10.xx.x.64]

TASK [setup/docker : Add the cyware docker repo] ***************************************************************************************************************************************************
skipping: [10.xx.x.64]

TASK [setup/docker : Add the cyware docker 8 repo] *************************************************************************************************************************************************
ok: [10.xx.x.64]

TASK [setup/docker : Install the docker in the rhel/centos server] *********************************************************************************************************************************
ok: [10.xx.x.64]

TASK [setup/docker : Install the docker in the aws server] *****************************************************************************************************************************************
skipping: [10.xx.x.64]

TASK [setup/docker : Start Docker service] *********************************************************************************************************************************************************
ok: [10.xx.x.64]
Deploy Database Stack

To deploy the CTIX database stack, run the following command on the installer server:

ansible-playbook -i vars/ctix/hosts deploy-db-stack.yml -e"client=ctix" -u <ssh-user>
root@ip-10-xx-x-64 ctix-installer]# ansible-playbook -i vars/ctix/hosts deploy-db-stack.yml -e"client=ctix" -u centos

PLAY [all] *********************************************************************

TASK [Gathering Facts] *********************************************************
ok: [10.xx.x.64]

TASK [deploy/deploy-db-stack : Change ansible python interpreter to python3] ***
ok: [10.xx.x.64]

 
TASK [deploy/deploy-db-stack : Allow Connections on DB PORT] *******************
changed: [10.xx.x.64]
...
...
...
TASK [deploy/deploy-db-stack : Start Docker service] ***************************
changed: [10.xx.x.64]
  
TASK [deploy/deploy-db-stack : Remove db stack from a compose file] ************
changed: [10.xx.x.64]

TASK [deploy/deploy-db-stack : Deploy db stack from a compose file] ************
changed: [10.xx.x.64]
 
PLAY RECAP *********************************************************************
10.xx.x.64                 : ok=21   changed=17   unreachable=0    failed=0    skipped=0    rescued=0    ignored=0 
Deploy CTIX Application Stack

To deploy the CTIX application stack, run the following command on the installer server:

ansible-playbook -i vars/ctix/hosts deploy-ctix.yml -e"client=ctix" -u <ssh-user>
root@ip-10-xx-x-64 ctix-installer]# ansible-playbook -i vars/ctix/hosts deploy-ctix.yml -e"client=ctix" -u centos
  
PLAY [all] *********************************************************************

TASK [Gathering Facts] *********************************************************
ok: [10.xx.x.64]
 
TASK [deploy/deploy-ctix : Change ansible python interpreter to python3] *******
ok: [10.xx.x.64]
  
TASK [deploy/deploy-ctix : create directory if they don't exist] ***************
changed: [10.xx.x.64] => (item=/apps/cyware/data)
changed: [10.xx.x.64] => (item=/apps/cyware/conf)

TASK [deploy/deploy-ctix : Change ansible python interpreter to python2] *******
ok: [10.xx.x.64]
 
TASK [deploy/deploy-ctix : Copy tenant.env] ************************************
changed: [10.xx.x.64]
 
TASK [deploy/deploy-ctix : Copy ctix stack file] *******************************
changed: [10.xx.x.64]

TASK [deploy/deploy-ctix : Change ansible python interpreter to python3] *******
ok: [10.xx.x.64]
  
TASK [deploy/deploy-ctix : Deploy ctix stack from a compose file] **************
changed: [10.xx.x.64]
 
TASK [deploy/deploy-ctix : Wait for services to become healthy] ****************
Pausing for 90 seconds
(ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)
ok: [10.xx.x.64]
  
TASK [deploy/deploy-ctix : Wait for API Gateway to be healthy] *****************
ok: [10.xx.x.64]
  
PLAY RECAP *********************************************************************
10.xx.x.64                 : ok=10   changed=4    unreachable=0    failed=0    skipped=0    rescued=0    ignored=1