feat: Phase 8 — Network Discovery + Windows Dev-Setup-Skripte
Network Discovery:
- Go Agent: internal/scanner/scanner.go mit TCP-Sweep (Port 445/80/22/443),
ARP-Tabellen-Parser (Windows: arp -a, Linux: /proc/net/arp), Reverse-DNS,
50 gleichzeitige Goroutines mit Semaphore
- Go Agent main.go: COMMAND_TYPE_NETWORK_SCAN Case → scanner.Scan() → JSON stdout
- Backend: NetworkDevice Model (Id, AgentId, IpAddress, MacAddress, Hostname,
Vendor, IsManaged, FirstSeen, LastSeen)
- Backend: EF Migration AddNetworkDevices + Index auf IpAddress + MacAddress
- Backend: NetworkDevicesController GET /api/v1/network-devices + DELETE /{id}
- Backend: AgentGrpcService.ProcessNetworkScanResultAsync — upsert via MAC,
IsManaged=true wenn IP einem bekannten Agent entspricht
- Frontend: NetworkPage.tsx mit Scan-Panel, Device-Tabelle, Filter, Delete
- Frontend: App.tsx — 'Netzwerk' Nav-Eintrag mit Network Icon
Windows Dev-Setup:
- dev-start.ps1 — Startet Docker/Postgres, EF-Migrationen, Backend+Frontend
in separaten PowerShell-Fenstern; Voraussetzungen-Check (docker/dotnet/node/go)
- dev-stop.ps1 — Stoppt alle NexusRMM-Prozesse + PostgreSQL Container
- build-agent.ps1 — Baut nexus-agent.exe (Windows) + optional nexus-agent-linux
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,7 @@ import type {
|
||||
DeployRequest,
|
||||
DeployResponse,
|
||||
RemoteSessionInfo,
|
||||
NetworkDevice,
|
||||
} from './types'
|
||||
|
||||
const BASE_URL = '/api/v1'
|
||||
@@ -104,3 +105,22 @@ export const remoteDesktopApi = {
|
||||
getSession: (agentId: string) =>
|
||||
request<RemoteSessionInfo>(`/agents/${agentId}/remote-session`),
|
||||
}
|
||||
|
||||
// Network Devices
|
||||
export const networkDevicesApi = {
|
||||
list: (agentId?: string) => {
|
||||
const param = agentId ? `?agentId=${agentId}` : ''
|
||||
return request<NetworkDevice[]>(`/network-devices${param}`)
|
||||
},
|
||||
delete: (id: number) =>
|
||||
request<void>(`/network-devices/${id}`, { method: 'DELETE' }),
|
||||
}
|
||||
|
||||
// Network Scan triggern (nutzt tasksApi intern)
|
||||
export const networkScanApi = {
|
||||
trigger: (agentId: string, subnet?: string) =>
|
||||
request<TaskItem>('/tasks', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ agentId, type: 'NetworkScan', payload: { subnet: subnet ?? '' } }),
|
||||
}),
|
||||
}
|
||||
|
||||
@@ -184,3 +184,15 @@ export interface RemoteSessionInfo {
|
||||
sessionUrl?: string
|
||||
meshCentralBaseUrl?: string
|
||||
}
|
||||
|
||||
export interface NetworkDevice {
|
||||
id: number
|
||||
agentId: string | null
|
||||
ipAddress: string
|
||||
macAddress: string
|
||||
hostname: string
|
||||
vendor: string
|
||||
isManaged: boolean
|
||||
firstSeen: string
|
||||
lastSeen: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user