Install PatrowlHears — Vulnerability Intelligence Center

Hardware minimum requirements

Installation steps

The very easy way: Use Docker

  • Install Docker and Docker-compose
  • Run the docker stack:
git clone https://github.com/Patrowl/PatrowlHears
cd PatrowlHears
docker-compose up
docker-compose exec patrowlhears bash -c 'cd backend_app && ./load_init_data.sh'
docker-compose exec patrowlhears bash -c 'cd backend_app && ./import_data_updates.sh'
  • Regularly update DB with command:
docker-compose exec patrowlhears bash -c 'cd backend_app && ./import_data_updates.sh'

The easy way: Use installation script

  • Install Git and Python3 on your server and un the commands:
git clone https://github.com/Patrowl/PatrowlHears
cd PatrowlHears
./install.sh
cd backend_app && ./import_data_updates.sh

The DevOps way: Install and deploy from Ansible playbook

  • Go to the playbook location cd deploy/ansible/playbooks
  • Copy and update the sample file ansible/vars.yml.sample to ansible/vars.yml
  • Run the Ansible playbook:
ansible-playbook patrowlhears.yml -t patrowlhears-install -i myhost,

The Nerd way: Install and deploy from sources

1. Install system pre-requisites

brew update
brew install postgres python3 rabbitmq npm
python -m ensurepip
pip install virtualenv
sudo apt update
sudo apt upgrade -y
sudo apt install -y build-essential python3 python3-dev git curl rabbitmq-server postgresql postgresql-client nodejs libpq-dev nginx
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python3 get-pip.py
rm get-pip.py
sudo pip3 install virtualenv
sudo yum install -y git python3 python3-pip python3-virtualenv rabbitmq-server postgresql postgresql-client npm postgresql-devel
git clone https://github.com/Patrowl/PatrowlHears
cd PatrowlHears/frontend
npm install
npm run build
cd ../backend_app
python3 -m virtualenv env
source env/bin/activate
pip install -r requirements.txt
(env) GreenLock@GL02:PatrowlHears$ ls
  • Edit file the var/db/create_user_and_db.sql and update the user and password values (default values are: 'patrowlhears' and 'patrowlhears').
  • Execute the SQL script:
psql < var/db/create_user_and_db.sql
  • Execute the SQL script:
sudo -u postgres psql < var/db/create_user_and_db.sql
  • Copy backend_app/settings.py.sample to backend_app/settings.py and update at least following options:
  • Create the db schema using the Django commands:
python manage.py makemigrations
python manage.py migrate
  • Collect static files (production mode — all static files copied to /staticfiles/ and will be served by NGinx):
python manage.py collectstatic --noinput
  • Create the Django superuser with all privileges, more than Batman but without a cape:
python manage.py shell < var/bin/create_default_admin.py
  • Create the default organization:
python manage.py shell < var/bin/create_default_organization.py
  • Start Supervisord (Celery workers consuming the tasks enqueued RabbitMQ — Yes, that’s how asynchronus tasks work here):
supervisord -c var/etc/supervisord.conf
  • Check every celery workers are in state RUNNING:
supervisorctl -s http://127.0.0.1:9002 status all
  • Then, the Django application (development only):
python manage.py runserver 127.0.0.1:8000
  • or, using Gunicorn (recommended in production):
gunicorn backend_app.wsgi:application -b 127.0.0.1:8000 --access-logfile -
  • Open the backend_app/settings.py file and set the variable DEBUG=False.
  • Follow the same steps for starting the development environment (see #7.1)
  • Customize the nginx.conf file provided. Then start it:
[sudo] nginx -p .
  • Run following commands (in path backend_app):
./load_init_data.sh
./import_data_updates.sh

Need help ? Stuck somewhere ?

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to install AWS EC2 Mac instance to to Build & Test macOS, iOS, iPadOS, tvOS, and watchOS Apps

Rethinking Twitter’s “who to follow” (using Node.js and d3.js)

Part2: Setup production docker and docker-compose with Node.js, MongoDB, Redis, and Next.js

Using MemSQL to Query Hundreds of Billions of Rows in a Dashboard

Taking Software Refactoring Seriously

The Best Ruby Frameworks to Build a REST API

Using AWS Session Manager to connect to Windows Instance without an RDP port open

Using Binary Search

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nicolas Mattiocco

Nicolas Mattiocco

More from Medium

NoCode In a Nutshell

Using Twitter to notify developers exposing their access tokens: The Aftermath

Auto Backup Cloud Function Source Codes

IoT Device provisioning and considerations