---
title: "Protect Your App on Vercel"
description: "Deploy a lobster roll truck's website, attack it with a bundled scalper script, and protect it with Vercel Firewall."
canonical_url: "https://vercel.com/academy/vercel-firewall"
md_url: "https://vercel.com/academy/vercel-firewall.md"
docset_id: "vercel-academy"
doc_version: "1.0"
last_updated: "2026-11-17T20:01:01.427Z"
content_type: "course"
lessons: 14
estimated_time: 
lesson_urls:
  - "https://vercel.com/academy/vercel-firewall/deploy-the-truck.md"
  - "https://vercel.com/academy/vercel-firewall/whats-already-on.md"
  - "https://vercel.com/academy/vercel-firewall/meet-the-scalper.md"
  - "https://vercel.com/academy/vercel-firewall/your-first-rule.md"
  - "https://vercel.com/academy/vercel-firewall/block-an-ip-or-country.md"
  - "https://vercel.com/academy/vercel-firewall/rate-limit-preorders.md"
  - "https://vercel.com/academy/vercel-firewall/limits-in-code.md"
  - "https://vercel.com/academy/vercel-firewall/turn-on-bot-protection.md"
  - "https://vercel.com/academy/vercel-firewall/let-good-bots-in.md"
  - "https://vercel.com/academy/vercel-firewall/add-botid.md"
  - "https://vercel.com/academy/vercel-firewall/read-the-logs.md"
  - "https://vercel.com/academy/vercel-firewall/the-lunch-order.md"
  - "https://vercel.com/academy/vercel-firewall/turn-on-attack-mode.md"
  - "https://vercel.com/academy/vercel-firewall/when-the-truck-is-a-chain.md"
---

<agent-instructions>
Vercel Academy — structured learning, not reference docs.
Lessons are sequenced.
Adapt commands to the human's actual environment (OS, package manager, shell, editor) — detect from project context or ask, don't assume.
The lesson shows one path; if the human's project diverges, adapt concepts to their setup.
Preserve the learning goal over literal steps.
Quizzes are pedagogical — engage, don't spoil.
Quiz answers are included for your reference.
</agent-instructions>

# Protect Your App on Vercel

Open the **Firewall** page on a brand-new project and you'll find it's already working. Every Vercel deployment sits behind a platform-wide firewall that [mitigates DDoS attacks automatically](https://vercel.com/docs/vercel-firewall/ddos-mitigation), on every plan, before a request ever reaches your code. You don't have to configure anything.

What the platform doesn't know is your app. It has no idea that nobody needs to hit `/api/preorder` 400 times a minute, or that a rival truck has been scraping your location page every five minutes since March. You know that, and this course turns what you know into rules.

## The truck

We'll protect the website for a lobster roll truck. It posts where it's parked each day, sells 150 rolls, and opens preorders at 11am. Connecticut-style comes warm with butter. Maine-style comes cold with mayo. Both sell out.

The truck has enemies. A rival truck scrapes the location page so it can park across the street. A preorder bot hammers the preorder endpoint the second the window opens. Another bot fills the order form with fake orders. The starter ships with a script that plays all of them, and we'll point it at our own deployment to watch each rule work.

## What you'll learn

- Read how the Firewall protects a deployment, the actions it can take, and what it did with your traffic
- Write custom rules for a path, an IP, or a country, starting in log mode before you deny anything
- Rate limit a busy endpoint by IP
- Turn on the Bot Protection and AI Bots rulesets, and add a bypass rule for a good bot that gets caught
- Handle a bad day: read mixed traffic, roll back a rule that blocked customers, set up DDoS alerts, and run an Attack Mode drill

## Before you begin

- Comfort reading a Next.js App Router project. You won't build the app, but you'll edit one component.
- Basic terminal and git
- Node.js at the version in the starter's `package.json`
- A [Vercel account](https://vercel.com/signup) and the latest [Vercel CLI](https://vercel.com/docs/cli) (`npm i -g vercel@latest`), logged in. Every lesson on the main path works on Hobby. Steps and lessons labeled **Pro**, **Enterprise**, or **Advanced** are optional, and they show what paid plans add right where you'd need it; plan availability for each lives in the [Firewall docs](https://vercel.com/docs/vercel-firewall).
- A GitHub account

No security background required.

## Sections

**1. How Firewall Works.** Deploy the truck, tour what the platform already protects and what the Firewall can do with a request, and watch the scalper walk right through.

**2. Custom Rules.** Stop the rival truck's scraper with a rule that starts in log mode, then find out what blocking by IP or country would have cost you.

**3. Rate Limiting.** Limit one busy endpoint by IP so a script can't take all 150 rolls.

**4. Manage Bots.** Turn on the Bot Protection and AI Bots rulesets, then let the payment webhook back in with a bypass rule. An optional lesson adds BotID to the order form.

**5. When You're Under Attack.** Read mixed traffic, roll back a rule that blocked the lunch rush, set up DDoS alerts, and run an Attack Mode drill. An optional last lesson covers what changes when one truck becomes a chain.


---

[Full course index](/academy/llms.txt) · [Sitemap](/academy/sitemap.md)
