How ombharati/cyberguard works
CYBERGUARD accepts URL, email, and suspicious-content submissions through a web UI or API, then returns explainable risk assessments and scan history. The main lifecycle validates and records a scan, runs it synchronously or through a Redis-backed worker, analyzes it with deterministic detectors and local AI, computes a deterministic score, and persists findings. The graph also preserves optional threat intelligence and health checks. The README documents these capabilities; some subsystem links rely on its architecture description or the SOURCE INDEX because their implementation was not excerpted.
Main entry points: orchestrator.py Scan Orchestrator · main.py FastAPI Application · scan_service.py Scan Service · database.py Database Sessions
Components 24
User Entry
- Web Dashboard
app/frontend/script.js - FastAPI Application
app/backend/main.py - Scan API
app/backend/api/v1/scans.py - Compatibility API
app/backend/api/frontend_compat.py - Request Schemas
app/backend/schemas/scan.py
Scan Lifecycle
- Scan Service
app/backend/services/scan_service.py - Redis Job Queue
app/backend/services/queue.py - Background Worker
app/backend/services/worker.py - Scan Orchestrator
app/backend/services/orchestrator.py
Threat Analysis
- URL Heuristics
detection/url/detector.py - SSRF Validation
detection/url/ssrf.py - Email Parser
detection/email/parser.py - Email Heuristics
detection/email/heuristics.py - Risk Engine
app/backend/services/risk_engine.py - External Threat Intel
app/backend/services/external_intel.py
Storage and Config
- Runtime Settings
app/backend/core/config.py - Database Sessions
app/backend/core/database.py - Scan Records
app/backend/models/scan.py
Model Integrations
- Laya Adapter
app/backend/services/ai/laya_adapter.py - Qwen Adapter
app/backend/services/ai/qwen_adapter.py
Other components
- User / Browser
- Ollama Service
- PostgreSQL
- Redis
Connections 32
- User / Browser → Web Dashboard: uses
README.md - Web Dashboard → FastAPI Application: sends HTTP scans
README.md - FastAPI Application → Scan API: routes requests
app/backend/main.py - FastAPI Application → Compatibility API: routes requests
app/backend/main.py - FastAPI Application → Web Dashboard: serves assets
app/backend/main.py - Scan API → Request Schemas: validates and responds
app/backend/api/v1/scans.py - Scan API → Scan Service: delegates scans
app/backend/api/v1/scans.py - Compatibility API → Request Schemas: validates and responds
app/backend/api/frontend_compat.py - Compatibility API → Scan Service: delegates scans
app/backend/api/frontend_compat.py - Scan Service → Scan Records: creates scan
app/backend/services/scan_service.py - Scan Service → Scan Orchestrator: executes synchronously
app/backend/services/scan_service.py - Scan Service → Redis Job Queue: enqueues scan
app/backend/services/scan_service.py - Background Worker → Redis Job Queue: dequeues scan
app/backend/services/worker.py - Background Worker → Scan Orchestrator: executes scan
app/backend/services/worker.py - Scan Orchestrator → URL Heuristics: analyzes URLs
app/backend/services/orchestrator.py - URL Heuristics → SSRF Validation: validates host
detection/url/detector.py - Scan Orchestrator → Email Parser: parses email
app/backend/services/orchestrator.py - Scan Orchestrator → Email Heuristics: checks email
app/backend/services/orchestrator.py - Email Heuristics → Email Parser: uses parsed email
detection/email/heuristics.py - Scan Orchestrator → Laya Adapter: scores URLs
app/backend/services/orchestrator.py - Scan Orchestrator → Qwen Adapter: analyzes content
app/backend/services/orchestrator.py - Scan Orchestrator → External Threat Intel: queries intelligence
app/backend/services/orchestrator.py - Scan Orchestrator → Risk Engine: calculates risk
app/backend/services/orchestrator.py - Scan Orchestrator → Scan Records: persists findings
app/backend/services/orchestrator.py - Qwen Adapter → Ollama Service: requests inference
app/backend/services/ai/qwen_adapter.py - FastAPI Application → Runtime Settings: loads settings
app/backend/main.py - FastAPI Application → Database Sessions: checks database
app/backend/main.py - Database Sessions → Runtime Settings: configures connection
app/backend/core/database.py - Scan Records → Database Sessions: uses ORM base
app/backend/models/scan.py - Database Sessions → PostgreSQL: connects to
README.md - Redis Job Queue → Redis: stores jobs
README.md - FastAPI Application → Redis Job Queue: checks availability
app/backend/main.py