Vercel Logo

What's already on

The truck's first real customer was a man named Hollis. He ordered two Maine rolls and asked, while he waited, whether the website "has security." You said yes with total confidence and no idea. Let's find out whether you were right, and where "yes" stops.

Outcome

You can name each Firewall layer in front of Claw & Order, in the order a request meets it, say what each Firewall action does to a request, and find each layer in the dashboard and the CLI.

The layers in front of the truck

Hollis was right to ask. Every request to the truck passes through the Vercel Firewall, which runs its checks in a fixed order:

request
  → DDoS mitigation        (on for every deployment, no setup)
  → Attack Mode             (off until you turn it on, Section 5)
  → Deployment Protection   (production domain stays public)
  → WAF IP blocking         (empty until you add blocks)
  → WAF custom rules        (empty until you write rules)
  → WAF managed rulesets    (Bot Protection off, AI Bots allow)
  → your Next.js app

The first layer, DDoS mitigation, watches traffic across the whole platform and blocks requests when the volume looks abnormal or suspicious. It's on for every plan, and Vercel doesn't bill you for traffic it blocks. On Hobby you can't turn it off at all, and on paid plans you'd have to go out of your way.

DDoS mitigation is good at volume. Ten thousand requests a second from a botnet is easy to spot. What it can't know is that one visitor reading /location every five minutes works for Pinchy's, the rival truck, because that visitor looks like everybody else. The WAF layers after it are yours to configure, and right now they're empty.

What a rule can do

Every layer you configure works the same way: it matches some requests and takes an action on them. There are only a handful, and the truck needs all but one:

ActionWhat the request getsWhere we use it
LogThrough, and the match is recordedEvery new rule, first
DenyA 403, before your code runsPinchy's scraper, Section 2
ChallengeA JavaScript check that browsers pass and scripts don'tBot Protection, Section 4
Rate limitA 429 once a client goes over a countThe preorder endpoint, Section 3
BypassSkips the rules after itThe payment webhook, Section 4
RedirectSent to another URLNot needed by the truck

Log is the one people skip and regret. It answers "what would this rule catch?" before it catches anything, and the answer is often "more than you meant."

HTTPS came with it

Vercel provisions certificates automatically and serves every deployment over HTTPS. Ask for the plain http:// version:

curl -sI "${URL/https/http}/location" | head -3

It redirects to https://, so nobody can read a preorder phone number off the wire.

Read the layers from the terminal

The CLI shows the Firewall's configuration in the order it runs, which is handy when you're working out which layer caught a request:

vercel firewall status

Top to bottom is the path a request takes. On a fresh project, custom rules and IP blocking are both empty.

The managed rulesets get their own command:

vercel firewall bot-management

It lists Bot Protection, AI Bots, and BotID with their current actions. We'll turn them on in Section 4. The unknown bot traffic panel will say it needs Observability Plus. That's fine; nothing in this course depends on it.

Enterprise: the OWASP core ruleset

Enterprise projects get a third managed ruleset, the OWASP core ruleset, for common attack patterns like injection attempts. Optional lesson 5.4 covers it.

Pro and Enterprise: leave system mitigations alone

On Pro and Enterprise, vercel firewall system-mitigations pause removes DDoS protection from the project, and you pay for the traffic it would have blocked. It exists for debugging rare false positives. Nothing in this course needs it.

Hands-on exercise 1.2

Find every layer in front of the truck before we add any, and the actions they'll use.

Requirements:

  1. Open the project's Firewall page in the dashboard and find the traffic view and the place where rules live.
  2. Run vercel firewall status and match each section of the output to a layer in the diagram above. Deployment Protection lives in project settings, so it won't appear there.
  3. Run vercel firewall bot-management and write down the current action for Bot Protection and AI Bots.
  4. Request the http:// version of /location and confirm it redirects to https://.
  5. For each action in the table above, say in one sentence what a customer would see if a rule took it on their request.

Implementation hints:

  • Run the CLI commands from the folder you linked in 1.1, or pass --project claw-and-order.
  • The traffic view will be close to empty. A brand-new truck has had about four customers, and two of them were you. Hollis was a third.
  • Keep the actions you wrote down in step 3. In Section 4 we'll change one and see what breaks.

Try It

Send three requests you can recognize, then find them:

for i in 1 2 3; do curl -s -o /dev/null "$URL/location"; done
vercel firewall traffic list --since 10m --dimension path

/location shows your three requests, all allowed. Every Try It from here on works this way: send traffic you know about, then find it in the report.

Done-When

  • You can point to the Firewall page's traffic view and its rules in the dashboard
  • vercel firewall status runs and shows empty custom rules and IP blocks
  • You've recorded the current actions for Bot Protection and AI Bots
  • http:// requests to the deployment redirect to https://
  • You can say which action returns a 403, which returns a 429, and which lets a request through while recording it

Troubleshooting

vercel firewall traffic list comes back empty or won't run. Traffic can take a minute to appear, so run it again first. Traffic reports are also scoped to a team. Make sure the folder is linked to the project under the team that owns it, or pass --scope <team-slug>.

The dashboard and CLI disagree about a rule. The CLI stages rule changes as drafts until you publish them, and overview and rules list show drafts alongside what's live. On a fresh project there shouldn't be any drafts. If there are, vercel firewall diff shows what's pending.

Solution

Here's the map we'll use for the rest of the course:

LayerWho sets it upWhere to see it
DDoS mitigationVercel, automaticallyvercel firewall status, Firewall page
HTTPSVercel, automaticallycurl -sI http://... redirects
WAF IP blockingYou (empty)vercel firewall ip-blocks list
WAF custom rulesYou (empty)vercel firewall rules list
Managed rulesetsYou choose the actionvercel firewall bot-management

The commands that produced it:

vercel firewall status
vercel firewall bot-management
vercel firewall overview
curl -sI "${URL/https/http}/location" | head -3

DDoS mitigation is on duty. Next, we'll send in a visitor it has no reason to stop.

Was this helpful?

supported.