Files
AetherForge/server/internal/alerts/kev_notify_test.go
AetherForge 5fc601b564 feat: fleet ops, KEV scan, tunnels, beacon fallback, persistence
Extend owned-fleet control with scheduled tasks, audit log, file browser,
HTTPS beacon when WS drops, protocol tunnels, registry/autostart forge
options, KEV exposure in full sys check with Telegram alerts, and UI/tests.
2026-06-04 09:34:33 -07:00

19 lines
719 B
Go

package alerts
import "testing"
func TestNotifyKEVFromSysCheckNoPanic(t *testing.T) {
n := NewNotifier(func() Settings {
return NewSettings(NotifyConfig{}, EventToggles{KEVExposure: true})
})
msg := `{"kev_exposure":{"exposed_count":1,"critical_count":1,"summary":"test","findings":[{"cve":"CVE-2021-26855","name":"ProxyLogon","status":"exposed","severity":"critical"}]}}`
NotifyKEVFromSysCheck(n, "worker-1", msg)
}
func TestNotifyKEVSkipsWhenClear(t *testing.T) {
n := NewNotifier(func() Settings {
return NewSettings(NotifyConfig{TelegramBotToken: "x", TelegramChatID: "1"}, EventToggles{KEVExposure: true})
})
NotifyKEVFromSysCheck(n, "w", `{"kev_exposure":{"exposed_count":0,"critical_count":0}}`)
}