firewall_config
Creates, updates, deletes, gets or lists a firewall_config resource.
Overview
| Name | firewall_config |
| Type | Resource |
| Id | vercel.security.firewall_config |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
active | object | |
draft | object | |
versions | array |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | Lists WAF configs for a project | ||
update | update | project_id, action, value, id | team_id, slug | Process updates to modify the existing firewall config for a project |
replace | replace | project_id, firewall_enabled | team_id, slug | Set the firewall configuration to provided rules and settings. Creates or overwrite the existing firewall configuration. |
generate_rule | exec | projectId, teamId, slug | Generate 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.
| Name | Datatype | Description |
|---|---|---|
project_id | string | (wire: projectId) |
projectId | string | |
slug | string | The Team slug to perform the request on behalf of. |
teamId | string | The Team identifier to perform the request on behalf of. |
team_id | string | The Team identifier to perform the request on behalf of. (wire: teamId) |
SELECT examples
- get
Lists WAF configs for a project
SELECT
active,
draft,
versions
FROM vercel.security.firewall_config
;
UPDATE examples
- update
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
- replace
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_rule
Generate a firewall rule from a natural language description.
EXEC vercel.security.firewall_config.generate_rule
@projectId='{{ projectId }}',
@teamId='{{ teamId }}',
@slug='{{ slug }}'
;