diff --git a/README.md b/README.md index 311fe45..d258b72 100644 --- a/README.md +++ b/README.md @@ -142,57 +142,69 @@ daemon -f -p /var/run/rmm-agent.pid -o /usr/local/rmm/rmm-agent.log \ | DELETE | `/api/v1/agents/{id}/tunnel/{tid}` | Tunnel schliessen | | POST | `/api/v1/agents/{id}/exec` | Remote-Command ausfuehren | -### Tunnel erstellen +### Tunnel-Beispiele ```bash # SSH-Tunnel zur OPNsense -curl -sk -H "X-API-Key: KEY" -X POST \ - https://backend:8443/api/v1/agents/AGENT_ID/tunnel \ +curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \ + https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/tunnel \ -d '{"target_host":"127.0.0.1","target_port":22}' # Response: {"tunnel_id":"xxx","proxy_port":10000,...} - # Verbinden: -ssh -p 10000 root@backend-ip -``` +ssh -p 10000 root@192.168.85.13 -```bash # WebGUI-Tunnel (OPNsense auf Port 4444) -curl -sk -H "X-API-Key: KEY" -X POST \ - https://backend:8443/api/v1/agents/AGENT_ID/tunnel \ +curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \ + https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/tunnel \ -d '{"target_host":"127.0.0.1","target_port":4444}' # Response: {"tunnel_id":"xxx","proxy_port":10001,...} +# Im Browser: https://192.168.85.13:10001/ -# Im Browser: https://backend-ip:10001/ +# Aktive Tunnel auflisten +curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" \ + https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/tunnels + +# Tunnel schliessen +curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X DELETE \ + https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/tunnel/TUNNEL_ID +``` + +### Zugangsdaten + +``` +Backend: https://192.168.85.13:8443 +API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9 +Agent-ID: e92e87a684b20db15d8d2344583c5887 (OPN-REP.intra.weidenhaupt.net) ``` ### Agent-Beispiele ```bash # Alle Agents auflisten (ID, Name, IP, Version, letzter Heartbeat) -curl -sk -H "X-API-Key: KEY" \ - https://backend:8443/api/v1/agents +curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" \ + https://192.168.85.13:8443/api/v1/agents # Einzelner Agent mit Systemdaten -curl -sk -H "X-API-Key: KEY" \ - https://backend:8443/api/v1/agents/AGENT_ID +curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" \ + https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887 # Nur Systemdaten (Hardware, CPU, RAM, Disks, Services, etc.) -curl -sk -H "X-API-Key: KEY" \ - https://backend:8443/api/v1/agents/AGENT_ID/system +curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" \ + https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/system # Agent loeschen -curl -sk -H "X-API-Key: KEY" -X DELETE \ - https://backend:8443/api/v1/agents/AGENT_ID +curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X DELETE \ + https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887 # Hub-Status (verbundene Agents, aktive Tunnel) -curl -sk -H "X-API-Key: KEY" \ - https://backend:8443/api/v1/hub/status +curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" \ + https://192.168.85.13:8443/api/v1/hub/status # Remote-Command ausfuehren -curl -sk -H "X-API-Key: KEY" -X POST \ - https://backend:8443/api/v1/agents/AGENT_ID/exec \ +curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \ + https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/exec \ -d '{"command":"uptime","timeout":30}' ``` @@ -200,26 +212,26 @@ curl -sk -H "X-API-Key: KEY" -X POST \ ```bash # Verfuegbare Updates pruefen -curl -sk -H "X-API-Key: KEY" -X POST \ - https://backend:8443/api/v1/agents/AGENT_ID/update-check +curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \ + https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/update-check # Normales Update (ohne Reboot) -curl -sk -H "X-API-Key: KEY" -X POST \ - https://backend:8443/api/v1/agents/AGENT_ID/update +curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \ + https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/update # Normales Update mit Reboot -curl -sk -H "X-API-Key: KEY" -X POST \ - https://backend:8443/api/v1/agents/AGENT_ID/update \ +curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \ + https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/update \ -d '{"reboot":true}' # Major-Upgrade auf Version 26.7 -curl -sk -H "X-API-Key: KEY" -X POST \ - https://backend:8443/api/v1/agents/AGENT_ID/major-update \ +curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \ + https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/major-update \ -d '{"version":"26.7","reboot":true}' # Reboot (5s Verzoegerung default) -curl -sk -H "X-API-Key: KEY" -X POST \ - https://backend:8443/api/v1/agents/AGENT_ID/reboot +curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \ + https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/reboot ``` ### WebSocket Commands (Backend → Agent)