AWS::WAFv2::RuleGroup Rule
A single rule, which you can use in a AWS::WAFv2::WebACL or AWS::WAFv2::RuleGroup to identify web requests that you want to manage in some way. Each rule includes one top-level Statement that AWS WAF uses to identify matching web requests, and parameters that govern how AWS WAF handles them.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Action" :
RuleAction
, "CaptchaConfig" :CaptchaConfig
, "ChallengeConfig" :ChallengeConfig
, "Name" :String
, "Priority" :Integer
, "RuleLabels" :[ Label, ... ]
, "Statement" :Statement
, "VisibilityConfig" :VisibilityConfig
}
YAML
Action:
RuleAction
CaptchaConfig:CaptchaConfig
ChallengeConfig:ChallengeConfig
Name:String
Priority:Integer
RuleLabels:- Label
Statement:Statement
VisibilityConfig:VisibilityConfig
Properties
Action
-
The action that AWS WAF should take on a web request when it matches the rule statement. Settings at the web ACL level can override the rule action setting.
Required: No
Type: RuleAction
Update requires: No interruption
CaptchaConfig
-
Specifies how AWS WAF should handle
CAPTCHA
evaluations. If you don't specify this, AWS WAF uses theCAPTCHA
configuration that's defined for the web ACL.Required: No
Type: CaptchaConfig
Update requires: No interruption
ChallengeConfig
-
Specifies how AWS WAF should handle
Challenge
evaluations. If you don't specify this, AWS WAF uses the challenge configuration that's defined for the web ACL.Required: No
Type: ChallengeConfig
Update requires: No interruption
Name
-
The name of the rule.
If you change the name of a
Rule
after you create it and you want the rule's metric name to reflect the change, update the metric name in the rule'sVisibilityConfig
settings. AWS WAF doesn't automatically update the metric name when you update the rule name.Required: Yes
Type: String
Pattern:
^[0-9A-Za-z_-]{1,128}$
Update requires: No interruption
Priority
-
If you define more than one
Rule
in aWebACL
, AWS WAF evaluates each request against theRules
in order based on the value ofPriority
. AWS WAF processes rules with lower priority first. The priorities don't need to be consecutive, but they must all be different.Required: Yes
Type: Integer
Minimum:
0
Update requires: No interruption
RuleLabels
-
Labels to apply to web requests that match the rule match statement. AWS WAF applies fully qualified labels to matching web requests. A fully qualified label is the concatenation of a label namespace and a rule label. The rule's rule group or web ACL defines the label namespace.
Rules that run after this rule in the web ACL can match against these labels using a
LabelMatchStatement
.For each label, provide a case-sensitive string containing optional namespaces and a label name, according to the following guidelines:
-
Separate each component of the label with a colon.
-
Each namespace or name can have up to 128 characters.
-
You can specify up to 5 namespaces in a label.
-
Don't use the following reserved words in your label specification:
aws
,waf
,managed
,rulegroup
,webacl
,regexpatternset
, oripset
.
For example,
myLabelName
ornameSpace1:nameSpace2:myLabelName
.Required: No
Type: Array of Label
Update requires: No interruption
-
Statement
-
The AWS WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.
Required: Yes
Type: Statement
Update requires: No interruption
VisibilityConfig
-
Defines and enables Amazon CloudWatch metrics and web request sample collection.
If you change the name of a
Rule
after you create it and you want the rule's metric name to reflect the change, update the metric name as well. AWS WAF doesn't automatically update the metric name.Required: Yes
Type: VisibilityConfig
Update requires: No interruption