Rules

Rules allow you to allow, block, rate limit, or tag requests for an arbitrary set of conditions.

IMPORTANT: The Fastly Next-Gen WAF API is only available to customers with access to the Next-Gen WAF product in the Fastly control panel. If you have access to the Next-Gen WAF control panel, check out the Next-Gen WAF API.

Data model

actionsarray Required.
conditionsarray Required.
created_atstringDate the rule was created. Required.
descriptionstringDescription for rule. Required.
enabledbooleanTurns a rule on and off. Defaults to false (off). Required.
expires_atstringDate the rule will automatically be disabled. Field is nullable and set to null if the rule should always be enabled. If the rule is always enabled, will return undefined.
group_operatorstringConditions that must be matched when evaluating the request. Required.
idstringThe ID of the rule. Required.
request_loggingstringAvailable only for request rules. Indicates whether to store the logs for requests that match the rule's conditions (sampled) or not store them (none). Required.
signalstringThe signal name being excluded if rule type is signal and action is 'exclude_signal'.
typestringThe type of rule. Required.
updated_atstringDate the rule was last updated. Required.
fieldstringEnums for multival condition field. Refer to: https://docs.fastly.com/en/ngwaf/defining-rule-conditions#fields.
operatorstringIndicates whether the supplied conditions will check for existence or non-existence of matching field values. Refer to: https://docs.fastly.com/en/ngwaf/defining-rule-conditions#operators.
valuestringThe value to compare against the field. Refer to: https://docs.fastly.com/en/ngwaf/defining-rule-conditions#field-value-case-sensitivity.

Endpoints

List rules

GET/ngwaf/v1/workspaces/workspace_id/rules

Create rule

POST/ngwaf/v1/workspaces/workspace_id/rules

Retrieve rule

GET/ngwaf/v1/workspaces/workspace_id/rules/rule_id

Remove a rule

DELETE/ngwaf/v1/workspaces/workspace_id/rules/rule_id

Edit rule

PATCH/ngwaf/v1/workspaces/workspace_id/rules/rule_id