# Security architecture

How a request reaches your application through bunny.net and Scaleway, what Shield stops on the way, and who is responsible for which part.


A visitor's request passes the edge of bunny.net before it reaches your container at Scaleway. Brewless sets that path up and keeps it in line at every deploy. Brewless itself is never on the path: no visitor's request passes through Brewless.

```text
visitor
  → bunny.net edge: the cache, and the edge rules Brewless puts on the pull zone
  → bunny.net Shield: web application firewall, rate limits, bot policy, DDoS protection
  → origin protection: Scaleway only lets requests through that carry the edge's token
  → your container at Scaleway Serverless Containers
  → your application
```

What each step does:

| Step | What it stops or keeps | See |
| --- | --- | --- |
| Edge cache | Answers pages that are the same for everybody itself, so they never reach the container. Rate limits do not count them. | [Edge cache](/running/edge-cache) |
| Edge rules | Answer scanner addresses (`/.env`, `/wp-login.php`, …) with `403` before Shield or the container sees them, and keep Shield's challenge, bot detection and rate limits off the paths crawlers must reach. | [Scanner addresses](/running/edge-cache#scanner-addresses-answered-by-the-edge) |
| Shield | Blocks requests the managed WAF rules match, addresses over a rate limit, and bots the policy turns away. On by default for a new environment, on Shield Basic. After an unusual day you can tighten it for 24 hours with one click (emergency mode); it then goes back to `brewless.yml` by itself, and a deploy meanwhile keeps it on. | [Firewall](/running/firewall), [Bots and AI crawlers](/running/bots), [Unusual traffic](/running/budgets-and-unusual-traffic#emergency-mode) |
| API Guardian | Optional, on Shield Advanced: checks requests to the API endpoints you pick against your OpenAPI document, first only recording. | [API Guardian](/running/api-guardian) |
| Origin protection | Keeps the container's own Scaleway address closed, so nobody gets past the edge and Shield by asking it directly. The edge's token opens only the environment's own containers, never shows in Shield's logs, and can be replaced without a gap. On for an environment that asks for it. | [Private origin](/running/private-origin) |
| Your application | Authentication, authorisation, validation and everything else your code does. | |

Every step is encrypted: the visitor's connection to bunny.net, and bunny.net's connection to the container. A deploy has bunny.net check the container's certificate once a [readiness scan](/running/post-quantum-readiness#what-brewless-sets-for-you) verified it. Which of these connections use a post-quantum key exchange is on the **Quantum** tab of the Shield page.

The WebSocket connections of a [realtime server](/running/realtime) go straight to its container, past bunny.net, so Shield does not see them.

## Shared responsibility

| Part | Brewless | bunny.net | Scaleway | You |
| --- | --- | --- | --- | --- |
| Setting up Shield, the edge rules and origin protection from `brewless.yml` | Yes, at every deploy | | | Decide what `brewless.yml` asks |
| The managed WAF rules and bot verification | | Keeps them up to date | | Choose the sensitivity and the exceptions |
| The Shield plan and what it costs | Never changes it | Bills it to your account | | Choose it in the bunny.net dashboard |
| Network-level DDoS protection | | Yes, at its edge | Yes, for its platform | |
| The containers and the network they run on | Deploys and scales them | | Runs them | |
| Your application's code and its dependencies | Builds and deploys them, runs security updates of the runtime images | | | Keep them secure |
| Secrets | Writes them to your Secret Manager, never stores them | | Keeps them | Push them |
| `robots.txt` and what crawlers may read | Never changes it | | | Write it |
| Vulnerability scans and penetration tests | Lets the scanner's addresses past Shield for an approved [scan session](/running/security-scans), and ends it by itself | | | Have them done, agree on them, approve the session |

A web application firewall does not replace secure application code, vulnerability scans or penetration tests.

## Limits of the providers

- **A Shield zone cannot be removed.** bunny.net offers no way to; turning Shield off leaves an empty zone, which costs nothing on Basic.
- **A new Shield zone learns for a week.** Its WAF only records in that week.
- **Shield Basic** has two rate limit rules, counting windows of one or ten seconds, blocks of 30 seconds or a minute, counting per address or per hostname, no bot detection and no custom WAF rules. The paid plans have more; bunny.net bills them to your account.
- **bunny.net keeps Shield's event logs three days.** The console shows what is in them; Brewless keeps none of it.
- **Not every crawler is known to bunny.net.** See [Bots and AI crawlers](/running/bots#limits).
- **Scaleway's own Edge Services cannot reach a private container**, which is why the edge is bunny.net.

## Troubleshooting

### A rule blocks my form

See [A rule blocks my form](/running/firewall#a-rule-blocks-my-form): find the rule id in the Shield event logs and add it to `waf_log_only`.

### The container's own address answers 403

With origin protection on, Scaleway refuses every request without the edge's token. That is what it is for: use your own domain or the test address through the edge. See [Private origin](/running/private-origin).

### A search engine or AI crawler gets a challenge

A challenge comes from bot detection, which only paid Shield plans have. Allow the crawler's group under `bots`, or the crawler itself under `bots.overrides`; see [Bots and AI crawlers](/running/bots). `robots.txt`, the sitemaps, `llms.txt` and `/.well-known/` never get a challenge.

### A deploy says Shield was not updated

bunny.net did not answer. The release is live; the next deploy tries again. See [Lifecycle and drift](/running/firewall#lifecycle-and-drift).

## FAQ

**Does Shield cost anything?** Shield Basic costs nothing at bunny.net up to 25 million clean requests a month per Shield zone; cache hits and blocked requests do not count. Past that, bunny.net bills $0.70 per million to the owner of the bunny.net account. Brewless charges nothing for Shield.

**Does Brewless ever move me to a paid plan?** No. A paid plan is your choice in the bunny.net dashboard, and Brewless keeps it as it is.

**Does Shield hurt my findability?** It is set up not to: search engines and AI services are let in by default, and the paths crawlers must reach are never challenged or rate-limited. Brewless promises no indexing or place in AI answers; see [How to check it](/running/bots#how-to-check-it).

**Can I turn it off?** Yes: `firewall: false` in `brewless.yml`. See [Turning it off](/running/firewall#turning-it-off).

**What if I change a setting in the bunny.net dashboard?** A deploy keeps your change and says so; see [A setting changed in the bunny.net dashboard](/running/firewall#a-setting-changed-in-the-bunnynet-dashboard).
