Architecture
Technical architecture of SOCSuite — monorepo structure, Clean Architecture in the Go backend, and the Orchestrator as single source of truth. This page is aimed at developers working on the backend or infrastructure.
Monorepo Structure
apps/api/ Go 1.26 + Fiber v2 (REST + WebSocket)
apps/web/ React 18 + TypeScript 5.7 + Vite 6
apps/docs/ MkDocs Material — Technical documentation (DE/EN, GitLab Pages)
packages/ ui, types, utils, config, design-tokens
orchestrator/ Meta-YAMLs (target state) + generators (OpenAPI, Docs)
infrastructure/ Kubernetes (Kustomize, Gateway API v1.4.0 + Traefik 3.7.16)
02_Initialisation/ SQL init scripts (no migration tool, MVP)
docs/ MkDocs Material — Operational documentation (this repo):::info [Satellite Agent]
The Satellite Agent lives in its own repository:
https://gitlab.com/imvee/satellite (local path: ../satellite/)
:::
Tech Stack
| Layer | Technology |
|---|---|
| Backend | Go 1.26 + Fiber v2 (REST + WebSocket) |
| Frontend | React 18 + TypeScript 5.7 + Vite 6 |
| Documentation | MkDocs Material (central documentation) |
| Infrastructure | Kubernetes, Kustomize, Gateway API v1.4.0, Traefik 3.7.16 |
Clean Architecture (Go)
The Go backend strictly follows a layered Clean Architecture. No DB access in handlers, no business logic in repositories.
handlers/ HTTP/WebSocket endpoints → no business logic, no DB access
service/ Business logic
repository/ Data access (PostgreSQL, Redis, OpenSearch)
domain/ Entities and interfacesWorkflow for a new endpoint
Every new endpoint is implemented in this order:
1. domain/{entity}.go → Define entity + interface
2. repository/{entity}_repository.go → Implement data access
3. service/{entity}_service.go → Implement business logic
4. handlers/{entity}_handler.go → Implement HTTP handler
5. cmd/server/main.go → Register route
6. Write tests:::warn [Orchestrator first]
Before any new endpoint, the entry in orchestrator/meta/endpoints.yaml must exist.
Without a declaration there: STOP — no code.
:::
Orchestrator
The Orchestrator under orchestrator/meta/ is the target state of the entire system — 57 services, 310 endpoints, 97 permissions in ~7,300 lines of YAML. No endpoint and no service may exist that is not declared there.
→ Full reference: Orchestrator Reference
| File | Content |
|---|---|
orchestrator/meta/endpoints.yaml | All API endpoints with auth and rate-limit fields |
orchestrator/meta/services.yaml | All services and their dependencies |
orchestrator/meta/invariants.yaml | System-wide invariants (CRITICAL/ERROR) |
orchestrator/meta/contracts.yaml | API contract rules |
orchestrator/meta/permissions.yaml | 97 RBAC permissions (registry) |
The Orchestrator also contains generators for OpenAPI specifications and documentation.
Data Flow
flowchart LR
subgraph EE["Event Collection"]
A1["🔷 Monitoring Agents"]
A2["🔷 Kubernetes Monitoring"]
end
subgraph DET["Detection"]
B1[("Event Database\nRules & Analysis")]
B2["Alert Engine\nPattern Detection"]
B3["Case Management\nMITRE ATT&CK"]
end
subgraph REA["Response"]
C1["✅ Automated Response\n~90% of cases"]
C2["👤 SOC Analyst\n~10% manual handling"]
end
A1 -->|"Events"| B1
A2 -->|"Events"| B1
B1 -->|"Rule violation"| B2
B2 -->|"Trigger alert"| B3
B3 -->|"Automated"| C1
B3 -->|"Escalate"| C2AI Situation Assistant (OpenRouter)
The mission-control dashboard (mission-control R5, DEV-392) shows an AI-generated security posture summary (1–2 sentences) plus a chat that answers questions about the live data. LLM calls run exclusively in the backend via OpenRouter (OpenAI-compatible chat completions API) — the API key never reaches the browser.
Endpoints:
| Method | Path | Response (200) |
|---|---|---|
GET | /v1/ai/situation | {text, model, generated_at} |
POST | /v1/ai/situation/chat | {reply, model} (body: {messages: [{role, content}]}, max. 10 most recent) |
Error model: 503 {"error":"ai_not_configured"} without OPENROUTER_API_KEY — the frontend then shows a deterministic fallback (short description of the security state) and disables the chat (graceful, no error dialog). LLM/timeout failures → 502 {"error":"ai_situation_failed"} or ai_chat_failed. Upstream 429s from free-tier pools are retried once with a 5 s backoff.
Environment variables (backend):
| Variable | Purpose | Default |
|---|---|---|
OPENROUTER_API_KEY | OpenRouter API key (without key: 503 ai_not_configured) | — (SoT: Infisical) |
OPENROUTER_MODEL | Model override if the free pool changes | code default google/gemma-4-31b-it:free; in dev: google/gemma-4-31b-it (paid — :free pools are upstream rate-limited, DEV-405) |
OPENROUTER_BASE_URL | API base (rarely needed) | https://openrouter.ai/api/v1 |
Code: apps/api/internal/llm/openrouter.go (client), internal/service/ai_situation_service.go (prompt / live-data context), internal/handler/ai_situation.go (endpoints). Timeout 90 s, max. 600 tokens, temperature 0.3.
Architecture Diagram
flowchart LR
analyst["👤 SOC Analyst"]
admin["👤 Administrator"]
subgraph K8S["Kubernetes Cluster"]
GW["Ingress Gateway"]
subgraph FE["User Interface"]
WEB["Web Application"]
end
subgraph BE["Application Logic"]
API["API Server"]
end
subgraph DS["Data Stores"]
PG[("Primary Database")]
RD[("Cache")]
OS[("Event Database")]
end
end
KC["🔑 Single Sign-On"]
SAT["🔷 Monitoring Agents"]
analyst -->|"HTTPS"| GW
admin -->|"HTTPS"| GW
GW --> WEB
GW --> API
WEB -->|"Real-time data"| API
API --> PG
API --> RD
API --> OS
API -.->|"Authentication"| KC
SAT -->|"Events"| OS
SAT -.->|"Registration"| APIRouting (Gateway)
API and UI traffic runs through Gateway-API HTTPRoutes (Traefik as
Gateway-Controller, namespace traefik-system). Current state: service split
P4 (DEV-438) — one HTTPRoute per domain (socsuite-core, socsuite-siem, …)
with per-resource-prefix rules; longest prefix wins over the catch-all.
| Path | Target | Mechanic |
|---|---|---|
/api/v1/<resource> (e.g. /api/v1/alerts) | Domain service (siem, case, …) | HTTPRoute rule + URLRewrite: /api is stripped (/api/v1/alerts → /v1/alerts at the service) |
/api/v1 (catch-all) | core:8080 | socsuite-main (base/gateway/httproute-main.yaml) — Caution: routes that only exist in the monolith 404 here until they get their own rule (fix example: DEV-1219) |
/v1/... (without /api) | agent:8085 (Satellite: heartbeats, ingest, WS) | Passthrough without strip |
/api/v1/public/** | connector:8087 | Public integration API (API key, DEV-441) — own rules for /api/v1/public and /v1/public (DEV-1219) |
/, /ws, /health, /dashboards, /downloads | Frontend / agent / core / Kibana / downloads | socsuite-main respectively Ingress |
:::warn [Legacy Ingress = shadow rules]
The old Ingress resource (socsuite-ingress) is a transitional state: its
rules /api, /v1, /ws are empirically shadowed by the HTTPRoutes
(proof DEV-1219: agent log 56 heartbeats/3 min + 1452 WS lines/5 min; backend
log 0). Only /dashboards, /downloads, /app still come from the Ingress.
Recommendation: remove the shadow rules or retire the Ingress (architecture
decision, open — DEV-1219 audit).
Monolith status (zombie observation): After the split, the monolith
(backend:8080) has exactly one real purpose — the Playbook-Engine-Worker
(DEV-1229) — plus P2 routes such as /v1/detection-rules. Until then it stays
reachable as the catch-all target; run-out = DEV-1209 follow-up.
:::
Container Diagram (C4 Level 2)
flowchart LR
analyst["👤 SOC Analyst"]
admin["👤 Administrator"]
subgraph PLAT["SOCSuite Platform"]
GW["Ingress Gateway\nAccess control & TLS"]
subgraph FE["User Interface"]
WEB["Web Application\nDashboard · Cases · Playbooks"]
end
subgraph BE["Application Logic"]
API["API Server\nBusiness logic & rules"]
end
subgraph DS["Data Stores"]
PG[("Primary Database\nCases · Tenants · Assets")]
RD[("Cache\nSessions")]
OS[("Event Database\nSIEM · Detection")]
end
end
KC["🔑 Authentication & Access\nSingle Sign-On"]
SAT["🔷 Monitoring Agents"]
analyst -->|"HTTPS"| GW
admin -->|"HTTPS"| GW
GW -->|"Routing"| WEB
GW -->|"API requests"| API
WEB -->|"Data & real-time updates"| API
API -->|"Read / Write"| PG
API -->|"Sessions"| RD
API -->|"Search / Analyze"| OS
API -.->|"Authentication"| KC
SAT -->|"Events"| OS
SAT -.->|"Registration / Tasks"| APIMulti-Tenancy (SaaS)
SOCSuite runs multi-tenant in the SaaS cloud: each customer is a
tenant (one Keycloak group tenants/<slug>, one OpenSearch index
imvee-satellite-<slug>, one quota set). Binding specification:
the tenancy contract (internal docs; code deviating from it is a bug).
- Isolation: all read paths (alerts, cases, assets) filter
server-side on the tenant from the JWT claim
tenant_id— other tenants' data is not readable (cross-read tests). - Ingest: satellites only write into their tenant's index (mapping via API key → agent → tenant); foreign tenants are rejected and logged.
- Quotas: per tenant
docs_per_min(ingest rate, violation =429+Retry-After),max_agents(registration, violation =403),storage_bytes(retention via ILM/ISM + monitoring). - Tenant lifecycle:
provisioning → active → suspended/expired → deprovisioning → deleted— inactive tenants immediately receive403on data and ingest paths (fail-closed, with audit trail). - Missing tenant claim (dev/bootstrap only): context
unassigned(bootstrap tenant, legacy data). In the production domain<slug>.socsuite.imvee.deevery user has a claim.
Further Reading
- Domain Model — Entities, relationships, database schema
- Authentication — BFF pattern and Keycloak integration
- Orchestrator — Meta-concept (not implemented) and actual API documentation
- Operations — Monitoring, backup, maintenance