Create an account or zone ruleset rule
Adds a new rule to an account or zone ruleset. The rule will be added to the end of the existing list of rules in the ruleset by default.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYYAPI Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
X-Auth-Email: user@example.comThe previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194Accepted Permissions (at least one required)
Mass URL Redirects WriteMagic Firewall WriteL4 DDoS Managed Ruleset WriteTransform Rules WriteSelect Configuration WriteAccount WAF WriteAccount Rulesets WriteLogs WriteParametersExpand Collapse
params RuleNewParams
Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
Query param: Validates the request without persisting changes when set to true. Responses that normally return 200 return result: null; endpoints that normally return 204 continue to return 204.
Body param: The expression defining which traffic will match the rule.
Body param: An object configuring where the rule will be placed.
Body param: An object configuring where the rule will be placed.
Body param: An object configuring the rule’s rate limit behavior.
Body param: An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
ReturnsExpand Collapse
type RuleNewResponseEnvelopeResult interface{…}A result.
A result.
type RuleNewResponseEnvelopeResult struct{…}A ruleset object.
A ruleset object.
Kind KindThe kind of the ruleset.
The kind of the ruleset.
Phase PhaseThe phase of the ruleset.
The phase of the ruleset.
Rules []RuleNewResponseEnvelopeResultRulesThe list of rules in the ruleset.
The list of rules in the ruleset.
type RuleNewResponseEnvelopeResultRulesChallengeRule struct{…}
The action to perform when the rule matches.
ExposedCredentialCheck RuleNewResponseEnvelopeResultRulesChallengeRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RuleNewResponseEnvelopeResultRulesChallengeRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type RuleNewResponseEnvelopeResultRulesJavaScriptChallengeRule struct{…}
The action to perform when the rule matches.
ExposedCredentialCheck RuleNewResponseEnvelopeResultRulesJavaScriptChallengeRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RuleNewResponseEnvelopeResultRulesJavaScriptChallengeRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRule struct{…}
The action to perform when the rule matches.
ActionParameters RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
Immutable RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersImmutableOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersImmutableSetDirective struct{…}Set the directive.
Set the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersImmutableSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersImmutableRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
MaxAge RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersMaxAgeOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersMaxAgeSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
MustRevalidate RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersMustRevalidateOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersMustRevalidateSetDirective struct{…}Set the directive.
Set the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
MustUnderstand RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersMustUnderstandOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersMustUnderstandSetDirective struct{…}Set the directive.
Set the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
NoCache RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersNoCacheOptionalA cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersNoCacheSetDirective struct{…}Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersNoCacheRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
NoStore RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersNoStoreOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersNoStoreSetDirective struct{…}Set the directive.
Set the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersNoStoreRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
NoTransform RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersNoTransformOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersNoTransformSetDirective struct{…}Set the directive.
Set the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersNoTransformRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
Private RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersPrivateOptionalA cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersPrivateSetDirective struct{…}Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersPrivateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersPrivateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
ProxyRevalidate RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersProxyRevalidateOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirective struct{…}Set the directive.
Set the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
Public RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersPublicOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersPublicSetDirective struct{…}Set the directive.
Set the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersPublicSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersPublicRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
SMaxage RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersSMaxageOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersSMaxageSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersSMaxageRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
StaleIfError RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersStaleIfErrorOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
StaleWhileRevalidate RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersStaleWhileRevalidateOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RuleNewResponseEnvelopeResultRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
ExposedCredentialCheck RuleNewResponseEnvelopeResultRulesSetCacheControlRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RuleNewResponseEnvelopeResultRulesSetCacheControlRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type RuleNewResponseEnvelopeResultRulesSetCacheTagsRule struct{…}
The action to perform when the rule matches.
ActionParameters RuleNewResponseEnvelopeResultRulesSetCacheTagsRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
type RuleNewResponseEnvelopeResultRulesSetCacheTagsRuleActionParametersAddCacheTagsValues struct{…}Add cache tags using a list of values.
Add cache tags using a list of values.
Operation RuleNewResponseEnvelopeResultRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type RuleNewResponseEnvelopeResultRulesSetCacheTagsRuleActionParametersAddCacheTagsExpression struct{…}Add cache tags using an expression.
Add cache tags using an expression.
Operation RuleNewResponseEnvelopeResultRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type RuleNewResponseEnvelopeResultRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValues struct{…}Remove cache tags using a list of values.
Remove cache tags using a list of values.
Operation RuleNewResponseEnvelopeResultRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type RuleNewResponseEnvelopeResultRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpression struct{…}Remove cache tags using an expression.
Remove cache tags using an expression.
Operation RuleNewResponseEnvelopeResultRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type RuleNewResponseEnvelopeResultRulesSetCacheTagsRuleActionParametersSetCacheTagsValues struct{…}Set cache tags using a list of values.
Set cache tags using a list of values.
Operation RuleNewResponseEnvelopeResultRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type RuleNewResponseEnvelopeResultRulesSetCacheTagsRuleActionParametersSetCacheTagsExpression struct{…}Set cache tags using an expression.
Set cache tags using an expression.
Operation RuleNewResponseEnvelopeResultRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
ExposedCredentialCheck RuleNewResponseEnvelopeResultRulesSetCacheTagsRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RuleNewResponseEnvelopeResultRulesSetCacheTagsRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type RuleNewResponseEnvelopeResultRulesTransformResponseHTMLRule struct{…}
The action to perform when the rule matches.
ActionParameters RuleNewResponseEnvelopeResultRulesTransformResponseHTMLRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
ExposedCredentialCheck RuleNewResponseEnvelopeResultRulesTransformResponseHTMLRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RuleNewResponseEnvelopeResultRulesTransformResponseHTMLRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
Create an account or zone ruleset rule
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/rulesets"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
rule, err := client.Rulesets.Rules.New(
context.TODO(),
"2f2feab2026849078ba485f918791bdc",
rulesets.RuleNewParams{
Body: rulesets.RuleNewParamsBodyBlockRule(rulesets.RuleNewParamsBodyBlockRule{
BlockRuleParam: rulesets.BlockRuleParam{
},
}),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", rule)
}
{
"errors": [
{
"message": "something bad happened",
"code": 10000,
"source": {
"pointer": "/rules/0/action"
}
}
],
"messages": [
{
"message": "something bad happened",
"code": 10000,
"source": {
"pointer": "/rules/0/action"
}
}
],
"result": {
"id": "2f2feab2026849078ba485f918791bdc",
"kind": "root",
"last_updated": "2000-01-01T00:00:00Z",
"name": "My ruleset",
"phase": "http_request_firewall_custom",
"rules": [
{
"last_updated": "2000-01-01T00:00:00Z",
"version": "1",
"id": "id",
"action": "action",
"action_parameters": {
"response": {
"content": "{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}",
"content_type": "application/json",
"status_code": 400
}
},
"categories": [
"directory-traversal"
],
"description": "Block the request.",
"enabled": true,
"exposed_credential_check": {
"password_expression": "url_decode(http.request.body.form[\\\"password\\\"][0])",
"username_expression": "url_decode(http.request.body.form[\\\"username\\\"][0])"
},
"expression": "expression",
"logging": {
"enabled": true
},
"ratelimit": {
"characteristics": [
"cf.colo.id"
],
"period": 60,
"counting_expression": "http.request.body.raw eq \"abcd\"",
"mitigation_timeout": 600,
"requests_per_period": 1000,
"requests_to_origin": true,
"score_per_period": 400,
"score_response_header_name": "my-score"
},
"ref": "ref"
}
],
"version": "1",
"description": "A description for my ruleset."
},
"success": true
}Returns Examples
{
"errors": [
{
"message": "something bad happened",
"code": 10000,
"source": {
"pointer": "/rules/0/action"
}
}
],
"messages": [
{
"message": "something bad happened",
"code": 10000,
"source": {
"pointer": "/rules/0/action"
}
}
],
"result": {
"id": "2f2feab2026849078ba485f918791bdc",
"kind": "root",
"last_updated": "2000-01-01T00:00:00Z",
"name": "My ruleset",
"phase": "http_request_firewall_custom",
"rules": [
{
"last_updated": "2000-01-01T00:00:00Z",
"version": "1",
"id": "id",
"action": "action",
"action_parameters": {
"response": {
"content": "{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}",
"content_type": "application/json",
"status_code": 400
}
},
"categories": [
"directory-traversal"
],
"description": "Block the request.",
"enabled": true,
"exposed_credential_check": {
"password_expression": "url_decode(http.request.body.form[\\\"password\\\"][0])",
"username_expression": "url_decode(http.request.body.form[\\\"username\\\"][0])"
},
"expression": "expression",
"logging": {
"enabled": true
},
"ratelimit": {
"characteristics": [
"cf.colo.id"
],
"period": 60,
"counting_expression": "http.request.body.raw eq \"abcd\"",
"mitigation_timeout": 600,
"requests_per_period": 1000,
"requests_to_origin": true,
"score_per_period": 400,
"score_response_header_name": "my-score"
},
"ref": "ref"
}
],
"version": "1",
"description": "A description for my ruleset."
},
"success": true
}