In the following example, we send a PATCH request to the Update Firewall Configuration endpoint of the Vercel REST API security group. This request creates a new rule in your project's WAF configuration.
Both the conditionGroup and action body parameters are required fields
A common strategy to protect your web application from specific known threats, can include the following:
- Denying non-browser traffic by targeting non "Mozilla" user-agents, which helps with blocking bots and scrapers.
- Blocking traffic from certain Autonomous System Numbers (ASN) that are known to be associated with malicious activities.
To enable this on your Vercel project, create a custom rule using the following code: