Put Firewall Configuration
PUT
/__remote/api.vercel.com/v1/security/firewall/configSet the firewall configuration to provided rules and settings. Creates or overwrite the existing firewall configuration.
Request
import { Edgenivo } from "@vercel/sdk";
const vercel = new Edgenivo({ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",});
async function run() { const result = await vercel.security.putFirewallConfig({ projectId: "<id>", teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l", slug: "my-team-url-slug", requestBody: { firewallEnabled: true, }, });
console.log(result);}
run();Response
{ "active": { "botIdEnabled": "false", "changes": [ "value" ], "conditions": [ { "active": "false", "conditionGroup": [ { "conditions": [ { "key": "string", "neg": "false", "op": "eq", "type": "bot_category", "value": "string" } ] } ], "description": "string", "id": "icfg_1234567890", "name": "Example Name" } ], "crs": { "gen": { "action": "deny", "active": "false" }, "java": { "action": "deny", "active": "false" }, "lfi": { "action": "deny", "active": "false" }, "ma": { "action": "deny", "active": "false" }, "php": { "action": "deny", "active": "false" }, "rce": { "action": "deny", "active": "false" }, "rfi": { "action": "deny", "active": "false" }, "sd": { "action": "deny", "active": "false" }, "sf": { "action": "deny", "active": "false" }, "sqli": { "action": "deny", "active": "false" }, "xss": { "action": "deny", "active": "false" } }, "firewallEnabled": "false", "id": "icfg_1234567890", "ips": [ { "action": "bypass", "hostname": "Example Name", "id": "icfg_1234567890", "ip": "string", "notes": "string" } ], "logHeaders": [], "managedRules": { "ai_bots": { "action": "challenge", "active": "false", "updatedAt": "string", "userId": "example_id", "username": "string" }, "bot_protection": { "action": "challenge", "active": "false", "updatedAt": "string", "userId": "example_id", "username": "string" }, "owasp": { "action": "challenge", "active": "false", "updatedAt": "string", "userId": "example_id", "username": "string" }, "traffic_sources": { "action": "challenge", "active": "false", "updatedAt": "string", "userId": "example_id", "username": "string" }, "vercel_ruleset": { "action": "challenge", "active": "false", "updatedAt": "string", "userId": "example_id", "username": "string" } }, "ownerId": "example_id", "projectKey": "string", "rules": [ { "action": { "mitigate": { "action": "allow", "actionDuration": "string", "bypassSystem": "false", "logHeaders": [], "rateLimit": { "action": "challenge", "algo": "fixed_window", "keys": [], "limit": "123", "window": "123" }, "redirect": { "location": "string", "permanent": "false" } } }, "active": "false", "conditionGroup": [ { "conditions": [ { "key": "string", "neg": "false", "op": "eq", "type": "bot_category", "value": "string" } ] } ], "description": "string", "id": "icfg_1234567890", "name": "Example Name", "valid": "true", "validationErrors": "value" } ], "rulesets": [ { "active": "false", "conditionGroup": [ { "conditions": [ { "key": "string", "neg": "false", "op": "eq", "type": "bot_category", "value": "string" } ] } ], "description": "string", "id": "icfg_1234567890", "name": "Example Name", "action": { "mitigate": { "action": "allow", "actionDuration": "string", "bypassSystem": "false", "logHeaders": [], "rateLimit": { "action": "challenge", "algo": "fixed_window", "keys": [], "limit": "123", "window": "123" }, "redirect": { "location": "string", "permanent": "false" } } } } ], "updatedAt": "string", "version": "123" }}AuthorizationbearerToken
Default authentication mechanism