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.
19 lines
719 B
Go
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}}`)
|
|
}
|