From 1c73239470315845990e88e4e1709af463566ff4 Mon Sep 17 00:00:00 2001 From: N7WEra <59871507+N7WEra@users.noreply.github.com> Date: Tue, 10 Mar 2026 13:51:11 +0000 Subject: [PATCH] Update new_alert.go Add a check for empty input message --- C2_Profiles/basic_webhook/my_webhooks/new_alert.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/C2_Profiles/basic_webhook/my_webhooks/new_alert.go b/C2_Profiles/basic_webhook/my_webhooks/new_alert.go index c6c0eae..4f832d6 100644 --- a/C2_Profiles/basic_webhook/my_webhooks/new_alert.go +++ b/C2_Profiles/basic_webhook/my_webhooks/new_alert.go @@ -16,6 +16,14 @@ func newAlertMessage(input webhookstructs.NewAlertWebhookMessage) { newMessage := webhookstructs.GetNewDefaultWebhookMessage() newMessage.Channel = webhookstructs.AllWebhookData.Get("my_webhooks").GetWebhookChannel(input, webhookstructs.WEBHOOK_TYPE_NEW_ALERT) var webhookURL = webhookstructs.AllWebhookData.Get("my_webhooks").GetWebhookURL(input, webhookstructs.WEBHOOK_TYPE_NEW_ALERT) + // debug incoming webhookdata + fmt.Printf("DEBUG: Received Webhook Data: %+v\n", input) + + if input.Data.Message == "" { + logging.LogInfo("Skipping webhook: No message content found in alert.") + return + } + if time.Now().Sub(newAlertLastTime).Abs() <= throttleTime { logging.LogInfo("Not sending basic_webhook because <10s has passed since last message") return