How ohmic-guy/cyberguard works
CyberGuard is an AI-assisted cyber-threat detection and response backend. Its intended workflow accepts threat inputs, routes them by modality, runs specialized detection, scores and explains results, and exposes threat and dashboard views. The excerpts verify the event envelope, modality routing, phishing-agent detector dispatch, and Redis Streams publishing; most API, ingestion, detection, scoring, and response implementations were not sampled, so their links are shown only as unverified. The tree also names API-abuse detection, although the sampled orchestrator does not route that modality.
Main entry points: scoring Threat scoring · orchestrator.py Modality router · routes FastAPI routes · event_bus.py Event bus
Components 22
API and ingestion
- FastAPI routes
backend/api/routes - File upload
backend/ingestion/file_upload_handler.py - Stream ingestion
backend/ingestion/redis_stream_handler.py
Event orchestration
- Threat event
backend/core/events/event_types.py - Modality router
backend/core/orchestrator.py - Agent assembly
backend/core/container.py - Stream names
backend/core/events/streams.py - Event bus
backend/core/events/event_bus.py
Threat detection
- Phishing agent
backend/agents/phishing/agent.py - Phishing detectors
backend/agents/phishing/detectors - Deepfake detection
backend/agents/deepfake - Log analysis
backend/agents/log_analysis - API abuse detection
backend/agents/api_abuse
Scoring and response
- Threat scoring
backend/scoring - Response agent
backend/response/response_agent.py - LLM providers
backend/response/providers
Persistence and delivery
- MongoDB
backend/db/mongodb.py - Threat repository
backend/db/repositories/threat_repository.py - Session repository
backend/db/repositories/session_repository.py - Redis Streams
- Dashboard and streams
backend/api/routes/dashboard.py
Other components
- Analyst / client
Connections 27
- Analyst / client → FastAPI routes: submits input
- FastAPI routes → File upload: accepts uploads
- File upload → Stream ingestion: forwards events
- Stream ingestion → Event bus: publishes input
- Modality router → Event bus: publishes routed events
backend/core/orchestrator.py - Modality router → Stream names: routes by modality
backend/core/orchestrator.py - Agent assembly → Modality router: constructs
backend/core/container.py - Agent assembly → Phishing agent: constructs
backend/core/container.py - Phishing agent → Phishing detectors: dispatches detection
backend/agents/phishing/agent.py - Phishing detectors → Threat event: returns findings
- Event bus → Redis Streams: reads and writes
backend/core/events/event_bus.py - Event bus → Threat event: serializes events
backend/core/events/event_bus.py - Modality router → Deepfake detection: routes media events
- Modality router → Log analysis: routes log events
- FastAPI routes → API abuse detection: submits abuse signals
- Phishing agent → Threat scoring: sends findings
- Deepfake detection → Threat scoring: sends findings
- Log analysis → Threat scoring: sends findings
- API abuse detection → Threat scoring: sends findings
- Threat scoring → Response agent: provides risk context
- Response agent → LLM providers: requests recommendations
- Threat scoring → Threat repository: persists results
- Threat repository → MongoDB: stores threats
- FastAPI routes → Session repository: uses sessions
- Session repository → MongoDB: stores sessions
- Dashboard and streams → Threat repository: queries threats
- Dashboard and streams → Analyst / client: serves threat views