Real-time vulnerability scanning Β· CVE intelligence Β· NIST + ISO compliance Β· PDF reporting Β· RBAC auth
$ docker-compose up --build
β Backend β http://localhost:8000
β Frontend β http://localhost:5173
β Swagger β http://localhost:8000/docs
β ZAP β http://localhost:8090
- Overview
- Features
- Tech Stack
- Architecture
- Quick Start
- Project Structure
- API Endpoints
- RBAC Roles
- Compliance
- Screenshots
- Author
Purple-Ops is a full-stack, production-ready Security Operations Center platform that integrates automated vulnerability scanning, real-time CVE threat intelligence, and regulatory compliance automation into a single deployable system.
Built as an MCA Final Year Major Project at Chandigarh University, it demonstrates that enterprise-grade SOC capabilities β typically costing $100K+/year in commercial tools β can be delivered through open-source technologies.
| Traditional Approach | Purple-Ops |
|---|---|
| Manual, fragmented tools | Single unified platform |
| No real-time CVE correlation | Automatic NIST NVD API lookup |
| Manual compliance mapping | Auto NIST 800-53 + ISO 27001 |
| Sequential scanning (slow) | Parallel scanning (~4x faster) |
| No PDF reporting | One-click SOC reports |
| No RBAC | 3-tier role enforcement |
- Nmap network port scanner β TCP SYN, service version detection, OS fingerprinting
- OWASP ZAP web application scanner β Spider + Active scan, OWASP Top 10 detection
- Parallel Scanning β ThreadPoolExecutor (5 workers), ~4x throughput improvement
- Auto-routing: IP targets β Nmap, URLs β ZAP
- Real-time NIST NVD API v2.0 integration
- Automatic CVE ID fetching per discovered service
- CVSS 3.x severity scoring (Critical / High / Medium / Low)
- AI-based risk prioritization with asset criticality weighting
- JWT authentication (HS256 signed tokens)
- bcrypt password hashing (cost factor 12)
- 3-tier RBAC β Admin / Analyst / Viewer
- Route-level enforcement on all 14 API endpoints
- CORS, input validation, SQL injection prevention via ORM
- NIST SP 800-53 Rev 5 β 9 control families, 39 controls mapped
- ISO/IEC 27001:2022 β Annex A technological controls, 28 controls mapped
- Per-vulnerability control cross-referencing
- Control frequency analysis for systemic gap identification
- ReportLab PDF SOC reports β executive summary, vuln tables, compliance section
- Prioritized remediation recommendations
- Downloadable from dashboard in one click
| Page | Description |
|---|---|
| Dashboard | SOC command center β stat cards, live alerts, threat meter |
| Analytics | 5 Recharts visualizations β donut, bar, area, horizontal bar, line |
| Alert Center | Real-time alert feed with severity filtering + detail panel |
| Assets | Asset inventory with CRUD + quick-scan button |
| Threats | Vulnerability intelligence with inline status editing |
| Web Scanner | OWASP ZAP-powered web assessment interface |
| Net Scanner | Nmap network scanning with terminal output |
| Threat Intel | IOC lookup β IP, domain, hash reputation analysis |
| Tickets | Auto-generated incident tickets for Critical/High vulns |
| Case Board | Card-based case management with status transitions |
| History | Scan history trend charts + detailed log table |
| Compliance | NIST + ISO mapping charts + audit-ready evidence table |
| Log Explorer | Searchable activity log with severity color-coding |
| Terminal | Real-time system activity stream |
| Layer | Technologies |
|---|---|
| Backend | FastAPI, SQLAlchemy, PostgreSQL/SQLite, Celery, Redis, APScheduler |
| Frontend | React 18, Vite 5, Recharts, Lucide React |
| Security Tools | Nmap 7.94+, OWASP ZAP (Docker), NIST NVD API v2.0 |
| Auth | JWT (python-jose), bcrypt, RBAC middleware |
| Reporting | ReportLab, FastAPI-Mail |
| DevOps | Docker Compose, 5-service architecture |
| Standards | NIST SP 800-53 Rev 5, ISO/IEC 27001:2022, CVSS 3.x |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π€ User / Browser β
β Admin | Analyst | Viewer β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β HTTPS / JWT Bearer
ββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
β ⬑ React 18 + Vite (localhost:5173) β
β 14 Pages | 5 Charts | Dark CyberPlatform UI β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β REST API / JSON
ββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
β βοΈ FastAPI Backend (localhost:8000) β
β JWT Auth | RBAC | SQLAlchemy ORM | 14 APIs β
ββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββββ¬ββββββββββββββ
β β β β
ββββββΌββββ βββββΌββββ ββββββΌββββ βββββΌβββββββ
βCelery β βScan β βReport β βComplianceβ
βWorkers β βEngine β βEngine β βMapper β
ββββββ¬ββββ βββββ¬ββββ ββββββββββ ββββββββββββ
β β
ββββββΌβββ ββββΌβββββββββββββββββββββββββββββββ
βRedis β β Nmap OWASP ZAP NVD API β
β:6379 β β (network) (web :8090) (CVEs) β
βββββββββ βββββββββββββββββββββββββββββββββββ
β
ββββββΌβββββββββββ
β PostgreSQL β
β (prod DB) β
βββββββββββββββββ
π³ All services via Docker Compose β 1 command deploy
- Docker + Docker Compose v2
- Git
git clone https://github.com/yourusername/VulnGuardAI.git
cd VulnGuardAIcp backend/.env.example backend/.envEdit backend/.env:
SECRET_KEY=your-super-secret-jwt-key-min-64-chars
DATABASE_URL=sqlite:///./vulnguard.db
REDIS_URL=redis://redis:6379/0
ZAP_API=http://zap:8090
NVD_API_KEY=your-nvd-api-key-optional
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-app-password
MAIL_FROM=your-email@gmail.comdocker-compose up --buildThis starts all 5 services:
| Service | URL | Description |
|---|---|---|
| Frontend | http://localhost:5173 | React dashboard |
| Backend API | http://localhost:8000 | FastAPI server |
| Swagger UI | http://localhost:8000/docs | API documentation |
| Redis | localhost:6379 | Celery broker (internal) |
| OWASP ZAP | localhost:8090 | Web scanner (internal) |
curl -X POST http://localhost:8000/auth/register \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "Admin@123", "role": "admin"}'Open http://localhost:5173, login with your credentials, and add your first asset!
# Terminal 1 β Redis
docker run -d -p 6379:6379 redis:alpine
# Terminal 2 β OWASP ZAP
docker run -d -p 8090:8090 ghcr.io/zaproxy/zaproxy:stable \
zap.sh -daemon -host 0.0.0.0 -port 8090 -config api.disablekey=true
# Terminal 3 β Backend
cd backend
pip install -r requirements.txt
uvicorn main:app --reload --host 0.0.0.0 --port 8000
# Terminal 4 β Celery worker
cd backend
celery -A task_queue.celery_app worker --loglevel=info
# Terminal 5 β Frontend
cd frontend
npm install
npm run devVulnGuardAI/
βββ backend/
β βββ main.py # App entry point, CORS, routers
β βββ database.py # SQLAlchemy engine + session
β βββ .env # Environment config (secrets)
β βββ requirements.txt
β βββ Dockerfile
β βββ models/
β β βββ asset.py
β β βββ vulnerability.py
β β βββ user.py
β β βββ ticket.py
β β βββ audit.py
β β βββ scan_history.py
β βββ routes/
β β βββ auth.py # Login, register, /me
β β βββ assets.py # CRUD assets
β β βββ scan.py # Single + parallel scan
β β βββ vulnerabilities.py # Vuln list + status update
β β βββ tickets.py # Incident tickets
β β βββ dashboard.py # Summary stats
β β βββ history.py # Scan history
β β βββ report.py # PDF + compliance reports
β βββ auth/
β β βββ jwt_handler.py # Token create/verify
β β βββ security.py # bcrypt helpers
β β βββ auth.py # RBAC dependency injection
β βββ scanner/
β β βββ nmap_scanner.py # Nmap integration
β β βββ zap_scanner.py # OWASP ZAP integration
β βββ intelligence/
β β βββ cve_fetcher.py # NIST NVD API client
β β βββ compliance_mapper.py # NIST 800-53 + ISO 27001
β βββ ai_engine/
β β βββ cvss_calculator.py # CVSS scoring logic
β β βββ risk_model.py # Risk prioritization
β βββ reports/
β β βββ pdf_report.py # ReportLab PDF generator
β βββ alerts/
β β βββ email_alert.py # FastAPI-Mail alerts
β βββ task_queue/
β β βββ celery_app.py # Celery configuration
β β βββ scan_tasks.py # Background scan tasks
β βββ core/
β βββ config.py # Settings from .env
β βββ scheduler.py # APScheduler jobs
β βββ alert_engine.py # Alert trigger logic
βββ frontend/
β βββ src/
β β βββ App.jsx # All 14 pages (single SPA)
β βββ public/
β βββ .env # VITE_API_BASE=http://localhost:8000
β βββ package.json
β βββ vite.config.js
β βββ Dockerfile
βββ docker-compose.yml # 5-service orchestration
βββ README.md
All endpoints except /auth/login and /auth/register require Authorization: Bearer <token>.
| Method | Endpoint | Role Required | Description |
|---|---|---|---|
POST |
/auth/register |
Public | Register new user |
POST |
/auth/login |
Public | Login + get JWT |
GET |
/auth/me |
All | Get current user info |
GET |
/assets/ |
All | List all assets |
POST |
/assets/ |
Admin / Analyst | Add new asset |
GET |
/vulnerabilities/ |
All | List vulnerabilities |
PUT |
/vulnerabilities/{id}/status |
Admin / Analyst | Update status |
POST |
/scan/{asset_id} |
Admin / Analyst | Scan single asset |
POST |
/scan/parallel |
Admin / Analyst | Parallel scan all |
GET |
/tickets/ |
All | List tickets |
PUT |
/tickets/{id}/status |
Admin / Analyst | Update ticket |
GET |
/dashboard/summary |
All | Dashboard stats |
GET |
/history/ |
All | Scan history |
GET |
/reports/vulnerabilities/pdf |
Admin / Analyst | Download PDF |
GET |
/reports/compliance |
All | Compliance mapping |
Full interactive docs: http://localhost:8000/docs
| Permission | Admin | Analyst | Viewer |
|---|---|---|---|
| View dashboard / analytics | β | β | β |
| View assets / vulnerabilities | β | β | β |
| View tickets / history | β | β | β |
| Add / edit assets | β | β | β |
| Trigger scans | β | β | β |
| Update vulnerability status | β | β | β |
| Generate PDF reports | β | β | β |
| Manage users | β | β | β |
| View audit logs | β | β | β |
| Metric | Result |
|---|---|
| API response time (GET endpoints) | < 70ms avg |
| PDF generation time | < 4s |
| Parallel scan speedup (5 workers) | ~4x vs sequential |
| JWT auth coverage | 100% of protected endpoints |
| Unit test cases | 97 passed, 0 failed |
| Backend test coverage | 89.8% |
| NIST SP 800-53 control coverage | 83% (39/47 relevant controls) |
| ISO 27001 control coverage | 82.4% (28/34 tech controls) |
Auto-mapped control families: AC, IA, SC, SI, RA, CM, AU, IR, SA
Auto-mapped themes: Organizational Controls (A.5), Technological Controls (A.8)
100% coverage via OWASP ZAP active scanning engine
cd backend
pip install pytest pytest-mock
pytest tests/ -v --tb=shortExpected output:
97 passed in 12.4s
Dashboard, Analytics, Compliance, Alert Center β screenshots available in
/docs/Screenshots/
Purple-Ops is designed exclusively for authorized security assessment of systems you own or have explicit written permission to test.
Unauthorized scanning of systems you do not own may violate the Computer Fraud and Abuse Act (CFAA), Computer Misuse Act, or equivalent legislation in your jurisdiction.
Always obtain written authorization before scanning any target.
| Field | Details |
|---|---|
| Project Type | MCA Final Year Major Project |
| Student | Ayush Kumar Thakur |
| UID | 24MCA20322 (MCA 5'B) |
| Institution | University Institute of Computing, Chandigarh University |
| Academic Year | 2024β26 |
| Domain | Cybersecurity |
This project is licensed under the MIT License β see LICENSE for details.
Purple-Ops β Built with β€οΈ for the cybersecurity community
"From scan to compliance report in minutes, not days."
