Before deploying a new rule, you need to test it to make sure you don’t accidentally block legitimate requests.
In previous sections, you used Block and Allow when defining actions for evaluating requests. Additionally, you have another option which is Count. Count allows you to evaluate the number of requests that match your rule conditions.
Count is not a blocking action. When a request matches a rule with a Count action, the Web ACL will continue processing other rules.
You have defined a new rule for your WAF. Before deploying it, you need to test it first. This is to reduce the risk of accidentally blocking legitimate requests.
The rule below will block requests with the username query parameter.




{
"Name": "count-von-count",
"Priority": 4,
"Action": {
"Count": {}
},
"VisibilityConfig": {
"SampledRequestsEnabled": true,
"CloudWatchMetricsEnabled": true,
"MetricName": "count-von-count"
},
"Statement": {
"SizeConstraintStatement": {
"FieldToMatch": {
"SingleQueryArgument": {
"Name": "username"
}
},
"ComparisonOperator": "GT",
"Size": 0,
"TextTransformations": [
{
"Type": "NONE",
"Priority": 4
}
]
}
}
}


curl "<Your Juice Shop URL>?username=admin"



