Templates
Pre-built rule templates for common security patterns like bot blocking and OFAC compliance.
Vercel Doorman includes pre-built rule templates for common security patterns. Templates save time by providing battle-tested configurations you can add with a single command.
Using Templates
# List all available templates
npx vercel-doorman template
# Add a specific template
npx vercel-doorman template <template-name>Templates are added to your existing configuration file. You can customize the rules after adding them.
Available Templates
bad-bots — Block Malicious Bots
Blocks common malicious bot user agents that are known to scrape, spam, or attack websites.
npx vercel-doorman template bad-botsBlocks user agents matching patterns like:
- Common scraping bots
- Known spam bots
- Vulnerability scanners
- SEO spam crawlers
ai-bots — Block AI Crawlers
Blocks AI training crawlers and scrapers that may use your content without permission.
npx vercel-doorman template ai-botsBlocks crawlers from:
- GPTBot (OpenAI)
- CCBot (Common Crawl)
- Google-Extended
- Anthropic crawlers
- Other AI training bots
wordpress — WordPress Protection
Blocks requests targeting WordPress-specific paths. Useful for non-WordPress sites that receive WordPress-targeted attacks.
npx vercel-doorman template wordpressBlocks paths like:
/wp-admin//wp-login.php/wp-content//xmlrpc.php- Other common WordPress attack vectors
block-ofac-sanctioned-countries — OFAC Compliance
Blocks traffic from OFAC-sanctioned countries for regulatory compliance.
npx vercel-doorman template block-ofac-sanctioned-countriesBlocks traffic from countries under US Treasury OFAC sanctions.
Customizing Templates
After adding a template, you can customize the generated rules in your vercel-firewall.config.json:
- Modify conditions — Adjust matching criteria
- Change actions — Switch from
denytochallengeorlog - Add exceptions — Create additional condition groups
- Disable rules — Set
"active": falseto temporarily disable
Creating Custom Templates
Templates are defined in the templates directory of the source code. Each template exports a set of rules following the standard rule format.
Related Pages
- Getting Started — Quick setup guide
- Configuration — Configuration file reference
- Examples — Real-world configuration examples
- Commands Overview — CLI command reference
This content is sourced from the GitHub Wiki.