waf graphql-validation rule
Use this command to create GraphQL protection rules and configure GraphQL protection policies.
Syntax
config waf graphql-validation rule
set host-status {enable | disable}
set request-type {plain | regular}
set action {alert | alert_deny | block-period | redirect | send_403_forbidden | deny_no_log}
set severity {High Low | Medium | Info}
set trigger "<trigger_policy_name>"
set enable-introspection {enable | disable}
set enable-fragment {enable | disable}
set graphql-data-size <integer>
set alias-batch-query {enable | disable}
set alias-batch-query-number <integer>
set array-batch-query {enable | disable}
set array-batch-query-number <integer>
next
end
config waf graphql-validation policy
set enable-signature-detection {enable | disable}
config input-rule-list
set graphql_input_rule <graphql_input_rule_str>
next
end
next
end
Variable | Description | Default |
Enter a name that can be referenced by other parts of the configuration. You will use the name to select the rule in a GraphQL protection policy. |
No default. | |
host-status {enable | disable}
|
Enable to compare the GraphQL rule to the |
disable |
host "<host_name_str>"
|
Enter the name of a protected host that the |
No default. |
Select whether request-type {plain | regular} must contain either:
|
No default. |
|
Depending on your selection for request-type {plain | regular}, enter either:
Do not include the domain name, such as |
No default. |
|
action {alert | alert_deny | block-period | redirect | send_403_forbidden | deny_no_log} |
Select one of the following actions that FortiWeb performs when a request violates the rule:
Caution:FortiWeb ignores this setting when monitor-mode {enable | disable} is enabled. Note: Logging and/or alert email will occur only if enabled and configured. For details, see log disk and log alertMail. |
alert |
Enter the amount of time (in seconds) that you want to block subsequent requests from a client after FortiWeb detects a rule violation. This setting is available only when action {alert | alert_deny | block-period | redirect | send_403_forbidden | deny_no_log} is The valid range is 1–3,600 seconds. |
|
|
When rule violations are recorded in the attack log, each log message contains a Severity Level field. Select which severity level FortiWeb will use when it logs a violation of the rule:
|
Low |
|
Enter the name of the trigger, if any, to apply when the rule is violated. The maximum length is 63 characters. For details, see log trigger-policy. To display a list of existing triggers, enter: set trigger ? |
No default. |
|
Enable to allow introspection queries. |
disable | |
Enable to allow fragments. |
disable | |
It sets a limit on the size of the HTTP request body in the POST method or the size of URL parameters in the GET method. |
1024 | |
It limits the number of terminal fields within a query, thereby limiting the number of fields within objects. |
256 | |
It sets a maximum length on any user input value within a GraphQL query.
|
256 | |
It limits the depth of a GraphQL query, which limits how deeply nested the query can be. |
32 | |
Enable this option to allow alias batching. |
disable | |
It sets a limit on the number of queries that can be found within an alias batch. Only available when Alias Batching is enabled. |
8 | |
Enable this option to allow array batching | disable | |
array-batch-query-number <integer>
|
It sets a limit on the number of queries that can be found within an array batch. Only available when Array Batching is enabled. |
8 |
<graphql_policy_name> | Enter the name of a GraphQL protection policy. You will use the name to select the policy in other parts of the configuration. | No default. |
<graphql-rule-list_id> | Enter the index number of an entry to create or modify a rule for the policy. | No default. |
enable-signature-detection {enable | disable} | Enable to scan for matches with signature attacks in GraphQL API requests. | disable |
graphql_input_rule <graphql_input_rule_str> | Enter the sequence number of a GraphQL protection rule to add to the GraphQL protection policy. | No default. |