cc4c3fcecb
- Backend: Customer/Satellite Models, customer_id auf Server/Job/Audit - Satellite-API: heartbeat, poll (atomares Claiming), logs, result, scan-result, health-report - Auth via X-Api-Key (SHA-256 gehasht) - Job-Queue: pending/claimed/running/success/failed + Stale-Janitor - Batch-Trigger: ein Job pro Server, Satellite arbeitet sequenziell ab - Credentials bleiben lokal: nur symbolische credential_ref zentral - Neues Paket satellite/: Pull-Loop, WinRM/SSH/CAU/Scanner, PyInstaller-tauglich - Frontend: Kunden-Switcher, Satelliten-View, Polling statt WebSocket - Entfernt: WebSocket/Socket.io, Redis, zentrale Credentials, JobRunner - Docs: README/AGENTS/PROMPT auf neue Architektur aktualisiert
65 lines
2.2 KiB
Markdown
65 lines
2.2 KiB
Markdown
# Insight Updater Satellite
|
|
|
|
Remote-Agent fuer Kundennetzwerke. Laedt Jobs von der zentralen Insight-Updater-Instanz,
|
|
fuehrt sie lokal im Kundennetz aus (WinRM / SSH / CAU / Netzwerk-Scan) und meldet
|
|
Logs und Ergebnisse zurueck. Kein Docker noetig - eine einzelne Binary genuegt.
|
|
|
|
## Prinzip
|
|
|
|
- Nur ausgehende HTTPS-Verbindungen zur Zentrale (keine Firewall-Loecher beim Kunden)
|
|
- Pull-Modell: der Satellite pollt alle N Sekunden nach Jobs
|
|
- Credentials (WinRM/SSH) liegen ausschliesslich lokal in `credentials.yaml`
|
|
- 1-2 Satelliten pro Kunde reichen - sie steuern das ganze Netz (wie CAU im Cluster)
|
|
|
|
## Setup (Development)
|
|
|
|
```bash
|
|
cd satellite
|
|
pip install -e .
|
|
cp config.example.yaml config.yaml
|
|
cp credentials.example.yaml credentials.yaml
|
|
# config.yaml: central_url + api_key eintragen (Key aus dem Dashboard)
|
|
# credentials.yaml: WinRM-/SSH-Zugangsdaten des Kundennetzes pflegen
|
|
insight-satellite --config config.yaml --credentials credentials.yaml
|
|
```
|
|
|
|
## Windows-Binary bauen
|
|
|
|
```bash
|
|
pip install -e ".[build]"
|
|
pyinstaller --onefile --name insight-satellite satellite/runner.py
|
|
# Ergebnis: dist/insight-satellite.exe
|
|
```
|
|
|
|
Auf dem Zielsystem (Windows-Server beim Kunden):
|
|
|
|
```
|
|
C:\insight-satellite\
|
|
insight-satellite.exe
|
|
config.yaml
|
|
credentials.yaml
|
|
```
|
|
|
|
Start als Scheduled Task (Beispiel, ohne Umlaute):
|
|
|
|
```powershell
|
|
schtasks /create /tn "InsightUpdaterSatellite" /tr "C:\insight-satellite\insight-satellite.exe --config C:\insight-satellite\config.yaml --credentials C:\insight-satellite\credentials.yaml" /sc onstart /ru SYSTEM /rl HIGHEST
|
|
```
|
|
|
|
## Job-Typen
|
|
|
|
| Typ | Aktion |
|
|
|---|---|
|
|
| `windows_update` | Windows Update via WinRM (COM Microsoft.Update.Session) |
|
|
| `linux_update` | apt/dnf/yum upgrade via SSH mit sudo |
|
|
| `cau_run` | Invoke-CauRun auf einem Failover-Cluster |
|
|
| `health_check` | Verbindungstest, Ergebnis geht an die Zentrale |
|
|
| `network_scan` | Ping-Sweep + Port-Probe (5985/22), legt gefundene Hosts zentral an |
|
|
|
|
## Ablauf pro Job
|
|
|
|
1. `GET /api/satellite/poll` - Jobs abholen (werden dabei claimed)
|
|
2. Lokal ausfuehren, Log-Zeilen sammeln
|
|
3. `POST /api/satellite/logs` - Batches waehrend der Ausfuehrung
|
|
4. `POST /api/satellite/result` - Abschluss (success/failed + Fehlertext)
|