Bunny

Prerequisites

This article assumes that the user has already:

  1. A pull zone configured (The website you would like to protect)
  2. DATADOME_SERVER_SIDE_KEY available in your DataDome dashboard ,
  3. Your pull zone (Caching > General) need to have Strip response cookies disabled (without that DataDome cookie will be removed from the response)

Installation

  1. Go to Scripting
  2. Click on + Add Script
  1. Click on Deploy with bunny.net
  1. Fill the following information and click on Add Script
    1. Script Name : DataDome
    2. Select Type : Middleware
    3. Pull Zone : Select the zone you would like to protect
  1. Download the DataDome Bunny module and use the content of datadome.ts
  2. Click on Save
  3. Go to Environment > Secrets
  4. Add a new secret with key : DATADOME_SERVER_SIDE_KEY and value the value of your DataDome Server Side Key
  5. Click on Save Secret
  6. Click on Publish
  1. When publishing the script world wide, enter a comment v1 and click on Publish Script

  2. Click on Connect Pull Zone

  3. Select your pull zone you would like to protect

  1. Click on Connect Pull Zone

You are now protected by DataDome.

Configuration

The configuration is done using Bunny environment variables

Server-side settings

Setting nameDescriptionRequiredDefault valueExample
DATADOME_SERVER_SIDE_KEYYour DataDome server-side key, found in your dashboard.Yes--
DATADOME_TIMEOUTRequest timeout to DataDome API, in milliseconds.No300350
DATADOME_URL_PATTERN_EXCLUSIONRegular expression to exclude URLs from the DataDome analysis.NoList of excluded static assets below
DATADOME_ENDPOINTThe Datadome endpoint to target - More info hereNoapi.datadome.co
\\.(avi|avif|bmp|css|eot|flac|flv|gif|gz|ico|jpeg|jpg|js|json|less|map|mka|mkv|mov|mp3|mp4|mpeg|mpg|ogg|ogm|opus|otf|png|svg|svgz|swf|ttf|wav|webm|webp|woff|woff2|xml|zip)$