NSV is a simple demo web application for displaying Nmap scan data. It consists of three main components:
- An ElasticSearch server were the data is stored and queried
- A Flask backend server that communicates with the Elasticsearch server and exposes API services to the web
- A frontend where AngularJS is used as a runtime code generator
When running this application using Docker images that were uploaded in Docker Hub, only Docker will be needed to be installed in the system.
However if the images are going to be built from source, or if the application is going to be run in development mode, the following tools will also be needed:
git clone https://github.com/rp-pedraza/nsv.git
cd nsv
The frontend service is provided by connect while in development mode, and the backend service is provided by Flask.
The Elasticsearch server can be run as a Docker service. This can be done trough the task es:up
command. Or it be can be setup manually somewhere. It simply needs to listen on port 9200
.
In production mode, the frontend files are statically compiled and are served through Nginx. The backend is still run by Flask but now works under uWSGI and Nginx. All these services and tasks run through Docker.
Make sure all the necesary software are installed and run the following command in a terminal:
task backend:all
This will instantiate an Elasticsearch server, import data to it, and then run the backend server.
If the Elasticsearch server is set up to run externally, run the task data:import backend:server
command instead so only the data importer and the backend server runs.
Run the following command in another terminal as well to start the frontend server:
task frontend:serve
A browser page should automatically open up to http://localhost:9000 if everything runs correctly.
In this mode, all services are run through Docker. They can be instantiated using the following command:
task docker:up
This will build the services and its images first if they don't yet exist. docker:up:build
will
force the images to be rebuilt again.
To use images from Docker Hub, run the following:
task docker:pull:up
Or without using task
:
( cd docker && docker compose pull && docker compose up --no-build )
Open the browser page to http://localhost:80/ to visit the application.
The uploaded Docker images have been tested to work in Ubuntu 22.04 running in WSL2 mode as well. See this page for instructions on how to have a properly integrated Docker setup.