Vercel WAF Management
Learn how to use the Vercel SDK through real-life examples.
Add custom rules
In this example, you create a new custom rule to protect your application against SQL injection threats.
Modify existing rules
In this example, you update an existing custom rule’s configuration. This is useful When you need to programmatically adjust conditions, actions, or status of an existing rule.
Delete custom rules
In this example, you delete an existing custom rule.
Change rule priority
This parameter applies when you have more than one custom rule in your project. By default, the priority is determined based on the order in which the rules are added. You can change this in the Vercel dashboard by re-ordering the rules in the Firewall Configure project page or by using the endpoint below.
Custom system bypass rule
The WAF system bypass rules allow you to have specific IP addresses or CIDRs bypass the system-level mitigations such as DDoS Mitigation. For more complex filters, you can use REST API directly.
For example, to allow mobile applications to bypass the system-level mitigations, use the following code to create a Custom Rule in your project. This condition will match mobile devices as well as other clients that emit mobile user_agent
values.
Bypassing system-level mitigations with the API is currently in beta. Contact support if you would like to use it.