---
title: "Camada for Cloudflare: no code, deploy one Worker · camada"
description: "Keep bad actors out of a site on Cloudflare with no code changes. One Worker in your own account reads request analytics and keeps a WAF block list in sync."
url: https://www.camada.app/docs/cloudflare
last_updated: 2026-11-22
---

Docs

# Camada for Cloudflare

Keep bad actors out of a site that already runs on Cloudflare, with no code changes. Keep `HOSTS` set to `*` for maximum domain-level edge coverage across your whole zone, so an attacker blocked on one host is blocked across all of them. Status: preview.

It is a Worker in your own Cloudflare account. It never sits in front of your site: it has no route, adds no latency. Every 5 minutes it:

1. Reads your zone's request analytics from Cloudflare (the same data as Observability → Logs) and sends it to camada.
2. Keeps a `camada_block` IP list and one WAF custom rule in your account in sync with the IPs camada blocks.

Your Cloudflare API token stays in your account. camada never sees it.

## Install

[Deploy to Cloudflare](https://deploy.workers.cloudflare.com/?url=https://github.com/camada-app/camada-cloudflare)

Cloudflare copies the repo to your GitHub account and deploys it. You may need to install the Cloudflare Workers and Pages GitHub app first. The prompts ask for:

| Prompt | Meaning |
| --- | --- |
| `CAMADA_KEY` | From the camada dashboard. |
| `CLOUDFLARE_API_TOKEN` | The token from the next section. |
| `ZONE` | Your domain, for example example.com. |
| `HOSTS` | Keep * for maximum domain-level edge protection (root domain and every subdomain at any depth). Or list comma-separated hostnames and subdomain wildcards such as www.example.com, *.api.example.com, *.*.*.example.com. |

Leave `CAMADA_URL` as it is.

## The API token

[Create the token](https://dash.cloudflare.com/profile/api-tokens?permissionGroupKeys=%5B%7B%22key%22%3A%22analytics%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone_waf%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22account_filter_lists%22%2C%22type%22%3A%22edit%22%7D%5D&accountId=%2A&zoneId=all&name=Camada%20Doorway). The form asks for four permissions:

| Permission | Access |
| --- | --- |
| `Zone > Analytics` | Read |
| `Zone > Zone` | Read |
| `Zone > Zone WAF` | Edit |
| `Account > Account Filter Lists` | Edit |

Narrow the token to your one zone and your account. If the form shows fewer than four permissions, add the missing ones by hand.

## What to expect

- **IP-level blocks, plus path and header exemptions.** Blocks match IP addresses (no ASN or country entries), while Project Settings excluded paths, Allow-list path and header entries, and single-condition path/header Skip rules (is, starts with, contains) are exempted directly in the `camada:block v1` WAF rule (within Cloudflare's 4 KB expression limit). Excluded paths are also skipped from analytics ingest.
- **About 10 to 17 minutes** from the first bad request to the block: up to 5 minutes until the next run, about 2 minutes of Cloudflare analytics delay, then camada's analysis, then the next list sync.
- Verified good bots (search engines and the like) get in. The rule exempts them.
- **A 48-hour dead-man's switch.** If the Worker stops running, the rule expires on its own within 48 hours, so nothing stays blocked forever.
- On busy minutes Cloudflare stores only a sample of the request rows. camada still gets per-IP request counts, which Cloudflare estimates for the whole minute, so volume-based blocks keep working. Billing counts the rows shipped.
- Cloudflare's analytics carry no request headers. An injection attempt seen here can recommend a block but never applies one by itself. Blocks come from volume and behaviour (scanners, credential stuffing, probing), plus your manual blocks and rules.
- It creates one list, `camada_block`, and one rule, `camada:block v1`. It never touches lists or rules it didn't create.
- Built to run on every plan, including Free: no Logpush, no Enterprise features and no storage. Free allows 1 list and 5 custom rules. If there is no free slot, Setup in the camada dashboard shows what to fix, and analytics keep flowing meanwhile.

## Updating

Most fixes ship on camada's side, so usually there is nothing to do.

When Setup in the dashboard says your Worker is out of date:

1. Download the source code (zip) of the [latest release](https://github.com/camada-app/camada-cloudflare/releases/latest) and unzip it.
2. In your copy of the repo, replace the `src/` folder with the one you unzipped, then commit and push.

Cloudflare redeploys the Worker within a few minutes of the push. Your settings (zone, hosts and secrets) are kept, because they aren't in `src/`.

To skip these steps next time, add [`.github/workflows/update.yml`](https://github.com/camada-app/camada-cloudflare/blob/main/.github/workflows/update.yml) from camada-app/camada-cloudflare to your copy. Then go to Actions, pick **Update Camada** and choose Run workflow.

## Uninstall

Do these in order:

1. Delete the Worker: Workers & Pages, pick the Worker, Settings, Delete.
2. Delete the rule: Security, WAF, Custom rules, `camada:block v1`, Delete. Delete only that rule, never the whole ruleset.
3. Delete the list: Manage Account, Configurations, Lists, `camada_block`, Delete.

The order matters because the rule uses the list, and a running Worker would recreate both.

## When to use an SDK instead

Use an SDK when you need:

- Blocking on the first request, inline in your app.
- Challenges (proof of work).
- ASN, country, or path and header block rules (plus multi-condition or regex Skip rules).
- App outcomes from `track()`, or the beacon.
- A site that isn't on Cloudflare.

Pick yours on the [frameworks](https://www.camada.app/frameworks) page, or see [Hono on Cloudflare Workers](https://www.camada.app/docs/hono) if your app is already a Worker. Don't feed one project from both an SDK and this Worker: every request would be counted twice.

Other SDK references: [Hono on Workers](https://www.camada.app/docs/hono) · [Python](https://www.camada.app/docs/python) · [Go SDK](https://www.camada.app/docs/go) · [PHP](https://www.camada.app/docs/php) · [Ruby](https://www.camada.app/docs/ruby) · [Java](https://www.camada.app/docs/java) · [.NET](https://www.camada.app/docs/dotnet) · [all frameworks](https://www.camada.app/frameworks) · [in-app bot detection](https://www.camada.app/bot-detection).

## Sitemap

[Every page on this site](https://www.camada.app/sitemap.md)
