Skip to content

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ ThreatView β€” Threat Intelligence Dashboard

An affordable, aggregated threat intelligence dashboard that translates raw data into actionable insights for SMBs.

ThreatView acts as a central nervous system for threat data β€” ingesting noisy data from sources like AlienVault OTX, PhishTank, and AbuseIPDB, normalizing it, and presenting it so a non-expert IT manager can say: "We need to block this IP address immediately."


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    REACT FRONTEND                         β”‚
β”‚  Dashboard β”‚ IoC Search β”‚ Alerts β”‚ Reports β”‚ Settings     β”‚
β”‚  Recharts  β”‚ TailwindCSS β”‚ Lucide Icons                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚ REST API
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  FASTAPI BACKEND                           β”‚
β”‚  Auth (JWT) β”‚ Dashboard β”‚ IoC Search β”‚ Alerts β”‚ Reports   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚              INGESTION ENGINE (ETL)                        β”‚
β”‚  AlienVault OTX β”‚ PhishTank β”‚ AbuseIPDB                   β”‚
β”‚  BaseIngestor (normalize β†’ upsert β†’ dedup)               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚              SCHEDULER (APScheduler)                       β”‚
β”‚  Data ingestion: every 30 min β”‚ Alerts: every 5 min       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚              DATABASE (SQLite/PostgreSQL)                   β”‚
β”‚  Users β”‚ IoCs β”‚ Alerts β”‚ Alert Rules β”‚ Ingestion Logs      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

threatview/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ main.py                     # FastAPI entry point
β”‚   β”œβ”€β”€ requirements.txt            # Python dependencies
β”‚   β”œβ”€β”€ .env.example                # Environment variables template
β”‚   └── app/
β”‚       β”œβ”€β”€ config.py               # Settings & env vars
β”‚       β”œβ”€β”€ database.py             # Async SQLAlchemy setup
β”‚       β”œβ”€β”€ models/
β”‚       β”‚   β”œβ”€β”€ models.py           # ORM models (User, IoC, Alert, etc.)
β”‚       β”‚   └── schemas.py          # Pydantic request/response schemas
β”‚       β”œβ”€β”€ ingestors/
β”‚       β”‚   β”œβ”€β”€ base.py             # BaseIngestor (abstract ETL)
β”‚       β”‚   β”œβ”€β”€ alienvault.py       # AlienVault OTX connector
β”‚       β”‚   β”œβ”€β”€ phishguard.py       # PhishTank phishing URLs
β”‚       β”‚   └── abuseipdb.py        # AbuseIPDB IP reputation
β”‚       β”œβ”€β”€ api/
β”‚       β”‚   β”œβ”€β”€ auth.py             # Register, login, profile
β”‚       β”‚   β”œβ”€β”€ dashboard.py        # Stats, trends, charts
β”‚       β”‚   β”œβ”€β”€ iocs.py             # IoC search, filter, export
β”‚       β”‚   β”œβ”€β”€ alerts.py           # Alert rules, brand monitoring
β”‚       β”‚   └── reports.py          # PDF report generation
β”‚       β”œβ”€β”€ services/
β”‚       β”‚   β”œβ”€β”€ scheduler.py        # APScheduler job runner
β”‚       β”‚   β”œβ”€β”€ alerting.py         # Alert rule engine
β”‚       β”‚   └── reports.py          # ReportLab PDF generator
β”‚       └── utils/
β”‚           └── auth.py             # JWT auth, password hashing, RBAC
└── frontend/
    β”œβ”€β”€ package.json
    β”œβ”€β”€ vite.config.js              # Vite with API proxy
    β”œβ”€β”€ tailwind.config.js
    β”œβ”€β”€ index.html
    └── src/
        β”œβ”€β”€ main.jsx
        β”œβ”€β”€ index.css
        β”œβ”€β”€ App.jsx                 # Router + protected routes
        β”œβ”€β”€ context/
        β”‚   └── AuthContext.jsx     # Auth state management
        β”œβ”€β”€ utils/
        β”‚   └── api.js              # API client with JWT
        β”œβ”€β”€ components/
        β”‚   └── Layout.jsx          # Sidebar navigation
        └── pages/
            β”œβ”€β”€ LoginPage.jsx
            β”œβ”€β”€ RegisterPage.jsx
            β”œβ”€β”€ DashboardPage.jsx    # Charts, stats, trends
            β”œβ”€β”€ IoCsPage.jsx         # Search & filter IoCs
            β”œβ”€β”€ AlertsPage.jsx       # Alert rules + brand monitoring
            β”œβ”€β”€ ReportsPage.jsx      # PDF report preview + download
            └── SettingsPage.jsx     # Profile + API access

πŸš€ Quick Start

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • npm or yarn

Backend

cd backend
pip install -r requirements.txt

# Copy and edit environment variables
cp .env.example .env

# Start the server (creates DB + seeds demo data automatically)
python -m uvicorn main:app --reload --port 8000

The backend will:

  1. Create the SQLite database
  2. Seed demo users (demo/demo123, freeuser/free123)
  3. Run initial ingestion with mock threat data
  4. Start the scheduler (ingestion every 30min, alerts every 5min)

Frontend

cd frontend
npm install
npm run dev

Open http://localhost:5173

Demo Credentials

Account Username Password Tier
Pro demo demo123 ⚑ PRO
Free freeuser free123 FREE

🎯 Key Features

Phase 1: Ingestion Engine (ETL)

  • AlienVault OTX: Malicious IPs, domains, URLs, file hashes from threat pulses
  • PhishTank: Verified phishing URLs targeting banks, tech companies, government
  • AbuseIPDB: IP reputation with abuse confidence scores
  • Normalization: All sources mapped to a unified IoC model (value, type, threat, severity, country, confidence)
  • Scheduler: APScheduler runs ingestion every 30 minutes with full ETL cycle

Phase 2: Intelligence Dashboard

  • Stats Cards: Total IoCs, 24h count, 7-day count, active alerts
  • Threat Type Distribution: Donut chart showing malware, phishing, ransomware, etc.
  • Severity Distribution: Bar chart with color-coded severity levels
  • Top Source Countries: Ranked list with country flags and progress bars
  • Threat Trends: 8-day area chart showing trend lines per threat type
  • Data Sources: Status cards for each intelligence feed

Phase 3: Alerting & Search

  • IoC Search: Full-text search across IoC values, descriptions, and tags
  • Filters: IoC type, threat type, severity range
  • Alert Rules: Custom rules with industry match, threat type, severity threshold, keyword
  • Brand Monitoring: Add domains to watchlist; auto-alerts if found in phishing feeds
  • Alert Types: IoC Match, Brand Alert, Industry Alert, Threat Spike

Phase 4: Reporting & Monetization

  • PDF Generation: Weekly Threat Landscape report with ReportLab
    • Executive summary
    • Threat type breakdown table
    • Top source countries
    • Top 20 highest-severity indicators
    • Data source summary
  • CSV Export: Pro-only IoC export with full fields
  • Tiered Access (RBAC):
    • Free: 24-hour data window, basic search, 3 alert rules
    • Pro: Historical search, API access, CSV export, PDF reports, unlimited rules

πŸ”Œ API Documentation

Once the backend is running, visit:

Key Endpoints

Method Endpoint Auth Tier Description
POST /api/auth/register No β€” Create account
POST /api/auth/login No β€” Get JWT token
GET /api/auth/me Yes β€” Get profile
GET /api/dashboard/stats Yes β€” Dashboard stats
GET /api/iocs/search?q= Yes Free/Pro* Search IoCs
GET /api/iocs/latest Yes β€” Latest IoCs
GET /api/iocs/export/csv Yes Pro CSV export
GET /api/alerts/ Yes β€” List alerts
POST /api/alerts/rules Yes β€” Create alert rule
POST /api/alerts/brand-monitor Yes β€” Add domain monitor
GET /api/reports/weekly Yes Pro Download PDF
GET /api/reports/preview Yes Free Report preview

* Free tier limited to 24h data window

🌐 Integrated Threat Feeds

Source API Data Type Auth
AlienVault OTX otx.alienvault.com IPs, domains, hashes, pulses API Key (optional)
PhishTank data.phishtank.com Verified phishing URLs API Key (optional)
AbuseIPDB abuseipdb.com IP reputation + geolocation API Key (optional)

Demo Mode: When API keys are not configured, all ingestors return realistic mock data so the dashboard works out of the box.

πŸ› οΈ Tech Stack

Layer Technology
Frontend React 18, Vite, TailwindCSS, Recharts, Lucide Icons
Backend Python, FastAPI, SQLAlchemy (async), Pydantic v2
Database SQLite (dev) / PostgreSQL (prod)
Auth JWT (python-jose), bcrypt
Scheduling APScheduler
PDF Reports ReportLab
Deployment Cloud-ready (Docker, AWS, GCP, Azure)

πŸ“Š Data Flow

External APIs β†’ Ingestors β†’ Normalize β†’ Upsert/Dedup β†’ Database
                                                          ↓
Scheduler (30min)                              Dashboard API β†’ React Charts
                                                          ↓
Alert Engine (5min)                          Alert Rules β†’ User Notifications

πŸ”’ Security Notes

  • JWT tokens expire after 24 hours
  • Passwords are bcrypt-hashed
  • CORS configured for localhost origins (update for production)
  • API keys stored in .env (never committed)
  • Demo credentials are for development only

πŸ“„ License

MIT License β€” see LICENSE for details. "# ThreatView-"

About

Threat Intelligence Dashboard

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages