Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions C2_Profiles/basic_webhook/my_webhooks/new_alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down