-
Notifications
You must be signed in to change notification settings - Fork 17
Setup
azazelm3dj3d edited this page Aug 1, 2023
·
2 revisions
Tested on Ubuntu Linux 14.04 -> 18.10
- Install system dependencies and libraries:
sudo apt-get install git screen libffi-dev libssl-dev libsqlite3-dev libmysqlclient-dev
- Install Python and associated packages:
sudo apt-get install python2.7 python-pip python-dev libpython-dev
- Install Python virtualenv library:
pip install virtualenv
- Install databases:
sudo apt-get install mysql-server redis-server
- Install front-end packages:
sudo apt-get install nodejs npm && npm install -g bower
- On some systems, nodejs is installed as either
/usr/bin/node
or/usr/bin/nodejs
, if it is installed as/usr/bin/nodejs
simply run the commandsudo cp /usr/bin/nodejs /usr/bin/node
for the npm install command to work properly
Note: If you are running on CentOS, install these dependencies:
yum install MySQL-python libffi-devel mysql mysql-devel mysql-lib
- Create system user:
sudo useradd -d /opt/ThreatKB -s /bin/bash -m -U threatkb
- Clone repo:
sudo git clone -b master https://github.com/InQuest/ThreatKB.git /opt/ThreatKB/install
- Fix permissions of /opt/ThreatKB if needed:
sudo chown -R threatkb:threatkb /opt/ThreatKB
- In MySQL shell as root user:
- Create MySQL database:
CREATE DATABASE threatkb;
- Create MySQL user:
CREATE USER 'threatkb'@'localhost' IDENTIFIED BY 'password';
- Allow permissions:
GRANT ALL PRIVILEGES ON threatkb . * TO 'threatkb'@'localhost';
- Flush privileges:
FLUSH PRIVILEGES;
- Create MySQL database:
- Update SQL config in /opt/ThreatKB/config.py parameters:
- SQL_HOST
- SQL_USERNAME
- SQL_PASSWORD
Note: These steps and the execution of ThreatKB should be ran under the threatkb
local user you created earlier
- Run
./install.sh
- Setups a Python virtual environment in the directory
/opt/ThreatKB/flask
- Installs required node libraries for front-end
- Setups a Python virtual environment in the directory
By default Flask will listen on 127.0.0.1:5000, if you want to change this modify the app.run()
command inside /opt/ThreatKB/run.py
Now that you are finished with setup, head to Getting Started.