# Webhook security

To prevent malicious actors sending fake payloads to your webhook endpoint we recommend using the following settings to improve security by making it possible to verify that Bunny was the sender of the webhook.

* **Webhook auth token** - You can create your own token/apikey and set it in Bunny. *This value will be included as bearer token in an "Authorization" header of the webhook request.*
* ***Webhook signing key** -* We will use this value as the shared secret key to generate a HMAC-SHA1 hash of the webhook request body. The resulting signature will be include in the **x-bunny-signature** header so you can use it to verify that the payload was sent by Bunny.

### Set a shared signing secret

Bunny will sign each webhook payload using a shared secret that you provide. This can be configured for [platform webhooks](https://docs.bunny.com/developer/webhooks#platform-webhooks) and [workflow webhooks](https://docs.bunny.com/developer/webhooks/webhooks).

Enter a value in the **Webhook signing key** field and use this in your code to verify the webhook signature.

#### Platform

<figure><img src="https://386337055-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuulYgSMMvPL7hiTgkFyZ%2Fuploads%2Fgit-blob-8eeafef8518a59b519ecc18ed25e7fc66a61fa45%2FScreenshot%202025-11-20%20at%202.15.16%E2%80%AFPM.png?alt=media" alt="Set a signing key for a Platform webhook"><figcaption></figcaption></figure>

#### Workflow action

<figure><img src="https://386337055-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuulYgSMMvPL7hiTgkFyZ%2Fuploads%2Fgit-blob-42710b5c70323324357984272820976c28d9ab92%2FScreenshot%202025-11-20%20at%202.12.42%E2%80%AFPM.png?alt=media" alt="Signing key on workflow webhook"><figcaption></figcaption></figure>

### Verify a webhook signature

When a signing key is configured Bunny will use this secret to sign the webhook payload and then include the signature in a **x-bunny-signature** heade&#x72;**.**

You will extract the signature from the webhook header and then compare it against your own HMAC-SHA1 hash of the payload using your signing key.

To make signature validation easier you can use one of our SDKs.

{% tabs %}
{% tab title="Ruby" %}
{% code overflow="wrap" %}

```ruby
signature = request.headers["x-bunny-signature"];

payload = '{"type":"SubscriptionProvisioningChange","payload":{"subscription":{"id":27,"state":"trial","trial_start_date":"2022-06-04","trial_end_date":"2022-06-18","start_date":null,"end_date":null,"auto_renew":false,"account":{"id":33,"name":"Ondricka, Flatley and Kessler"},"tenant":null,"product":{"code":"stealth","name":"Stealth","description":null,"sku":null},"features":[{"code":"users","quantity":1},{"code":"crm","quantity":null}]}}}'

signingKey = "<signing_key>";

valid = BunnyApp::Webhook.verify(signature, payload, signing_key)
```

{% endcode %}
{% endtab %}

{% tab title="Node.js" %}

```javascript
let signature = req.headers["x-bunny-signature"];

let payload = '{"type":"SubscriptionProvisioningChange","payload":{"subscription":{"id":27,"state":"trial","trial_start_date":"2022-06-04","trial_end_date":"2022-06-18","start_date":null,"end_date":null,"auto_renew":false,"account":{"id":33,"name":"Ondricka, Flatley and Kessler"},"environment":null,"product":{"code":"stealth","name":"Stealth","description":null,"sku":null},"features":[{"code":"users","quantity":1},{"code":"crm","quantity":null}]}}}';

let signingKey = "<signing_key>";

let valid = bunny.webhooks.validate(signature, payload, signingKey);
```

{% endtab %}
{% endtabs %}

### IP Addresses

Webhook requests from Bunny originate from the following IP addresses:

* 52.5.155.132
* 52.87.82.133
