Define your own WAF rules in Bunny Shield to fine-tune existing protections or block threats the managed ruleset doesn’t cover.
Custom WAF rules let you write conditions Bunny Shield doesn’t cover out of the box. You pick the variables, operators, transformations, and response actions to target threats specific to your application.
Before writing your first rule, read the Rule Engine documentation to understand how rules are structured.This rule processes each HTTP request by extracting only the REQUEST_URI (Variable), converting it to lowercase, and removing whitespaces (Transformations). It then verifies if the transformed REQUEST_URI matches exactly (Operator) with ‘/blockedpath’ (Operator Value). If a match is found, our WAF Engine will block (Response Action) the request, halting further rule processing and intercepting the request.With the basics covered, you can write WAF rules that target the threats specific to your site.
To block requests that have a User-Agent matching a known crawler, the rule would be:Adapt these patterns to mitigate the threats and enforce the security policies that match your application.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"bunny.net Documentation","colors":{"primary":"#EF6126","light":"#EF6126","dark":"#EF6126"},"logo":{"light":"https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/logo/bunny-logo-dark.svg?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=62c091ea1aaea93d0a981902b7783e37","dark":"https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/logo/bunny-logo-light.svg?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=3610e32d68a9fa458b0116ac58ca812a"},"favicon":"https://mintcdn.com/bunnynet-cb9733c2/1bTPx1eyQm8EK8W3/favicon.png?fit=max\u0026auto=format\u0026n=1bTPx1eyQm8EK8W3\u0026q=85\u0026s=85267b63e804fac7a4dd94599bb8c6e8","navbar":{"links":[{"href":"https://bunny.net/docs/api-reference","label":"API Reference"},{"href":"https://github.com/BunnyWay","label":"GitHub"}],"primary":{"type":"button","label":"Get Started","href":"https://dash.bunny.net/auth/register"}},"footer":{"socials":{"discord":"https://discord.gg/bunnynet","github":"https://github.com/BunnyWay","x":"https://x.com/BunnyCDN","bluesky":"https://bsky.app/profile/bunny.net","linkedin":"https://www.linkedin.com/company/bunnynet","facebook":"https://www.facebook.com/bunnycdn"}},"icons":{"library":"lucide"},"contextual":{"options":["copy","claude","chatgpt","cursor","view","vscode"],"display":"header"},"interaction":{"drilldown":false},"metadata":{"timestamp":true},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"bunnynet-cb9733c2","hasAudioNarration":false,"actualSubdomain":"bunnynet-cb9733c2","customDomains":["bunny.net"],"gitSource":{"type":"github","owner":"bunnyway","repo":"documentation","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae49f2d21d44d6b52dcfe35","collectionId":"5e262b87-ade9-45d8-9b63-06888c8d59a3","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae49f2d21d44d6b52dcfe35"},"feedback":{"thumbs":true,"contextualFeedback":{"allowEmail":true},"agentFeedback":true,"edits":true,"issues":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae534f2b9a26f131eb41834","clientVersion":"0.0.4043","searchFilterCounts":[{"language":"default","tag":"Documentation","count":752},{"language":"default","tag":"API Reference","count":318},{"language":"default","tag":"Core Platform API","count":109},{"language":"default","tag":"CDN","count":82},{"language":"default","tag":"Shield API","count":66},{"language":"default","tag":"Stream","count":66},{"language":"default","tag":"Magic Containers API","count":56},{"language":"default","tag":"Storage","count":54},{"language":"default","tag":"Guides","count":54},{"language":"default","tag":"Reference","count":52}],"searchSettings":{"isFiltersEnabled":true}},"assistantConfig":{"enableStarterQuestions":false,"deflection":{"enabled":true,"type":"link","email":"support@bunny.net","url":"https://bunny.net/contact","showHelpButton":true}},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".dark img[src*=\"/logo/frameworks/angular.svg\"],.dark img[src*=\"/logo/frameworks/eleventy.svg\"],.dark img[src*=\"/logo/frameworks/express.svg\"],.dark img[src*=\"/logo/frameworks/mariadb.svg\"],.dark img[src*=\"/logo/frameworks/nextjs.svg\"],.dark img[src*=\"/logo/frameworks/sphinx.svg\"]{filter:invert(1)}html:not(.dark) img[src*=\"/logo/frameworks/zola.svg\"]{filter:invert(1)}"}],"page":{"pagePath":"shield/custom-waf-rule","slug":"/shield/custom-waf-rule","pageMetadata":{"title":"Creating a custom WAF rule","description":"Define your own WAF rules in Bunny Shield to fine-tune existing protections or block threats the managed ruleset doesn't cover.","href":"/shield/custom-waf-rule"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Define your own WAF rules in Bunny Shield to fine-tune existing protections or block threats the managed ruleset doesn’t cover.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,li:`li`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Heading,OptimizedImage}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Custom WAF rules let you write conditions Bunny Shield doesn’t cover out of the box. You pick the variables, operators, transformations, and response actions to target threats specific to your application.`}),`\n`,_jsx(Heading,{level:`2`,id:`what-you’ll-need`,children:`What you’ll need`}),`\n`,_jsx(_components.p,{children:`Before you dive in, make sure you have the following prerequisites in place:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`A `,_jsx(_components.a,{href:`https://bunny.net/`,children:`bunny.net`}),` account ( `,_jsx(_components.a,{href:`https://dash.bunny.net/auth/login?pk_buttonlocation=menu`,children:`Log in`}),` or sign up for a `,_jsx(_components.a,{href:`https://dash.bunny.net/auth/register`,children:`free trial`}),`).`]}),`\n`,_jsx(_components.li,{children:`An existing Shield Zone.`}),`\n`,_jsx(_components.li,{children:`Advanced Plan or above on the existing Shield Zone.`}),`\n`,_jsx(_components.li,{children:`Your AccessKey or JWT for API authentication.`}),`\n`]}),`\n`,_jsx(_components.p,{children:`With these in place, you’ll have the access and permissions needed to create and manage custom WAF rules.`}),`\n`,_jsx(Heading,{level:`2`,id:`creating-a-custom-waf-rule`,children:`Creating a custom WAF rule`}),`\n`,_jsxs(_components.p,{children:[`Before writing your first rule, read the `,_jsx(_components.a,{href:`/shield/rule-engine`,children:`Rule Engine`}),` documentation to understand how rules are structured.`]}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/7943f5069c900e680d2b136f98d0bce7ddd320d2beec28157b16af24e41caa16-image.png?fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=349360476e0d9cf23382a2062d39344f`,alt:``,\"data-og-width\":`1651`,width:`1651`,\"data-og-height\":`1273`,height:`1273`,\"data-path\":`images/docs/7943f5069c900e680d2b136f98d0bce7ddd320d2beec28157b16af24e41caa16-image.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/7943f5069c900e680d2b136f98d0bce7ddd320d2beec28157b16af24e41caa16-image.png?w=280\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=74e4a9ff8183a7ea058bbe7b25f38b29 280w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/7943f5069c900e680d2b136f98d0bce7ddd320d2beec28157b16af24e41caa16-image.png?w=560\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=3a603a02f9b4270751df1335e5d8218c 560w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/7943f5069c900e680d2b136f98d0bce7ddd320d2beec28157b16af24e41caa16-image.png?w=840\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=303bc843d11d73f764618f815016b0ed 840w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/7943f5069c900e680d2b136f98d0bce7ddd320d2beec28157b16af24e41caa16-image.png?w=1100\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=538a6878138758b953f97dd36716fc4b 1100w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/7943f5069c900e680d2b136f98d0bce7ddd320d2beec28157b16af24e41caa16-image.png?w=1650\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=6693eccb5c1bd74e28f505d3c4dff9af 1650w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/7943f5069c900e680d2b136f98d0bce7ddd320d2beec28157b16af24e41caa16-image.png?w=2500\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=d2238405288717f2f38a90bbc57c358f 2500w`}),`\n`,_jsxs(_components.p,{children:[`This rule processes each HTTP request by extracting only the REQUEST_URI (`,_jsx(_components.strong,{children:`Variable`}),`), converting it to lowercase, and removing whitespaces (`,_jsx(_components.strong,{children:`Transformations`}),`). It then verifies if the transformed REQUEST_URI matches exactly (`,_jsx(_components.strong,{children:`Operator`}),`) with ‘/blockedpath’ (`,_jsx(_components.strong,{children:`Operator Value`}),`). If a match is found, our WAF Engine will block (`,_jsx(_components.strong,{children:`Response Action`}),`) the request, halting further rule processing and intercepting the request.`]}),`\n`,_jsx(_components.p,{children:`With the basics covered, you can write WAF rules that target the threats specific to your site.`}),`\n`,_jsx(Heading,{level:`2`,id:`examples-of-custom-waf-rules`,children:`Examples of custom WAF rules`}),`\n`,_jsx(_components.p,{children:`To illustrate how you can implement custom WAF rules, here are some practical examples:`}),`\n`,_jsx(Heading,{level:`3`,id:`block-request-by-asn`,children:`Block request by ASN`}),`\n`,_jsx(_components.p,{children:`If you want to block requests that originate from a specific ASN, you can create a rule as follows:`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/ae556d5fb671d9928c2088848330834ac308f82fe207b83752ac8450106a21ad-image.png?fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=130779e07b45f0fdbc564e4188ebcb2b`,alt:``,\"data-og-width\":`1562`,width:`1562`,\"data-og-height\":`1189`,height:`1189`,\"data-path\":`images/docs/ae556d5fb671d9928c2088848330834ac308f82fe207b83752ac8450106a21ad-image.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/ae556d5fb671d9928c2088848330834ac308f82fe207b83752ac8450106a21ad-image.png?w=280\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=4d5c4cb286b344b90d437c47a11b9168 280w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/ae556d5fb671d9928c2088848330834ac308f82fe207b83752ac8450106a21ad-image.png?w=560\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=c01feb08b53d86b36046cfeb4b8bd55e 560w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/ae556d5fb671d9928c2088848330834ac308f82fe207b83752ac8450106a21ad-image.png?w=840\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=60e743957f6d0ae5d9f75f6fda2709ce 840w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/ae556d5fb671d9928c2088848330834ac308f82fe207b83752ac8450106a21ad-image.png?w=1100\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=07bceaefd2714ac7e20937583d1032f0 1100w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/ae556d5fb671d9928c2088848330834ac308f82fe207b83752ac8450106a21ad-image.png?w=1650\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=7679457b4734901e91ea34d41ad445ca 1650w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/ae556d5fb671d9928c2088848330834ac308f82fe207b83752ac8450106a21ad-image.png?w=2500\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=484d7343007d10524bc3d1a493fd3678 2500w`}),`\n`,_jsx(Heading,{level:`3`,id:`block-request-by-country-code`,children:`Block request by country code`}),`\n`,_jsx(_components.p,{children:`If you want to block requests that originate from a specific country code, you can create a rule as follows:`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/bunnynet-cb9733c2/kcU5tb-Sz5318NF5/images/docs/e7f3550fe240d2a64d18632a5183b0cb909c4716f0e796518d35fae34bfeeac5-image.png?fit=max\u0026auto=format\u0026n=kcU5tb-Sz5318NF5\u0026q=85\u0026s=3150efa4247fbb1dabc1567d7e1ba320`,alt:``,\"data-og-width\":`1572`,width:`1572`,\"data-og-height\":`1213`,height:`1213`,\"data-path\":`images/docs/e7f3550fe240d2a64d18632a5183b0cb909c4716f0e796518d35fae34bfeeac5-image.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bunnynet-cb9733c2/kcU5tb-Sz5318NF5/images/docs/e7f3550fe240d2a64d18632a5183b0cb909c4716f0e796518d35fae34bfeeac5-image.png?w=280\u0026fit=max\u0026auto=format\u0026n=kcU5tb-Sz5318NF5\u0026q=85\u0026s=aaf3c1329e4a4855dc518497c9ea517a 280w, https://mintcdn.com/bunnynet-cb9733c2/kcU5tb-Sz5318NF5/images/docs/e7f3550fe240d2a64d18632a5183b0cb909c4716f0e796518d35fae34bfeeac5-image.png?w=560\u0026fit=max\u0026auto=format\u0026n=kcU5tb-Sz5318NF5\u0026q=85\u0026s=f204cd4db2e58b0644b374b38a2272b6 560w, https://mintcdn.com/bunnynet-cb9733c2/kcU5tb-Sz5318NF5/images/docs/e7f3550fe240d2a64d18632a5183b0cb909c4716f0e796518d35fae34bfeeac5-image.png?w=840\u0026fit=max\u0026auto=format\u0026n=kcU5tb-Sz5318NF5\u0026q=85\u0026s=f507af9ef856d270957da75435f7b360 840w, https://mintcdn.com/bunnynet-cb9733c2/kcU5tb-Sz5318NF5/images/docs/e7f3550fe240d2a64d18632a5183b0cb909c4716f0e796518d35fae34bfeeac5-image.png?w=1100\u0026fit=max\u0026auto=format\u0026n=kcU5tb-Sz5318NF5\u0026q=85\u0026s=70008fbc9b7a487c651453cf050e35f6 1100w, https://mintcdn.com/bunnynet-cb9733c2/kcU5tb-Sz5318NF5/images/docs/e7f3550fe240d2a64d18632a5183b0cb909c4716f0e796518d35fae34bfeeac5-image.png?w=1650\u0026fit=max\u0026auto=format\u0026n=kcU5tb-Sz5318NF5\u0026q=85\u0026s=a06c110cebebe1478473fecdfabedf5f 1650w, https://mintcdn.com/bunnynet-cb9733c2/kcU5tb-Sz5318NF5/images/docs/e7f3550fe240d2a64d18632a5183b0cb909c4716f0e796518d35fae34bfeeac5-image.png?w=2500\u0026fit=max\u0026auto=format\u0026n=kcU5tb-Sz5318NF5\u0026q=85\u0026s=115791f0b7b61153f3659ef608cb3121 2500w`}),`\n`,_jsx(Heading,{level:`3`,id:`log-request-if-the-specific-cookie-is-set-and-has-a-specific-value`,children:`Log request if the specific cookie is set and has a specific value`}),`\n`,_jsx(_components.p,{children:`If you want to log requests that contain a specific cookie with a particular value, you can create a rule as follows:`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/57b2bbe2aef059d026f21abb8a1b44fd5ae31907fb50eae15f6bf9ed74177b4f-image.png?fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=5be5933d064ca98b520577b46c802a26`,alt:``,\"data-og-width\":`1672`,width:`1672`,\"data-og-height\":`1261`,height:`1261`,\"data-path\":`images/docs/57b2bbe2aef059d026f21abb8a1b44fd5ae31907fb50eae15f6bf9ed74177b4f-image.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/57b2bbe2aef059d026f21abb8a1b44fd5ae31907fb50eae15f6bf9ed74177b4f-image.png?w=280\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=e5ac86ad42ed87af782432aaf77c4572 280w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/57b2bbe2aef059d026f21abb8a1b44fd5ae31907fb50eae15f6bf9ed74177b4f-image.png?w=560\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=fadf77580cd32aebe4f5660311367a9d 560w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/57b2bbe2aef059d026f21abb8a1b44fd5ae31907fb50eae15f6bf9ed74177b4f-image.png?w=840\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=040c5b5283a79e310ad56d62c30621f9 840w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/57b2bbe2aef059d026f21abb8a1b44fd5ae31907fb50eae15f6bf9ed74177b4f-image.png?w=1100\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=6da59d0d1cc2e980bc2bc9ec874f90a4 1100w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/57b2bbe2aef059d026f21abb8a1b44fd5ae31907fb50eae15f6bf9ed74177b4f-image.png?w=1650\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=8cc3ec5d5919f4132e4d784c8e66b2cc 1650w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/57b2bbe2aef059d026f21abb8a1b44fd5ae31907fb50eae15f6bf9ed74177b4f-image.png?w=2500\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=8889ff24e599d2dcc7b6b33b0e64a96b 2500w`}),`\n`,_jsx(Heading,{level:`3`,id:`challenge-request-if-a-specific-path-is-accessed`,children:`Challenge request if a specific path is accessed`}),`\n`,_jsx(_components.p,{children:`To challenge a user when they access a specific path, you can define a rule like this:`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/6507dfa00b76c30cfde6cf128e77fef5488a9c0e3532bf8e4506489caeb00ee0-image.png?fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=3ad43b56c84e20a13b1209a42a6f6251`,alt:``,\"data-og-width\":`1690`,width:`1690`,\"data-og-height\":`1264`,height:`1264`,\"data-path\":`images/docs/6507dfa00b76c30cfde6cf128e77fef5488a9c0e3532bf8e4506489caeb00ee0-image.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/6507dfa00b76c30cfde6cf128e77fef5488a9c0e3532bf8e4506489caeb00ee0-image.png?w=280\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=3d7417937357aeeecb75a956f0017700 280w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/6507dfa00b76c30cfde6cf128e77fef5488a9c0e3532bf8e4506489caeb00ee0-image.png?w=560\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=2f0cb416fa09dac58b962b4778ed3e60 560w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/6507dfa00b76c30cfde6cf128e77fef5488a9c0e3532bf8e4506489caeb00ee0-image.png?w=840\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=7b22b820bc6b58aff437a05f96485009 840w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/6507dfa00b76c30cfde6cf128e77fef5488a9c0e3532bf8e4506489caeb00ee0-image.png?w=1100\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=fad34ad99b150b88bbaee196804a7bcb 1100w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/6507dfa00b76c30cfde6cf128e77fef5488a9c0e3532bf8e4506489caeb00ee0-image.png?w=1650\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=6eb46a46fe1d832bb3aab38f1717a55a 1650w, https://mintcdn.com/bunnynet-cb9733c2/L57MhyfuZyBVCcmn/images/docs/6507dfa00b76c30cfde6cf128e77fef5488a9c0e3532bf8e4506489caeb00ee0-image.png?w=2500\u0026fit=max\u0026auto=format\u0026n=L57MhyfuZyBVCcmn\u0026q=85\u0026s=a1972fa72b38f4f4ac518bb9173c7ed0 2500w`}),`\n`,_jsx(Heading,{level:`3`,id:`block-request-if-user-agent-is-a-known-crawler`,children:`Block request if User-Agent is a known crawler`}),`\n`,_jsx(_components.p,{children:`To block requests that have a User-Agent matching a known crawler, the rule would be:`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/1b0a50e440294062c2805f47564fbd4b1bb410569d7db29452eb1c5de0cb682b-image.png?fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=74fb8bdc035d3f00030c2e2406278a7e`,alt:``,\"data-og-width\":`1649`,width:`1649`,\"data-og-height\":`1266`,height:`1266`,\"data-path\":`images/docs/1b0a50e440294062c2805f47564fbd4b1bb410569d7db29452eb1c5de0cb682b-image.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/1b0a50e440294062c2805f47564fbd4b1bb410569d7db29452eb1c5de0cb682b-image.png?w=280\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=245594316992218391c92528250454c9 280w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/1b0a50e440294062c2805f47564fbd4b1bb410569d7db29452eb1c5de0cb682b-image.png?w=560\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=3b667c3606f31aeb65c148731fb8c4fc 560w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/1b0a50e440294062c2805f47564fbd4b1bb410569d7db29452eb1c5de0cb682b-image.png?w=840\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=208a820178effd6159c6298e15434c19 840w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/1b0a50e440294062c2805f47564fbd4b1bb410569d7db29452eb1c5de0cb682b-image.png?w=1100\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=7e03f9d7330c0acf9e0cf04e3cbec0a4 1100w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/1b0a50e440294062c2805f47564fbd4b1bb410569d7db29452eb1c5de0cb682b-image.png?w=1650\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=4754777c0dab8c74f5cb565ccbb1c867 1650w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/1b0a50e440294062c2805f47564fbd4b1bb410569d7db29452eb1c5de0cb682b-image.png?w=2500\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=f9db4eff4ab7bf2e79f349ea0844238f 2500w`}),`\n`,_jsx(_components.p,{children:`Adapt these patterns to mitigate the threats and enforce the security policies that match your application.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Creating a custom WAF rule","description":"Define your own WAF rules in Bunny Shield to fine-tune existing protections or block threats the managed ruleset doesn't cover.","href":"/shield/custom-waf-rule"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"What you’ll need","slug":"what-you’ll-need","depth":2,"children":[]},{"title":"Creating a custom WAF rule","slug":"creating-a-custom-waf-rule","depth":2,"children":[]},{"title":"Examples of custom WAF rules","slug":"examples-of-custom-waf-rules","depth":2,"children":[{"title":"Block request by ASN","slug":"block-request-by-asn","depth":3,"children":[]},{"title":"Block request by country code","slug":"block-request-by-country-code","depth":3,"children":[]},{"title":"Log request if the specific cookie is set and has a specific value","slug":"log-request-if-the-specific-cookie-is-set-and-has-a-specific-value","depth":3,"children":[]},{"title":"Challenge request if a specific path is accessed","slug":"challenge-request-if-a-specific-path-is-accessed","depth":3,"children":[]},{"title":"Block request if User-Agent is a known crawler","slug":"block-request-if-user-agent-is-a-known-crawler","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"bunnynet-cb9733c2","siteName":"bunny.net Documentation","title":"Creating a custom WAF rule - bunny.net Documentation","relatedPagesConfig":{"enabled":false,"limit":5,"mode":"automatic"},"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-30T15:28:19.100Z","gitLastModified":"2026-05-19T11:35:23.000Z","originalFileLocation":"shield/custom-waf-rule.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Define your own WAF rules in Bunny Shield to fine-tune existing protections or block threats the managed ruleset doesn\u0026#x27;t cover.\">\u003cmeta data-mint-head name=\"application-name\" content=\"bunny.net Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Creating a custom WAF rule - bunny.net Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Define your own WAF rules in Bunny Shield to fine-tune existing protections or block threats the managed ruleset doesn\u0026#x27;t cover.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"bunny.net Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://bunny.net/docs/shield/custom-waf-rule\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://bunnynet-cb9733c2.mintlify.app/_mintlify/api/og/v2?division=WAF\u0026amp;title=Creating+a+custom+WAF+rule\u0026amp;description=Define+your+own+WAF+rules+in+Bunny+Shield+to+fine-tune+existing+protections+or+block+threats+the+managed+ruleset+doesn%27t+cover.\u0026amp;theme=3e3fa11ba94222b95e7f52d5\u0026amp;signature=e76fcd84599189f606401c623a91ce804e1b355b8dcc8876f1abdb6026530c87\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Creating a custom WAF rule - bunny.net Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Define your own WAF rules in Bunny Shield to fine-tune existing protections or block threats the managed ruleset doesn\u0026#x27;t cover.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://bunnynet-cb9733c2.mintlify.app/_mintlify/api/og/v2?division=WAF\u0026amp;title=Creating+a+custom+WAF+rule\u0026amp;description=Define+your+own+WAF+rules+in+Bunny+Shield+to+fine-tune+existing+protections+or+block+threats+the+managed+ruleset+doesn%27t+cover.\u0026amp;theme=3e3fa11ba94222b95e7f52d5\u0026amp;signature=e76fcd84599189f606401c623a91ce804e1b355b8dcc8876f1abdb6026530c87\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"bunny.net Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#EF6126\">\u003clink data-mint-head rel=\"canonical\" href=\"https://bunny.net/docs/shield/custom-waf-rule\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/shield/custom-waf-rule.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://bunny.net/#organization\",\"name\":\"bunny.net Documentation\",\"url\":\"https://bunny.net\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/logo/bunny-logo-dark.svg?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=62c091ea1aaea93d0a981902b7783e37\"}},{\"@type\":\"WebSite\",\"@id\":\"https://bunny.net/docs#website\",\"name\":\"bunny.net Documentation\",\"url\":\"https://bunny.net/docs\",\"publisher\":{\"@id\":\"https://bunny.net/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://bunny.net/docs/shield/custom-waf-rule#webpage\",\"url\":\"https://bunny.net/docs/shield/custom-waf-rule\",\"name\":\"Creating a custom WAF rule\",\"description\":\"Define your own WAF rules in Bunny Shield to fine-tune existing protections or block threats the managed ruleset doesn't cover.\",\"dateModified\":\"2026-05-19T11:35:23.000Z\",\"isPartOf\":{\"@id\":\"https://bunny.net/docs#website\"},\"breadcrumb\":{\"@id\":\"https://bunny.net/docs/shield/custom-waf-rule#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://bunny.net/docs/shield/custom-waf-rule#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Protection Features\",\"item\":\"https://bunny.net/docs/shield/waf\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WAF\",\"item\":\"https://bunny.net/docs/shield/waf\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Creating a custom WAF rule\",\"item\":\"https://bunny.net/docs/shield/custom-waf-rule\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://bunny.net/docs/shield/custom-waf-rule#article\",\"headline\":\"Creating a custom WAF rule\",\"name\":\"Creating a custom WAF rule\",\"description\":\"Define your own WAF rules in Bunny Shield to fine-tune existing protections or block threats the managed ruleset doesn't cover.\",\"url\":\"https://bunny.net/docs/shield/custom-waf-rule\",\"mainEntityOfPage\":{\"@id\":\"https://bunny.net/docs/shield/custom-waf-rule#webpage\"},\"dateModified\":\"2026-05-19T11:35:23.000Z\",\"publisher\":{\"@id\":\"https://bunny.net/#organization\"},\"isPartOf\":{\"@id\":\"https://bunny.net/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"bunny.net Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"bunny.net Documentation","nav":{"global":null,"products":[{"product":"Home","icon":"book-open","pages":[{"title":"Home","href":""}]},{"product":"CDN","icon":"zap","description":"Accelerate and protect your content globally","pages":[{"title":"CDN","href":"/cdn"}]},{"product":"Magic Containers","icon":"box","description":"Deploy any app anywhere with Docker","pages":[{"title":"Magic Containers","href":"/magic-containers"}]},{"product":"Edge Scripting","icon":"code","description":"Deploy serverless code at the edge","pages":[{"title":"Edge Scripting","href":"/scripting"}]},{"product":"Stream","icon":"video","description":"Video streaming and delivery platform","pages":[{"title":"Stream","href":"/stream"}]},{"product":"Storage","icon":"hard-drive","description":"Global object storage","pages":[{"title":"Storage","href":"/storage"}]},{"product":"Shield","icon":"shield","description":"Stay protected and online no matter what","tabs":[{"tab":"Documentation","groups":[{"group":"Documentation","pages":[{"title":"Bunny Shield","sidebarTitle":"Introduction","mode":"wide","href":"/shield"},{"title":"Quickstart","href":"/shield/quickstart"},{"title":"Pricing","href":"/shield/pricing"},{"title":"Bunny Shield Changelog","sidebarTitle":"Changelog","url":"/changelog?tags=Shield","href":"/shield/changelog"}]},{"group":"Protection Features","pages":[{"group":"WAF","pages":[{"title":"WAF","sidebarTitle":"Overview","href":"/shield/waf"},{"title":"Understanding Rule Engine","description":"The Rule Engine is the core component of the Web Application Firewall (WAF) that enables precise control over HTTP requests by executing rules. These rules determine how the WAF inspects, evaluates, and responds to incoming traffic, enhancing the security and integrity of web applications.","href":"/shield/rule-engine"},{"title":"Creating a custom WAF rule","href":"/shield/custom-waf-rule"}]},{"group":"Rate Limiting","pages":[{"title":"Rate Limiting","sidebarTitle":"Overview","description":"Bunny Shield's rate limiting is a critical feature of its Web Application Firewall (WAF) that helps prevent abuse of your web resources by controlling the number of requests a client can make to your application within a given timeframe. This feature is essential in mitigating brute force attacks, Distributed Denial-of-Service (DDoS) attacks, and other types of automated abuse. In this section, we’ll guide you through configuring rate limiting rules to protect your application effectively without impacting legitimate users.","href":"/shield/rate-limiting"},{"title":"Creating a rate limit rule","href":"/shield/custom-rate-limit-rule"}]},{"title":"DDoS Mitigation","href":"/shield/ddos"},{"title":"Bot Detection","href":"/shield/bot-detection"},{"title":"Access Lists","href":"/shield/access-lists"},{"title":"Upload Scanning","href":"/shield/upload-scanning"},{"title":"API Guardian","href":"/shield/api-guardian"}]},{"group":"Reference","pages":[{"title":"Custom Response Pages","href":"/shield/custom-response-pages"},{"title":"Verified Bots","href":"/shield/verified-bots"},{"title":"Metrics \u0026 Logging","href":"/shield/metrics"},{"title":"Cookies","href":"/shield/cookies"},{"title":"Troubleshooting","href":"/shield/troubleshooting"},{"title":"API Reference","url":"/api-reference/shield","href":"/shield/api-reference"}]}]}]},{"product":"Optimizer","icon":"sparkles","description":"Automatic image and web optimization.","pages":[{"title":"Optimizer","href":"/optimizer"}]},{"product":"DNS","icon":"globe","description":"Unlock the true power of DNS with an ultra-fast scriptable platform","pages":[{"title":"DNS","href":"/dns"}]},{"product":"Database","icon":"database","description":"Serverless SQLite over HTTP","pages":[{"title":"Database","href":"/database"}]},{"product":"Integrations","icon":"puzzle","description":"Official and third-party plugins and integrations","pages":[{"title":"Integrations","href":"/integrations/wordpress"}]},{"product":"CLI","icon":"terminal","description":"Manage bunny.net from your terminal","pages":[{"title":"CLI","href":"/cli"}]},{"product":"API Reference","icon":"square-terminal","description":"Build \u0026 Integrate with the Platform API","pages":[{"title":"API Reference","href":"/api-reference"}]},{"product":"Partners","icon":"handshake","description":"Manage customers, pricing, and billing as a bunny.net partner","pages":[{"title":"Partners","href":"/partners"}]}]},"basePath":"","title":"Creating a custom WAF rule - bunny.net Documentation","buildId":"dpl_4RHMRqtvdHvKgaEfTTjFqjzja3B6","deploymentId":"dpl_4RHMRqtvdHvKgaEfTTjFqjzja3B6","dynamics":["a74be98ba7"],"chunks":["zoom-image-lightbox-CZTaVDTN.js","lightbox-handle-r17bVUz3.js"]}