Skip to content

Latest commit

Β 

History

History
151 lines (106 loc) Β· 2.69 KB

File metadata and controls

151 lines (106 loc) Β· 2.69 KB

SPIR Setup Guide

Prerequisites

  • Python 3.11+
  • Docker 24+ & Docker Compose v2 (for full stack)
  • Git

Development Setup

1. Clone the Repository

git clone https://github.com/aryanajit24/VAPT.git
cd VAPT

2. Create Virtual Environment

cd spir
python3.11 -m venv venv
source venv/bin/activate        # Linux/macOS
# or: venv\Scripts\activate    # Windows

3. Install Dependencies

pip install -r requirements.txt

4. Configure Environment

cp .env.example .env

Edit .env β€” at minimum set:

  • SPIR_API_KEY β€” a random secret key for API auth
  • SPIR_SECRET_KEY β€” another random key

Generate secure keys:

python -c "import secrets; print(secrets.token_hex(32))"

5. Run the API (in-memory mode, no external services)

python -m api.app

The API starts at http://localhost:8000. Swagger docs at http://localhost:8000/docs.

6. Run the Demo

python scripts/demo.py

7. Run Tests

pytest tests/ -v

Full Stack with Docker Compose

Start All Services

# From spir/ directory
docker-compose up -d

Services started:

  • spir-api β€” FastAPI backend on port 8000
  • spir-dashboard β€” React frontend on port 3000
  • postgres β€” PostgreSQL on port 5432
  • opensearch β€” OpenSearch on port 9200
  • redis β€” Redis on port 6379

Verify Services

docker-compose ps
curl http://localhost:8000/health

View Logs

docker-compose logs -f spir-api

Stop Services

docker-compose down

Dashboard Setup (React)

cd dashboard
npm install
npm start

Dashboard available at http://localhost:3000.


Collector Configuration

Syslog Receiver

Configure your firewalls/servers to send syslog to SPIR:

# Firewall example (iptables rsyslog):
# /etc/rsyslog.d/spir.conf
*.* @spir-host:514   # UDP
*.* @@spir-host:601  # TCP

Windows Event Forwarding

Set up WEF to forward Windows events to SPIR's syslog TCP port (601).


Environment Variables Reference

Variable Default Description
SPIR_ENV development Environment mode
SPIR_API_KEY change-me API authentication key
SPIR_API_PORT 8000 API server port
POSTGRES_HOST localhost PostgreSQL host
POSTGRES_PASSWORD spirpassword PostgreSQL password
OPENSEARCH_HOST localhost OpenSearch host
REDIS_HOST localhost Redis host
SLACK_WEBHOOK_URL β€” Slack webhook for alerts
SMTP_HOST localhost SMTP server for email alerts
VAPT_CRITICAL_THRESHOLD_DAYS 7 Alert if critical vuln open > N days