Skip to content

Latest commit

 

History

History
144 lines (99 loc) · 3.33 KB

build-guide.md

File metadata and controls

144 lines (99 loc) · 3.33 KB

Build from sources

This document is a step-by-step guide to build Cortex from sources.

1. Pre-requisites

The following softwares are required to download and build Cortex.

2. Quick Build Guide

To install the requirements and build Cortex from sources, please follow the instructions below depending on your operating system.

2.1. CentOS/RHEL

2.1.1. Packages

sudo yum -y install git bzip2

2.1.2. Installation of OpenJDK

sudo yum -y install java-1.8.0-openjdk-devel

2.1.3. Installation of NodeJs

Install the EPEL Repository:

You should have the "extras" repository enabled, then:

sudo yum -y install epel-release

Then, you can install NodeJs:

sudo yum -y install nodejs

2.1.4. Installation of bower and grunt

sudo npm install -g bower grunt-cli

2.2. Ubuntu

2.2.1. Packages

sudo apt-get install git wget

2.2.2. Installation of Oracle JDK

echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main' | sudo tee -a /etc/apt/sources.list.d/java.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key EEA14886
sudo apt-get update
sudo apt-get install oracle-java8-installer

2.2.3. Installation of NodeJs

sudo apt-get install wget
wget -qO- https://deb.nodesource.com/setup_4.x | sudo bash -
sudo apt-get install nodejs

2.2.4. Installation of bower and grunt

sudo npm install -g bower grunt-cli

2.3. Cortex

Download sources

git clone https://github.com/CERT-BDF/Cortex.git

Build the projects

cd Cortex
bin/activator clean stage

It will download all dependencies (could be long) then build the back-end. This command clean previous build files and create an autonomous package in target/universal/stage directory. This packages contains Cortex binaries with required libraries (/lib), analyzers (/analyzers), configuration files (/conf) and startup scripts (/bin).

Binaries are built and stored in Cortex/target/universal/stage/. Install them in /opt/cortex for example.

sudo cp -r Cortex/target/universal/stage /opt/cortex

Follow the configuration guide to run Cortex.

First start

Follow First start in the Installation guide to start using Cortex.

Build the front-end only

Building back-end builds also front-end, so you don't need to build front-end separately. This section is useful only for troubleshooting or in order to install front-end in a reverse proxy.

Go to front-end directory:

cd Cortex/ui

Install NodeJs libraries (required by building step), bower libraries (javascript libraries downloaded by browser). Then build the front-end :

npm install
bower install
grunt build

This step generates static files (html, javascript and related resources) in dist directory. These files are ready to be imported in http server.