PUT
/
v1
/
security
/
firewall
/
config
import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  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,
    },
  });

  // Handle the result
  console.log(result);
}

run();
{
  "active": {
    "ownerId": "<string>",
    "projectKey": "<string>",
    "id": "<string>",
    "version": 123,
    "updatedAt": "<string>",
    "firewallEnabled": true,
    "crs": {
      "sd": {
        "active": true,
        "action": "deny"
      },
      "ma": {
        "active": true,
        "action": "deny"
      },
      "lfi": {
        "active": true,
        "action": "deny"
      },
      "rfi": {
        "active": true,
        "action": "deny"
      },
      "rce": {
        "active": true,
        "action": "deny"
      },
      "php": {
        "active": true,
        "action": "deny"
      },
      "gen": {
        "active": true,
        "action": "deny"
      },
      "xss": {
        "active": true,
        "action": "deny"
      },
      "sqli": {
        "active": true,
        "action": "deny"
      },
      "sf": {
        "active": true,
        "action": "deny"
      },
      "java": {
        "active": true,
        "action": "deny"
      }
    },
    "rules": [
      {
        "id": "<string>",
        "name": "<string>",
        "description": "<string>",
        "active": true,
        "conditionGroup": [
          {
            "conditions": [
              {
                "type": "host",
                "op": "re",
                "neg": true,
                "key": "<string>",
                "value": "<string>"
              }
            ]
          }
        ],
        "action": {
          "mitigate": {
            "action": "deny",
            "rateLimit": {
              "algo": "fixed_window",
              "window": 123,
              "limit": 123,
              "keys": [
                "<string>"
              ],
              "action": "deny"
            },
            "redirect": {
              "location": "<string>",
              "permanent": true
            },
            "actionDuration": "<string>",
            "bypassSystem": true
          }
        }
      }
    ],
    "ips": [
      {
        "id": "<string>",
        "hostname": "<string>",
        "ip": "<string>",
        "notes": "<string>",
        "action": "deny"
      }
    ],
    "changes": [
      {}
    ],
    "managedRules": {}
  }
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Query Parameters

projectId
string
required
teamId
string

The Team identifier to perform the request on behalf of.

Example:

"team_1a2b3c4d5e6f7g8h9i0j1k2l"

slug
string

The Team slug to perform the request on behalf of.

Example:

"my-team-url-slug"

Body

application/json
firewallEnabled
boolean
required
managedRules
object
crs
object

Custom Ruleset

rules
object[]
ips
object[]

Response

200
application/json
active
object
required