amazonka-wafv2-2.0: Amazon WAFV2 SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.WAFV2.Types.Rule

Description

 
Synopsis

Documentation

data Rule Source #

A single rule, which you can use in a WebACL or RuleGroup to identify web requests that you want to allow, block, or count. Each rule includes one top-level Statement that WAF uses to identify matching web requests, and parameters that govern how WAF handles them.

See: newRule smart constructor.

Constructors

Rule' 

Fields

  • action :: Maybe RuleAction

    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.
  • captchaConfig :: Maybe 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.

  • challengeConfig :: Maybe 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.

  • overrideAction :: Maybe 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.

  • ruleLabels :: Maybe [Label]

    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.

  • name :: Text

    The name of the rule. You can't change the name of a Rule after you create it.

  • priority :: Natural

    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.

  • statement :: Statement

    The WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.

  • visibilityConfig :: VisibilityConfig

    Defines and enables Amazon CloudWatch metrics and web request sample collection.

Instances

Instances details
FromJSON Rule Source # 
Instance details

Defined in Amazonka.WAFV2.Types.Rule

ToJSON Rule Source # 
Instance details

Defined in Amazonka.WAFV2.Types.Rule

Generic Rule Source # 
Instance details

Defined in Amazonka.WAFV2.Types.Rule

Associated Types

type Rep Rule :: Type -> Type #

Methods

from :: Rule -> Rep Rule x #

to :: Rep Rule x -> Rule #

Read Rule Source # 
Instance details

Defined in Amazonka.WAFV2.Types.Rule

Show Rule Source # 
Instance details

Defined in Amazonka.WAFV2.Types.Rule

Methods

showsPrec :: Int -> Rule -> ShowS #

show :: Rule -> String #

showList :: [Rule] -> ShowS #

NFData Rule Source # 
Instance details

Defined in Amazonka.WAFV2.Types.Rule

Methods

rnf :: Rule -> () #

Eq Rule Source # 
Instance details

Defined in Amazonka.WAFV2.Types.Rule

Methods

(==) :: Rule -> Rule -> Bool #

(/=) :: Rule -> Rule -> Bool #

Hashable Rule Source # 
Instance details

Defined in Amazonka.WAFV2.Types.Rule

Methods

hashWithSalt :: Int -> Rule -> Int #

hash :: Rule -> Int #

type Rep Rule Source # 
Instance details

Defined in Amazonka.WAFV2.Types.Rule

newRule Source #

Create a value of Rule with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:action:Rule', rule_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.

$sel:captchaConfig:Rule', rule_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.

$sel:challengeConfig:Rule', rule_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.

$sel:overrideAction:Rule', rule_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.

$sel:ruleLabels:Rule', rule_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, rule_name - The name of the rule. You can't change the name of a Rule after you create it.

$sel:priority:Rule', rule_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.

$sel:statement:Rule', rule_statement - The WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.

$sel:visibilityConfig:Rule', rule_visibilityConfig - Defines and enables Amazon CloudWatch metrics and web request sample collection.

rule_action :: Lens' Rule (Maybe RuleAction) Source #

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.

rule_captchaConfig :: Lens' Rule (Maybe CaptchaConfig) Source #

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.

rule_challengeConfig :: Lens' Rule (Maybe ChallengeConfig) Source #

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.

rule_overrideAction :: Lens' Rule (Maybe OverrideAction) Source #

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.

rule_ruleLabels :: Lens' Rule (Maybe [Label]) Source #

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_name :: Lens' Rule Text Source #

The name of the rule. You can't change the name of a Rule after you create it.

rule_priority :: Lens' Rule Natural Source #

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_statement :: Lens' Rule Statement Source #

The WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.

rule_visibilityConfig :: Lens' Rule VisibilityConfig Source #

Defines and enables Amazon CloudWatch metrics and web request sample collection.