CfnRuleGroup

class aws_cdk.aws_wafv2.CfnRuleGroup(scope_, id, *, capacity, scope, visibility_config, available_labels=None, consumed_labels=None, custom_response_bodies=None, description=None, name=None, rules=None, tags=None)

Bases: CfnResource

A CloudFormation AWS::WAFv2::RuleGroup.

This is the latest version of AWS WAF , named AWS WAF V2, released in November, 2019. For information, including how to migrate your AWS WAF resources from the prior release, see the AWS WAF Developer Guide .

Use an RuleGroup to define a collection of rules for inspecting and controlling web requests. You use a rule group in an WebACL by providing its Amazon Resource Name (ARN) to the rule statement RuleGroupReferenceStatement , when you add rules to the web ACL.

When you create a rule group, you define an immutable capacity limit. If you update a rule group, you must stay within the capacity. This allows others to reuse the rule group with confidence in its capacity requirements.

CloudformationResource:

AWS::WAFv2::RuleGroup

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-rulegroup.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any
# allow: Any
# all_query_arguments: Any
# block: Any
# captcha: Any
# challenge: Any
# count: Any
# method: Any
# query_string: Any
# single_header: Any
# single_query_argument: Any
# statement_property_: wafv2.CfnRuleGroup.StatementProperty
# uri_path: Any

cfn_rule_group = wafv2.CfnRuleGroup(self, "MyCfnRuleGroup",
    capacity=123,
    scope="scope",
    visibility_config=wafv2.CfnRuleGroup.VisibilityConfigProperty(
        cloud_watch_metrics_enabled=False,
        metric_name="metricName",
        sampled_requests_enabled=False
    ),

    # the properties below are optional
    available_labels=[wafv2.CfnRuleGroup.LabelSummaryProperty(
        name="name"
    )],
    consumed_labels=[wafv2.CfnRuleGroup.LabelSummaryProperty(
        name="name"
    )],
    custom_response_bodies={
        "custom_response_bodies_key": wafv2.CfnRuleGroup.CustomResponseBodyProperty(
            content="content",
            content_type="contentType"
        )
    },
    description="description",
    name="name",
    rules=[wafv2.CfnRuleGroup.RuleProperty(
        name="name",
        priority=123,
        statement=wafv2.CfnRuleGroup.StatementProperty(
            and_statement=wafv2.CfnRuleGroup.AndStatementProperty(
                statements=[statement_property_]
            ),
            byte_match_statement=wafv2.CfnRuleGroup.ByteMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                positional_constraint="positionalConstraint",
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )],

                # the properties below are optional
                search_string="searchString",
                search_string_base64="searchStringBase64"
            ),
            geo_match_statement=wafv2.CfnRuleGroup.GeoMatchStatementProperty(
                country_codes=["countryCodes"],
                forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                    fallback_behavior="fallbackBehavior",
                    header_name="headerName"
                )
            ),
            ip_set_reference_statement={
                "arn": "arn",

                # the properties below are optional
                "ip_set_forwarded_ip_config": {
                    "fallback_behavior": "fallbackBehavior",
                    "header_name": "headerName",
                    "position": "position"
                }
            },
            label_match_statement=wafv2.CfnRuleGroup.LabelMatchStatementProperty(
                key="key",
                scope="scope"
            ),
            not_statement=wafv2.CfnRuleGroup.NotStatementProperty(
                statement=statement_property_
            ),
            or_statement=wafv2.CfnRuleGroup.OrStatementProperty(
                statements=[statement_property_]
            ),
            rate_based_statement=wafv2.CfnRuleGroup.RateBasedStatementProperty(
                aggregate_key_type="aggregateKeyType",
                limit=123,

                # the properties below are optional
                forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                    fallback_behavior="fallbackBehavior",
                    header_name="headerName"
                ),
                scope_down_statement=statement_property_
            ),
            regex_match_statement=wafv2.CfnRuleGroup.RegexMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                regex_string="regexString",
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            ),
            regex_pattern_set_reference_statement=wafv2.CfnRuleGroup.RegexPatternSetReferenceStatementProperty(
                arn="arn",
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            ),
            size_constraint_statement=wafv2.CfnRuleGroup.SizeConstraintStatementProperty(
                comparison_operator="comparisonOperator",
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                size=123,
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            ),
            sqli_match_statement=wafv2.CfnRuleGroup.SqliMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )],

                # the properties below are optional
                sensitivity_level="sensitivityLevel"
            ),
            xss_match_statement=wafv2.CfnRuleGroup.XssMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            )
        ),
        visibility_config=wafv2.CfnRuleGroup.VisibilityConfigProperty(
            cloud_watch_metrics_enabled=False,
            metric_name="metricName",
            sampled_requests_enabled=False
        ),

        # the properties below are optional
        action=wafv2.CfnRuleGroup.RuleActionProperty(
            allow=allow,
            block=block,
            captcha=captcha,
            challenge=challenge,
            count=count
        ),
        captcha_config=wafv2.CfnRuleGroup.CaptchaConfigProperty(
            immunity_time_property=wafv2.CfnRuleGroup.ImmunityTimePropertyProperty(
                immunity_time=123
            )
        ),
        challenge_config=wafv2.CfnRuleGroup.ChallengeConfigProperty(
            immunity_time_property=wafv2.CfnRuleGroup.ImmunityTimePropertyProperty(
                immunity_time=123
            )
        ),
        rule_labels=[wafv2.CfnRuleGroup.LabelProperty(
            name="name"
        )]
    )],
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Create a new AWS::WAFv2::RuleGroup.

Parameters:
  • scope (str) –

    • scope in which this resource is defined.

  • id (str) –

    • scoped id of the resource.

  • capacity (Union[int, float]) – The web ACL capacity units (WCUs) required for this rule group. When you create your own rule group, you define this, and you cannot change it after creation. When you add or modify the rules in a rule group, AWS WAF enforces this limit. AWS WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. AWS WAF calculates capacity differently for each rule type, to reflect the relative cost of each rule. Simple rules that cost little to run use fewer WCUs than more complex rules that use more processing power. Rule group capacity is fixed at creation, which helps users plan their web ACL WCU usage when they use a rule group. The WCU limit for web ACLs is 1,500.

  • scope – Specifies whether this is for an Amazon CloudFront distribution or for a regional application. A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AWS AppSync GraphQL API, an Amazon Cognito user pool, or an AWS App Runner service. Valid Values are CLOUDFRONT and REGIONAL . .. epigraph:: For CLOUDFRONT , you must create your WAFv2 resources in the US East (N. Virginia) Region, us-east-1 .

  • visibility_config (Union[IResolvable, VisibilityConfigProperty, Dict[str, Any]]) – Defines and enables Amazon CloudWatch metrics and web request sample collection.

  • available_labels (Union[IResolvable, Sequence[Union[IResolvable, LabelSummaryProperty, Dict[str, Any]]], None]) – The labels that one or more rules in this rule group add to matching web requests. These labels are defined in the RuleLabels for a Rule .

  • consumed_labels (Union[IResolvable, Sequence[Union[IResolvable, LabelSummaryProperty, Dict[str, Any]]], None]) – The labels that one or more rules in this rule group match against in label match statements. These labels are defined in a LabelMatchStatement specification, in the Statement definition of a rule.

  • custom_response_bodies (Union[IResolvable, Mapping[str, Union[IResolvable, CustomResponseBodyProperty, Dict[str, Any]]], None]) – A map of custom response keys and content bodies. When you create a rule with a block action, you can send a custom response to the web request. You define these for the rule group, and then use them in the rules that you define in the rule group. For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF Developer Guide . For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .

  • description (Optional[str]) – A description of the rule group that helps with identification.

  • name (Optional[str]) – The name of the rule group. You cannot change the name of a rule group after you create it.

  • rules (Union[IResolvable, Sequence[Union[IResolvable, RuleProperty, Dict[str, Any]]], None]) – The rule statements used to identify the web requests that you want to allow, block, or count. 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.

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – Key:value pairs associated with an AWS resource. The key:value pair can be anything you define. Typically, the tag key represents a category (such as “environment”) and the tag value represents a specific value within that category (such as “test,” “development,” or “production”). You can add up to 50 tags to each AWS resource. .. epigraph:: To modify tags on existing resources, use the AWS WAF APIs or command line interface. With AWS CloudFormation , you can only add tags to AWS WAF resources during resource creation.

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters:

path (str) – The path of the value to delete.

Return type:

None

add_depends_on(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters:

target (CfnResource) –

Return type:

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters:
  • key (str) –

  • value (Any) –

See:

Return type:

None

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
   "GlobalSecondaryIndexes": [
     {
       "Projection": {
         "NonKeyAttributes": [ "myattribute" ]
         ...
       }
       ...
     },
     {
       "ProjectionType": "INCLUDE"
       ...
     },
   ]
   ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters:
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type:

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters:

property_path (str) – The path to the property.

Return type:

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters:
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type:

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.

Return type:

None

get_att(attribute_name)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters:

attribute_name (str) – The name of the attribute.

Return type:

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters:

key (str) –

See:

Return type:

Any

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters:

inspector (TreeInspector) –

  • tree inspector to collect and process attributes.

Return type:

None

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters:

new_logical_id (str) – The new logical ID to use for this stack element.

Return type:

None

to_string()

Returns a string representation of this construct.

Return type:

str

Returns:

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::WAFv2::RuleGroup'
attr_arn

The Amazon Resource Name (ARN) of the rule group.

CloudformationAttribute:

Arn

attr_id

The ID of the rule group.

CloudformationAttribute:

Id

attr_label_namespace

The label namespace prefix for this rule group.

All labels added by rules in this rule group have this prefix.

The syntax for the label namespace prefix for a rule group is the following: awswaf:<account ID>:rule group:<rule group name>:

When a rule with a label matches a web request, AWS WAF adds the fully qualified label to the request. A fully qualified label is made up of the label namespace from the rule group or web ACL where the rule is defined and the label from the rule, separated by a colon.

CloudformationAttribute:

LabelNamespace

available_labels

The labels that one or more rules in this rule group add to matching web requests.

These labels are defined in the RuleLabels for a Rule .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-rulegroup.html#cfn-wafv2-rulegroup-availablelabels

capacity

The web ACL capacity units (WCUs) required for this rule group.

When you create your own rule group, you define this, and you cannot change it after creation. When you add or modify the rules in a rule group, AWS WAF enforces this limit.

AWS WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. AWS WAF calculates capacity differently for each rule type, to reflect the relative cost of each rule. Simple rules that cost little to run use fewer WCUs than more complex rules that use more processing power. Rule group capacity is fixed at creation, which helps users plan their web ACL WCU usage when they use a rule group. The WCU limit for web ACLs is 1,500.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-rulegroup.html#cfn-wafv2-rulegroup-capacity

cfn_options

Options for this resource, such as condition, update policy etc.

cfn_resource_type

AWS resource type.

consumed_labels

The labels that one or more rules in this rule group match against in label match statements.

These labels are defined in a LabelMatchStatement specification, in the Statement definition of a rule.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-rulegroup.html#cfn-wafv2-rulegroup-consumedlabels

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

custom_response_bodies

A map of custom response keys and content bodies.

When you create a rule with a block action, you can send a custom response to the web request. You define these for the rule group, and then use them in the rules that you define in the rule group.

For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF Developer Guide .

For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-rulegroup.html#cfn-wafv2-rulegroup-customresponsebodies

description

A description of the rule group that helps with identification.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-rulegroup.html#cfn-wafv2-rulegroup-description

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Returns:

the logical ID as a stringified token. This value will only get resolved during synthesis.

name

The name of the rule group.

You cannot change the name of a rule group after you create it.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-rulegroup.html#cfn-wafv2-rulegroup-name

node

The construct tree node associated with this construct.

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

rules

The rule statements used to identify the web requests that you want to allow, block, or count.

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.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-rulegroup.html#cfn-wafv2-rulegroup-rules

scope

Specifies whether this is for an Amazon CloudFront distribution or for a regional application.

A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AWS AppSync GraphQL API, an Amazon Cognito user pool, or an AWS App Runner service. Valid Values are CLOUDFRONT and REGIONAL . .. epigraph:

For ``CLOUDFRONT`` , you must create your WAFv2 resources in the US East (N. Virginia) Region, ``us-east-1`` .
Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-rulegroup.html#cfn-wafv2-rulegroup-scope

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

tags

value pairs associated with an AWS resource.

The key:value pair can be anything you define. Typically, the tag key represents a category (such as “environment”) and the tag value represents a specific value within that category (such as “test,” “development,” or “production”). You can add up to 50 tags to each AWS resource. .. epigraph:

To modify tags on existing resources, use the AWS WAF APIs or command line interface. With AWS CloudFormation , you can only add tags to AWS WAF resources during resource creation.
Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-rulegroup.html#cfn-wafv2-rulegroup-tags

Type:

Key

visibility_config

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

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-rulegroup.html#cfn-wafv2-rulegroup-visibilityconfig

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters:

x (Any) –

Return type:

bool

Returns:

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(construct)

Check whether the given construct is a CfnResource.

Parameters:

construct (IConstruct) –

Return type:

bool

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool

AllowProperty

class CfnRuleGroup.AllowProperty(*, custom_request_handling=None)

Bases: object

Parameters:

custom_request_handling (Union[IResolvable, CustomRequestHandlingProperty, Dict[str, Any], None]) – CfnRuleGroup.AllowProperty.CustomRequestHandling.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-allowaction.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

allow_property = wafv2.CfnRuleGroup.AllowProperty(
    custom_request_handling=wafv2.CfnRuleGroup.CustomRequestHandlingProperty(
        insert_headers=[wafv2.CfnRuleGroup.CustomHTTPHeaderProperty(
            name="name",
            value="value"
        )]
    )
)

Attributes

custom_request_handling

CfnRuleGroup.AllowProperty.CustomRequestHandling.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-allowaction.html#cfn-wafv2-rulegroup-allowaction-customrequesthandling

AndStatementProperty

class CfnRuleGroup.AndStatementProperty(*, statements)

Bases: object

A logical rule statement used to combine other rule statements with AND logic.

You provide more than one Statement within the AndStatement .

Parameters:

statements (Union[IResolvable, Sequence[Union[IResolvable, StatementProperty, Dict[str, Any]]]]) – The statements to combine with AND logic. You can use any statements that can be nested.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-andstatement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any
# all_query_arguments: Any
# method: Any
# query_string: Any
# single_header: Any
# single_query_argument: Any
# statement_property_: wafv2.CfnRuleGroup.StatementProperty
# uri_path: Any

and_statement_property = wafv2.CfnRuleGroup.AndStatementProperty(
    statements=[wafv2.CfnRuleGroup.StatementProperty(
        and_statement=wafv2.CfnRuleGroup.AndStatementProperty(
            statements=[statement_property_]
        ),
        byte_match_statement=wafv2.CfnRuleGroup.ByteMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            positional_constraint="positionalConstraint",
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )],

            # the properties below are optional
            search_string="searchString",
            search_string_base64="searchStringBase64"
        ),
        geo_match_statement=wafv2.CfnRuleGroup.GeoMatchStatementProperty(
            country_codes=["countryCodes"],
            forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                fallback_behavior="fallbackBehavior",
                header_name="headerName"
            )
        ),
        ip_set_reference_statement={
            "arn": "arn",

            # the properties below are optional
            "ip_set_forwarded_ip_config": {
                "fallback_behavior": "fallbackBehavior",
                "header_name": "headerName",
                "position": "position"
            }
        },
        label_match_statement=wafv2.CfnRuleGroup.LabelMatchStatementProperty(
            key="key",
            scope="scope"
        ),
        not_statement=wafv2.CfnRuleGroup.NotStatementProperty(
            statement=statement_property_
        ),
        or_statement=wafv2.CfnRuleGroup.OrStatementProperty(
            statements=[statement_property_]
        ),
        rate_based_statement=wafv2.CfnRuleGroup.RateBasedStatementProperty(
            aggregate_key_type="aggregateKeyType",
            limit=123,

            # the properties below are optional
            forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                fallback_behavior="fallbackBehavior",
                header_name="headerName"
            ),
            scope_down_statement=statement_property_
        ),
        regex_match_statement=wafv2.CfnRuleGroup.RegexMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            regex_string="regexString",
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        ),
        regex_pattern_set_reference_statement=wafv2.CfnRuleGroup.RegexPatternSetReferenceStatementProperty(
            arn="arn",
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        ),
        size_constraint_statement=wafv2.CfnRuleGroup.SizeConstraintStatementProperty(
            comparison_operator="comparisonOperator",
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            size=123,
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        ),
        sqli_match_statement=wafv2.CfnRuleGroup.SqliMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )],

            # the properties below are optional
            sensitivity_level="sensitivityLevel"
        ),
        xss_match_statement=wafv2.CfnRuleGroup.XssMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        )
    )]
)

Attributes

statements

The statements to combine with AND logic.

You can use any statements that can be nested.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-andstatement.html#cfn-wafv2-rulegroup-andstatement-statements

BlockProperty

class CfnRuleGroup.BlockProperty(*, custom_response=None)

Bases: object

Parameters:

custom_response (Union[IResolvable, CustomResponseProperty, Dict[str, Any], None]) – CfnRuleGroup.BlockProperty.CustomResponse.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-blockaction.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

block_property = wafv2.CfnRuleGroup.BlockProperty(
    custom_response=wafv2.CfnRuleGroup.CustomResponseProperty(
        response_code=123,

        # the properties below are optional
        custom_response_body_key="customResponseBodyKey",
        response_headers=[wafv2.CfnRuleGroup.CustomHTTPHeaderProperty(
            name="name",
            value="value"
        )]
    )
)

Attributes

custom_response

CfnRuleGroup.BlockProperty.CustomResponse.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-blockaction.html#cfn-wafv2-rulegroup-blockaction-customresponse

BodyProperty

class CfnRuleGroup.BodyProperty(*, oversize_handling=None)

Bases: object

Inspect the body of the web request. The body immediately follows the request headers.

This is used to indicate the web request component to inspect, in the FieldToMatch specification.

Parameters:

oversize_handling (Optional[str]) – What AWS WAF should do if the body is larger than AWS WAF can inspect. AWS WAF does not support inspecting the entire contents of the web request body if the body exceeds the limit for the resource type. If the body is larger than the limit, the underlying host service only forwards the contents that are below the limit to AWS WAF for inspection. The default limit is 8 KB (8,192 kilobytes) for regional resources and 16 KB (16,384 kilobytes) for CloudFront distributions. For CloudFront distributions, you can increase the limit in the web ACL AssociationConfig , for additional processing fees. The options for oversize handling are the following: - CONTINUE - Inspect the available body contents normally, according to the rule inspection criteria. - MATCH - Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request. - NO_MATCH - Treat the web request as not matching the rule statement. You can combine the MATCH or NO_MATCH settings for oversize handling with your rule and web ACL action settings, so that you block any request whose body is over the limit. Default: CONTINUE

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-body.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

body_property = wafv2.CfnRuleGroup.BodyProperty(
    oversize_handling="oversizeHandling"
)

Attributes

oversize_handling

What AWS WAF should do if the body is larger than AWS WAF can inspect.

AWS WAF does not support inspecting the entire contents of the web request body if the body exceeds the limit for the resource type. If the body is larger than the limit, the underlying host service only forwards the contents that are below the limit to AWS WAF for inspection.

The default limit is 8 KB (8,192 kilobytes) for regional resources and 16 KB (16,384 kilobytes) for CloudFront distributions. For CloudFront distributions, you can increase the limit in the web ACL AssociationConfig , for additional processing fees.

The options for oversize handling are the following:

  • CONTINUE - Inspect the available body contents normally, according to the rule inspection criteria.

  • MATCH - Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request.

  • NO_MATCH - Treat the web request as not matching the rule statement.

You can combine the MATCH or NO_MATCH settings for oversize handling with your rule and web ACL action settings, so that you block any request whose body is over the limit.

Default: CONTINUE

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-body.html#cfn-wafv2-rulegroup-body-oversizehandling

ByteMatchStatementProperty

class CfnRuleGroup.ByteMatchStatementProperty(*, field_to_match, positional_constraint, text_transformations, search_string=None, search_string_base64=None)

Bases: object

A rule statement that defines a string match search for AWS WAF to apply to web requests.

The byte match statement provides the bytes to search for, the location in requests that you want AWS WAF to search, and other settings. The bytes to search for are typically a string that corresponds with ASCII characters. In the AWS WAF console and the developer guide, this is called a string match statement.

Parameters:
  • field_to_match (Union[IResolvable, FieldToMatchProperty, Dict[str, Any]]) – The part of the web request that you want AWS WAF to inspect.

  • positional_constraint (str) – The area within the portion of the web request that you want AWS WAF to search for SearchString . Valid values include the following: CONTAINS The specified part of the web request must include the value of SearchString , but the location doesn’t matter. CONTAINS_WORD The specified part of the web request must include the value of SearchString , and SearchString must contain only alphanumeric characters or underscore (A-Z, a-z, 0-9, or _). In addition, SearchString must be a word, which means that both of the following are true: - SearchString is at the beginning of the specified part of the web request or is preceded by a character other than an alphanumeric character or underscore (_). Examples include the value of a header and ;BadBot . - SearchString is at the end of the specified part of the web request or is followed by a character other than an alphanumeric character or underscore (_), for example, BadBot; and -BadBot; . EXACTLY The value of the specified part of the web request must exactly match the value of SearchString . STARTS_WITH The value of SearchString must appear at the beginning of the specified part of the web request. ENDS_WITH The value of SearchString must appear at the end of the specified part of the web request.

  • text_transformations (Union[IResolvable, Sequence[Union[IResolvable, TextTransformationProperty, Dict[str, Any]]]]) – Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by FieldToMatch , starting from the lowest priority setting, before inspecting the content for a match.

  • search_string (Optional[str]) – A string value that you want AWS WAF to search for. AWS WAF searches only in the part of web requests that you designate for inspection in FieldToMatch . The maximum length of the value is 200 bytes. For alphabetic characters A-Z and a-z, the value is case sensitive. Don’t encode this string. Provide the value that you want AWS WAF to search for. AWS CloudFormation automatically base64 encodes the value for you. For example, suppose the value of Type is HEADER and the value of Data is User-Agent . If you want to search the User-Agent header for the value BadBot , you provide the string BadBot in the value of SearchString . You must specify either SearchString or SearchStringBase64 in a ByteMatchStatement .

  • search_string_base64 (Optional[str]) – String to search for in a web request component, base64-encoded. If you don’t want to encode the string, specify the unencoded value in SearchString instead. You must specify either SearchString or SearchStringBase64 in a ByteMatchStatement .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any
# all_query_arguments: Any
# method: Any
# query_string: Any
# single_header: Any
# single_query_argument: Any
# uri_path: Any

byte_match_statement_property = wafv2.CfnRuleGroup.ByteMatchStatementProperty(
    field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
        all_query_arguments=all_query_arguments,
        body=wafv2.CfnRuleGroup.BodyProperty(
            oversize_handling="oversizeHandling"
        ),
        cookies=wafv2.CfnRuleGroup.CookiesProperty(
            match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                all=all,
                excluded_cookies=["excludedCookies"],
                included_cookies=["includedCookies"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        headers=wafv2.CfnRuleGroup.HeadersProperty(
            match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                all=all,
                excluded_headers=["excludedHeaders"],
                included_headers=["includedHeaders"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
            match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                all=all,
                included_paths=["includedPaths"]
            ),
            match_scope="matchScope",

            # the properties below are optional
            invalid_fallback_behavior="invalidFallbackBehavior",
            oversize_handling="oversizeHandling"
        ),
        method=method,
        query_string=query_string,
        single_header=single_header,
        single_query_argument=single_query_argument,
        uri_path=uri_path
    ),
    positional_constraint="positionalConstraint",
    text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
        priority=123,
        type="type"
    )],

    # the properties below are optional
    search_string="searchString",
    search_string_base64="searchStringBase64"
)

Attributes

field_to_match

The part of the web request that you want AWS WAF to inspect.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html#cfn-wafv2-rulegroup-bytematchstatement-fieldtomatch

positional_constraint

The area within the portion of the web request that you want AWS WAF to search for SearchString .

Valid values include the following:

CONTAINS

The specified part of the web request must include the value of SearchString , but the location doesn’t matter.

CONTAINS_WORD

The specified part of the web request must include the value of SearchString , and SearchString must contain only alphanumeric characters or underscore (A-Z, a-z, 0-9, or _). In addition, SearchString must be a word, which means that both of the following are true:

  • SearchString is at the beginning of the specified part of the web request or is preceded by a character other than an alphanumeric character or underscore (_). Examples include the value of a header and ;BadBot .

  • SearchString is at the end of the specified part of the web request or is followed by a character other than an alphanumeric character or underscore (_), for example, BadBot; and -BadBot; .

EXACTLY

The value of the specified part of the web request must exactly match the value of SearchString .

STARTS_WITH

The value of SearchString must appear at the beginning of the specified part of the web request.

ENDS_WITH

The value of SearchString must appear at the end of the specified part of the web request.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html#cfn-wafv2-rulegroup-bytematchstatement-positionalconstraint

search_string

A string value that you want AWS WAF to search for.

AWS WAF searches only in the part of web requests that you designate for inspection in FieldToMatch . The maximum length of the value is 200 bytes. For alphabetic characters A-Z and a-z, the value is case sensitive.

Don’t encode this string. Provide the value that you want AWS WAF to search for. AWS CloudFormation automatically base64 encodes the value for you.

For example, suppose the value of Type is HEADER and the value of Data is User-Agent . If you want to search the User-Agent header for the value BadBot , you provide the string BadBot in the value of SearchString .

You must specify either SearchString or SearchStringBase64 in a ByteMatchStatement .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html#cfn-wafv2-rulegroup-bytematchstatement-searchstring

search_string_base64

String to search for in a web request component, base64-encoded.

If you don’t want to encode the string, specify the unencoded value in SearchString instead.

You must specify either SearchString or SearchStringBase64 in a ByteMatchStatement .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html#cfn-wafv2-rulegroup-bytematchstatement-searchstringbase64

text_transformations

Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection.

If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by FieldToMatch , starting from the lowest priority setting, before inspecting the content for a match.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html#cfn-wafv2-rulegroup-bytematchstatement-texttransformations

CaptchaConfigProperty

class CfnRuleGroup.CaptchaConfigProperty(*, immunity_time_property=None)

Bases: object

Specifies how AWS WAF should handle CAPTCHA evaluations.

This is available at the web ACL level and in each rule.

Parameters:

immunity_time_property (Union[IResolvable, ImmunityTimePropertyProperty, Dict[str, Any], None]) – Determines how long a CAPTCHA timestamp in the token remains valid after the client successfully solves a CAPTCHA puzzle.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-captchaconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

captcha_config_property = wafv2.CfnRuleGroup.CaptchaConfigProperty(
    immunity_time_property=wafv2.CfnRuleGroup.ImmunityTimePropertyProperty(
        immunity_time=123
    )
)

Attributes

immunity_time_property

Determines how long a CAPTCHA timestamp in the token remains valid after the client successfully solves a CAPTCHA puzzle.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-captchaconfig.html#cfn-wafv2-rulegroup-captchaconfig-immunitytimeproperty

CaptchaProperty

class CfnRuleGroup.CaptchaProperty(*, custom_request_handling=None)

Bases: object

Parameters:

custom_request_handling (Union[IResolvable, CustomRequestHandlingProperty, Dict[str, Any], None]) – CfnRuleGroup.CaptchaProperty.CustomRequestHandling.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-captchaaction.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

captcha_property = wafv2.CfnRuleGroup.CaptchaProperty(
    custom_request_handling=wafv2.CfnRuleGroup.CustomRequestHandlingProperty(
        insert_headers=[wafv2.CfnRuleGroup.CustomHTTPHeaderProperty(
            name="name",
            value="value"
        )]
    )
)

Attributes

custom_request_handling

CfnRuleGroup.CaptchaProperty.CustomRequestHandling.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-captchaaction.html#cfn-wafv2-rulegroup-captchaaction-customrequesthandling

ChallengeConfigProperty

class CfnRuleGroup.ChallengeConfigProperty(*, immunity_time_property=None)

Bases: object

Specifies how AWS WAF should handle Challenge evaluations.

This is available at the web ACL level and in each rule.

Parameters:

immunity_time_property (Union[IResolvable, ImmunityTimePropertyProperty, Dict[str, Any], None]) – Determines how long a challenge timestamp in the token remains valid after the client successfully responds to a challenge.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-challengeconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

challenge_config_property = wafv2.CfnRuleGroup.ChallengeConfigProperty(
    immunity_time_property=wafv2.CfnRuleGroup.ImmunityTimePropertyProperty(
        immunity_time=123
    )
)

Attributes

immunity_time_property

Determines how long a challenge timestamp in the token remains valid after the client successfully responds to a challenge.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-challengeconfig.html#cfn-wafv2-rulegroup-challengeconfig-immunitytimeproperty

ChallengeProperty

class CfnRuleGroup.ChallengeProperty(*, custom_request_handling=None)

Bases: object

Parameters:

custom_request_handling (Union[IResolvable, CustomRequestHandlingProperty, Dict[str, Any], None]) – CfnRuleGroup.ChallengeProperty.CustomRequestHandling.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-challengeaction.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

challenge_property = wafv2.CfnRuleGroup.ChallengeProperty(
    custom_request_handling=wafv2.CfnRuleGroup.CustomRequestHandlingProperty(
        insert_headers=[wafv2.CfnRuleGroup.CustomHTTPHeaderProperty(
            name="name",
            value="value"
        )]
    )
)

Attributes

custom_request_handling

CfnRuleGroup.ChallengeProperty.CustomRequestHandling.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-challengeaction.html#cfn-wafv2-rulegroup-challengeaction-customrequesthandling

CookieMatchPatternProperty

class CfnRuleGroup.CookieMatchPatternProperty(*, all=None, excluded_cookies=None, included_cookies=None)

Bases: object

The filter to use to identify the subset of cookies to inspect in a web request.

You must specify exactly one setting: either All , IncludedCookies , or ExcludedCookies .

Example JSON: "MatchPattern": { "IncludedCookies": {"KeyToInclude1", "KeyToInclude2", "KeyToInclude3"} }

Parameters:
  • all (Optional[Any]) – Inspect all cookies.

  • excluded_cookies (Optional[Sequence[str]]) – Inspect only the cookies whose keys don’t match any of the strings specified here.

  • included_cookies (Optional[Sequence[str]]) – Inspect only the cookies that have a key that matches one of the strings specified here.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-cookiematchpattern.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any

cookie_match_pattern_property = wafv2.CfnRuleGroup.CookieMatchPatternProperty(
    all=all,
    excluded_cookies=["excludedCookies"],
    included_cookies=["includedCookies"]
)

Attributes

all

Inspect all cookies.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-cookiematchpattern.html#cfn-wafv2-rulegroup-cookiematchpattern-all

excluded_cookies

Inspect only the cookies whose keys don’t match any of the strings specified here.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-cookiematchpattern.html#cfn-wafv2-rulegroup-cookiematchpattern-excludedcookies

included_cookies

Inspect only the cookies that have a key that matches one of the strings specified here.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-cookiematchpattern.html#cfn-wafv2-rulegroup-cookiematchpattern-includedcookies

CookiesProperty

class CfnRuleGroup.CookiesProperty(*, match_pattern, match_scope, oversize_handling)

Bases: object

Inspect the cookies in the web request.

You can specify the parts of the cookies to inspect and you can narrow the set of cookies to inspect by including or excluding specific keys.

This is used to indicate the web request component to inspect, in the FieldToMatch specification.

Example JSON: "Cookies": { "MatchPattern": { "All": {} }, "MatchScope": "KEY", "OversizeHandling": "MATCH" }

Parameters:
  • match_pattern (Union[IResolvable, CookieMatchPatternProperty, Dict[str, Any]]) – The filter to use to identify the subset of cookies to inspect in a web request. You must specify exactly one setting: either All , IncludedCookies , or ExcludedCookies . Example JSON: "MatchPattern": { "IncludedCookies": {"KeyToInclude1", "KeyToInclude2", "KeyToInclude3"} }

  • match_scope (str) – The parts of the cookies to inspect with the rule inspection criteria. If you specify All , AWS WAF inspects both keys and values.

  • oversize_handling (str) – What AWS WAF should do if the cookies of the request are more numerous or larger than AWS WAF can inspect. AWS WAF does not support inspecting the entire contents of request cookies when they exceed 8 KB (8192 bytes) or 200 total cookies. The underlying host service forwards a maximum of 200 cookies and at most 8 KB of cookie contents to AWS WAF . The options for oversize handling are the following: - CONTINUE - Inspect the available cookies normally, according to the rule inspection criteria. - MATCH - Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request. - NO_MATCH - Treat the web request as not matching the rule statement.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-cookies.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any

cookies_property = wafv2.CfnRuleGroup.CookiesProperty(
    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
        all=all,
        excluded_cookies=["excludedCookies"],
        included_cookies=["includedCookies"]
    ),
    match_scope="matchScope",
    oversize_handling="oversizeHandling"
)

Attributes

match_pattern

The filter to use to identify the subset of cookies to inspect in a web request.

You must specify exactly one setting: either All , IncludedCookies , or ExcludedCookies .

Example JSON: "MatchPattern": { "IncludedCookies": {"KeyToInclude1", "KeyToInclude2", "KeyToInclude3"} }

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-cookies.html#cfn-wafv2-rulegroup-cookies-matchpattern

match_scope

The parts of the cookies to inspect with the rule inspection criteria.

If you specify All , AWS WAF inspects both keys and values.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-cookies.html#cfn-wafv2-rulegroup-cookies-matchscope

oversize_handling

What AWS WAF should do if the cookies of the request are more numerous or larger than AWS WAF can inspect.

AWS WAF does not support inspecting the entire contents of request cookies when they exceed 8 KB (8192 bytes) or 200 total cookies. The underlying host service forwards a maximum of 200 cookies and at most 8 KB of cookie contents to AWS WAF .

The options for oversize handling are the following:

  • CONTINUE - Inspect the available cookies normally, according to the rule inspection criteria.

  • MATCH - Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request.

  • NO_MATCH - Treat the web request as not matching the rule statement.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-cookies.html#cfn-wafv2-rulegroup-cookies-oversizehandling

CountProperty

class CfnRuleGroup.CountProperty(*, custom_request_handling=None)

Bases: object

Parameters:

custom_request_handling (Union[IResolvable, CustomRequestHandlingProperty, Dict[str, Any], None]) – CfnRuleGroup.CountProperty.CustomRequestHandling.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-countaction.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

count_property = wafv2.CfnRuleGroup.CountProperty(
    custom_request_handling=wafv2.CfnRuleGroup.CustomRequestHandlingProperty(
        insert_headers=[wafv2.CfnRuleGroup.CustomHTTPHeaderProperty(
            name="name",
            value="value"
        )]
    )
)

Attributes

custom_request_handling

CfnRuleGroup.CountProperty.CustomRequestHandling.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-countaction.html#cfn-wafv2-rulegroup-countaction-customrequesthandling

CustomHTTPHeaderProperty

class CfnRuleGroup.CustomHTTPHeaderProperty(*, name, value)

Bases: object

A custom header for custom request and response handling.

This is used in CustomResponse and CustomRequestHandling

Parameters:
  • name (str) – The name of the custom header. For custom request header insertion, when AWS WAF inserts the header into the request, it prefixes this name x-amzn-waf- , to avoid confusion with the headers that are already in the request. For example, for the header name sample , AWS WAF inserts the header x-amzn-waf-sample .

  • value (str) – The value of the custom header.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-customhttpheader.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

custom_hTTPHeader_property = wafv2.CfnRuleGroup.CustomHTTPHeaderProperty(
    name="name",
    value="value"
)

Attributes

name

The name of the custom header.

For custom request header insertion, when AWS WAF inserts the header into the request, it prefixes this name x-amzn-waf- , to avoid confusion with the headers that are already in the request. For example, for the header name sample , AWS WAF inserts the header x-amzn-waf-sample .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-customhttpheader.html#cfn-wafv2-rulegroup-customhttpheader-name

value

The value of the custom header.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-customhttpheader.html#cfn-wafv2-rulegroup-customhttpheader-value

CustomRequestHandlingProperty

class CfnRuleGroup.CustomRequestHandlingProperty(*, insert_headers)

Bases: object

Custom request handling behavior that inserts custom headers into a web request.

You can add custom request handling for AWS WAF to use when the rule action doesn’t block the request. For example, CaptchaAction for requests with valid t okens, and AllowAction .

For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF Developer Guide .

Parameters:

insert_headers (Union[IResolvable, Sequence[Union[IResolvable, CustomHTTPHeaderProperty, Dict[str, Any]]]]) –

The HTTP headers to insert into the request. Duplicate header names are not allowed. For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-customrequesthandling.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

custom_request_handling_property = wafv2.CfnRuleGroup.CustomRequestHandlingProperty(
    insert_headers=[wafv2.CfnRuleGroup.CustomHTTPHeaderProperty(
        name="name",
        value="value"
    )]
)

Attributes

insert_headers

The HTTP headers to insert into the request. Duplicate header names are not allowed.

For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-customrequesthandling.html#cfn-wafv2-rulegroup-customrequesthandling-insertheaders

CustomResponseBodyProperty

class CfnRuleGroup.CustomResponseBodyProperty(*, content, content_type)

Bases: object

The response body to use in a custom response to a web request.

This is referenced by key from CustomResponse CustomResponseBodyKey .

Parameters:
  • content (str) –

    The payload of the custom response. You can use JSON escape strings in JSON content. To do this, you must specify JSON content in the ContentType setting. For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .

  • content_type (str) – The type of content in the payload that you are defining in the Content string.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-customresponsebody.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

custom_response_body_property = wafv2.CfnRuleGroup.CustomResponseBodyProperty(
    content="content",
    content_type="contentType"
)

Attributes

content

The payload of the custom response.

You can use JSON escape strings in JSON content. To do this, you must specify JSON content in the ContentType setting.

For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-customresponsebody.html#cfn-wafv2-rulegroup-customresponsebody-content

content_type

The type of content in the payload that you are defining in the Content string.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-customresponsebody.html#cfn-wafv2-rulegroup-customresponsebody-contenttype

CustomResponseProperty

class CfnRuleGroup.CustomResponseProperty(*, response_code, custom_response_body_key=None, response_headers=None)

Bases: object

A custom response to send to the client.

You can define a custom response for rule actions and default web ACL actions that are set to Block .

For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF Developer Guide .

Parameters:
  • response_code (Union[int, float]) – The HTTP status code to return to the client. For a list of status codes that you can use in your custom responses, see Supported status codes for custom response in the AWS WAF Developer Guide .

  • custom_response_body_key (Optional[str]) – References the response body that you want AWS WAF to return to the web request client. You can define a custom response for a rule action or a default web ACL action that is set to block. To do this, you first define the response body key and value in the CustomResponseBodies setting for the WebACL or RuleGroup where you want to use it. Then, in the rule action or web ACL default action BlockAction setting, you reference the response body using this key.

  • response_headers (Union[IResolvable, Sequence[Union[IResolvable, CustomHTTPHeaderProperty, Dict[str, Any]]], None]) –

    The HTTP headers to use in the response. Duplicate header names are not allowed. For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-customresponse.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

custom_response_property = wafv2.CfnRuleGroup.CustomResponseProperty(
    response_code=123,

    # the properties below are optional
    custom_response_body_key="customResponseBodyKey",
    response_headers=[wafv2.CfnRuleGroup.CustomHTTPHeaderProperty(
        name="name",
        value="value"
    )]
)

Attributes

custom_response_body_key

References the response body that you want AWS WAF to return to the web request client.

You can define a custom response for a rule action or a default web ACL action that is set to block. To do this, you first define the response body key and value in the CustomResponseBodies setting for the WebACL or RuleGroup where you want to use it. Then, in the rule action or web ACL default action BlockAction setting, you reference the response body using this key.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-customresponse.html#cfn-wafv2-rulegroup-customresponse-customresponsebodykey

response_code

The HTTP status code to return to the client.

For a list of status codes that you can use in your custom responses, see Supported status codes for custom response in the AWS WAF Developer Guide .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-customresponse.html#cfn-wafv2-rulegroup-customresponse-responsecode

response_headers

The HTTP headers to use in the response. Duplicate header names are not allowed.

For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-customresponse.html#cfn-wafv2-rulegroup-customresponse-responseheaders

FieldToMatchProperty

class CfnRuleGroup.FieldToMatchProperty(*, all_query_arguments=None, body=None, cookies=None, headers=None, json_body=None, method=None, query_string=None, single_header=None, single_query_argument=None, uri_path=None)

Bases: object

The part of the web request that you want AWS WAF to inspect.

Include the single FieldToMatch type that you want to inspect, with additional specifications as needed, according to the type. You specify a single request component in FieldToMatch for each rule statement that requires it. To inspect more than one component of the web request, create a separate rule statement for each component.

Example JSON for a QueryString field to match:

"FieldToMatch": { "QueryString": {} }

Example JSON for a Method field to match specification:

"FieldToMatch": { "Method": { "Name": "DELETE" } }

Parameters:
  • all_query_arguments (Optional[Any]) – Inspect all query arguments.

  • body (Union[IResolvable, BodyProperty, Dict[str, Any], None]) – Inspect the request body as plain text. The request body immediately follows the request headers. This is the part of a request that contains any additional data that you want to send to your web server as the HTTP request body, such as data from a form. A limited amount of the request body is forwarded to AWS WAF for inspection by the underlying host service. For regional resources, the limit is 8 KB (8,192 kilobytes) and for CloudFront distributions, the limit is 16 KB (16,384 kilobytes). For CloudFront distributions, you can increase the limit in the web ACL’s AssociationConfig , for additional processing fees. For information about how to handle oversized request bodies, see the Body object configuration.

  • cookies (Union[IResolvable, CookiesProperty, Dict[str, Any], None]) – Inspect the request cookies. You must configure scope and pattern matching filters in the Cookies object, to define the set of cookies and the parts of the cookies that AWS WAF inspects. Only the first 8 KB (8192 bytes) of a request’s cookies and only the first 200 cookies are forwarded to AWS WAF for inspection by the underlying host service. You must configure how to handle any oversize cookie content in the Cookies object. AWS WAF applies the pattern matching filters to the cookies that it receives from the underlying host service.

  • headers (Union[IResolvable, HeadersProperty, Dict[str, Any], None]) – Inspect the request headers. You must configure scope and pattern matching filters in the Headers object, to define the set of headers to and the parts of the headers that AWS WAF inspects. Only the first 8 KB (8192 bytes) of a request’s headers and only the first 200 headers are forwarded to AWS WAF for inspection by the underlying host service. You must configure how to handle any oversize header content in the Headers object. AWS WAF applies the pattern matching filters to the headers that it receives from the underlying host service.

  • json_body (Union[IResolvable, JsonBodyProperty, Dict[str, Any], None]) – Inspect the request body as JSON. The request body immediately follows the request headers. This is the part of a request that contains any additional data that you want to send to your web server as the HTTP request body, such as data from a form. A limited amount of the request body is forwarded to AWS WAF for inspection by the underlying host service. For regional resources, the limit is 8 KB (8,192 kilobytes) and for CloudFront distributions, the limit is 16 KB (16,384 kilobytes). For CloudFront distributions, you can increase the limit in the web ACL’s AssociationConfig , for additional processing fees. For information about how to handle oversized request bodies, see the JsonBody object configuration.

  • method (Optional[Any]) – Inspect the HTTP method. The method indicates the type of operation that the request is asking the origin to perform.

  • query_string (Optional[Any]) – Inspect the query string. This is the part of a URL that appears after a ? character, if any.

  • single_header (Optional[Any]) – Inspect a single header. Provide the name of the header to inspect, for example, User-Agent or Referer . This setting isn’t case sensitive. Example JSON: "SingleHeader": { "Name": "haystack" } Alternately, you can filter and inspect all headers with the Headers FieldToMatch setting.

  • single_query_argument (Optional[Any]) – Inspect a single query argument. Provide the name of the query argument to inspect, such as UserName or SalesRegion . The name can be up to 30 characters long and isn’t case sensitive. Example JSON: "SingleQueryArgument": { "Name": "myArgument" }

  • uri_path (Optional[Any]) – Inspect the request URI path. This is the part of the web request that identifies a resource, for example, /images/daily-ad.jpg .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any
# all_query_arguments: Any
# method: Any
# query_string: Any
# single_header: Any
# single_query_argument: Any
# uri_path: Any

field_to_match_property = wafv2.CfnRuleGroup.FieldToMatchProperty(
    all_query_arguments=all_query_arguments,
    body=wafv2.CfnRuleGroup.BodyProperty(
        oversize_handling="oversizeHandling"
    ),
    cookies=wafv2.CfnRuleGroup.CookiesProperty(
        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
            all=all,
            excluded_cookies=["excludedCookies"],
            included_cookies=["includedCookies"]
        ),
        match_scope="matchScope",
        oversize_handling="oversizeHandling"
    ),
    headers=wafv2.CfnRuleGroup.HeadersProperty(
        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
            all=all,
            excluded_headers=["excludedHeaders"],
            included_headers=["includedHeaders"]
        ),
        match_scope="matchScope",
        oversize_handling="oversizeHandling"
    ),
    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
            all=all,
            included_paths=["includedPaths"]
        ),
        match_scope="matchScope",

        # the properties below are optional
        invalid_fallback_behavior="invalidFallbackBehavior",
        oversize_handling="oversizeHandling"
    ),
    method=method,
    query_string=query_string,
    single_header=single_header,
    single_query_argument=single_query_argument,
    uri_path=uri_path
)

Attributes

all_query_arguments

Inspect all query arguments.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-allqueryarguments

body

Inspect the request body as plain text.

The request body immediately follows the request headers. This is the part of a request that contains any additional data that you want to send to your web server as the HTTP request body, such as data from a form.

A limited amount of the request body is forwarded to AWS WAF for inspection by the underlying host service. For regional resources, the limit is 8 KB (8,192 kilobytes) and for CloudFront distributions, the limit is 16 KB (16,384 kilobytes). For CloudFront distributions, you can increase the limit in the web ACL’s AssociationConfig , for additional processing fees.

For information about how to handle oversized request bodies, see the Body object configuration.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-body

cookies

Inspect the request cookies.

You must configure scope and pattern matching filters in the Cookies object, to define the set of cookies and the parts of the cookies that AWS WAF inspects.

Only the first 8 KB (8192 bytes) of a request’s cookies and only the first 200 cookies are forwarded to AWS WAF for inspection by the underlying host service. You must configure how to handle any oversize cookie content in the Cookies object. AWS WAF applies the pattern matching filters to the cookies that it receives from the underlying host service.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-cookies

headers

Inspect the request headers.

You must configure scope and pattern matching filters in the Headers object, to define the set of headers to and the parts of the headers that AWS WAF inspects.

Only the first 8 KB (8192 bytes) of a request’s headers and only the first 200 headers are forwarded to AWS WAF for inspection by the underlying host service. You must configure how to handle any oversize header content in the Headers object. AWS WAF applies the pattern matching filters to the headers that it receives from the underlying host service.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-headers

json_body

Inspect the request body as JSON.

The request body immediately follows the request headers. This is the part of a request that contains any additional data that you want to send to your web server as the HTTP request body, such as data from a form.

A limited amount of the request body is forwarded to AWS WAF for inspection by the underlying host service. For regional resources, the limit is 8 KB (8,192 kilobytes) and for CloudFront distributions, the limit is 16 KB (16,384 kilobytes). For CloudFront distributions, you can increase the limit in the web ACL’s AssociationConfig , for additional processing fees.

For information about how to handle oversized request bodies, see the JsonBody object configuration.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-jsonbody

method

Inspect the HTTP method.

The method indicates the type of operation that the request is asking the origin to perform.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-method

query_string

Inspect the query string.

This is the part of a URL that appears after a ? character, if any.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-querystring

single_header

Inspect a single header.

Provide the name of the header to inspect, for example, User-Agent or Referer . This setting isn’t case sensitive.

Example JSON: "SingleHeader": { "Name": "haystack" }

Alternately, you can filter and inspect all headers with the Headers FieldToMatch setting.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-singleheader

single_query_argument

Inspect a single query argument.

Provide the name of the query argument to inspect, such as UserName or SalesRegion . The name can be up to 30 characters long and isn’t case sensitive.

Example JSON: "SingleQueryArgument": { "Name": "myArgument" }

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-singlequeryargument

uri_path

Inspect the request URI path.

This is the part of the web request that identifies a resource, for example, /images/daily-ad.jpg .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-uripath

ForwardedIPConfigurationProperty

class CfnRuleGroup.ForwardedIPConfigurationProperty(*, fallback_behavior, header_name)

Bases: object

The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that’s reported by the web request origin.

Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name. .. epigraph:

If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.

This configuration is used for GeoMatchStatement and RateBasedStatement . For IPSetReferenceStatement , use IPSetForwardedIPConfig instead.

AWS WAF only evaluates the first IP address found in the specified HTTP header.

Parameters:
  • fallback_behavior (str) – The match status to assign to the web request if the request doesn’t have a valid IP address in the specified position. .. epigraph:: If the specified header isn’t present in the request, AWS WAF doesn’t apply the rule to the web request at all. You can specify the following fallback behaviors: - MATCH - Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request. - NO_MATCH - Treat the web request as not matching the rule statement.

  • header_name (str) – The name of the HTTP header to use for the IP address. For example, to use the X-Forwarded-For (XFF) header, set this to X-Forwarded-For . .. epigraph:: If the specified header isn’t present in the request, AWS WAF doesn’t apply the rule to the web request at all.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-forwardedipconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

forwarded_iPConfiguration_property = wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
    fallback_behavior="fallbackBehavior",
    header_name="headerName"
)

Attributes

fallback_behavior

The match status to assign to the web request if the request doesn’t have a valid IP address in the specified position.

If the specified header isn’t present in the request, AWS WAF doesn’t apply the rule to the web request at all.

You can specify the following fallback behaviors:

  • MATCH - Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request.

  • NO_MATCH - Treat the web request as not matching the rule statement.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-forwardedipconfiguration.html#cfn-wafv2-rulegroup-forwardedipconfiguration-fallbackbehavior

header_name

The name of the HTTP header to use for the IP address.

For example, to use the X-Forwarded-For (XFF) header, set this to X-Forwarded-For . .. epigraph:

If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.
Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-forwardedipconfiguration.html#cfn-wafv2-rulegroup-forwardedipconfiguration-headername

GeoMatchStatementProperty

class CfnRuleGroup.GeoMatchStatementProperty(*, country_codes=None, forwarded_ip_config=None)

Bases: object

A rule statement that labels web requests by country and region and that matches against web requests based on country code.

A geo match rule labels every request that it inspects regardless of whether it finds a match.

  • To manage requests only by country, you can use this statement by itself and specify the countries that you want to match against in the CountryCodes array.

  • Otherwise, configure your geo match rule with Count action so that it only labels requests. Then, add one or more label match rules to run after the geo match rule and configure them to match against the geographic labels and handle the requests as needed.

AWS WAF labels requests using the alpha-2 country and region codes from the International Organization for Standardization (ISO) 3166 standard. AWS WAF determines the codes using either the IP address in the web request origin or, if you specify it, the address in the geo match ForwardedIPConfig .

If you use the web request origin, the label formats are awswaf:clientip:geo:region:<ISO country code>-<ISO region code> and awswaf:clientip:geo:country:<ISO country code> .

If you use a forwarded IP address, the label formats are awswaf:forwardedip:geo:region:<ISO country code>-<ISO region code> and awswaf:forwardedip:geo:country:<ISO country code> .

For additional details, see Geographic match rule statement in the AWS WAF Developer Guide .

Parameters:
  • country_codes (Optional[Sequence[str]]) – An array of two-character country codes that you want to match against, for example, [ "US", "CN" ] , from the alpha-2 country ISO codes of the ISO 3166 international standard. When you use a geo match statement just for the region and country labels that it adds to requests, you still have to supply a country code for the rule to evaluate. In this case, you configure the rule to only count matching requests, but it will still generate logging and count metrics for any matches. You can reduce the logging and metrics that the rule produces by specifying a country that’s unlikely to be a source of traffic to your site.

  • forwarded_ip_config (Union[IResolvable, ForwardedIPConfigurationProperty, Dict[str, Any], None]) – The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that’s reported by the web request origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name. .. epigraph:: If the specified header isn’t present in the request, AWS WAF doesn’t apply the rule to the web request at all.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-geomatchstatement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

geo_match_statement_property = wafv2.CfnRuleGroup.GeoMatchStatementProperty(
    country_codes=["countryCodes"],
    forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
        fallback_behavior="fallbackBehavior",
        header_name="headerName"
    )
)

Attributes

country_codes

An array of two-character country codes that you want to match against, for example, [ "US", "CN" ] , from the alpha-2 country ISO codes of the ISO 3166 international standard.

When you use a geo match statement just for the region and country labels that it adds to requests, you still have to supply a country code for the rule to evaluate. In this case, you configure the rule to only count matching requests, but it will still generate logging and count metrics for any matches. You can reduce the logging and metrics that the rule produces by specifying a country that’s unlikely to be a source of traffic to your site.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-geomatchstatement.html#cfn-wafv2-rulegroup-geomatchstatement-countrycodes

forwarded_ip_config

The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that’s reported by the web request origin.

Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name. .. epigraph:

If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.
Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-geomatchstatement.html#cfn-wafv2-rulegroup-geomatchstatement-forwardedipconfig

HeaderMatchPatternProperty

class CfnRuleGroup.HeaderMatchPatternProperty(*, all=None, excluded_headers=None, included_headers=None)

Bases: object

The filter to use to identify the subset of headers to inspect in a web request.

You must specify exactly one setting: either All , IncludedHeaders , or ExcludedHeaders .

Example JSON: "MatchPattern": { "ExcludedHeaders": {"KeyToExclude1", "KeyToExclude2"} }

Parameters:
  • all (Optional[Any]) – Inspect all headers.

  • excluded_headers (Optional[Sequence[str]]) – Inspect only the headers whose keys don’t match any of the strings specified here.

  • included_headers (Optional[Sequence[str]]) – Inspect only the headers that have a key that matches one of the strings specified here.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-headermatchpattern.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any

header_match_pattern_property = wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
    all=all,
    excluded_headers=["excludedHeaders"],
    included_headers=["includedHeaders"]
)

Attributes

all

Inspect all headers.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-headermatchpattern.html#cfn-wafv2-rulegroup-headermatchpattern-all

excluded_headers

Inspect only the headers whose keys don’t match any of the strings specified here.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-headermatchpattern.html#cfn-wafv2-rulegroup-headermatchpattern-excludedheaders

included_headers

Inspect only the headers that have a key that matches one of the strings specified here.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-headermatchpattern.html#cfn-wafv2-rulegroup-headermatchpattern-includedheaders

HeadersProperty

class CfnRuleGroup.HeadersProperty(*, match_pattern, match_scope, oversize_handling)

Bases: object

Inspect all headers in the web request.

You can specify the parts of the headers to inspect and you can narrow the set of headers to inspect by including or excluding specific keys.

This is used to indicate the web request component to inspect, in the FieldToMatch specification.

If you want to inspect just the value of a single header, use the SingleHeader FieldToMatch setting instead.

Example JSON: "Headers": { "MatchPattern": { "All": {} }, "MatchScope": "KEY", "OversizeHandling": "MATCH" }

Parameters:
  • match_pattern (Union[IResolvable, HeaderMatchPatternProperty, Dict[str, Any]]) – The filter to use to identify the subset of headers to inspect in a web request. You must specify exactly one setting: either All , IncludedHeaders , or ExcludedHeaders . Example JSON: "MatchPattern": { "ExcludedHeaders": {"KeyToExclude1", "KeyToExclude2"} }

  • match_scope (str) – The parts of the headers to match with the rule inspection criteria. If you specify All , AWS WAF inspects both keys and values.

  • oversize_handling (str) – What AWS WAF should do if the headers of the request are more numerous or larger than AWS WAF can inspect. AWS WAF does not support inspecting the entire contents of request headers when they exceed 8 KB (8192 bytes) or 200 total headers. The underlying host service forwards a maximum of 200 headers and at most 8 KB of header contents to AWS WAF . The options for oversize handling are the following: - CONTINUE - Inspect the available headers normally, according to the rule inspection criteria. - MATCH - Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request. - NO_MATCH - Treat the web request as not matching the rule statement.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-headers.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any

headers_property = wafv2.CfnRuleGroup.HeadersProperty(
    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
        all=all,
        excluded_headers=["excludedHeaders"],
        included_headers=["includedHeaders"]
    ),
    match_scope="matchScope",
    oversize_handling="oversizeHandling"
)

Attributes

match_pattern

The filter to use to identify the subset of headers to inspect in a web request.

You must specify exactly one setting: either All , IncludedHeaders , or ExcludedHeaders .

Example JSON: "MatchPattern": { "ExcludedHeaders": {"KeyToExclude1", "KeyToExclude2"} }

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-headers.html#cfn-wafv2-rulegroup-headers-matchpattern

match_scope

The parts of the headers to match with the rule inspection criteria.

If you specify All , AWS WAF inspects both keys and values.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-headers.html#cfn-wafv2-rulegroup-headers-matchscope

oversize_handling

What AWS WAF should do if the headers of the request are more numerous or larger than AWS WAF can inspect.

AWS WAF does not support inspecting the entire contents of request headers when they exceed 8 KB (8192 bytes) or 200 total headers. The underlying host service forwards a maximum of 200 headers and at most 8 KB of header contents to AWS WAF .

The options for oversize handling are the following:

  • CONTINUE - Inspect the available headers normally, according to the rule inspection criteria.

  • MATCH - Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request.

  • NO_MATCH - Treat the web request as not matching the rule statement.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-headers.html#cfn-wafv2-rulegroup-headers-oversizehandling

IPSetForwardedIPConfigurationProperty

class CfnRuleGroup.IPSetForwardedIPConfigurationProperty(*, fallback_behavior, header_name, position)

Bases: object

The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that’s reported by the web request origin.

Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name. .. epigraph:

If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.

This configuration is used only for IPSetReferenceStatement . For GeoMatchStatement and RateBasedStatement , use ForwardedIPConfig instead.

Parameters:
  • fallback_behavior (str) – The match status to assign to the web request if the request doesn’t have a valid IP address in the specified position. .. epigraph:: If the specified header isn’t present in the request, AWS WAF doesn’t apply the rule to the web request at all. You can specify the following fallback behaviors: - MATCH - Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request. - NO_MATCH - Treat the web request as not matching the rule statement.

  • header_name (str) – The name of the HTTP header to use for the IP address. For example, to use the X-Forwarded-For (XFF) header, set this to X-Forwarded-For . .. epigraph:: If the specified header isn’t present in the request, AWS WAF doesn’t apply the rule to the web request at all.

  • position (str) – The position in the header to search for the IP address. The header can contain IP addresses of the original client and also of proxies. For example, the header value could be 10.1.1.1, 127.0.0.0, 10.10.10.10 where the first IP address identifies the original client and the rest identify proxies that the request went through. The options for this setting are the following: - FIRST - Inspect the first IP address in the list of IP addresses in the header. This is usually the client’s original IP. - LAST - Inspect the last IP address in the list of IP addresses in the header. - ANY - Inspect all IP addresses in the header for a match. If the header contains more than 10 IP addresses, AWS WAF inspects the last 10.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ipsetforwardedipconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

i_pSet_forwarded_iPConfiguration_property = {
    "fallback_behavior": "fallbackBehavior",
    "header_name": "headerName",
    "position": "position"
}

Attributes

fallback_behavior

The match status to assign to the web request if the request doesn’t have a valid IP address in the specified position.

If the specified header isn’t present in the request, AWS WAF doesn’t apply the rule to the web request at all.

You can specify the following fallback behaviors:

  • MATCH - Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request.

  • NO_MATCH - Treat the web request as not matching the rule statement.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ipsetforwardedipconfiguration.html#cfn-wafv2-rulegroup-ipsetforwardedipconfiguration-fallbackbehavior

header_name

The name of the HTTP header to use for the IP address.

For example, to use the X-Forwarded-For (XFF) header, set this to X-Forwarded-For . .. epigraph:

If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.
Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ipsetforwardedipconfiguration.html#cfn-wafv2-rulegroup-ipsetforwardedipconfiguration-headername

position

The position in the header to search for the IP address.

The header can contain IP addresses of the original client and also of proxies. For example, the header value could be 10.1.1.1, 127.0.0.0, 10.10.10.10 where the first IP address identifies the original client and the rest identify proxies that the request went through.

The options for this setting are the following:

  • FIRST - Inspect the first IP address in the list of IP addresses in the header. This is usually the client’s original IP.

  • LAST - Inspect the last IP address in the list of IP addresses in the header.

  • ANY - Inspect all IP addresses in the header for a match. If the header contains more than 10 IP addresses, AWS WAF inspects the last 10.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ipsetforwardedipconfiguration.html#cfn-wafv2-rulegroup-ipsetforwardedipconfiguration-position

IPSetReferenceStatementProperty

class CfnRuleGroup.IPSetReferenceStatementProperty(*, arn, ip_set_forwarded_ip_config=None)

Bases: object

A rule statement used to detect web requests coming from particular IP addresses or address ranges.

To use this, create an IPSet that specifies the addresses you want to detect, then use the ARN of that set in this statement.

Each IP set rule statement references an IP set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, AWS WAF automatically updates all rules that reference it.

Parameters:
  • arn (str) – The Amazon Resource Name (ARN) of the IPSet that this statement references.

  • ip_set_forwarded_ip_config (Union[IResolvable, IPSetForwardedIPConfigurationProperty, Dict[str, Any], None]) – The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that’s reported by the web request origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name. .. epigraph:: If the specified header isn’t present in the request, AWS WAF doesn’t apply the rule to the web request at all.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ipsetreferencestatement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

i_pSet_reference_statement_property = {
    "arn": "arn",

    # the properties below are optional
    "ip_set_forwarded_ip_config": {
        "fallback_behavior": "fallbackBehavior",
        "header_name": "headerName",
        "position": "position"
    }
}

Attributes

arn

The Amazon Resource Name (ARN) of the IPSet that this statement references.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ipsetreferencestatement.html#cfn-wafv2-rulegroup-ipsetreferencestatement-arn

ip_set_forwarded_ip_config

The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that’s reported by the web request origin.

Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name. .. epigraph:

If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.
Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ipsetreferencestatement.html#cfn-wafv2-rulegroup-ipsetreferencestatement-ipsetforwardedipconfig

ImmunityTimePropertyProperty

class CfnRuleGroup.ImmunityTimePropertyProperty(*, immunity_time)

Bases: object

Used for CAPTCHA and challenge token settings.

Determines how long a CAPTCHA or challenge timestamp remains valid after AWS WAF updates it for a successful CAPTCHA or challenge response.

Parameters:

immunity_time (Union[int, float]) – The amount of time, in seconds, that a CAPTCHA or challenge timestamp is considered valid by AWS WAF . The default setting is 300. For the Challenge action, the minimum setting is 300.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-immunitytimeproperty.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

immunity_time_property_property = wafv2.CfnRuleGroup.ImmunityTimePropertyProperty(
    immunity_time=123
)

Attributes

immunity_time

The amount of time, in seconds, that a CAPTCHA or challenge timestamp is considered valid by AWS WAF .

The default setting is 300.

For the Challenge action, the minimum setting is 300.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-immunitytimeproperty.html#cfn-wafv2-rulegroup-immunitytimeproperty-immunitytime

JsonBodyProperty

class CfnRuleGroup.JsonBodyProperty(*, match_pattern, match_scope, invalid_fallback_behavior=None, oversize_handling=None)

Bases: object

Inspect the body of the web request as JSON. The body immediately follows the request headers.

This is used to indicate the web request component to inspect, in the FieldToMatch specification.

Use the specifications in this object to indicate which parts of the JSON body to inspect using the rule’s inspection criteria. AWS WAF inspects only the parts of the JSON that result from the matches that you indicate.

Example JSON: "JsonBody": { "MatchPattern": { "All": {} }, "MatchScope": "ALL" }

Parameters:
  • match_pattern (Union[IResolvable, JsonMatchPatternProperty, Dict[str, Any]]) – The patterns to look for in the JSON body. AWS WAF inspects the results of these pattern matches against the rule inspection criteria.

  • match_scope (str) – The parts of the JSON to match against using the MatchPattern . If you specify All , AWS WAF matches against keys and values.

  • invalid_fallback_behavior (Optional[str]) – What AWS WAF should do if it fails to completely parse the JSON body. The options are the following:. - EVALUATE_AS_STRING - Inspect the body as plain text. AWS WAF applies the text transformations and inspection criteria that you defined for the JSON inspection to the body text string. - MATCH - Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request. - NO_MATCH - Treat the web request as not matching the rule statement. If you don’t provide this setting, AWS WAF parses and evaluates the content only up to the first parsing failure that it encounters. AWS WAF does its best to parse the entire JSON body, but might be forced to stop for reasons such as invalid characters, duplicate keys, truncation, and any content whose root node isn’t an object or an array. AWS WAF parses the JSON in the following examples as two valid key, value pairs: - Missing comma: {"key1":"value1""key2":"value2"} - Missing colon: {"key1":"value1","key2""value2"} - Extra colons: {"key1"::"value1","key2""value2"}

  • oversize_handling (Optional[str]) – What AWS WAF should do if the body is larger than AWS WAF can inspect. AWS WAF does not support inspecting the entire contents of the web request body if the body exceeds the limit for the resource type. If the body is larger than the limit, the underlying host service only forwards the contents that are below the limit to AWS WAF for inspection. The default limit is 8 KB (8,192 kilobytes) for regional resources and 16 KB (16,384 kilobytes) for CloudFront distributions. For CloudFront distributions, you can increase the limit in the web ACL AssociationConfig , for additional processing fees. The options for oversize handling are the following: - CONTINUE - Inspect the available body contents normally, according to the rule inspection criteria. - MATCH - Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request. - NO_MATCH - Treat the web request as not matching the rule statement. You can combine the MATCH or NO_MATCH settings for oversize handling with your rule and web ACL action settings, so that you block any request whose body is over the limit. Default: CONTINUE

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-jsonbody.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any

json_body_property = wafv2.CfnRuleGroup.JsonBodyProperty(
    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
        all=all,
        included_paths=["includedPaths"]
    ),
    match_scope="matchScope",

    # the properties below are optional
    invalid_fallback_behavior="invalidFallbackBehavior",
    oversize_handling="oversizeHandling"
)

Attributes

invalid_fallback_behavior

.

  • EVALUATE_AS_STRING - Inspect the body as plain text. AWS WAF applies the text transformations and inspection criteria that you defined for the JSON inspection to the body text string.

  • MATCH - Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request.

  • NO_MATCH - Treat the web request as not matching the rule statement.

If you don’t provide this setting, AWS WAF parses and evaluates the content only up to the first parsing failure that it encounters.

AWS WAF does its best to parse the entire JSON body, but might be forced to stop for reasons such as invalid characters, duplicate keys, truncation, and any content whose root node isn’t an object or an array.

AWS WAF parses the JSON in the following examples as two valid key, value pairs:

  • Missing comma: {"key1":"value1""key2":"value2"}

  • Missing colon: {"key1":"value1","key2""value2"}

  • Extra colons: {"key1"::"value1","key2""value2"}

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-jsonbody.html#cfn-wafv2-rulegroup-jsonbody-invalidfallbackbehavior

Type:

What AWS WAF should do if it fails to completely parse the JSON body. The options are the following

match_pattern

The patterns to look for in the JSON body.

AWS WAF inspects the results of these pattern matches against the rule inspection criteria.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-jsonbody.html#cfn-wafv2-rulegroup-jsonbody-matchpattern

match_scope

The parts of the JSON to match against using the MatchPattern .

If you specify All , AWS WAF matches against keys and values.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-jsonbody.html#cfn-wafv2-rulegroup-jsonbody-matchscope

oversize_handling

What AWS WAF should do if the body is larger than AWS WAF can inspect.

AWS WAF does not support inspecting the entire contents of the web request body if the body exceeds the limit for the resource type. If the body is larger than the limit, the underlying host service only forwards the contents that are below the limit to AWS WAF for inspection.

The default limit is 8 KB (8,192 kilobytes) for regional resources and 16 KB (16,384 kilobytes) for CloudFront distributions. For CloudFront distributions, you can increase the limit in the web ACL AssociationConfig , for additional processing fees.

The options for oversize handling are the following:

  • CONTINUE - Inspect the available body contents normally, according to the rule inspection criteria.

  • MATCH - Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request.

  • NO_MATCH - Treat the web request as not matching the rule statement.

You can combine the MATCH or NO_MATCH settings for oversize handling with your rule and web ACL action settings, so that you block any request whose body is over the limit.

Default: CONTINUE

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-jsonbody.html#cfn-wafv2-rulegroup-jsonbody-oversizehandling

JsonMatchPatternProperty

class CfnRuleGroup.JsonMatchPatternProperty(*, all=None, included_paths=None)

Bases: object

The patterns to look for in the JSON body.

AWS WAF inspects the results of these pattern matches against the rule inspection criteria. This is used with the FieldToMatch option JsonBody .

Parameters:
  • all (Optional[Any]) – Match all of the elements. See also MatchScope in the JsonBody FieldToMatch specification. You must specify either this setting or the IncludedPaths setting, but not both.

  • included_paths (Optional[Sequence[str]]) – Match only the specified include paths. See also MatchScope in the JsonBody FieldToMatch specification. Provide the include paths using JSON Pointer syntax. For example, "IncludedPaths": ["/dogs/0/name", "/dogs/1/name"] . For information about this syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer . You must specify either this setting or the All setting, but not both. .. epigraph:: Don’t use this option to include all paths. Instead, use the All setting.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-jsonmatchpattern.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any

json_match_pattern_property = wafv2.CfnRuleGroup.JsonMatchPatternProperty(
    all=all,
    included_paths=["includedPaths"]
)

Attributes

all

Match all of the elements. See also MatchScope in the JsonBody FieldToMatch specification.

You must specify either this setting or the IncludedPaths setting, but not both.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-jsonmatchpattern.html#cfn-wafv2-rulegroup-jsonmatchpattern-all

included_paths

Match only the specified include paths. See also MatchScope in the JsonBody FieldToMatch specification.

Provide the include paths using JSON Pointer syntax. For example, "IncludedPaths": ["/dogs/0/name", "/dogs/1/name"] . For information about this syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer .

You must specify either this setting or the All setting, but not both. .. epigraph:

Don't use this option to include all paths. Instead, use the ``All`` setting.
Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-jsonmatchpattern.html#cfn-wafv2-rulegroup-jsonmatchpattern-includedpaths

LabelMatchStatementProperty

class CfnRuleGroup.LabelMatchStatementProperty(*, key, scope)

Bases: object

A rule statement to match against labels that have been added to the web request by rules that have already run in the web ACL.

The label match statement provides the label or namespace string to search for. The label string can represent a part or all of the fully qualified label name that had been added to the web request. Fully qualified labels have a prefix, optional namespaces, and label name. The prefix identifies the rule group or web ACL context of the rule that added the label. If you do not provide the fully qualified name in your label match string, AWS WAF performs the search for labels that were added in the same context as the label match statement.

Parameters:
  • key (str) – The string to match against. The setting you provide for this depends on the match statement’s Scope setting:. - If the Scope indicates LABEL , then this specification must include the name and can include any number of preceding namespace specifications and prefix up to providing the fully qualified label name. - If the Scope indicates NAMESPACE , then this specification can include any number of contiguous namespace strings, and can include the entire label namespace prefix from the rule group or web ACL where the label originates. Labels are case sensitive and components of a label must be separated by colon, for example NS1:NS2:name .

  • scope (str) – Specify whether you want to match using the label name or just the namespace.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-labelmatchstatement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

label_match_statement_property = wafv2.CfnRuleGroup.LabelMatchStatementProperty(
    key="key",
    scope="scope"
)

Attributes

key

.

  • If the Scope indicates LABEL , then this specification must include the name and can include any number of preceding namespace specifications and prefix up to providing the fully qualified label name.

  • If the Scope indicates NAMESPACE , then this specification can include any number of contiguous namespace strings, and can include the entire label namespace prefix from the rule group or web ACL where the label originates.

Labels are case sensitive and components of a label must be separated by colon, for example NS1:NS2:name .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-labelmatchstatement.html#cfn-wafv2-rulegroup-labelmatchstatement-key

Type:

The string to match against. The setting you provide for this depends on the match statement’s Scope setting

scope

Specify whether you want to match using the label name or just the namespace.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-labelmatchstatement.html#cfn-wafv2-rulegroup-labelmatchstatement-scope

LabelProperty

class CfnRuleGroup.LabelProperty(*, name)

Bases: object

A single label container.

This is used as an element of a label array in RuleLabels inside a rule.

Parameters:

name (str) – The label string.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-label.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

label_property = wafv2.CfnRuleGroup.LabelProperty(
    name="name"
)

Attributes

name

The label string.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-label.html#cfn-wafv2-rulegroup-label-name

LabelSummaryProperty

class CfnRuleGroup.LabelSummaryProperty(*, name=None)

Bases: object

List of labels used by one or more of the rules of a RuleGroup .

This summary object is used for the following rule group lists:

  • AvailableLabels - Labels that rules add to matching requests. These labels are defined in the RuleLabels for a rule.

  • ConsumedLabels - Labels that rules match against. These labels are defined in a LabelMatchStatement specification, in the Statement definition of a rule.

Parameters:

name (Optional[str]) – An individual label specification.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-labelsummary.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

label_summary_property = wafv2.CfnRuleGroup.LabelSummaryProperty(
    name="name"
)

Attributes

name

An individual label specification.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-labelsummary.html#cfn-wafv2-rulegroup-labelsummary-name

NotStatementProperty

class CfnRuleGroup.NotStatementProperty(*, statement)

Bases: object

A logical rule statement used to negate the results of another rule statement.

You provide one Statement within the NotStatement .

Parameters:

statement (Union[IResolvable, StatementProperty, Dict[str, Any]]) – The statement to negate. You can use any statement that can be nested.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-notstatement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any
# all_query_arguments: Any
# method: Any
# query_string: Any
# single_header: Any
# single_query_argument: Any
# statement_property_: wafv2.CfnRuleGroup.StatementProperty
# uri_path: Any

not_statement_property = wafv2.CfnRuleGroup.NotStatementProperty(
    statement=wafv2.CfnRuleGroup.StatementProperty(
        and_statement=wafv2.CfnRuleGroup.AndStatementProperty(
            statements=[statement_property_]
        ),
        byte_match_statement=wafv2.CfnRuleGroup.ByteMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            positional_constraint="positionalConstraint",
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )],

            # the properties below are optional
            search_string="searchString",
            search_string_base64="searchStringBase64"
        ),
        geo_match_statement=wafv2.CfnRuleGroup.GeoMatchStatementProperty(
            country_codes=["countryCodes"],
            forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                fallback_behavior="fallbackBehavior",
                header_name="headerName"
            )
        ),
        ip_set_reference_statement={
            "arn": "arn",

            # the properties below are optional
            "ip_set_forwarded_ip_config": {
                "fallback_behavior": "fallbackBehavior",
                "header_name": "headerName",
                "position": "position"
            }
        },
        label_match_statement=wafv2.CfnRuleGroup.LabelMatchStatementProperty(
            key="key",
            scope="scope"
        ),
        not_statement=wafv2.CfnRuleGroup.NotStatementProperty(
            statement=statement_property_
        ),
        or_statement=wafv2.CfnRuleGroup.OrStatementProperty(
            statements=[statement_property_]
        ),
        rate_based_statement=wafv2.CfnRuleGroup.RateBasedStatementProperty(
            aggregate_key_type="aggregateKeyType",
            limit=123,

            # the properties below are optional
            forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                fallback_behavior="fallbackBehavior",
                header_name="headerName"
            ),
            scope_down_statement=statement_property_
        ),
        regex_match_statement=wafv2.CfnRuleGroup.RegexMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            regex_string="regexString",
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        ),
        regex_pattern_set_reference_statement=wafv2.CfnRuleGroup.RegexPatternSetReferenceStatementProperty(
            arn="arn",
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        ),
        size_constraint_statement=wafv2.CfnRuleGroup.SizeConstraintStatementProperty(
            comparison_operator="comparisonOperator",
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            size=123,
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        ),
        sqli_match_statement=wafv2.CfnRuleGroup.SqliMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )],

            # the properties below are optional
            sensitivity_level="sensitivityLevel"
        ),
        xss_match_statement=wafv2.CfnRuleGroup.XssMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        )
    )
)

Attributes

statement

The statement to negate.

You can use any statement that can be nested.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-notstatement.html#cfn-wafv2-rulegroup-notstatement-statement

OrStatementProperty

class CfnRuleGroup.OrStatementProperty(*, statements)

Bases: object

A logical rule statement used to combine other rule statements with OR logic.

You provide more than one Statement within the OrStatement .

Parameters:

statements (Union[IResolvable, Sequence[Union[IResolvable, StatementProperty, Dict[str, Any]]]]) – The statements to combine with OR logic. You can use any statements that can be nested.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-orstatement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any
# all_query_arguments: Any
# method: Any
# query_string: Any
# single_header: Any
# single_query_argument: Any
# statement_property_: wafv2.CfnRuleGroup.StatementProperty
# uri_path: Any

or_statement_property = wafv2.CfnRuleGroup.OrStatementProperty(
    statements=[wafv2.CfnRuleGroup.StatementProperty(
        and_statement=wafv2.CfnRuleGroup.AndStatementProperty(
            statements=[statement_property_]
        ),
        byte_match_statement=wafv2.CfnRuleGroup.ByteMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            positional_constraint="positionalConstraint",
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )],

            # the properties below are optional
            search_string="searchString",
            search_string_base64="searchStringBase64"
        ),
        geo_match_statement=wafv2.CfnRuleGroup.GeoMatchStatementProperty(
            country_codes=["countryCodes"],
            forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                fallback_behavior="fallbackBehavior",
                header_name="headerName"
            )
        ),
        ip_set_reference_statement={
            "arn": "arn",

            # the properties below are optional
            "ip_set_forwarded_ip_config": {
                "fallback_behavior": "fallbackBehavior",
                "header_name": "headerName",
                "position": "position"
            }
        },
        label_match_statement=wafv2.CfnRuleGroup.LabelMatchStatementProperty(
            key="key",
            scope="scope"
        ),
        not_statement=wafv2.CfnRuleGroup.NotStatementProperty(
            statement=statement_property_
        ),
        or_statement=wafv2.CfnRuleGroup.OrStatementProperty(
            statements=[statement_property_]
        ),
        rate_based_statement=wafv2.CfnRuleGroup.RateBasedStatementProperty(
            aggregate_key_type="aggregateKeyType",
            limit=123,

            # the properties below are optional
            forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                fallback_behavior="fallbackBehavior",
                header_name="headerName"
            ),
            scope_down_statement=statement_property_
        ),
        regex_match_statement=wafv2.CfnRuleGroup.RegexMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            regex_string="regexString",
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        ),
        regex_pattern_set_reference_statement=wafv2.CfnRuleGroup.RegexPatternSetReferenceStatementProperty(
            arn="arn",
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        ),
        size_constraint_statement=wafv2.CfnRuleGroup.SizeConstraintStatementProperty(
            comparison_operator="comparisonOperator",
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            size=123,
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        ),
        sqli_match_statement=wafv2.CfnRuleGroup.SqliMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )],

            # the properties below are optional
            sensitivity_level="sensitivityLevel"
        ),
        xss_match_statement=wafv2.CfnRuleGroup.XssMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        )
    )]
)

Attributes

statements

The statements to combine with OR logic.

You can use any statements that can be nested.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-orstatement.html#cfn-wafv2-rulegroup-orstatement-statements

RateBasedStatementProperty

class CfnRuleGroup.RateBasedStatementProperty(*, aggregate_key_type, limit, forwarded_ip_config=None, scope_down_statement=None)

Bases: object

A rate-based rule tracks the rate of requests for each originating IP address, and triggers the rule action when the rate exceeds a limit that you specify on the number of requests in any 5-minute time span.

You can use this to put a temporary block on requests from an IP address that is sending excessive requests.

AWS WAF tracks and manages web requests separately for each instance of a rate-based rule that you use. For example, if you provide the same rate-based rule settings in two web ACLs, each of the two rule statements represents a separate instance of the rate-based rule and gets its own tracking and management by AWS WAF . If you define a rate-based rule inside a rule group, and then use that rule group in multiple places, each use creates a separate instance of the rate-based rule that gets its own tracking and management by AWS WAF .

When the rule action triggers, AWS WAF blocks additional requests from the IP address until the request rate falls below the limit.

You can optionally nest another statement inside the rate-based statement, to narrow the scope of the rule so that it only counts requests that match the nested statement. For example, based on recent requests that you have seen from an attacker, you might create a rate-based rule with a nested AND rule statement that contains the following nested statements:

  • An IP match statement with an IP set that specifies the address 192.0.2.44.

  • A string match statement that searches in the User-Agent header for the string BadBot.

In this rate-based rule, you also define a rate limit. For this example, the rate limit is 1,000. Requests that meet the criteria of both of the nested statements are counted. If the count exceeds 1,000 requests per five minutes, the rule action triggers. Requests that do not meet the criteria of both of the nested statements are not counted towards the rate limit and are not affected by this rule.

You cannot nest a RateBasedStatement inside another statement, for example inside a NotStatement or OrStatement . You can define a RateBasedStatement inside a web ACL and inside a rule group.

Parameters:
  • aggregate_key_type (str) – Setting that indicates how to aggregate the request counts. The options are the following:. - IP - Aggregate the request counts on the IP address from the web request origin. - FORWARDED_IP - Aggregate the request counts on the first IP address in an HTTP header. If you use this, configure the ForwardedIPConfig , to specify the header to use. .. epigraph:: You can only use the IP and FORWARDED_IP key types.

  • limit (Union[int, float]) – The limit on requests per 5-minute period for a single originating IP address. If the statement includes a ScopeDownStatement , this limit is applied only to the requests that match the statement.

  • forwarded_ip_config (Union[IResolvable, ForwardedIPConfigurationProperty, Dict[str, Any], None]) – The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that’s reported by the web request origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name. .. epigraph:: If the specified header isn’t present in the request, AWS WAF doesn’t apply the rule to the web request at all. This is required if you specify a forwarded IP in the rule’s aggregate key settings.

  • scope_down_statement (Union[IResolvable, StatementProperty, Dict[str, Any], None]) – An optional nested statement that narrows the scope of the web requests that are evaluated by the rate-based statement. Requests are only tracked by the rate-based statement if they match the scope-down statement. You can use any nestable statement in the scope-down statement, and you can nest statements at any level, the same as you can for a rule statement.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ratebasedstatement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any
# all_query_arguments: Any
# method: Any
# query_string: Any
# single_header: Any
# single_query_argument: Any
# statement_property_: wafv2.CfnRuleGroup.StatementProperty
# uri_path: Any

rate_based_statement_property = wafv2.CfnRuleGroup.RateBasedStatementProperty(
    aggregate_key_type="aggregateKeyType",
    limit=123,

    # the properties below are optional
    forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
        fallback_behavior="fallbackBehavior",
        header_name="headerName"
    ),
    scope_down_statement=wafv2.CfnRuleGroup.StatementProperty(
        and_statement=wafv2.CfnRuleGroup.AndStatementProperty(
            statements=[statement_property_]
        ),
        byte_match_statement=wafv2.CfnRuleGroup.ByteMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            positional_constraint="positionalConstraint",
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )],

            # the properties below are optional
            search_string="searchString",
            search_string_base64="searchStringBase64"
        ),
        geo_match_statement=wafv2.CfnRuleGroup.GeoMatchStatementProperty(
            country_codes=["countryCodes"],
            forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                fallback_behavior="fallbackBehavior",
                header_name="headerName"
            )
        ),
        ip_set_reference_statement={
            "arn": "arn",

            # the properties below are optional
            "ip_set_forwarded_ip_config": {
                "fallback_behavior": "fallbackBehavior",
                "header_name": "headerName",
                "position": "position"
            }
        },
        label_match_statement=wafv2.CfnRuleGroup.LabelMatchStatementProperty(
            key="key",
            scope="scope"
        ),
        not_statement=wafv2.CfnRuleGroup.NotStatementProperty(
            statement=statement_property_
        ),
        or_statement=wafv2.CfnRuleGroup.OrStatementProperty(
            statements=[statement_property_]
        ),
        rate_based_statement=wafv2.CfnRuleGroup.RateBasedStatementProperty(
            aggregate_key_type="aggregateKeyType",
            limit=123,

            # the properties below are optional
            forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                fallback_behavior="fallbackBehavior",
                header_name="headerName"
            ),
            scope_down_statement=statement_property_
        ),
        regex_match_statement=wafv2.CfnRuleGroup.RegexMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            regex_string="regexString",
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        ),
        regex_pattern_set_reference_statement=wafv2.CfnRuleGroup.RegexPatternSetReferenceStatementProperty(
            arn="arn",
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        ),
        size_constraint_statement=wafv2.CfnRuleGroup.SizeConstraintStatementProperty(
            comparison_operator="comparisonOperator",
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            size=123,
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        ),
        sqli_match_statement=wafv2.CfnRuleGroup.SqliMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )],

            # the properties below are optional
            sensitivity_level="sensitivityLevel"
        ),
        xss_match_statement=wafv2.CfnRuleGroup.XssMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        )
    )
)

Attributes

aggregate_key_type

.

  • IP - Aggregate the request counts on the IP address from the web request origin.

  • FORWARDED_IP - Aggregate the request counts on the first IP address in an HTTP header. If you use this, configure the ForwardedIPConfig , to specify the header to use.

You can only use the IP and FORWARDED_IP key types.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ratebasedstatement.html#cfn-wafv2-rulegroup-ratebasedstatement-aggregatekeytype

Type:

Setting that indicates how to aggregate the request counts. The options are the following

forwarded_ip_config

The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that’s reported by the web request origin.

Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name. .. epigraph:

If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.

This is required if you specify a forwarded IP in the rule’s aggregate key settings.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ratebasedstatement.html#cfn-wafv2-rulegroup-ratebasedstatement-forwardedipconfig

limit

The limit on requests per 5-minute period for a single originating IP address.

If the statement includes a ScopeDownStatement , this limit is applied only to the requests that match the statement.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ratebasedstatement.html#cfn-wafv2-rulegroup-ratebasedstatement-limit

scope_down_statement

An optional nested statement that narrows the scope of the web requests that are evaluated by the rate-based statement.

Requests are only tracked by the rate-based statement if they match the scope-down statement. You can use any nestable statement in the scope-down statement, and you can nest statements at any level, the same as you can for a rule statement.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ratebasedstatement.html#cfn-wafv2-rulegroup-ratebasedstatement-scopedownstatement

RegexMatchStatementProperty

class CfnRuleGroup.RegexMatchStatementProperty(*, field_to_match, regex_string, text_transformations)

Bases: object

A rule statement used to search web request components for a match against a single regular expression.

Parameters:
  • field_to_match (Union[IResolvable, FieldToMatchProperty, Dict[str, Any]]) – The part of the web request that you want AWS WAF to inspect.

  • regex_string (str) – The string representing the regular expression.

  • text_transformations (Union[IResolvable, Sequence[Union[IResolvable, TextTransformationProperty, Dict[str, Any]]]]) – Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by FieldToMatch , starting from the lowest priority setting, before inspecting the content for a match.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-regexmatchstatement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any
# all_query_arguments: Any
# method: Any
# query_string: Any
# single_header: Any
# single_query_argument: Any
# uri_path: Any

regex_match_statement_property = wafv2.CfnRuleGroup.RegexMatchStatementProperty(
    field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
        all_query_arguments=all_query_arguments,
        body=wafv2.CfnRuleGroup.BodyProperty(
            oversize_handling="oversizeHandling"
        ),
        cookies=wafv2.CfnRuleGroup.CookiesProperty(
            match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                all=all,
                excluded_cookies=["excludedCookies"],
                included_cookies=["includedCookies"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        headers=wafv2.CfnRuleGroup.HeadersProperty(
            match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                all=all,
                excluded_headers=["excludedHeaders"],
                included_headers=["includedHeaders"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
            match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                all=all,
                included_paths=["includedPaths"]
            ),
            match_scope="matchScope",

            # the properties below are optional
            invalid_fallback_behavior="invalidFallbackBehavior",
            oversize_handling="oversizeHandling"
        ),
        method=method,
        query_string=query_string,
        single_header=single_header,
        single_query_argument=single_query_argument,
        uri_path=uri_path
    ),
    regex_string="regexString",
    text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
        priority=123,
        type="type"
    )]
)

Attributes

field_to_match

The part of the web request that you want AWS WAF to inspect.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-regexmatchstatement.html#cfn-wafv2-rulegroup-regexmatchstatement-fieldtomatch

regex_string

The string representing the regular expression.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-regexmatchstatement.html#cfn-wafv2-rulegroup-regexmatchstatement-regexstring

text_transformations

Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection.

If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by FieldToMatch , starting from the lowest priority setting, before inspecting the content for a match.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-regexmatchstatement.html#cfn-wafv2-rulegroup-regexmatchstatement-texttransformations

RegexPatternSetReferenceStatementProperty

class CfnRuleGroup.RegexPatternSetReferenceStatementProperty(*, arn, field_to_match, text_transformations)

Bases: object

A rule statement used to search web request components for matches with regular expressions.

To use this, create a RegexPatternSet that specifies the expressions that you want to detect, then use the ARN of that set in this statement. A web request matches the pattern set rule statement if the request component matches any of the patterns in the set.

Each regex pattern set rule statement references a regex pattern set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, AWS WAF automatically updates all rules that reference it.

Parameters:
  • arn (str) – The Amazon Resource Name (ARN) of the RegexPatternSet that this statement references.

  • field_to_match (Union[IResolvable, FieldToMatchProperty, Dict[str, Any]]) – The part of the web request that you want AWS WAF to inspect.

  • text_transformations (Union[IResolvable, Sequence[Union[IResolvable, TextTransformationProperty, Dict[str, Any]]]]) – Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by FieldToMatch , starting from the lowest priority setting, before inspecting the content for a match.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-regexpatternsetreferencestatement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any
# all_query_arguments: Any
# method: Any
# query_string: Any
# single_header: Any
# single_query_argument: Any
# uri_path: Any

regex_pattern_set_reference_statement_property = wafv2.CfnRuleGroup.RegexPatternSetReferenceStatementProperty(
    arn="arn",
    field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
        all_query_arguments=all_query_arguments,
        body=wafv2.CfnRuleGroup.BodyProperty(
            oversize_handling="oversizeHandling"
        ),
        cookies=wafv2.CfnRuleGroup.CookiesProperty(
            match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                all=all,
                excluded_cookies=["excludedCookies"],
                included_cookies=["includedCookies"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        headers=wafv2.CfnRuleGroup.HeadersProperty(
            match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                all=all,
                excluded_headers=["excludedHeaders"],
                included_headers=["includedHeaders"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
            match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                all=all,
                included_paths=["includedPaths"]
            ),
            match_scope="matchScope",

            # the properties below are optional
            invalid_fallback_behavior="invalidFallbackBehavior",
            oversize_handling="oversizeHandling"
        ),
        method=method,
        query_string=query_string,
        single_header=single_header,
        single_query_argument=single_query_argument,
        uri_path=uri_path
    ),
    text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
        priority=123,
        type="type"
    )]
)

Attributes

arn

The Amazon Resource Name (ARN) of the RegexPatternSet that this statement references.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-regexpatternsetreferencestatement.html#cfn-wafv2-rulegroup-regexpatternsetreferencestatement-arn

field_to_match

The part of the web request that you want AWS WAF to inspect.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-regexpatternsetreferencestatement.html#cfn-wafv2-rulegroup-regexpatternsetreferencestatement-fieldtomatch

text_transformations

Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection.

If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by FieldToMatch , starting from the lowest priority setting, before inspecting the content for a match.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-regexpatternsetreferencestatement.html#cfn-wafv2-rulegroup-regexpatternsetreferencestatement-texttransformations

RuleActionProperty

class CfnRuleGroup.RuleActionProperty(*, allow=None, block=None, captcha=None, challenge=None, count=None)

Bases: object

The action that AWS WAF should take on a web request when it matches a rule’s statement.

Settings at the web ACL level can override the rule action setting.

Parameters:
  • allow (Optional[Any]) – Instructs AWS WAF to allow the web request.

  • block (Optional[Any]) – Instructs AWS WAF to block the web request.

  • captcha (Optional[Any]) – Specifies that AWS WAF should run a CAPTCHA check against the request:. - If the request includes a valid, unexpired CAPTCHA token, AWS WAF allows the web request inspection to proceed to the next rule, similar to a CountAction . - If the request doesn’t include a valid, unexpired CAPTCHA token, AWS WAF discontinues the web ACL evaluation of the request and blocks it from going to its intended destination. AWS WAF generates a response that it sends back to the client, which includes the following: - The header x-amzn-waf-action with a value of captcha . - The HTTP status code 405 Method Not Allowed . - If the request contains an Accept header with a value of text/html , the response includes a CAPTCHA challenge. You can configure the expiration time in the CaptchaConfig ImmunityTimeProperty setting at the rule and web ACL level. The rule setting overrides the web ACL setting. This action option is available for rules. It isn’t available for web ACL default actions.

  • challenge (Optional[Any]) – Instructs AWS WAF to run a Challenge check against the web request.

  • count (Optional[Any]) – Instructs AWS WAF to count the web request and then continue evaluating the request using the remaining rules in the web ACL.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ruleaction.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# allow: Any
# block: Any
# captcha: Any
# challenge: Any
# count: Any

rule_action_property = wafv2.CfnRuleGroup.RuleActionProperty(
    allow=allow,
    block=block,
    captcha=captcha,
    challenge=challenge,
    count=count
)

Attributes

allow

Instructs AWS WAF to allow the web request.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ruleaction.html#cfn-wafv2-rulegroup-ruleaction-allow

block

Instructs AWS WAF to block the web request.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ruleaction.html#cfn-wafv2-rulegroup-ruleaction-block

captcha

.

  • If the request includes a valid, unexpired CAPTCHA token, AWS WAF allows the web request inspection to proceed to the next rule, similar to a CountAction .

  • If the request doesn’t include a valid, unexpired CAPTCHA token, AWS WAF discontinues the web ACL evaluation of the request and blocks it from going to its intended destination.

AWS WAF generates a response that it sends back to the client, which includes the following:

  • The header x-amzn-waf-action with a value of captcha .

  • The HTTP status code 405 Method Not Allowed .

  • If the request contains an Accept header with a value of text/html , the response includes a CAPTCHA challenge.

You can configure the expiration time in the CaptchaConfig ImmunityTimeProperty setting at the rule and web ACL level. The rule setting overrides the web ACL setting.

This action option is available for rules. It isn’t available for web ACL default actions.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ruleaction.html#cfn-wafv2-rulegroup-ruleaction-captcha

Type:

Specifies that AWS WAF should run a CAPTCHA check against the request

challenge

Instructs AWS WAF to run a Challenge check against the web request.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ruleaction.html#cfn-wafv2-rulegroup-ruleaction-challenge

count

Instructs AWS WAF to count the web request and then continue evaluating the request using the remaining rules in the web ACL.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ruleaction.html#cfn-wafv2-rulegroup-ruleaction-count

RuleProperty

class CfnRuleGroup.RuleProperty(*, name, priority, statement, visibility_config, action=None, captcha_config=None, challenge_config=None, rule_labels=None)

Bases: object

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 AWS WAF uses to identify matching web requests, and parameters that govern how AWS WAF handles them.

Parameters:
  • name (str) – The name of the rule. You can’t change the name of a Rule after you create it.

  • priority (Union[int, float]) – If you define more than one Rule in a WebACL , AWS WAF evaluates each request against the Rules in order based on the value of Priority . AWS WAF processes rules with lower priority first. The priorities don’t need to be consecutive, but they must all be different.

  • statement (Union[IResolvable, StatementProperty, Dict[str, Any]]) – The AWS WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement .

  • visibility_config (Union[IResolvable, VisibilityConfigProperty, Dict[str, Any]]) – Defines and enables Amazon CloudWatch metrics and web request sample collection.

  • action (Union[IResolvable, RuleActionProperty, Dict[str, Any], None]) – 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.

  • captcha_config (Union[IResolvable, CaptchaConfigProperty, Dict[str, Any], None]) – Specifies how AWS WAF should handle CAPTCHA evaluations. If you don’t specify this, AWS WAF uses the CAPTCHA configuration that’s defined for the web ACL.

  • challenge_config (Union[IResolvable, ChallengeConfigProperty, Dict[str, Any], None]) – 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.

  • rule_labels (Union[IResolvable, Sequence[Union[IResolvable, LabelProperty, Dict[str, Any]]], None]) – 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 , or ipset . For example, myLabelName or nameSpace1:nameSpace2:myLabelName .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-rule.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any
# allow: Any
# all_query_arguments: Any
# block: Any
# captcha: Any
# challenge: Any
# count: Any
# method: Any
# query_string: Any
# single_header: Any
# single_query_argument: Any
# statement_property_: wafv2.CfnRuleGroup.StatementProperty
# uri_path: Any

rule_property = wafv2.CfnRuleGroup.RuleProperty(
    name="name",
    priority=123,
    statement=wafv2.CfnRuleGroup.StatementProperty(
        and_statement=wafv2.CfnRuleGroup.AndStatementProperty(
            statements=[statement_property_]
        ),
        byte_match_statement=wafv2.CfnRuleGroup.ByteMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            positional_constraint="positionalConstraint",
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )],

            # the properties below are optional
            search_string="searchString",
            search_string_base64="searchStringBase64"
        ),
        geo_match_statement=wafv2.CfnRuleGroup.GeoMatchStatementProperty(
            country_codes=["countryCodes"],
            forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                fallback_behavior="fallbackBehavior",
                header_name="headerName"
            )
        ),
        ip_set_reference_statement={
            "arn": "arn",

            # the properties below are optional
            "ip_set_forwarded_ip_config": {
                "fallback_behavior": "fallbackBehavior",
                "header_name": "headerName",
                "position": "position"
            }
        },
        label_match_statement=wafv2.CfnRuleGroup.LabelMatchStatementProperty(
            key="key",
            scope="scope"
        ),
        not_statement=wafv2.CfnRuleGroup.NotStatementProperty(
            statement=statement_property_
        ),
        or_statement=wafv2.CfnRuleGroup.OrStatementProperty(
            statements=[statement_property_]
        ),
        rate_based_statement=wafv2.CfnRuleGroup.RateBasedStatementProperty(
            aggregate_key_type="aggregateKeyType",
            limit=123,

            # the properties below are optional
            forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                fallback_behavior="fallbackBehavior",
                header_name="headerName"
            ),
            scope_down_statement=statement_property_
        ),
        regex_match_statement=wafv2.CfnRuleGroup.RegexMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            regex_string="regexString",
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        ),
        regex_pattern_set_reference_statement=wafv2.CfnRuleGroup.RegexPatternSetReferenceStatementProperty(
            arn="arn",
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        ),
        size_constraint_statement=wafv2.CfnRuleGroup.SizeConstraintStatementProperty(
            comparison_operator="comparisonOperator",
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            size=123,
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        ),
        sqli_match_statement=wafv2.CfnRuleGroup.SqliMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )],

            # the properties below are optional
            sensitivity_level="sensitivityLevel"
        ),
        xss_match_statement=wafv2.CfnRuleGroup.XssMatchStatementProperty(
            field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                all_query_arguments=all_query_arguments,
                body=wafv2.CfnRuleGroup.BodyProperty(
                    oversize_handling="oversizeHandling"
                ),
                cookies=wafv2.CfnRuleGroup.CookiesProperty(
                    match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                        all=all,
                        excluded_cookies=["excludedCookies"],
                        included_cookies=["includedCookies"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                headers=wafv2.CfnRuleGroup.HeadersProperty(
                    match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                        all=all,
                        excluded_headers=["excludedHeaders"],
                        included_headers=["includedHeaders"]
                    ),
                    match_scope="matchScope",
                    oversize_handling="oversizeHandling"
                ),
                json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                    match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                        all=all,
                        included_paths=["includedPaths"]
                    ),
                    match_scope="matchScope",

                    # the properties below are optional
                    invalid_fallback_behavior="invalidFallbackBehavior",
                    oversize_handling="oversizeHandling"
                ),
                method=method,
                query_string=query_string,
                single_header=single_header,
                single_query_argument=single_query_argument,
                uri_path=uri_path
            ),
            text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                priority=123,
                type="type"
            )]
        )
    ),
    visibility_config=wafv2.CfnRuleGroup.VisibilityConfigProperty(
        cloud_watch_metrics_enabled=False,
        metric_name="metricName",
        sampled_requests_enabled=False
    ),

    # the properties below are optional
    action=wafv2.CfnRuleGroup.RuleActionProperty(
        allow=allow,
        block=block,
        captcha=captcha,
        challenge=challenge,
        count=count
    ),
    captcha_config=wafv2.CfnRuleGroup.CaptchaConfigProperty(
        immunity_time_property=wafv2.CfnRuleGroup.ImmunityTimePropertyProperty(
            immunity_time=123
        )
    ),
    challenge_config=wafv2.CfnRuleGroup.ChallengeConfigProperty(
        immunity_time_property=wafv2.CfnRuleGroup.ImmunityTimePropertyProperty(
            immunity_time=123
        )
    ),
    rule_labels=[wafv2.CfnRuleGroup.LabelProperty(
        name="name"
    )]
)

Attributes

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.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-rule.html#cfn-wafv2-rulegroup-rule-action

captcha_config

Specifies how AWS WAF should handle CAPTCHA evaluations.

If you don’t specify this, AWS WAF uses the CAPTCHA configuration that’s defined for the web ACL.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-rule.html#cfn-wafv2-rulegroup-rule-captchaconfig

challenge_config

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.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-rule.html#cfn-wafv2-rulegroup-rule-challengeconfig

name

The name of the rule.

You can’t change the name of a Rule after you create it.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-rule.html#cfn-wafv2-rulegroup-rule-name

priority

If you define more than one Rule in a WebACL , AWS WAF evaluates each request against the Rules in order based on the value of Priority .

AWS WAF processes rules with lower priority first. The priorities don’t need to be consecutive, but they must all be different.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-rule.html#cfn-wafv2-rulegroup-rule-priority

rule_labels

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 , or ipset .

For example, myLabelName or nameSpace1:nameSpace2:myLabelName .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-rule.html#cfn-wafv2-rulegroup-rule-rulelabels

statement

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

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-rule.html#cfn-wafv2-rulegroup-rule-statement

visibility_config

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

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-rule.html#cfn-wafv2-rulegroup-rule-visibilityconfig

SingleHeaderProperty

class CfnRuleGroup.SingleHeaderProperty(*, name)

Bases: object

Inspect one of the headers in the web request, identified by name, for example, User-Agent or Referer .

The name isn’t case sensitive.

You can filter and inspect all headers with the FieldToMatch setting Headers .

This is used to indicate the web request component to inspect, in the FieldToMatch specification.

Example JSON: "SingleHeader": { "Name": "haystack" }

Parameters:

name (str) – The name of the query header to inspect.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-singleheader.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

single_header_property = wafv2.CfnRuleGroup.SingleHeaderProperty(
    name="name"
)

Attributes

name

The name of the query header to inspect.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-singleheader.html#cfn-wafv2-rulegroup-singleheader-name

SingleQueryArgumentProperty

class CfnRuleGroup.SingleQueryArgumentProperty(*, name)

Bases: object

Inspect one query argument in the web request, identified by name, for example UserName or SalesRegion .

The name isn’t case sensitive.

This is used to indicate the web request component to inspect, in the FieldToMatch specification.

Example JSON: "SingleQueryArgument": { "Name": "myArgument" }

Parameters:

name (str) – The name of the query argument to inspect.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-singlequeryargument.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

single_query_argument_property = wafv2.CfnRuleGroup.SingleQueryArgumentProperty(
    name="name"
)

Attributes

name

The name of the query argument to inspect.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-singlequeryargument.html#cfn-wafv2-rulegroup-singlequeryargument-name

SizeConstraintStatementProperty

class CfnRuleGroup.SizeConstraintStatementProperty(*, comparison_operator, field_to_match, size, text_transformations)

Bases: object

A rule statement that compares a number of bytes against the size of a request component, using a comparison operator, such as greater than (>) or less than (<).

For example, you can use a size constraint statement to look for query strings that are longer than 100 bytes.

If you configure AWS WAF to inspect the request body, AWS WAF inspects only the number of bytes of the body up to the limit for the web ACL. By default, for regional web ACLs, this limit is 8 KB (8,192 kilobytes) and for CloudFront web ACLs, this limit is 16 KB (16,384 kilobytes). For CloudFront web ACLs, you can increase the limit in the web ACL AssociationConfig , for additional fees. If you know that the request body for your web requests should never exceed the inspection limit, you could use a size constraint statement to block requests that have a larger request body size.

If you choose URI for the value of Part of the request to filter on, the slash (/) in the URI counts as one character. For example, the URI /logo.jpg is nine characters long.

Parameters:
  • comparison_operator (str) – The operator to use to compare the request part to the size setting.

  • field_to_match (Union[IResolvable, FieldToMatchProperty, Dict[str, Any]]) – The part of the web request that you want AWS WAF to inspect.

  • size (Union[int, float]) – The size, in byte, to compare to the request part, after any transformations.

  • text_transformations (Union[IResolvable, Sequence[Union[IResolvable, TextTransformationProperty, Dict[str, Any]]]]) – Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by FieldToMatch , starting from the lowest priority setting, before inspecting the content for a match.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-sizeconstraintstatement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any
# all_query_arguments: Any
# method: Any
# query_string: Any
# single_header: Any
# single_query_argument: Any
# uri_path: Any

size_constraint_statement_property = wafv2.CfnRuleGroup.SizeConstraintStatementProperty(
    comparison_operator="comparisonOperator",
    field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
        all_query_arguments=all_query_arguments,
        body=wafv2.CfnRuleGroup.BodyProperty(
            oversize_handling="oversizeHandling"
        ),
        cookies=wafv2.CfnRuleGroup.CookiesProperty(
            match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                all=all,
                excluded_cookies=["excludedCookies"],
                included_cookies=["includedCookies"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        headers=wafv2.CfnRuleGroup.HeadersProperty(
            match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                all=all,
                excluded_headers=["excludedHeaders"],
                included_headers=["includedHeaders"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
            match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                all=all,
                included_paths=["includedPaths"]
            ),
            match_scope="matchScope",

            # the properties below are optional
            invalid_fallback_behavior="invalidFallbackBehavior",
            oversize_handling="oversizeHandling"
        ),
        method=method,
        query_string=query_string,
        single_header=single_header,
        single_query_argument=single_query_argument,
        uri_path=uri_path
    ),
    size=123,
    text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
        priority=123,
        type="type"
    )]
)

Attributes

comparison_operator

The operator to use to compare the request part to the size setting.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-sizeconstraintstatement.html#cfn-wafv2-rulegroup-sizeconstraintstatement-comparisonoperator

field_to_match

The part of the web request that you want AWS WAF to inspect.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-sizeconstraintstatement.html#cfn-wafv2-rulegroup-sizeconstraintstatement-fieldtomatch

size

The size, in byte, to compare to the request part, after any transformations.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-sizeconstraintstatement.html#cfn-wafv2-rulegroup-sizeconstraintstatement-size

text_transformations

Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection.

If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by FieldToMatch , starting from the lowest priority setting, before inspecting the content for a match.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-sizeconstraintstatement.html#cfn-wafv2-rulegroup-sizeconstraintstatement-texttransformations

SqliMatchStatementProperty

class CfnRuleGroup.SqliMatchStatementProperty(*, field_to_match, text_transformations, sensitivity_level=None)

Bases: object

A rule statement that inspects for malicious SQL code.

Attackers insert malicious SQL code into web requests to do things like modify your database or extract data from it.

Parameters:
  • field_to_match (Union[IResolvable, FieldToMatchProperty, Dict[str, Any]]) – The part of the web request that you want AWS WAF to inspect.

  • text_transformations (Union[IResolvable, Sequence[Union[IResolvable, TextTransformationProperty, Dict[str, Any]]]]) – Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by FieldToMatch , starting from the lowest priority setting, before inspecting the content for a match.

  • sensitivity_level (Optional[str]) – The sensitivity that you want AWS WAF to use to inspect for SQL injection attacks. HIGH detects more attacks, but might generate more false positives, especially if your web requests frequently contain unusual strings. For information about identifying and mitigating false positives, see Testing and tuning in the AWS WAF Developer Guide . LOW is generally a better choice for resources that already have other protections against SQL injection attacks or that have a low tolerance for false positives. Default: LOW

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-sqlimatchstatement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any
# all_query_arguments: Any
# method: Any
# query_string: Any
# single_header: Any
# single_query_argument: Any
# uri_path: Any

sqli_match_statement_property = wafv2.CfnRuleGroup.SqliMatchStatementProperty(
    field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
        all_query_arguments=all_query_arguments,
        body=wafv2.CfnRuleGroup.BodyProperty(
            oversize_handling="oversizeHandling"
        ),
        cookies=wafv2.CfnRuleGroup.CookiesProperty(
            match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                all=all,
                excluded_cookies=["excludedCookies"],
                included_cookies=["includedCookies"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        headers=wafv2.CfnRuleGroup.HeadersProperty(
            match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                all=all,
                excluded_headers=["excludedHeaders"],
                included_headers=["includedHeaders"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
            match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                all=all,
                included_paths=["includedPaths"]
            ),
            match_scope="matchScope",

            # the properties below are optional
            invalid_fallback_behavior="invalidFallbackBehavior",
            oversize_handling="oversizeHandling"
        ),
        method=method,
        query_string=query_string,
        single_header=single_header,
        single_query_argument=single_query_argument,
        uri_path=uri_path
    ),
    text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
        priority=123,
        type="type"
    )],

    # the properties below are optional
    sensitivity_level="sensitivityLevel"
)

Attributes

field_to_match

The part of the web request that you want AWS WAF to inspect.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-sqlimatchstatement.html#cfn-wafv2-rulegroup-sqlimatchstatement-fieldtomatch

sensitivity_level

The sensitivity that you want AWS WAF to use to inspect for SQL injection attacks.

HIGH detects more attacks, but might generate more false positives, especially if your web requests frequently contain unusual strings. For information about identifying and mitigating false positives, see Testing and tuning in the AWS WAF Developer Guide .

LOW is generally a better choice for resources that already have other protections against SQL injection attacks or that have a low tolerance for false positives.

Default: LOW

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-sqlimatchstatement.html#cfn-wafv2-rulegroup-sqlimatchstatement-sensitivitylevel

text_transformations

Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection.

If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by FieldToMatch , starting from the lowest priority setting, before inspecting the content for a match.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-sqlimatchstatement.html#cfn-wafv2-rulegroup-sqlimatchstatement-texttransformations

StatementProperty

class CfnRuleGroup.StatementProperty(*, and_statement=None, byte_match_statement=None, geo_match_statement=None, ip_set_reference_statement=None, label_match_statement=None, not_statement=None, or_statement=None, rate_based_statement=None, regex_match_statement=None, regex_pattern_set_reference_statement=None, size_constraint_statement=None, sqli_match_statement=None, xss_match_statement=None)

Bases: object

The processing guidance for a rule, used by AWS WAF to determine whether a web request matches the rule.

Parameters:
  • and_statement (Union[IResolvable, AndStatementProperty, Dict[str, Any], None]) – A logical rule statement used to combine other rule statements with AND logic. You provide more than one Statement within the AndStatement .

  • byte_match_statement (Union[IResolvable, ByteMatchStatementProperty, Dict[str, Any], None]) – A rule statement that defines a string match search for AWS WAF to apply to web requests. The byte match statement provides the bytes to search for, the location in requests that you want AWS WAF to search, and other settings. The bytes to search for are typically a string that corresponds with ASCII characters. In the AWS WAF console and the developer guide, this is called a string match statement.

  • geo_match_statement (Union[IResolvable, GeoMatchStatementProperty, Dict[str, Any], None]) –

    A rule statement that labels web requests by country and region and that matches against web requests based on country code. A geo match rule labels every request that it inspects regardless of whether it finds a match. - To manage requests only by country, you can use this statement by itself and specify the countries that you want to match against in the CountryCodes array. - Otherwise, configure your geo match rule with Count action so that it only labels requests. Then, add one or more label match rules to run after the geo match rule and configure them to match against the geographic labels and handle the requests as needed. AWS WAF labels requests using the alpha-2 country and region codes from the International Organization for Standardization (ISO) 3166 standard. AWS WAF determines the codes using either the IP address in the web request origin or, if you specify it, the address in the geo match ForwardedIPConfig . If you use the web request origin, the label formats are awswaf:clientip:geo:region:<ISO country code>-<ISO region code> and awswaf:clientip:geo:country:<ISO country code> . If you use a forwarded IP address, the label formats are awswaf:forwardedip:geo:region:<ISO country code>-<ISO region code> and awswaf:forwardedip:geo:country:<ISO country code> . For additional details, see Geographic match rule statement in the AWS WAF Developer Guide .

  • ip_set_reference_statement (Union[IResolvable, IPSetReferenceStatementProperty, Dict[str, Any], None]) – A rule statement used to detect web requests coming from particular IP addresses or address ranges. To use this, create an IPSet that specifies the addresses you want to detect, then use the ARN of that set in this statement. Each IP set rule statement references an IP set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, AWS WAF automatically updates all rules that reference it.

  • label_match_statement (Union[IResolvable, LabelMatchStatementProperty, Dict[str, Any], None]) – A rule statement to match against labels that have been added to the web request by rules that have already run in the web ACL. The label match statement provides the label or namespace string to search for. The label string can represent a part or all of the fully qualified label name that had been added to the web request. Fully qualified labels have a prefix, optional namespaces, and label name. The prefix identifies the rule group or web ACL context of the rule that added the label. If you do not provide the fully qualified name in your label match string, AWS WAF performs the search for labels that were added in the same context as the label match statement.

  • not_statement (Union[IResolvable, NotStatementProperty, Dict[str, Any], None]) – A logical rule statement used to negate the results of another rule statement. You provide one Statement within the NotStatement .

  • or_statement (Union[IResolvable, OrStatementProperty, Dict[str, Any], None]) – A logical rule statement used to combine other rule statements with OR logic. You provide more than one Statement within the OrStatement .

  • rate_based_statement (Union[IResolvable, RateBasedStatementProperty, Dict[str, Any], None]) – A rate-based rule tracks the rate of requests for each originating IP address, and triggers the rule action when the rate exceeds a limit that you specify on the number of requests in any 5-minute time span. You can use this to put a temporary block on requests from an IP address that is sending excessive requests. AWS WAF tracks and manages web requests separately for each instance of a rate-based rule that you use. For example, if you provide the same rate-based rule settings in two web ACLs, each of the two rule statements represents a separate instance of the rate-based rule and gets its own tracking and management by AWS WAF . If you define a rate-based rule inside a rule group, and then use that rule group in multiple places, each use creates a separate instance of the rate-based rule that gets its own tracking and management by AWS WAF . When the rule action triggers, AWS WAF blocks additional requests from the IP address until the request rate falls below the limit. You can optionally nest another statement inside the rate-based statement, to narrow the scope of the rule so that it only counts requests that match the nested statement. For example, based on recent requests that you have seen from an attacker, you might create a rate-based rule with a nested AND rule statement that contains the following nested statements: - An IP match statement with an IP set that specifies the address 192.0.2.44. - A string match statement that searches in the User-Agent header for the string BadBot. In this rate-based rule, you also define a rate limit. For this example, the rate limit is 1,000. Requests that meet the criteria of both of the nested statements are counted. If the count exceeds 1,000 requests per five minutes, the rule action triggers. Requests that do not meet the criteria of both of the nested statements are not counted towards the rate limit and are not affected by this rule. You cannot nest a RateBasedStatement inside another statement, for example inside a NotStatement or OrStatement . You can define a RateBasedStatement inside a web ACL and inside a rule group.

  • regex_match_statement (Union[IResolvable, RegexMatchStatementProperty, Dict[str, Any], None]) – A rule statement used to search web request components for a match against a single regular expression.

  • regex_pattern_set_reference_statement (Union[IResolvable, RegexPatternSetReferenceStatementProperty, Dict[str, Any], None]) – A rule statement used to search web request components for matches with regular expressions. To use this, create a RegexPatternSet that specifies the expressions that you want to detect, then use the ARN of that set in this statement. A web request matches the pattern set rule statement if the request component matches any of the patterns in the set. Each regex pattern set rule statement references a regex pattern set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, AWS WAF automatically updates all rules that reference it.

  • size_constraint_statement (Union[IResolvable, SizeConstraintStatementProperty, Dict[str, Any], None]) – A rule statement that compares a number of bytes against the size of a request component, using a comparison operator, such as greater than (>) or less than (<). For example, you can use a size constraint statement to look for query strings that are longer than 100 bytes. If you configure AWS WAF to inspect the request body, AWS WAF inspects only the number of bytes of the body up to the limit for the web ACL. By default, for regional web ACLs, this limit is 8 KB (8,192 kilobytes) and for CloudFront web ACLs, this limit is 16 KB (16,384 kilobytes). For CloudFront web ACLs, you can increase the limit in the web ACL AssociationConfig , for additional fees. If you know that the request body for your web requests should never exceed the inspection limit, you could use a size constraint statement to block requests that have a larger request body size. If you choose URI for the value of Part of the request to filter on, the slash (/) in the URI counts as one character. For example, the URI /logo.jpg is nine characters long.

  • sqli_match_statement (Union[IResolvable, SqliMatchStatementProperty, Dict[str, Any], None]) – A rule statement that inspects for malicious SQL code. Attackers insert malicious SQL code into web requests to do things like modify your database or extract data from it.

  • xss_match_statement (Union[IResolvable, XssMatchStatementProperty, Dict[str, Any], None]) – A rule statement that inspects for cross-site scripting (XSS) attacks. In XSS attacks, the attacker uses vulnerabilities in a benign website as a vehicle to inject malicious client-site scripts into other legitimate web browsers.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any
# all_query_arguments: Any
# and_statement_property_: wafv2.CfnRuleGroup.AndStatementProperty
# method: Any
# not_statement_property_: wafv2.CfnRuleGroup.NotStatementProperty
# or_statement_property_: wafv2.CfnRuleGroup.OrStatementProperty
# query_string: Any
# rate_based_statement_property_: wafv2.CfnRuleGroup.RateBasedStatementProperty
# single_header: Any
# single_query_argument: Any
# statement_property_: wafv2.CfnRuleGroup.StatementProperty
# uri_path: Any

statement_property = wafv2.CfnRuleGroup.StatementProperty(
    and_statement=wafv2.CfnRuleGroup.AndStatementProperty(
        statements=[wafv2.CfnRuleGroup.StatementProperty(
            and_statement=and_statement_property_,
            byte_match_statement=wafv2.CfnRuleGroup.ByteMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                positional_constraint="positionalConstraint",
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )],

                # the properties below are optional
                search_string="searchString",
                search_string_base64="searchStringBase64"
            ),
            geo_match_statement=wafv2.CfnRuleGroup.GeoMatchStatementProperty(
                country_codes=["countryCodes"],
                forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                    fallback_behavior="fallbackBehavior",
                    header_name="headerName"
                )
            ),
            ip_set_reference_statement={
                "arn": "arn",

                # the properties below are optional
                "ip_set_forwarded_ip_config": {
                    "fallback_behavior": "fallbackBehavior",
                    "header_name": "headerName",
                    "position": "position"
                }
            },
            label_match_statement=wafv2.CfnRuleGroup.LabelMatchStatementProperty(
                key="key",
                scope="scope"
            ),
            not_statement=wafv2.CfnRuleGroup.NotStatementProperty(
                statement=statement_property_
            ),
            or_statement=wafv2.CfnRuleGroup.OrStatementProperty(
                statements=[statement_property_]
            ),
            rate_based_statement=wafv2.CfnRuleGroup.RateBasedStatementProperty(
                aggregate_key_type="aggregateKeyType",
                limit=123,

                # the properties below are optional
                forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                    fallback_behavior="fallbackBehavior",
                    header_name="headerName"
                ),
                scope_down_statement=statement_property_
            ),
            regex_match_statement=wafv2.CfnRuleGroup.RegexMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                regex_string="regexString",
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            ),
            regex_pattern_set_reference_statement=wafv2.CfnRuleGroup.RegexPatternSetReferenceStatementProperty(
                arn="arn",
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            ),
            size_constraint_statement=wafv2.CfnRuleGroup.SizeConstraintStatementProperty(
                comparison_operator="comparisonOperator",
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                size=123,
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            ),
            sqli_match_statement=wafv2.CfnRuleGroup.SqliMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )],

                # the properties below are optional
                sensitivity_level="sensitivityLevel"
            ),
            xss_match_statement=wafv2.CfnRuleGroup.XssMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            )
        )]
    ),
    byte_match_statement=wafv2.CfnRuleGroup.ByteMatchStatementProperty(
        field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
            all_query_arguments=all_query_arguments,
            body=wafv2.CfnRuleGroup.BodyProperty(
                oversize_handling="oversizeHandling"
            ),
            cookies=wafv2.CfnRuleGroup.CookiesProperty(
                match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                    all=all,
                    excluded_cookies=["excludedCookies"],
                    included_cookies=["includedCookies"]
                ),
                match_scope="matchScope",
                oversize_handling="oversizeHandling"
            ),
            headers=wafv2.CfnRuleGroup.HeadersProperty(
                match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                    all=all,
                    excluded_headers=["excludedHeaders"],
                    included_headers=["includedHeaders"]
                ),
                match_scope="matchScope",
                oversize_handling="oversizeHandling"
            ),
            json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                    all=all,
                    included_paths=["includedPaths"]
                ),
                match_scope="matchScope",

                # the properties below are optional
                invalid_fallback_behavior="invalidFallbackBehavior",
                oversize_handling="oversizeHandling"
            ),
            method=method,
            query_string=query_string,
            single_header=single_header,
            single_query_argument=single_query_argument,
            uri_path=uri_path
        ),
        positional_constraint="positionalConstraint",
        text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
            priority=123,
            type="type"
        )],

        # the properties below are optional
        search_string="searchString",
        search_string_base64="searchStringBase64"
    ),
    geo_match_statement=wafv2.CfnRuleGroup.GeoMatchStatementProperty(
        country_codes=["countryCodes"],
        forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
            fallback_behavior="fallbackBehavior",
            header_name="headerName"
        )
    ),
    ip_set_reference_statement={
        "arn": "arn",

        # the properties below are optional
        "ip_set_forwarded_ip_config": {
            "fallback_behavior": "fallbackBehavior",
            "header_name": "headerName",
            "position": "position"
        }
    },
    label_match_statement=wafv2.CfnRuleGroup.LabelMatchStatementProperty(
        key="key",
        scope="scope"
    ),
    not_statement=wafv2.CfnRuleGroup.NotStatementProperty(
        statement=wafv2.CfnRuleGroup.StatementProperty(
            and_statement=wafv2.CfnRuleGroup.AndStatementProperty(
                statements=[statement_property_]
            ),
            byte_match_statement=wafv2.CfnRuleGroup.ByteMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                positional_constraint="positionalConstraint",
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )],

                # the properties below are optional
                search_string="searchString",
                search_string_base64="searchStringBase64"
            ),
            geo_match_statement=wafv2.CfnRuleGroup.GeoMatchStatementProperty(
                country_codes=["countryCodes"],
                forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                    fallback_behavior="fallbackBehavior",
                    header_name="headerName"
                )
            ),
            ip_set_reference_statement={
                "arn": "arn",

                # the properties below are optional
                "ip_set_forwarded_ip_config": {
                    "fallback_behavior": "fallbackBehavior",
                    "header_name": "headerName",
                    "position": "position"
                }
            },
            label_match_statement=wafv2.CfnRuleGroup.LabelMatchStatementProperty(
                key="key",
                scope="scope"
            ),
            not_statement=not_statement_property_,
            or_statement=wafv2.CfnRuleGroup.OrStatementProperty(
                statements=[statement_property_]
            ),
            rate_based_statement=wafv2.CfnRuleGroup.RateBasedStatementProperty(
                aggregate_key_type="aggregateKeyType",
                limit=123,

                # the properties below are optional
                forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                    fallback_behavior="fallbackBehavior",
                    header_name="headerName"
                ),
                scope_down_statement=statement_property_
            ),
            regex_match_statement=wafv2.CfnRuleGroup.RegexMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                regex_string="regexString",
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            ),
            regex_pattern_set_reference_statement=wafv2.CfnRuleGroup.RegexPatternSetReferenceStatementProperty(
                arn="arn",
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            ),
            size_constraint_statement=wafv2.CfnRuleGroup.SizeConstraintStatementProperty(
                comparison_operator="comparisonOperator",
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                size=123,
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            ),
            sqli_match_statement=wafv2.CfnRuleGroup.SqliMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )],

                # the properties below are optional
                sensitivity_level="sensitivityLevel"
            ),
            xss_match_statement=wafv2.CfnRuleGroup.XssMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            )
        )
    ),
    or_statement=wafv2.CfnRuleGroup.OrStatementProperty(
        statements=[wafv2.CfnRuleGroup.StatementProperty(
            and_statement=wafv2.CfnRuleGroup.AndStatementProperty(
                statements=[statement_property_]
            ),
            byte_match_statement=wafv2.CfnRuleGroup.ByteMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                positional_constraint="positionalConstraint",
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )],

                # the properties below are optional
                search_string="searchString",
                search_string_base64="searchStringBase64"
            ),
            geo_match_statement=wafv2.CfnRuleGroup.GeoMatchStatementProperty(
                country_codes=["countryCodes"],
                forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                    fallback_behavior="fallbackBehavior",
                    header_name="headerName"
                )
            ),
            ip_set_reference_statement={
                "arn": "arn",

                # the properties below are optional
                "ip_set_forwarded_ip_config": {
                    "fallback_behavior": "fallbackBehavior",
                    "header_name": "headerName",
                    "position": "position"
                }
            },
            label_match_statement=wafv2.CfnRuleGroup.LabelMatchStatementProperty(
                key="key",
                scope="scope"
            ),
            not_statement=wafv2.CfnRuleGroup.NotStatementProperty(
                statement=statement_property_
            ),
            or_statement=or_statement_property_,
            rate_based_statement=wafv2.CfnRuleGroup.RateBasedStatementProperty(
                aggregate_key_type="aggregateKeyType",
                limit=123,

                # the properties below are optional
                forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                    fallback_behavior="fallbackBehavior",
                    header_name="headerName"
                ),
                scope_down_statement=statement_property_
            ),
            regex_match_statement=wafv2.CfnRuleGroup.RegexMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                regex_string="regexString",
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            ),
            regex_pattern_set_reference_statement=wafv2.CfnRuleGroup.RegexPatternSetReferenceStatementProperty(
                arn="arn",
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            ),
            size_constraint_statement=wafv2.CfnRuleGroup.SizeConstraintStatementProperty(
                comparison_operator="comparisonOperator",
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                size=123,
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            ),
            sqli_match_statement=wafv2.CfnRuleGroup.SqliMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )],

                # the properties below are optional
                sensitivity_level="sensitivityLevel"
            ),
            xss_match_statement=wafv2.CfnRuleGroup.XssMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            )
        )]
    ),
    rate_based_statement=wafv2.CfnRuleGroup.RateBasedStatementProperty(
        aggregate_key_type="aggregateKeyType",
        limit=123,

        # the properties below are optional
        forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
            fallback_behavior="fallbackBehavior",
            header_name="headerName"
        ),
        scope_down_statement=wafv2.CfnRuleGroup.StatementProperty(
            and_statement=wafv2.CfnRuleGroup.AndStatementProperty(
                statements=[statement_property_]
            ),
            byte_match_statement=wafv2.CfnRuleGroup.ByteMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                positional_constraint="positionalConstraint",
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )],

                # the properties below are optional
                search_string="searchString",
                search_string_base64="searchStringBase64"
            ),
            geo_match_statement=wafv2.CfnRuleGroup.GeoMatchStatementProperty(
                country_codes=["countryCodes"],
                forwarded_ip_config=wafv2.CfnRuleGroup.ForwardedIPConfigurationProperty(
                    fallback_behavior="fallbackBehavior",
                    header_name="headerName"
                )
            ),
            ip_set_reference_statement={
                "arn": "arn",

                # the properties below are optional
                "ip_set_forwarded_ip_config": {
                    "fallback_behavior": "fallbackBehavior",
                    "header_name": "headerName",
                    "position": "position"
                }
            },
            label_match_statement=wafv2.CfnRuleGroup.LabelMatchStatementProperty(
                key="key",
                scope="scope"
            ),
            not_statement=wafv2.CfnRuleGroup.NotStatementProperty(
                statement=statement_property_
            ),
            or_statement=wafv2.CfnRuleGroup.OrStatementProperty(
                statements=[statement_property_]
            ),
            rate_based_statement=rate_based_statement_property_,
            regex_match_statement=wafv2.CfnRuleGroup.RegexMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                regex_string="regexString",
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            ),
            regex_pattern_set_reference_statement=wafv2.CfnRuleGroup.RegexPatternSetReferenceStatementProperty(
                arn="arn",
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            ),
            size_constraint_statement=wafv2.CfnRuleGroup.SizeConstraintStatementProperty(
                comparison_operator="comparisonOperator",
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                size=123,
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            ),
            sqli_match_statement=wafv2.CfnRuleGroup.SqliMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )],

                # the properties below are optional
                sensitivity_level="sensitivityLevel"
            ),
            xss_match_statement=wafv2.CfnRuleGroup.XssMatchStatementProperty(
                field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
                    all_query_arguments=all_query_arguments,
                    body=wafv2.CfnRuleGroup.BodyProperty(
                        oversize_handling="oversizeHandling"
                    ),
                    cookies=wafv2.CfnRuleGroup.CookiesProperty(
                        match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                            all=all,
                            excluded_cookies=["excludedCookies"],
                            included_cookies=["includedCookies"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    headers=wafv2.CfnRuleGroup.HeadersProperty(
                        match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                            all=all,
                            excluded_headers=["excludedHeaders"],
                            included_headers=["includedHeaders"]
                        ),
                        match_scope="matchScope",
                        oversize_handling="oversizeHandling"
                    ),
                    json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                        match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                            all=all,
                            included_paths=["includedPaths"]
                        ),
                        match_scope="matchScope",

                        # the properties below are optional
                        invalid_fallback_behavior="invalidFallbackBehavior",
                        oversize_handling="oversizeHandling"
                    ),
                    method=method,
                    query_string=query_string,
                    single_header=single_header,
                    single_query_argument=single_query_argument,
                    uri_path=uri_path
                ),
                text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
                    priority=123,
                    type="type"
                )]
            )
        )
    ),
    regex_match_statement=wafv2.CfnRuleGroup.RegexMatchStatementProperty(
        field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
            all_query_arguments=all_query_arguments,
            body=wafv2.CfnRuleGroup.BodyProperty(
                oversize_handling="oversizeHandling"
            ),
            cookies=wafv2.CfnRuleGroup.CookiesProperty(
                match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                    all=all,
                    excluded_cookies=["excludedCookies"],
                    included_cookies=["includedCookies"]
                ),
                match_scope="matchScope",
                oversize_handling="oversizeHandling"
            ),
            headers=wafv2.CfnRuleGroup.HeadersProperty(
                match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                    all=all,
                    excluded_headers=["excludedHeaders"],
                    included_headers=["includedHeaders"]
                ),
                match_scope="matchScope",
                oversize_handling="oversizeHandling"
            ),
            json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                    all=all,
                    included_paths=["includedPaths"]
                ),
                match_scope="matchScope",

                # the properties below are optional
                invalid_fallback_behavior="invalidFallbackBehavior",
                oversize_handling="oversizeHandling"
            ),
            method=method,
            query_string=query_string,
            single_header=single_header,
            single_query_argument=single_query_argument,
            uri_path=uri_path
        ),
        regex_string="regexString",
        text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
            priority=123,
            type="type"
        )]
    ),
    regex_pattern_set_reference_statement=wafv2.CfnRuleGroup.RegexPatternSetReferenceStatementProperty(
        arn="arn",
        field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
            all_query_arguments=all_query_arguments,
            body=wafv2.CfnRuleGroup.BodyProperty(
                oversize_handling="oversizeHandling"
            ),
            cookies=wafv2.CfnRuleGroup.CookiesProperty(
                match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                    all=all,
                    excluded_cookies=["excludedCookies"],
                    included_cookies=["includedCookies"]
                ),
                match_scope="matchScope",
                oversize_handling="oversizeHandling"
            ),
            headers=wafv2.CfnRuleGroup.HeadersProperty(
                match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                    all=all,
                    excluded_headers=["excludedHeaders"],
                    included_headers=["includedHeaders"]
                ),
                match_scope="matchScope",
                oversize_handling="oversizeHandling"
            ),
            json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                    all=all,
                    included_paths=["includedPaths"]
                ),
                match_scope="matchScope",

                # the properties below are optional
                invalid_fallback_behavior="invalidFallbackBehavior",
                oversize_handling="oversizeHandling"
            ),
            method=method,
            query_string=query_string,
            single_header=single_header,
            single_query_argument=single_query_argument,
            uri_path=uri_path
        ),
        text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
            priority=123,
            type="type"
        )]
    ),
    size_constraint_statement=wafv2.CfnRuleGroup.SizeConstraintStatementProperty(
        comparison_operator="comparisonOperator",
        field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
            all_query_arguments=all_query_arguments,
            body=wafv2.CfnRuleGroup.BodyProperty(
                oversize_handling="oversizeHandling"
            ),
            cookies=wafv2.CfnRuleGroup.CookiesProperty(
                match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                    all=all,
                    excluded_cookies=["excludedCookies"],
                    included_cookies=["includedCookies"]
                ),
                match_scope="matchScope",
                oversize_handling="oversizeHandling"
            ),
            headers=wafv2.CfnRuleGroup.HeadersProperty(
                match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                    all=all,
                    excluded_headers=["excludedHeaders"],
                    included_headers=["includedHeaders"]
                ),
                match_scope="matchScope",
                oversize_handling="oversizeHandling"
            ),
            json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                    all=all,
                    included_paths=["includedPaths"]
                ),
                match_scope="matchScope",

                # the properties below are optional
                invalid_fallback_behavior="invalidFallbackBehavior",
                oversize_handling="oversizeHandling"
            ),
            method=method,
            query_string=query_string,
            single_header=single_header,
            single_query_argument=single_query_argument,
            uri_path=uri_path
        ),
        size=123,
        text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
            priority=123,
            type="type"
        )]
    ),
    sqli_match_statement=wafv2.CfnRuleGroup.SqliMatchStatementProperty(
        field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
            all_query_arguments=all_query_arguments,
            body=wafv2.CfnRuleGroup.BodyProperty(
                oversize_handling="oversizeHandling"
            ),
            cookies=wafv2.CfnRuleGroup.CookiesProperty(
                match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                    all=all,
                    excluded_cookies=["excludedCookies"],
                    included_cookies=["includedCookies"]
                ),
                match_scope="matchScope",
                oversize_handling="oversizeHandling"
            ),
            headers=wafv2.CfnRuleGroup.HeadersProperty(
                match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                    all=all,
                    excluded_headers=["excludedHeaders"],
                    included_headers=["includedHeaders"]
                ),
                match_scope="matchScope",
                oversize_handling="oversizeHandling"
            ),
            json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                    all=all,
                    included_paths=["includedPaths"]
                ),
                match_scope="matchScope",

                # the properties below are optional
                invalid_fallback_behavior="invalidFallbackBehavior",
                oversize_handling="oversizeHandling"
            ),
            method=method,
            query_string=query_string,
            single_header=single_header,
            single_query_argument=single_query_argument,
            uri_path=uri_path
        ),
        text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
            priority=123,
            type="type"
        )],

        # the properties below are optional
        sensitivity_level="sensitivityLevel"
    ),
    xss_match_statement=wafv2.CfnRuleGroup.XssMatchStatementProperty(
        field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
            all_query_arguments=all_query_arguments,
            body=wafv2.CfnRuleGroup.BodyProperty(
                oversize_handling="oversizeHandling"
            ),
            cookies=wafv2.CfnRuleGroup.CookiesProperty(
                match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                    all=all,
                    excluded_cookies=["excludedCookies"],
                    included_cookies=["includedCookies"]
                ),
                match_scope="matchScope",
                oversize_handling="oversizeHandling"
            ),
            headers=wafv2.CfnRuleGroup.HeadersProperty(
                match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                    all=all,
                    excluded_headers=["excludedHeaders"],
                    included_headers=["includedHeaders"]
                ),
                match_scope="matchScope",
                oversize_handling="oversizeHandling"
            ),
            json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
                match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                    all=all,
                    included_paths=["includedPaths"]
                ),
                match_scope="matchScope",

                # the properties below are optional
                invalid_fallback_behavior="invalidFallbackBehavior",
                oversize_handling="oversizeHandling"
            ),
            method=method,
            query_string=query_string,
            single_header=single_header,
            single_query_argument=single_query_argument,
            uri_path=uri_path
        ),
        text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
            priority=123,
            type="type"
        )]
    )
)

Attributes

and_statement

A logical rule statement used to combine other rule statements with AND logic.

You provide more than one Statement within the AndStatement .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statement.html#cfn-wafv2-rulegroup-statement-andstatement

byte_match_statement

A rule statement that defines a string match search for AWS WAF to apply to web requests.

The byte match statement provides the bytes to search for, the location in requests that you want AWS WAF to search, and other settings. The bytes to search for are typically a string that corresponds with ASCII characters. In the AWS WAF console and the developer guide, this is called a string match statement.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statement.html#cfn-wafv2-rulegroup-statement-bytematchstatement

geo_match_statement

A rule statement that labels web requests by country and region and that matches against web requests based on country code.

A geo match rule labels every request that it inspects regardless of whether it finds a match.

  • To manage requests only by country, you can use this statement by itself and specify the countries that you want to match against in the CountryCodes array.

  • Otherwise, configure your geo match rule with Count action so that it only labels requests. Then, add one or more label match rules to run after the geo match rule and configure them to match against the geographic labels and handle the requests as needed.

AWS WAF labels requests using the alpha-2 country and region codes from the International Organization for Standardization (ISO) 3166 standard. AWS WAF determines the codes using either the IP address in the web request origin or, if you specify it, the address in the geo match ForwardedIPConfig .

If you use the web request origin, the label formats are awswaf:clientip:geo:region:<ISO country code>-<ISO region code> and awswaf:clientip:geo:country:<ISO country code> .

If you use a forwarded IP address, the label formats are awswaf:forwardedip:geo:region:<ISO country code>-<ISO region code> and awswaf:forwardedip:geo:country:<ISO country code> .

For additional details, see Geographic match rule statement in the AWS WAF Developer Guide .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statement.html#cfn-wafv2-rulegroup-statement-geomatchstatement

ip_set_reference_statement

A rule statement used to detect web requests coming from particular IP addresses or address ranges.

To use this, create an IPSet that specifies the addresses you want to detect, then use the ARN of that set in this statement.

Each IP set rule statement references an IP set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, AWS WAF automatically updates all rules that reference it.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statement.html#cfn-wafv2-rulegroup-statement-ipsetreferencestatement

label_match_statement

A rule statement to match against labels that have been added to the web request by rules that have already run in the web ACL.

The label match statement provides the label or namespace string to search for. The label string can represent a part or all of the fully qualified label name that had been added to the web request. Fully qualified labels have a prefix, optional namespaces, and label name. The prefix identifies the rule group or web ACL context of the rule that added the label. If you do not provide the fully qualified name in your label match string, AWS WAF performs the search for labels that were added in the same context as the label match statement.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statement.html#cfn-wafv2-rulegroup-statement-labelmatchstatement

not_statement

A logical rule statement used to negate the results of another rule statement.

You provide one Statement within the NotStatement .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statement.html#cfn-wafv2-rulegroup-statement-notstatement

or_statement

A logical rule statement used to combine other rule statements with OR logic.

You provide more than one Statement within the OrStatement .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statement.html#cfn-wafv2-rulegroup-statement-orstatement

rate_based_statement

A rate-based rule tracks the rate of requests for each originating IP address, and triggers the rule action when the rate exceeds a limit that you specify on the number of requests in any 5-minute time span.

You can use this to put a temporary block on requests from an IP address that is sending excessive requests.

AWS WAF tracks and manages web requests separately for each instance of a rate-based rule that you use. For example, if you provide the same rate-based rule settings in two web ACLs, each of the two rule statements represents a separate instance of the rate-based rule and gets its own tracking and management by AWS WAF . If you define a rate-based rule inside a rule group, and then use that rule group in multiple places, each use creates a separate instance of the rate-based rule that gets its own tracking and management by AWS WAF .

When the rule action triggers, AWS WAF blocks additional requests from the IP address until the request rate falls below the limit.

You can optionally nest another statement inside the rate-based statement, to narrow the scope of the rule so that it only counts requests that match the nested statement. For example, based on recent requests that you have seen from an attacker, you might create a rate-based rule with a nested AND rule statement that contains the following nested statements:

  • An IP match statement with an IP set that specifies the address 192.0.2.44.

  • A string match statement that searches in the User-Agent header for the string BadBot.

In this rate-based rule, you also define a rate limit. For this example, the rate limit is 1,000. Requests that meet the criteria of both of the nested statements are counted. If the count exceeds 1,000 requests per five minutes, the rule action triggers. Requests that do not meet the criteria of both of the nested statements are not counted towards the rate limit and are not affected by this rule.

You cannot nest a RateBasedStatement inside another statement, for example inside a NotStatement or OrStatement . You can define a RateBasedStatement inside a web ACL and inside a rule group.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statement.html#cfn-wafv2-rulegroup-statement-ratebasedstatement

regex_match_statement

A rule statement used to search web request components for a match against a single regular expression.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statement.html#cfn-wafv2-rulegroup-statement-regexmatchstatement

regex_pattern_set_reference_statement

A rule statement used to search web request components for matches with regular expressions.

To use this, create a RegexPatternSet that specifies the expressions that you want to detect, then use the ARN of that set in this statement. A web request matches the pattern set rule statement if the request component matches any of the patterns in the set.

Each regex pattern set rule statement references a regex pattern set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, AWS WAF automatically updates all rules that reference it.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statement.html#cfn-wafv2-rulegroup-statement-regexpatternsetreferencestatement

size_constraint_statement

A rule statement that compares a number of bytes against the size of a request component, using a comparison operator, such as greater than (>) or less than (<).

For example, you can use a size constraint statement to look for query strings that are longer than 100 bytes.

If you configure AWS WAF to inspect the request body, AWS WAF inspects only the number of bytes of the body up to the limit for the web ACL. By default, for regional web ACLs, this limit is 8 KB (8,192 kilobytes) and for CloudFront web ACLs, this limit is 16 KB (16,384 kilobytes). For CloudFront web ACLs, you can increase the limit in the web ACL AssociationConfig , for additional fees. If you know that the request body for your web requests should never exceed the inspection limit, you could use a size constraint statement to block requests that have a larger request body size.

If you choose URI for the value of Part of the request to filter on, the slash (/) in the URI counts as one character. For example, the URI /logo.jpg is nine characters long.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statement.html#cfn-wafv2-rulegroup-statement-sizeconstraintstatement

sqli_match_statement

A rule statement that inspects for malicious SQL code.

Attackers insert malicious SQL code into web requests to do things like modify your database or extract data from it.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statement.html#cfn-wafv2-rulegroup-statement-sqlimatchstatement

xss_match_statement

A rule statement that inspects for cross-site scripting (XSS) attacks.

In XSS attacks, the attacker uses vulnerabilities in a benign website as a vehicle to inject malicious client-site scripts into other legitimate web browsers.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statement.html#cfn-wafv2-rulegroup-statement-xssmatchstatement

TextTransformationProperty

class CfnRuleGroup.TextTransformationProperty(*, priority, type)

Bases: object

Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection.

Parameters:
  • priority (Union[int, float]) – Sets the relative processing order for multiple transformations. AWS WAF processes all transformations, from lowest priority to highest, before inspecting the transformed content. The priorities don’t need to be consecutive, but they must all be different.

  • type (str) – You can specify the following transformation types:. BASE64_DECODE - Decode a Base64 -encoded string. BASE64_DECODE_EXT - Decode a Base64 -encoded string, but use a forgiving implementation that ignores characters that aren’t valid. CMD_LINE - Command-line transformations. These are helpful in reducing effectiveness of attackers who inject an operating system command-line command and use unusual formatting to disguise some or all of the command. - Delete the following characters: \ " ' ^ - Delete spaces before the following characters: / ( - Replace the following characters with a space: , ; - Replace multiple spaces with one space - Convert uppercase letters (A-Z) to lowercase (a-z) COMPRESS_WHITE_SPACE - Replace these characters with a space character (decimal 32): - \f , formfeed, decimal 12 - \t , tab, decimal 9 - \n , newline, decimal 10 - \r , carriage return, decimal 13 - \v , vertical tab, decimal 11 - Non-breaking space, decimal 160 COMPRESS_WHITE_SPACE also replaces multiple spaces with one space. CSS_DECODE - Decode characters that were encoded using CSS 2.x escape rules syndata.html#characters . This function uses up to two bytes in the decoding process, so it can help to uncover ASCII characters that were encoded using CSS encoding that wouldn’t typically be encoded. It’s also useful in countering evasion, which is a combination of a backslash and non-hexadecimal characters. For example, ja\vascript for javascript. ESCAPE_SEQ_DECODE - Decode the following ANSI C escape sequences: \a , \b , \f , \n , \r , \t , \v , \\ , \? , \' , \" , \xHH (hexadecimal), \0OOO (octal). Encodings that aren’t valid remain in the output. HEX_DECODE - Decode a string of hexadecimal characters into a binary. HTML_ENTITY_DECODE - Replace HTML-encoded characters with unencoded characters. HTML_ENTITY_DECODE performs these operations: - Replaces (ampersand)quot; with " - Replaces (ampersand)nbsp; with a non-breaking space, decimal 160 - Replaces (ampersand)lt; with a “less than” symbol - Replaces (ampersand)gt; with > - Replaces characters that are represented in hexadecimal format, (ampersand)#xhhhh; , with the corresponding characters - Replaces characters that are represented in decimal format, (ampersand)#nnnn; , with the corresponding characters JS_DECODE - Decode JavaScript escape sequences. If a \ u HHHH code is in the full-width ASCII code range of FF01-FF5E , then the higher byte is used to detect and adjust the lower byte. If not, only the lower byte is used and the higher byte is zeroed, causing a possible loss of information. LOWERCASE - Convert uppercase letters (A-Z) to lowercase (a-z). MD5 - Calculate an MD5 hash from the data in the input. The computed hash is in a raw binary form. NONE - Specify NONE if you don’t want any text transformations. NORMALIZE_PATH - Remove multiple slashes, directory self-references, and directory back-references that are not at the beginning of the input from an input string. NORMALIZE_PATH_WIN - This is the same as NORMALIZE_PATH , but first converts backslash characters to forward slashes. REMOVE_NULLS - Remove all NULL bytes from the input. REPLACE_COMMENTS - Replace each occurrence of a C-style comment ( /* ... * / ) with a single space. Multiple consecutive occurrences are not compressed. Unterminated comments are also replaced with a space (ASCII 0x20). However, a standalone termination of a comment ( * / ) is not acted upon. REPLACE_NULLS - Replace NULL bytes in the input with space characters (ASCII 0x20 ). SQL_HEX_DECODE - Decode SQL hex data. Example ( 0x414243 ) will be decoded to ( ABC ). URL_DECODE - Decode a URL-encoded value. URL_DECODE_UNI - Like URL_DECODE , but with support for Microsoft-specific %u encoding. If the code is in the full-width ASCII code range of FF01-FF5E , the higher byte is used to detect and adjust the lower byte. Otherwise, only the lower byte is used and the higher byte is zeroed. UTF8_TO_UNICODE - Convert all UTF-8 character sequences to Unicode. This helps input normalization, and minimizing false-positives and false-negatives for non-English languages.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-texttransformation.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

text_transformation_property = wafv2.CfnRuleGroup.TextTransformationProperty(
    priority=123,
    type="type"
)

Attributes

priority

Sets the relative processing order for multiple transformations.

AWS WAF processes all transformations, from lowest priority to highest, before inspecting the transformed content. The priorities don’t need to be consecutive, but they must all be different.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-texttransformation.html#cfn-wafv2-rulegroup-texttransformation-priority

type

.

BASE64_DECODE - Decode a Base64 -encoded string.

BASE64_DECODE_EXT - Decode a Base64 -encoded string, but use a forgiving implementation that ignores characters that aren’t valid.

CMD_LINE - Command-line transformations. These are helpful in reducing effectiveness of attackers who inject an operating system command-line command and use unusual formatting to disguise some or all of the command.

  • Delete the following characters: \ " ' ^

  • Delete spaces before the following characters: / (

  • Replace the following characters with a space: , ;

  • Replace multiple spaces with one space

  • Convert uppercase letters (A-Z) to lowercase (a-z)

COMPRESS_WHITE_SPACE - Replace these characters with a space character (decimal 32):

  • \f , formfeed, decimal 12

  • \t , tab, decimal 9

  • \n , newline, decimal 10

  • \r , carriage return, decimal 13

  • \v , vertical tab, decimal 11

  • Non-breaking space, decimal 160

COMPRESS_WHITE_SPACE also replaces multiple spaces with one space.

CSS_DECODE - Decode characters that were encoded using CSS 2.x escape rules syndata.html#characters . This function uses up to two bytes in the decoding process, so it can help to uncover ASCII characters that were encoded using CSS encoding that wouldn’t typically be encoded. It’s also useful in countering evasion, which is a combination of a backslash and non-hexadecimal characters. For example, ja\vascript for javascript.

ESCAPE_SEQ_DECODE - Decode the following ANSI C escape sequences: \a , \b , \f , \n , \r , \t , \v , \\ , \? , \' , \" , \xHH (hexadecimal), \0OOO (octal). Encodings that aren’t valid remain in the output.

HEX_DECODE - Decode a string of hexadecimal characters into a binary.

HTML_ENTITY_DECODE - Replace HTML-encoded characters with unencoded characters. HTML_ENTITY_DECODE performs these operations:

  • Replaces (ampersand)quot; with "

  • Replaces (ampersand)nbsp; with a non-breaking space, decimal 160

  • Replaces (ampersand)lt; with a “less than” symbol

  • Replaces (ampersand)gt; with >

  • Replaces characters that are represented in hexadecimal format, (ampersand)#xhhhh; , with the corresponding characters

  • Replaces characters that are represented in decimal format, (ampersand)#nnnn; , with the corresponding characters

JS_DECODE - Decode JavaScript escape sequences. If a \ u HHHH code is in the full-width ASCII code range of FF01-FF5E , then the higher byte is used to detect and adjust the lower byte. If not, only the lower byte is used and the higher byte is zeroed, causing a possible loss of information.

LOWERCASE - Convert uppercase letters (A-Z) to lowercase (a-z).

MD5 - Calculate an MD5 hash from the data in the input. The computed hash is in a raw binary form.

NONE - Specify NONE if you don’t want any text transformations.

NORMALIZE_PATH - Remove multiple slashes, directory self-references, and directory back-references that are not at the beginning of the input from an input string.

NORMALIZE_PATH_WIN - This is the same as NORMALIZE_PATH , but first converts backslash characters to forward slashes.

REMOVE_NULLS - Remove all NULL bytes from the input.

REPLACE_COMMENTS - Replace each occurrence of a C-style comment ( /* ... * / ) with a single space. Multiple consecutive occurrences are not compressed. Unterminated comments are also replaced with a space (ASCII 0x20). However, a standalone termination of a comment ( * / ) is not acted upon.

REPLACE_NULLS - Replace NULL bytes in the input with space characters (ASCII 0x20 ).

SQL_HEX_DECODE - Decode SQL hex data. Example ( 0x414243 ) will be decoded to ( ABC ).

URL_DECODE - Decode a URL-encoded value.

URL_DECODE_UNI - Like URL_DECODE , but with support for Microsoft-specific %u encoding. If the code is in the full-width ASCII code range of FF01-FF5E , the higher byte is used to detect and adjust the lower byte. Otherwise, only the lower byte is used and the higher byte is zeroed.

UTF8_TO_UNICODE - Convert all UTF-8 character sequences to Unicode. This helps input normalization, and minimizing false-positives and false-negatives for non-English languages.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-texttransformation.html#cfn-wafv2-rulegroup-texttransformation-type

Type:

You can specify the following transformation types

VisibilityConfigProperty

class CfnRuleGroup.VisibilityConfigProperty(*, cloud_watch_metrics_enabled, metric_name, sampled_requests_enabled)

Bases: object

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

Parameters:
  • cloud_watch_metrics_enabled (Union[bool, IResolvable]) – Indicates whether the associated resource sends metrics to Amazon CloudWatch. For the list of available metrics, see AWS WAF Metrics in the AWS WAF Developer Guide . For web ACLs, the metrics are for web requests that have the web ACL default action applied. AWS WAF applies the default action to web requests that pass the inspection of all rules in the web ACL without being either allowed or blocked. For more information, see The web ACL default action in the AWS WAF Developer Guide .

  • metric_name (str) – A name of the Amazon CloudWatch metric dimension. The name can contain only the characters: A-Z, a-z, 0-9, - (hyphen), and _ (underscore). The name can be from one to 128 characters long. It can’t contain whitespace or metric names that are reserved for AWS WAF , for example All and Default_Action .

  • sampled_requests_enabled (Union[bool, IResolvable]) – Indicates whether AWS WAF should store a sampling of the web requests that match the rules. You can view the sampled requests through the AWS WAF console.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-visibilityconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

visibility_config_property = wafv2.CfnRuleGroup.VisibilityConfigProperty(
    cloud_watch_metrics_enabled=False,
    metric_name="metricName",
    sampled_requests_enabled=False
)

Attributes

cloud_watch_metrics_enabled

Indicates whether the associated resource sends metrics to Amazon CloudWatch.

For the list of available metrics, see AWS WAF Metrics in the AWS WAF Developer Guide .

For web ACLs, the metrics are for web requests that have the web ACL default action applied. AWS WAF applies the default action to web requests that pass the inspection of all rules in the web ACL without being either allowed or blocked. For more information, see The web ACL default action in the AWS WAF Developer Guide .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-visibilityconfig.html#cfn-wafv2-rulegroup-visibilityconfig-cloudwatchmetricsenabled

metric_name

A name of the Amazon CloudWatch metric dimension.

The name can contain only the characters: A-Z, a-z, 0-9, - (hyphen), and _ (underscore). The name can be from one to 128 characters long. It can’t contain whitespace or metric names that are reserved for AWS WAF , for example All and Default_Action .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-visibilityconfig.html#cfn-wafv2-rulegroup-visibilityconfig-metricname

sampled_requests_enabled

Indicates whether AWS WAF should store a sampling of the web requests that match the rules.

You can view the sampled requests through the AWS WAF console.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-visibilityconfig.html#cfn-wafv2-rulegroup-visibilityconfig-sampledrequestsenabled

XssMatchStatementProperty

class CfnRuleGroup.XssMatchStatementProperty(*, field_to_match, text_transformations)

Bases: object

A rule statement that inspects for cross-site scripting (XSS) attacks.

In XSS attacks, the attacker uses vulnerabilities in a benign website as a vehicle to inject malicious client-site scripts into other legitimate web browsers.

Parameters:
  • field_to_match (Union[IResolvable, FieldToMatchProperty, Dict[str, Any]]) – The part of the web request that you want AWS WAF to inspect.

  • text_transformations (Union[IResolvable, Sequence[Union[IResolvable, TextTransformationProperty, Dict[str, Any]]]]) – Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by FieldToMatch , starting from the lowest priority setting, before inspecting the content for a match.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-xssmatchstatement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_wafv2 as wafv2

# all: Any
# all_query_arguments: Any
# method: Any
# query_string: Any
# single_header: Any
# single_query_argument: Any
# uri_path: Any

xss_match_statement_property = wafv2.CfnRuleGroup.XssMatchStatementProperty(
    field_to_match=wafv2.CfnRuleGroup.FieldToMatchProperty(
        all_query_arguments=all_query_arguments,
        body=wafv2.CfnRuleGroup.BodyProperty(
            oversize_handling="oversizeHandling"
        ),
        cookies=wafv2.CfnRuleGroup.CookiesProperty(
            match_pattern=wafv2.CfnRuleGroup.CookieMatchPatternProperty(
                all=all,
                excluded_cookies=["excludedCookies"],
                included_cookies=["includedCookies"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        headers=wafv2.CfnRuleGroup.HeadersProperty(
            match_pattern=wafv2.CfnRuleGroup.HeaderMatchPatternProperty(
                all=all,
                excluded_headers=["excludedHeaders"],
                included_headers=["includedHeaders"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        json_body=wafv2.CfnRuleGroup.JsonBodyProperty(
            match_pattern=wafv2.CfnRuleGroup.JsonMatchPatternProperty(
                all=all,
                included_paths=["includedPaths"]
            ),
            match_scope="matchScope",

            # the properties below are optional
            invalid_fallback_behavior="invalidFallbackBehavior",
            oversize_handling="oversizeHandling"
        ),
        method=method,
        query_string=query_string,
        single_header=single_header,
        single_query_argument=single_query_argument,
        uri_path=uri_path
    ),
    text_transformations=[wafv2.CfnRuleGroup.TextTransformationProperty(
        priority=123,
        type="type"
    )]
)

Attributes

field_to_match

The part of the web request that you want AWS WAF to inspect.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-xssmatchstatement.html#cfn-wafv2-rulegroup-xssmatchstatement-fieldtomatch

text_transformations

Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection.

If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by FieldToMatch , starting from the lowest priority setting, before inspecting the content for a match.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-xssmatchstatement.html#cfn-wafv2-rulegroup-xssmatchstatement-texttransformations