Skip to content

Repository files navigation

🛡️ CVE Analyzer Assistant

End-to-end vulnerability intelligence platform that automatically ingests, prioritizes, and summarizes CVE records using FastAPI, PostgreSQL (pgvector), and LLM/RAG pipelines.


👥 Engineering & Individual Contributions

  • Backend Architecture & APIs: Built asynchronous REST endpoints using FastAPI to serve analyzed vulnerability records and trigger ingestion pipelines.
  • Database & Vector Search: Modeled relational schemas and vector storage using PostgreSQL + pgvector for semantic similarity search.
  • Data Ingestion & Automation: Integrated automated scrapers for NVD API and the CISA KEV (Known Exploited Vulnerabilities) catalog with automated cron scheduling.
  • Containerization: Configured Docker environments for local database initialization and system dependencies.

👉 View My Direct Commits


🛠️ Tech Stack & Architecture

  • Backend: FastAPI, Python 3.10+, Uvicorn
  • Database & Search: PostgreSQL, pgvector (Vector Search / RAG)
  • AI / ML Pipeline: Google Gemini API, Embeddings & RAG Risk Scoring
  • Frontend: React, Vite
  • DevOps & Tools: Docker, Git, Telegram Bot API (Alerting)
NVD API + CISA KEV Catalog
        │
        ▼
data_collector/ (nvd_fetcher.py + cisa_fetcher.py)
        │
        ▼
PostgreSQL + pgvector (cves table)
        │
        ▼
ai_engine/ (Embeddings + RAG + Risk Scoring)
        │
        ▼
app/ (FastAPI Backend) ────► notifications/ (Telegram Alerts)
        │
        ▼
src/ (React Dashboard)

🚀 Quickstart & Setup

1. Clone & Set Up Environment

git clone [https://github.com/hes0o/cve-analyzer-assistant.git](https://github.com/hes0o/cve-analyzer-assistant.git)
cd cve-analyzer-assistant

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt
npm install

2. Environment Configuration

Create a .env file in the root directory:

GEMINI_API_KEY=your_gemini_api_key
DB_HOST=localhost
DB_PORT=5432
DB_NAME=cve_db
DB_USER=postgres
DB_PASSWORD=your_password
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_CHAT_ID=your_chat_id

3. Start Database & Initialize Schema

# Run PostgreSQL with pgvector via Docker
docker run -d --name cve-postgres \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=your_password \
  -e POSTGRES_DB=cve_db \
  -p 5432:5432 pgvector/pgvector:pg17

# Initialize database tables
python ai_engine/create_schema.py

⚡ Running the Services

Run Automated Ingestion & Analysis Pipeline

# Execute the full pipeline (Data Collection -> AI Analysis -> Alerts)
python pipeline.py

# Or run the background scheduler (e.g. every 12 hours)
python scheduler.py --interval-hours 12

Start Applications

# Terminal 1: Backend API ([http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs))
uvicorn app.main:app --reload

# Terminal 2: React Dashboard (http://localhost:5173)
npm run dev

📂 Project Structure

Directory / File Module Purpose
data_collector/ Ingestion NVD API & CISA KEV fetchers
ai_engine/ Intelligence Embeddings, RAG prioritization, and risk scoring
app/ API FastAPI routes, schemas, and controllers
notifications/ Alerting Telegram critical risk dispatch service
src/ Frontend React + Vite security analytics dashboard
pipeline.py / scheduler.py Automation Automated scheduled execution engines

🔧 Troubleshooting

  • ModuleNotFoundError: No module named 'app': Ensure you are running scripts from the root repository directory.
  • psycopg2.OperationalError: Verify Docker container is running (docker ps) and credentials in .env match.
  • 429 RESOURCE_EXHAUSTED: The Gemini free tier limit was reached; the pipeline includes built-in rate-limit backoffs.

About

NVD verilerini toplayan, yapay zeka (LLM) ve pgvector destekli RAG mimarisiyle CVE analizleri yapan akıllı siber güvenlik asistanı projesi.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages