Description
The project is divided into various modules namely Dashboard
, Coordinator Node
, Worker Node
, and Testing
.
The Dashboard
provides a responsive web interface for uploading files for new scans and tracking the status of all the submitted scans.
The Coordinator Node
listens to updates for new scans, subsequently creating and adding scan jobs to the Redis Queue.
The Worker Node
listens to updates for new jobs in Redis Queue and executes them.
The Testing
module helps in maintaining the application and facilitating the CI/CD process for the same.
Application Architecture
Dependencies
- Language:
Python 3.8.10
- Database:
MongoDB
- Tools:
redis-server clamav clamav-daemon
Specific dependencies for the
Dashboard
,Coordinator
andWorker
can be found in the respective directories inrequirements.txt
file.
Local Setup Guide
- Clone the current repository to your local machine using
git clone
. - Install the dependencies as specified in
Dependencies
section. - Make sure the
mongod
andclamav-daemon
services are running in the background. - Check the
.env
file to have the appropriate MongoDB and Redis host and port (variables are set to defaults). - Access the terminal and move to the
Dashboard
directory. - Run the flask application using
export FLASK_APP=app.py
followed byflask run
. - Access another terminal and move to the
Coordinator
directory. - Run the coordinator node application using
python3 app.py
. - Access another terminal and move to the
Worker
directory. - Run the worker node application using
python3 app.py
. - Create
Uploads
andResults
directories in the project directory.
Usage
- After following the
Local setup guide
, use any web browser to access the IP address mentioned in the terminal after runningflask run
(by default it ishttp://127.0.0.1:5000/
). - Submit new scans using the
New Scan
button and track their progress on the dashboard. - The results for the submitted scans can be found in the
Results
directory as<scan id>_<file_name>.json
.
Testing
The application comes with a test suite to help users ensure correct installation and help developers verify any updates.
- Ensure the Results and Uploads directories are empty.
- Ensure the MongoDB collections are empty.
- Ensure the scan8 application is up and running.
- Access a terminal and move to the
Testing
directory. - Run the test suite using
python3 app.py -v
. - Run a single scan using the Scan8 dashboard and wait till completion.
- Run the test suite again using
python3 app.py -v
.