Skip to main content

firewall_config

Creates, updates, deletes, gets or lists a firewall_config resource.

Overview

Namefirewall_config
TypeResource
Idvercel.security.firewall_config

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
activeobject
draftobject
versionsarray

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectLists WAF configs for a project
updateupdateproject_id, action, value, idteam_id, slugProcess updates to modify the existing firewall config for a project
replacereplaceproject_id, firewall_enabledteam_id, slugSet the firewall configuration to provided rules and settings. Creates or overwrite the existing firewall configuration.
generate_ruleexecprojectId, teamId, slugGenerate a firewall rule from a natural language description.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
project_idstring (wire: projectId)
projectIdstring
slugstringThe Team slug to perform the request on behalf of.
teamIdstringThe Team identifier to perform the request on behalf of.
team_idstringThe Team identifier to perform the request on behalf of. (wire: teamId)

SELECT examples

Lists WAF configs for a project

SELECT
active,
draft,
versions
FROM vercel.security.firewall_config
;

UPDATE examples

Process updates to modify the existing firewall config for a project

UPDATE vercel.security.firewall_config
SET
action = '{{ action }}',
id = '{{ id }}',
value = '{{ value }}'
WHERE
project_id = '{{ project_id }}' --required
AND action = '{{ action }}' --required
AND value = '{{ value }}' --required
AND id = '{{ id }}' --required
AND team_id = '{{ team_id}}'
AND slug = '{{ slug}}';

REPLACE examples

Set the firewall configuration to provided rules and settings. Creates or overwrite the existing firewall configuration.

REPLACE vercel.security.firewall_config
SET
firewall_enabled = {{ firewall_enabled }},
managed_rules = '{{ managed_rules }}',
crs = '{{ crs }}',
rules = '{{ rules }}',
rulesets = '{{ rulesets }}',
ips = '{{ ips }}',
bot_id_enabled = {{ bot_id_enabled }},
log_headers = '{{ log_headers }}'
WHERE
project_id = '{{ project_id }}' --required
AND firewall_enabled = {{ firewall_enabled }} --required
AND team_id = '{{ team_id}}'
AND slug = '{{ slug}}'
RETURNING
active;

Lifecycle Methods

EXEC variables use wire (API) names.

Generate a firewall rule from a natural language description.

EXEC vercel.security.firewall_config.generate_rule
@projectId='{{ projectId }}',
@teamId='{{ teamId }}',
@slug='{{ slug }}'
;