> For the complete documentation index, see [llms.txt](https://docs.bunny.com/developer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bunny.com/developer/webhooks/webhook-security.md).

# 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](/developer/webhooks/webhooks.md#platform-webhooks) and [workflow webhooks](/developer/webhooks/webhooks.md).

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

#### Platform

<figure><img src="/files/rpGYB02h4WpvqyeW0pyW" alt="Set a signing key for a Platform webhook"><figcaption></figcaption></figure>

#### Workflow action

<figure><img src="/files/FwDSTrA1bRhTRwaWz3cS" 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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bunny.com/developer/webhooks/webhook-security.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
