Generic webhooks

Our generic webhooks integration (alert) allows you to subscribe to notifications for select Next-Gen WAF activity types.

Adding a webhook integration (alert)

To add a webhook integration (alert), complete the following steps:

  1. Next-Gen WAF control panel
  2. Fastly control panel
  1. Log in to the Next-Gen WAF control panel.

  2. From the Sites menu, select a site if you have more than one site.

  3. From the Manage menu, select Site Integrations.
  4. Click Add site integration.
  5. Select the Generic Webhook integration.
  6. In the Webhook URL field, enter a URL to receive the notifications at.
  7. Select if you want to be alerted regarding All activity or Specific activity. If you selected Specific activity, then in the Activity menu choose the activity types that you want the integration to create alerts for.

  8. Click Create site integration.

Notifications format

Notifications are sent with the following format:

{
"created": "2024-02-09T21:08:21.31644377Z",
"type": "flag",
"payload": {
"ID": "abcde123456789",
"CorpID": "123456789abcde",
"SiteID": "987654321fedcba",
"Scope": "site",
"Slug": "site.example",
"Name": "example",
"Description": "Webhook integration for Example site",
"CreatedBy": "admin@example.com",
"CreatedByID": "edcba987654321",
"Created": "2024-02-09T21:08:21.31644377Z",
"Updated": "2025-01-07T21:06:31.50725289Z",
"ResourceID": "ASDFghjkl123456789"
},
"link":"dashboard link to event"
}

X-SigSci-Signature header

All requests sent from the generic webhook integration (alert) contain a header called X-SigSci-Signature. The value is an HMAC-SHA256 hex digest hashed using a signing key generated when the generic webhook was created.

To rotate the signing key, complete the following steps:

  1. Next-Gen WAF control panel
  2. Fastly control panel
  1. Log in to the Next-Gen WAF control panel.

  2. From the Sites menu, select a site if you have more than one site.

  3. From the Manage menu, select Site Integrations.
  4. Click the name of the appropriate generic webhook integration.
  5. Click Rotate.
  6. (Optional) Click Reveal to see the full value of the signing key.

Verification is done by creating an HMAC-SHA256 hex digest of the generic webhook payload using the signing key and comparing the result to the value of the X-SigSci-Signature header.

X-SigSci-Signature header verification example code

The examples show header verification code for X-SigSci-Signature.

  1. Go
  2. Python
  3. Ruby
  4. Bash
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"fmt"
)
// CheckMAC reports whether messageMAC is a valid HMAC tag for message.
func CheckMAC(message, messageMAC, key []byte) bool {
mac := hmac.New(sha256.New, key)
mac.Write(message)
expectedMAC := mac.Sum(nil)
return hmac.Equal(messageMAC, expectedMAC)
}
func main() {
key := []byte("[insert signing key here]")
h := "[insert X-SigSci-Signature value here]"
json := []byte(`[insert JSON payload here]`)
hash, err := hex.DecodeString(h)
if err != nil {
log.Fatal("ERROR: ", err)
}
ok := CheckMAC(json, hash, key)
fmt.Println(ok)
}

Activity types

This section only applies to Next-Gen WAF customers with access to the Next-Gen WAF control panel.

When setting up a webhook integration (alert) in the Next-Gen WAF control panel, you can select from the following activity types:

Activity typeDescriptionPayload
siteDisplayNameChangedThe display name of a site (workspace) was changed
siteNameChangedThe short name of a site (workspace) was changed
loggingModeChangedThe agent mode (Blocking, Not Blocking, Off) was changedGet site by name
agentAnonModeChangedThe agent IP anonymization mode was changedGet site by name
flagAn IP address was flaggedGet event by ID
expireFlagAn IP address flag was manually expiredList events
createCustomRedactionA custom redaction was createdCreate a custom redaction
removeCustomRedactionA custom redaction was removedRemove a custom redaction
updateCustomRedactionA custom redaction was updatedUpdate a custom redaction
customTagCreatedA custom signal was created
customTagUpdatedA custom signal was updated
customTagDeletedA custom signal was removed
customAlertCreatedA custom alert was createdCreate a custom alert
customAlertUpdatedA custom alert was updatedUpdate a custom alert
customAlertDeletedA custom alert was removedRemove a custom alert
detectionCreatedA templated rule was created
detectionUpdatedA templated rule was updated
detectionDeletedA templated rule was removed
listCreatedA list was createdCreate a list
listUpdatedA list was updatedUpdate a list
listDeletedA list was removedRemove a list
ruleCreatedA request rule was created
ruleUpdatedA request rule was updated
ruleDeletedA request rule was deleted
customDashboardCreatedA custom dashboard was created
customDashboardUpdatedA custom dashboard was updated
customDashboardResetA custom dashboard was reset
customDashboardDeletedA custom dashboard was removed
customDashboardWidgetCreatedA custom dashboard card was created
customDashboardWidgetUpdatedA custom dashboard card was updated
customDashboardWidgetDeletedA custom dashboard card was removed
agentAlertAn agent alert was triggered