How vaibhav300503/soc-dashboard works
1. Overall shape
- This is a two-tier SOC platform: a Vue 3 frontend in src/ and a Node/Express backend in backend/.
- The backend is the system of record and integration layer; the frontend is a dashboard/analysis shell that consumes API data and renders charts, maps, tables, and real-time streams.
2. Frontend presentation layer
- The UI is organized around route-driven pages such as Dashboard, GeoAnalytics, IpAnalytics, LogTypes, Severity, Endpoints, LogViewer, Tailscale, and Profile.
- src/components/soc/ holds the analytics widgets: maps, topology graphs, timelines, severity charts, tables, and notification panels.
- State is managed with Pinia stores plus API/service wrappers, with Vue Router controlling page-level navigation.
3. Frontend data access boundary
- The frontend does not talk directly to databases; it goes through src/api/* and src/services/*.
- These API clients feed store modules like apiStore, logStore, authStore, and userStore, which then drive computed views in the pages/components.
- The architecture is intentionally layered: API client → store → page → visualization component.
4. Backend API layer
- backend/routes/ is the main HTTP surface and is split by domain: logs, events, alerts, cases, auth, geo, IP management, lookup, export, topology, profile, agents, and multiple Tailscale-related routes.
- This makes the backend the orchestration boundary between MongoDB, external enrichment services, alert/case integrations, and real-time delivery mechanisms.
5. Persistence model
- The backend uses MongoDB with a model-per-collection approach under backend/models/.
- Key persisted domains include logs, events, alerts, cases, users, blocked/safe IP lists, geo cache, topology data, and Tailscale devices/logs.
- Several scripts and maintenance utilities indicate production concerns around indexing, migration, seeding, and data backfill.
6. Security and request mediation
- Middleware enforces authentication, HMAC/signature checks, validation, log classification, geoIP enrichment, and Tailscale-specific request validation.
- This suggests the backend is handling both interactive dashboard traffic and trusted ingestion from agents/streaming clients, with different trust levels at the edge.
- secureConfig and secureLogger indicate sensitive configuration and audit-friendly logging are treated as first-class concerns.
7. Real-time and streaming subsystem
- The repo supports live updates through both SSE-style streaming and WebSocket-based routes/services.
- Tailscale has the most explicit real-time path: server-side stream services, websocket manager, protected websocket routes, and frontend stream/websocket clients.
- This is the boundary for “live SOC” behavior: incoming telemetry is pushed to clients instead of waiting for page refreshes.
8. Tailscale integration
- Tailscale is a dedicated subsystem spanning agents, sync services, streaming, routes, and models.
- The presence of host-side agents (tailscale-agent.py, tailscale-live-streamer.py, systemd service) implies telemetry is collected from endpoints and forwarded into the backend.
- The dashboard then surfaces device status, peer connections, sessions, subnet routers, exit nodes, and Tailscale logs as a separate operational domain.
9. Geo and threat enrichment
- Geo enrichment is a backend service concern, not just a UI feature: IPs are enriched, cached, and stored for reuse.
- The backend also exposes lookup endpoints for WHOIS/GeoIP/threat-intel style queries, and the frontend uses them for geographic and IP-centric investigation views.
- This is a clear enrichment pipeline: raw event/log data → IP enrichment/cache → geo summaries/maps → analyst views.
10. Alerts, cases, and external integrations
- Alerting is modeled as rules plus generated alert events, with streaming support for notifications.
- Case management is separate and synchronized through services like caseService, caseSync, and integration modules for TheHive and Cortex.
- This indicates the SOC dashboard is not isolated; it can feed or mirror incident workflows in external security platforms.
11. Operational/maintenance tooling
- The backend includes many scripts for seeding, validation, migration, cleanup, severity recalculation, and Tailscale import/testing.
- These scripts show the system expects ongoing data hygiene and schema evolution, especially around log classification, severity normalization, and index management.
- There are also agent/service files and proxy/exposure tools in tools/, suggesting deployment into mixed local/networked environments.
12. Main data flow for diagramming
- Primary path: agents/external sources → backend ingestion/routes → MongoDB collections/models → API responses → Pinia stores → Vue pages/components.
- Secondary paths: backend enrichment/integration services augment data before it reaches the UI; streaming services push updates directly to connected clients; alert/case integrations export security events to external systems.
- The key architectural boundary is between the browser UI and the backend API/streaming layer; almost everything operational crosses that boundary through authenticated, validated routes.
Main entry points: geoEnrichment.js Core Services · logs.js API Routes · Log.js Mongo Models · tailscale.js Tailscale API
Components 20
Frontend
Vue dashboard, route pages, state, and visual analytics
- Vue App · Root Vue 3 application and composition entrypoint
src/App.vue - Router · Route definitions and navigation guards
src/router/index.js - SOC Pages · Dashboard, analytics, viewer, profile, and Tailscale pages
src/pages/Dashboard.vue - SOC Visuals · Maps, graphs, charts, tables, timelines, and notification panels
src/components/soc/GeoMap.vue - Pinia Stores · Client state for auth, logs, search, API data, and users
src/stores/apiStore.js - API Clients · HTTP clients and interceptors used by the UI
src/api/index.js - Stream Clients · Tailscale websocket and stream clients for live updates
src/services/tailscaleStreamService.js
Backend
Express API, persistence, middleware, and services
- Express Server · Main backend entrypoint wiring routes, middleware, and services
backend/server.js - Edge Middleware · Auth, HMAC, validation, geoIP, log classification, and Tailscale checks
backend/middleware/authMiddleware.js - API Routes · Domain routes for logs, alerts, cases, geo, IP, profile, agents, and Tailscale
backend/routes/logs.js - Core Services · Geo enrichment, case sync, alert integrations, metrics, websockets, and Tailscale workflows
backend/services/geoEnrichment.js - Mongo Models · Collections for logs, events, alerts, cases, users, geo cache, IP lists, and Tailscale data
backend/models/Log.js - MongoDB · Primary system of record for operational and investigative data
backend/config/db.js - External Intel · TheHive, Cortex, enrichment sources, and remote telemetry clients
backend/services/thehiveIntegration.js - Secure Config · Sensitive configuration and audit-oriented logging support
backend/config/secureConfig.js - Tailscale API · Dedicated Tailscale routes plus protected websocket and stream endpoints
backend/routes/tailscale.js - Tailscale Services · Device sync, stream handling, websocket management, and protected delivery
backend/services/tailscale.js - Geo/IP Lookup · Lookup and geo/threat investigation endpoints
backend/routes/lookup.js
Operations
Agents, scripts, and deployment helpers
- Tailscale Agents · Host-side telemetry collectors and live streamers
backend/agents/tailscale-agent.py - Maintenance Scripts · Seeding, migration, backfill, validation, and cleanup tooling
backend/scripts/seed-mongodb.js
Connections 22
- Vue App → Router: uses · Root app mounts routed navigation
- Router → SOC Pages: loads · Routes select dashboard and investigation pages
- SOC Pages → SOC Visuals: renders · Pages compose charts, maps, tables, and timelines
- SOC Pages → Pinia Stores: reads state · Views consume Pinia state for data and filters
- Pinia Stores → API Clients: fetches · Stores hydrate from API clients
- API Clients → Express Server: http · Frontend API calls reach the backend server
- Stream Clients → Tailscale API: realtime · Live UI connects to Tailscale stream/websocket endpoints
- Express Server → Edge Middleware: passes through · Requests are mediated before route handling
- Edge Middleware → API Routes: protects · Authentication, validation, and enrichment guard the HTTP surface
- API Routes → Core Services: orchestrates · Routes delegate business logic and integrations
- API Routes → Mongo Models: reads/writes · API handlers persist and query domain records
- Mongo Models → MongoDB: stored in · Collections are backed by MongoDB
- Core Services → Mongo Models: updates · Services synchronize caches, cases, alerts, and Tailscale state
- Core Services → External Intel: integrates · Backend talks to enrichment and incident platforms
- Tailscale Agents → Tailscale API: ingests · Endpoint collectors feed Tailscale telemetry into the backend
- Tailscale API → Tailscale Services: delegates · Dedicated routes hand off to sync and websocket services
- Tailscale Services → Mongo Models: persists · Tailscale devices and logs are stored in MongoDB
- Geo/IP Lookup → Core Services: enriches · Geo and threat lookup endpoints reuse backend enrichment logic
- Maintenance Scripts → MongoDB: maintains · Scripts seed, migrate, validate, and backfill stored data
- Secure Config → Express Server: configures · Sensitive configuration and logging settings shape runtime behavior
- Core Services → Tailscale API: streams · Realtime services feed server-sent and websocket updates
- API Routes → Geo/IP Lookup: exposes · HTTP surface includes investigation and enrichment endpoints