public static interface Rule.Builder extends SdkPojo, CopyableBuilder<Rule.Builder,Rule>
| Modifier and Type | Method and Description |
|---|---|
default Rule.Builder |
action(Consumer<RuleAction.Builder> action)
The action that WAF should take on a web request when it matches the rule statement.
|
Rule.Builder |
action(RuleAction action)
The action that WAF should take on a web request when it matches the rule statement.
|
Rule.Builder |
captchaConfig(CaptchaConfig captchaConfig)
Specifies how WAF should handle
CAPTCHA evaluations. |
default Rule.Builder |
captchaConfig(Consumer<CaptchaConfig.Builder> captchaConfig)
Specifies how WAF should handle
CAPTCHA evaluations. |
Rule.Builder |
challengeConfig(ChallengeConfig challengeConfig)
Specifies how WAF should handle
Challenge evaluations. |
default Rule.Builder |
challengeConfig(Consumer<ChallengeConfig.Builder> challengeConfig)
Specifies how WAF should handle
Challenge evaluations. |
Rule.Builder |
name(String name)
The name of the rule.
|
default Rule.Builder |
overrideAction(Consumer<OverrideAction.Builder> overrideAction)
The action to use in the place of the action that results from the rule group evaluation.
|
Rule.Builder |
overrideAction(OverrideAction overrideAction)
The action to use in the place of the action that results from the rule group evaluation.
|
Rule.Builder |
priority(Integer priority)
If you define more than one
Rule in a WebACL, WAF evaluates each request against
the Rules in order based on the value of Priority. |
Rule.Builder |
ruleLabels(Collection<Label> ruleLabels)
Labels to apply to web requests that match the rule match statement.
|
Rule.Builder |
ruleLabels(Consumer<Label.Builder>... ruleLabels)
Labels to apply to web requests that match the rule match statement.
|
Rule.Builder |
ruleLabels(Label... ruleLabels)
Labels to apply to web requests that match the rule match statement.
|
default Rule.Builder |
statement(Consumer<Statement.Builder> statement)
The WAF processing statement for the rule, for example ByteMatchStatement or
SizeConstraintStatement.
|
Rule.Builder |
statement(Statement statement)
The WAF processing statement for the rule, for example ByteMatchStatement or
SizeConstraintStatement.
|
default Rule.Builder |
visibilityConfig(Consumer<VisibilityConfig.Builder> visibilityConfig)
Defines and enables Amazon CloudWatch metrics and web request sample collection.
|
Rule.Builder |
visibilityConfig(VisibilityConfig visibilityConfig)
Defines and enables Amazon CloudWatch metrics and web request sample collection.
|
equalsBySdkFields, sdkFieldscopyapplyMutation, buildRule.Builder name(String 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's VisibilityConfig settings. WAF doesn't
automatically update the metric name when you update the rule name.
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's VisibilityConfig settings.
WAF doesn't automatically update the metric name when you update the rule name.
Rule.Builder priority(Integer priority)
If you define more than one Rule in a WebACL, WAF evaluates each request against
the Rules in order based on the value of Priority. WAF processes rules with lower
priority first. The priorities don't need to be consecutive, but they must all be different.
priority - If you define more than one Rule in a WebACL, WAF evaluates each request
against the Rules in order based on the value of Priority. WAF processes
rules with lower priority first. The priorities don't need to be consecutive, but they must all be
different.Rule.Builder statement(Statement statement)
The WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.
statement - The WAF processing statement for the rule, for example ByteMatchStatement or
SizeConstraintStatement.default Rule.Builder statement(Consumer<Statement.Builder> statement)
The WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.
This is a convenience method that creates an instance of theStatement.Builder avoiding the need to
create one manually via Statement.builder().
When the Consumer completes, SdkBuilder.build() is called immediately and its result
is passed to statement(Statement).
statement - a consumer that will call methods on Statement.Builderstatement(Statement)Rule.Builder action(RuleAction action)
The action that 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.
This is used only for rules whose statements do not reference a rule group. Rule statements that reference a
rule group include RuleGroupReferenceStatement and ManagedRuleGroupStatement.
You must specify either this Action setting or the rule OverrideAction setting, but
not both:
If the rule statement does not reference a rule group, use this rule action setting and not the rule override action setting.
If the rule statement references a rule group, use the override action setting and not this action setting.
action - The action that 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.
This is used only for rules whose statements do not reference a rule group. Rule statements that
reference a rule group include RuleGroupReferenceStatement and
ManagedRuleGroupStatement.
You must specify either this Action setting or the rule OverrideAction
setting, but not both:
If the rule statement does not reference a rule group, use this rule action setting and not the rule override action setting.
If the rule statement references a rule group, use the override action setting and not this action setting.
default Rule.Builder action(Consumer<RuleAction.Builder> action)
The action that 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.
This is used only for rules whose statements do not reference a rule group. Rule statements that reference a
rule group include RuleGroupReferenceStatement and ManagedRuleGroupStatement.
You must specify either this Action setting or the rule OverrideAction setting, but
not both:
If the rule statement does not reference a rule group, use this rule action setting and not the rule override action setting.
If the rule statement references a rule group, use the override action setting and not this action setting.
RuleAction.Builder avoiding the need to
create one manually via RuleAction.builder().
When the Consumer completes, SdkBuilder.build() is called immediately and its result
is passed to action(RuleAction).
action - a consumer that will call methods on RuleAction.Builderaction(RuleAction)Rule.Builder overrideAction(OverrideAction overrideAction)
The action to use in the place of the action that results from the rule group evaluation. Set the override action to none to leave the result of the rule group alone. Set it to count to override the result to count only.
You can only use this for rule statements that reference a rule group, like
RuleGroupReferenceStatement and ManagedRuleGroupStatement.
This option is usually set to none. It does not affect how the rules in the rule group are evaluated. If you
want the rules in the rule group to only count matches, do not use this and instead use the rule action
override option, with Count action, in your rule group reference statement settings.
overrideAction - The action to use in the place of the action that results from the rule group evaluation. Set the
override action to none to leave the result of the rule group alone. Set it to count to override the
result to count only.
You can only use this for rule statements that reference a rule group, like
RuleGroupReferenceStatement and ManagedRuleGroupStatement.
This option is usually set to none. It does not affect how the rules in the rule group are evaluated.
If you want the rules in the rule group to only count matches, do not use this and instead use the
rule action override option, with Count action, in your rule group reference statement
settings.
default Rule.Builder overrideAction(Consumer<OverrideAction.Builder> overrideAction)
The action to use in the place of the action that results from the rule group evaluation. Set the override action to none to leave the result of the rule group alone. Set it to count to override the result to count only.
You can only use this for rule statements that reference a rule group, like
RuleGroupReferenceStatement and ManagedRuleGroupStatement.
This option is usually set to none. It does not affect how the rules in the rule group are evaluated. If you
want the rules in the rule group to only count matches, do not use this and instead use the rule action
override option, with Count action, in your rule group reference statement settings.
OverrideAction.Builder avoiding
the need to create one manually via OverrideAction.builder().
When the Consumer completes, SdkBuilder.build() is called immediately and its
result is passed to overrideAction(OverrideAction).
overrideAction - a consumer that will call methods on OverrideAction.BuilderoverrideAction(OverrideAction)Rule.Builder ruleLabels(Collection<Label> ruleLabels)
Labels to apply to web requests that match the rule match statement. 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, or
ipset.
For example, myLabelName or nameSpace1:nameSpace2:myLabelName.
ruleLabels - Labels to apply to web requests that match the rule match statement. 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, or
ipset.
For example, myLabelName or nameSpace1:nameSpace2:myLabelName.
Rule.Builder ruleLabels(Label... ruleLabels)
Labels to apply to web requests that match the rule match statement. 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, or
ipset.
For example, myLabelName or nameSpace1:nameSpace2:myLabelName.
ruleLabels - Labels to apply to web requests that match the rule match statement. 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, or
ipset.
For example, myLabelName or nameSpace1:nameSpace2:myLabelName.
Rule.Builder ruleLabels(Consumer<Label.Builder>... ruleLabels)
Labels to apply to web requests that match the rule match statement. 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, or
ipset.
For example, myLabelName or nameSpace1:nameSpace2:myLabelName.
Label.Builder avoiding the need to create one manually
via Label.builder().
When the Consumer completes,
SdkBuilder.build() is called immediately and its
result is passed to #ruleLabels(List.
ruleLabels - a consumer that will call methods on Label.Builder#ruleLabels(java.util.CollectionRule.Builder visibilityConfig(VisibilityConfig 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. WAF doesn't automatically update the metric name.
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. WAF doesn't automatically update the metric
name.
default Rule.Builder visibilityConfig(Consumer<VisibilityConfig.Builder> 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. WAF doesn't automatically update the metric name.
VisibilityConfig.Builder avoiding the
need to create one manually via VisibilityConfig.builder().
When the Consumer completes, SdkBuilder.build() is called immediately and its
result is passed to visibilityConfig(VisibilityConfig).
visibilityConfig - a consumer that will call methods on VisibilityConfig.BuildervisibilityConfig(VisibilityConfig)Rule.Builder captchaConfig(CaptchaConfig captchaConfig)
Specifies how WAF should handle CAPTCHA evaluations. If you don't specify this, WAF uses the
CAPTCHA configuration that's defined for the web ACL.
captchaConfig - Specifies how WAF should handle CAPTCHA evaluations. If you don't specify this, WAF uses
the CAPTCHA configuration that's defined for the web ACL.default Rule.Builder captchaConfig(Consumer<CaptchaConfig.Builder> captchaConfig)
Specifies how WAF should handle CAPTCHA evaluations. If you don't specify this, WAF uses the
CAPTCHA configuration that's defined for the web ACL.
CaptchaConfig.Builder avoiding the need
to create one manually via CaptchaConfig.builder().
When the Consumer completes, SdkBuilder.build() is called immediately and its
result is passed to captchaConfig(CaptchaConfig).
captchaConfig - a consumer that will call methods on CaptchaConfig.BuildercaptchaConfig(CaptchaConfig)Rule.Builder challengeConfig(ChallengeConfig challengeConfig)
Specifies how WAF should handle Challenge evaluations. If you don't specify this, WAF uses the
challenge configuration that's defined for the web ACL.
challengeConfig - Specifies how WAF should handle Challenge evaluations. If you don't specify this, WAF
uses the challenge configuration that's defined for the web ACL.default Rule.Builder challengeConfig(Consumer<ChallengeConfig.Builder> challengeConfig)
Specifies how WAF should handle Challenge evaluations. If you don't specify this, WAF uses the
challenge configuration that's defined for the web ACL.
ChallengeConfig.Builder avoiding the
need to create one manually via ChallengeConfig.builder().
When the Consumer completes, SdkBuilder.build() is called immediately and its
result is passed to challengeConfig(ChallengeConfig).
challengeConfig - a consumer that will call methods on ChallengeConfig.BuilderchallengeConfig(ChallengeConfig)Copyright © 2023. All rights reserved.