CfnWebACL

class aws_cdk.aws_wafv2.CfnWebACL(scope_, id, *, default_action, scope, visibility_config, association_config=None, captcha_config=None, challenge_config=None, custom_response_bodies=None, description=None, name=None, rules=None, tags=None, token_domains=None)

Bases: CfnResource

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 WebACL to define a collection of rules to use to inspect and control web requests. Each rule in a web ACL has a statement that defines what to look for in web requests and an action that AWS WAF applies to requests that match the statement. In the web ACL, you assign a default action to take (allow, block) for any request that doesn’t match any of the rules.

The rules in a web ACL can be a combination of explicitly defined rules and rule groups that you reference from the web ACL. The rule groups can be rule groups that you manage or rule groups that are managed by others.

You can associate a web ACL with one or more AWS resources to protect. The resources can be an Amazon CloudFront distribution, an Amazon API Gateway REST API, an Application Load Balancer , an AWS AppSync GraphQL API , an Amazon Cognito user pool, an AWS App Runner service, or an AWS Verified Access instance.

For more information, see Web access control lists (web ACLs) in the AWS WAF developer guide .

Web ACLs used in AWS Shield Advanced automatic application layer DDoS mitigation

If you use Shield Advanced automatic application layer DDoS mitigation, the web ACLs that you use with automatic mitigation have a rule group rule whose name starts with ShieldMitigationRuleGroup . This rule is used for automatic mitigations and it’s managed for you in the web ACL by Shield Advanced and AWS WAF . You’ll see the rule listed among the web ACL rules when you view the web ACL through the AWS WAF interfaces.

When you manage the web ACL through AWS CloudFormation interfaces, you won’t see the Shield Advanced rule. AWS CloudFormation doesn’t include this type of rule in the stack drift status between the actual configuration of the web ACL and your web ACL template.

Don’t add the Shield Advanced rule group rule to your web ACL template. The rule shouldn’t be in your template. When you update the web ACL template in a stack, the Shield Advanced rule is maintained for you by AWS WAF in the resulting web ACL.

For more information, see Shield Advanced automatic application layer DDoS mitigation in the AWS Shield Advanced developer guide .

see:

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

cloudformationResource:

AWS::WAFv2::WebACL

exampleMetadata:

fixture=_generated

Example:

Parameters:
  • scope (str) – Scope in which this resource is defined.

  • id (str) – Construct identifier for this resource (unique in its scope).

  • default_action (Union[IResolvable, DefaultActionProperty, Dict[str, Any]]) – The action to perform if none of the Rules contained in the WebACL match.

  • 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, an AWS App Runner service, or an AWS Verified Access instance. 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 . For information about how to define the association of the web ACL with your resource, see WebACLAssociation .

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

  • association_config (Union[IResolvable, AssociationConfigProperty, Dict[str, Any], None]) – Specifies custom configurations for the associations between the web ACL and protected resources. Use this to customize the maximum size of the request body that your protected resources forward to AWS WAF for inspection. You can customize this setting for CloudFront, API Gateway, Amazon Cognito, App Runner, or Verified Access resources. The default setting is 16 KB (16,384 bytes). .. epigraph:: You are charged additional fees when your protected resources forward body sizes that are larger than the default. For more information, see AWS WAF Pricing . For Application Load Balancer and AWS AppSync , the limit is fixed at 8 KB (8,192 bytes).

  • captcha_config (Union[IResolvable, CaptchaConfigProperty, Dict[str, Any], None]) – Specifies how AWS WAF should handle CAPTCHA evaluations for rules that don’t have their own CaptchaConfig settings. If you don’t specify this, AWS WAF uses its default settings for CaptchaConfig .

  • challenge_config (Union[IResolvable, ChallengeConfigProperty, Dict[str, Any], None]) – Specifies how AWS WAF should handle challenge evaluations for rules that don’t have their own ChallengeConfig settings. If you don’t specify this, AWS WAF uses its default settings for ChallengeConfig .

  • 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 web ACL, and then use them in the rules and default actions that you define in the web ACL. 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 web ACL that helps with identification.

  • name (Optional[str]) – The name of the web ACL. You cannot change the name of a web ACL 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 manage. 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.

  • token_domains (Optional[Sequence[str]]) – Specifies the domains that AWS WAF should accept in a web request token. This enables the use of tokens across multiple protected websites. When AWS WAF provides a token, it uses the domain of the AWS resource that the web ACL is protecting. If you don’t specify a list of token domains, AWS WAF accepts tokens only for the domain of the protected resource. With a token domain list, AWS WAF accepts the resource’s host domain plus all domains in the token domain list, including their prefixed subdomains.

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_dependency(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_depends_on(target)

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

Parameters:

target (CfnResource) –

Deprecated:

use addDependency

Stability:

deprecated

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 intermediate 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). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

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 resource, please consult that specific resource’s documentation.

See:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options

Return type:

None

get_att(attribute_name, type_hint=None)

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.

  • type_hint (Optional[ResolutionTypeHint]) –

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

obtain_dependencies()

Retrieves an array of resources this resource depends on.

This assembles dependencies on resources across stacks (including nested stacks) automatically.

Return type:

List[Union[Stack, CfnResource]]

obtain_resource_dependencies()

Get a shallow copy of dependencies between this resource and other resources in the same stack.

Return type:

List[CfnResource]

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

remove_dependency(target)

Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

Parameters:

target (CfnResource) –

Return type:

None

replace_dependency(target, new_target)

Replaces one dependency with another.

Parameters:
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::WebACL'
association_config

Specifies custom configurations for the associations between the web ACL and protected resources.

attr_arn

The Amazon Resource Name (ARN) of the web ACL.

CloudformationAttribute:

Arn

attr_capacity

The web ACL capacity units (WCUs) currently being used by this web ACL.

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.

CloudformationAttribute:

Capacity

attr_id

The ID of the web ACL.

CloudformationAttribute:

Id

attr_label_namespace

The label namespace prefix for this web ACL.

All labels added by rules in this web ACL have this prefix.

The syntax for the label namespace prefix for a web ACL is the following: awswaf:<account ID>:webacl:<web ACL 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

captcha_config

Specifies how AWS WAF should handle CAPTCHA evaluations for rules that don’t have their own CaptchaConfig settings.

cfn_options

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

cfn_resource_type

AWS resource type.

challenge_config

Specifies how AWS WAF should handle challenge evaluations for rules that don’t have their own ChallengeConfig settings.

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.

default_action

The action to perform if none of the Rules contained in the WebACL match.

description

A description of the web ACL that helps with identification.

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 web ACL.

node

The tree node.

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 manage.

scope

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

stack

The stack in which this element is defined.

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

tags

Tag Manager which manages the tags for this resource.

tags_raw

value pairs associated with an AWS resource.

Type:

Key

token_domains

Specifies the domains that AWS WAF should accept in a web request token.

visibility_config

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

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(x)

Check whether the given object is a CfnResource.

Parameters:

x (Any) –

Return type:

bool

classmethod is_construct(x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Construct.

AWSManagedRulesACFPRuleSetProperty

class CfnWebACL.AWSManagedRulesACFPRuleSetProperty(*, creation_path, registration_page_path, request_inspection, enable_regex_in_path=None, response_inspection=None)

Bases: object

Details for your use of the account creation fraud prevention managed rule group, AWSManagedRulesACFPRuleSet .

This configuration is used in ManagedRuleGroupConfig .

Parameters:
  • creation_path (str) – The path of the account creation endpoint for your application. This is the page on your website that accepts the completed registration form for a new user. This page must accept POST requests. For example, for the URL https://example.com/web/newaccount , you would provide the path /web/newaccount . Account creation page paths that start with the path that you provide are considered a match. For example /web/newaccount matches the account creation paths /web/newaccount , /web/newaccount/ , /web/newaccountPage , and /web/newaccount/thisPage , but doesn’t match the path /home/web/newaccount or /website/newaccount .

  • registration_page_path (str) – The path of the account registration endpoint for your application. This is the page on your website that presents the registration form to new users. .. epigraph:: This page must accept GET text/html requests. For example, for the URL https://example.com/web/registration , you would provide the path /web/registration . Registration page paths that start with the path that you provide are considered a match. For example /web/registration matches the registration paths /web/registration , /web/registration/ , /web/registrationPage , and /web/registration/thisPage , but doesn’t match the path /home/web/registration or /website/registration .

  • request_inspection (Union[IResolvable, RequestInspectionACFPProperty, Dict[str, Any]]) – The criteria for inspecting account creation requests, used by the ACFP rule group to validate and track account creation attempts.

  • enable_regex_in_path (Union[bool, IResolvable, None]) – Allow the use of regular expressions in the registration page path and the account creation path.

  • response_inspection (Union[IResolvable, ResponseInspectionProperty, Dict[str, Any], None]) – The criteria for inspecting responses to account creation requests, used by the ACFP rule group to track account creation success rates. .. epigraph:: Response inspection is available only in web ACLs that protect Amazon CloudFront distributions. The ACFP rule group evaluates the responses that your protected resources send back to client account creation attempts, keeping count of successful and failed attempts from each IP address and client session. Using this information, the rule group labels and mitigates requests from client sessions and IP addresses that have had too many successful account creation attempts in a short amount of time.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-awsmanagedrulesacfpruleset.html

ExampleMetadata:

fixture=_generated

Example:

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

a_wSManaged_rules_aCFPRule_set_property = wafv2.CfnWebACL.AWSManagedRulesACFPRuleSetProperty(
    creation_path="creationPath",
    registration_page_path="registrationPagePath",
    request_inspection=wafv2.CfnWebACL.RequestInspectionACFPProperty(
        payload_type="payloadType",

        # the properties below are optional
        address_fields=[wafv2.CfnWebACL.FieldIdentifierProperty(
            identifier="identifier"
        )],
        email_field=wafv2.CfnWebACL.FieldIdentifierProperty(
            identifier="identifier"
        ),
        password_field=wafv2.CfnWebACL.FieldIdentifierProperty(
            identifier="identifier"
        ),
        phone_number_fields=[wafv2.CfnWebACL.FieldIdentifierProperty(
            identifier="identifier"
        )],
        username_field=wafv2.CfnWebACL.FieldIdentifierProperty(
            identifier="identifier"
        )
    ),

    # the properties below are optional
    enable_regex_in_path=False,
    response_inspection=wafv2.CfnWebACL.ResponseInspectionProperty(
        body_contains=wafv2.CfnWebACL.ResponseInspectionBodyContainsProperty(
            failure_strings=["failureStrings"],
            success_strings=["successStrings"]
        ),
        header=wafv2.CfnWebACL.ResponseInspectionHeaderProperty(
            failure_values=["failureValues"],
            name="name",
            success_values=["successValues"]
        ),
        json=wafv2.CfnWebACL.ResponseInspectionJsonProperty(
            failure_values=["failureValues"],
            identifier="identifier",
            success_values=["successValues"]
        ),
        status_code=wafv2.CfnWebACL.ResponseInspectionStatusCodeProperty(
            failure_codes=[123],
            success_codes=[123]
        )
    )
)

Attributes

creation_path

The path of the account creation endpoint for your application.

This is the page on your website that accepts the completed registration form for a new user. This page must accept POST requests.

For example, for the URL https://example.com/web/newaccount , you would provide the path /web/newaccount . Account creation page paths that start with the path that you provide are considered a match. For example /web/newaccount matches the account creation paths /web/newaccount , /web/newaccount/ , /web/newaccountPage , and /web/newaccount/thisPage , but doesn’t match the path /home/web/newaccount or /website/newaccount .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-awsmanagedrulesacfpruleset.html#cfn-wafv2-webacl-awsmanagedrulesacfpruleset-creationpath

enable_regex_in_path

Allow the use of regular expressions in the registration page path and the account creation path.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-awsmanagedrulesacfpruleset.html#cfn-wafv2-webacl-awsmanagedrulesacfpruleset-enableregexinpath

registration_page_path

The path of the account registration endpoint for your application.

This is the page on your website that presents the registration form to new users. .. epigraph:

This page must accept ``GET`` text/html requests.

For example, for the URL https://example.com/web/registration , you would provide the path /web/registration . Registration page paths that start with the path that you provide are considered a match. For example /web/registration matches the registration paths /web/registration , /web/registration/ , /web/registrationPage , and /web/registration/thisPage , but doesn’t match the path /home/web/registration or /website/registration .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-awsmanagedrulesacfpruleset.html#cfn-wafv2-webacl-awsmanagedrulesacfpruleset-registrationpagepath

request_inspection

The criteria for inspecting account creation requests, used by the ACFP rule group to validate and track account creation attempts.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-awsmanagedrulesacfpruleset.html#cfn-wafv2-webacl-awsmanagedrulesacfpruleset-requestinspection

response_inspection

The criteria for inspecting responses to account creation requests, used by the ACFP rule group to track account creation success rates.

Response inspection is available only in web ACLs that protect Amazon CloudFront distributions.

The ACFP rule group evaluates the responses that your protected resources send back to client account creation attempts, keeping count of successful and failed attempts from each IP address and client session. Using this information, the rule group labels and mitigates requests from client sessions and IP addresses that have had too many successful account creation attempts in a short amount of time.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-awsmanagedrulesacfpruleset.html#cfn-wafv2-webacl-awsmanagedrulesacfpruleset-responseinspection

AWSManagedRulesATPRuleSetProperty

class CfnWebACL.AWSManagedRulesATPRuleSetProperty(*, login_path, enable_regex_in_path=None, request_inspection=None, response_inspection=None)

Bases: object

Details for your use of the account takeover prevention managed rule group, AWSManagedRulesATPRuleSet .

This configuration is used in ManagedRuleGroupConfig .

Parameters:
  • login_path (str) – The path of the login endpoint for your application. For example, for the URL https://example.com/web/login , you would provide the path /web/login . Login paths that start with the path that you provide are considered a match. For example /web/login matches the login paths /web/login , /web/login/ , /web/loginPage , and /web/login/thisPage , but doesn’t match the login path /home/web/login or /website/login . The rule group inspects only HTTP POST requests to your specified login endpoint.

  • enable_regex_in_path (Union[bool, IResolvable, None]) – Allow the use of regular expressions in the login page path.

  • request_inspection (Union[IResolvable, RequestInspectionProperty, Dict[str, Any], None]) – The criteria for inspecting login requests, used by the ATP rule group to validate credentials usage.

  • response_inspection (Union[IResolvable, ResponseInspectionProperty, Dict[str, Any], None]) – The criteria for inspecting responses to login requests, used by the ATP rule group to track login failure rates. .. epigraph:: Response inspection is available only in web ACLs that protect Amazon CloudFront distributions. The ATP rule group evaluates the responses that your protected resources send back to client login attempts, keeping count of successful and failed attempts for each IP address and client session. Using this information, the rule group labels and mitigates requests from client sessions and IP addresses that have had too many failed login attempts in a short amount of time.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-awsmanagedrulesatpruleset.html

ExampleMetadata:

fixture=_generated

Example:

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

a_wSManaged_rules_aTPRule_set_property = wafv2.CfnWebACL.AWSManagedRulesATPRuleSetProperty(
    login_path="loginPath",

    # the properties below are optional
    enable_regex_in_path=False,
    request_inspection=wafv2.CfnWebACL.RequestInspectionProperty(
        password_field=wafv2.CfnWebACL.FieldIdentifierProperty(
            identifier="identifier"
        ),
        payload_type="payloadType",
        username_field=wafv2.CfnWebACL.FieldIdentifierProperty(
            identifier="identifier"
        )
    ),
    response_inspection=wafv2.CfnWebACL.ResponseInspectionProperty(
        body_contains=wafv2.CfnWebACL.ResponseInspectionBodyContainsProperty(
            failure_strings=["failureStrings"],
            success_strings=["successStrings"]
        ),
        header=wafv2.CfnWebACL.ResponseInspectionHeaderProperty(
            failure_values=["failureValues"],
            name="name",
            success_values=["successValues"]
        ),
        json=wafv2.CfnWebACL.ResponseInspectionJsonProperty(
            failure_values=["failureValues"],
            identifier="identifier",
            success_values=["successValues"]
        ),
        status_code=wafv2.CfnWebACL.ResponseInspectionStatusCodeProperty(
            failure_codes=[123],
            success_codes=[123]
        )
    )
)

Attributes

enable_regex_in_path

Allow the use of regular expressions in the login page path.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-awsmanagedrulesatpruleset.html#cfn-wafv2-webacl-awsmanagedrulesatpruleset-enableregexinpath

login_path

The path of the login endpoint for your application.

For example, for the URL https://example.com/web/login , you would provide the path /web/login . Login paths that start with the path that you provide are considered a match. For example /web/login matches the login paths /web/login , /web/login/ , /web/loginPage , and /web/login/thisPage , but doesn’t match the login path /home/web/login or /website/login .

The rule group inspects only HTTP POST requests to your specified login endpoint.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-awsmanagedrulesatpruleset.html#cfn-wafv2-webacl-awsmanagedrulesatpruleset-loginpath

request_inspection

The criteria for inspecting login requests, used by the ATP rule group to validate credentials usage.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-awsmanagedrulesatpruleset.html#cfn-wafv2-webacl-awsmanagedrulesatpruleset-requestinspection

response_inspection

The criteria for inspecting responses to login requests, used by the ATP rule group to track login failure rates.

Response inspection is available only in web ACLs that protect Amazon CloudFront distributions.

The ATP rule group evaluates the responses that your protected resources send back to client login attempts, keeping count of successful and failed attempts for each IP address and client session. Using this information, the rule group labels and mitigates requests from client sessions and IP addresses that have had too many failed login attempts in a short amount of time.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-awsmanagedrulesatpruleset.html#cfn-wafv2-webacl-awsmanagedrulesatpruleset-responseinspection

AWSManagedRulesBotControlRuleSetProperty

class CfnWebACL.AWSManagedRulesBotControlRuleSetProperty(*, inspection_level, enable_machine_learning=None)

Bases: object

Details for your use of the Bot Control managed rule group, AWSManagedRulesBotControlRuleSet .

This configuration is used in ManagedRuleGroupConfig .

Parameters:
  • inspection_level (str) – The inspection level to use for the Bot Control rule group. The common level is the least expensive. The targeted level includes all common level rules and adds rules with more advanced inspection criteria. For details, see AWS WAF Bot Control rule group in the AWS WAF Developer Guide .

  • enable_machine_learning (Union[bool, IResolvable, None]) – Applies only to the targeted inspection level. Determines whether to use machine learning (ML) to analyze your web traffic for bot-related activity. Machine learning is required for the Bot Control rules TGT_ML_CoordinatedActivityLow and TGT_ML_CoordinatedActivityMedium , which inspect for anomalous behavior that might indicate distributed, coordinated bot activity. For more information about this choice, see the listing for these rules in the table at Bot Control rules listing in the AWS WAF Developer Guide . Default: TRUE

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-awsmanagedrulesbotcontrolruleset.html

ExampleMetadata:

fixture=_generated

Example:

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

a_wSManaged_rules_bot_control_rule_set_property = wafv2.CfnWebACL.AWSManagedRulesBotControlRuleSetProperty(
    inspection_level="inspectionLevel",

    # the properties below are optional
    enable_machine_learning=False
)

Attributes

enable_machine_learning

Applies only to the targeted inspection level.

Determines whether to use machine learning (ML) to analyze your web traffic for bot-related activity. Machine learning is required for the Bot Control rules TGT_ML_CoordinatedActivityLow and TGT_ML_CoordinatedActivityMedium , which inspect for anomalous behavior that might indicate distributed, coordinated bot activity.

For more information about this choice, see the listing for these rules in the table at Bot Control rules listing in the AWS WAF Developer Guide .

Default: TRUE

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-awsmanagedrulesbotcontrolruleset.html#cfn-wafv2-webacl-awsmanagedrulesbotcontrolruleset-enablemachinelearning

inspection_level

The inspection level to use for the Bot Control rule group.

The common level is the least expensive. The targeted level includes all common level rules and adds rules with more advanced inspection criteria. For details, see AWS WAF Bot Control rule group in the AWS WAF Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-awsmanagedrulesbotcontrolruleset.html#cfn-wafv2-webacl-awsmanagedrulesbotcontrolruleset-inspectionlevel

AllowActionProperty

class CfnWebACL.AllowActionProperty(*, custom_request_handling=None)

Bases: object

Specifies that AWS WAF should allow the request and optionally defines additional custom handling for the request.

This is used in the context of other settings, for example to specify values for a rule action or a web ACL default action.

Parameters:

custom_request_handling (Union[IResolvable, CustomRequestHandlingProperty, Dict[str, Any], None]) –

Defines custom handling for the web request. For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

allow_action_property = wafv2.CfnWebACL.AllowActionProperty(
    custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
        insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
            name="name",
            value="value"
        )]
    )
)

Attributes

custom_request_handling

Defines custom handling for the web request.

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

See:

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

AndStatementProperty

class CfnWebACL.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.

See:

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

ExampleMetadata:

fixture=_generated

Example:

.. rubric:: Attributes
statements

The statements to combine with AND logic.

You can use any statements that can be nested.

See:

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

AssociationConfigProperty

class CfnWebACL.AssociationConfigProperty(*, request_body=None)

Bases: object

Specifies custom configurations for the associations between the web ACL and protected resources.

Use this to customize the maximum size of the request body that your protected resources forward to AWS WAF for inspection. You can customize this setting for CloudFront, API Gateway, Amazon Cognito, App Runner, or Verified Access resources. The default setting is 16 KB (16,384 bytes). .. epigraph:

You are charged additional fees when your protected resources forward body sizes that are larger than the default. For more information, see `AWS WAF Pricing <https://docs.aws.amazon.com/waf/pricing/>`_ .

For Application Load Balancer and AWS AppSync , the limit is fixed at 8 KB (8,192 bytes).

Parameters:

request_body (Union[IResolvable, Mapping[str, Union[IResolvable, RequestBodyAssociatedResourceTypeConfigProperty, Dict[str, Any]]], None]) –

Customizes the maximum size of the request body that your protected CloudFront, API Gateway, Amazon Cognito, App Runner, and Verified Access resources forward to AWS WAF for inspection. The default size is 16 KB (16,384 bytes). You can change the setting for any of the available resource types. .. epigraph:: You are charged additional fees when your protected resources forward body sizes that are larger than the default. For more information, see AWS WAF Pricing . Example JSON: { "API_GATEWAY": "KB_48", "APP_RUNNER_SERVICE": "KB_32" } For Application Load Balancer and AWS AppSync , the limit is fixed at 8 KB (8,192 bytes).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-associationconfig.html

ExampleMetadata:

fixture=_generated

Example:

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

association_config_property = wafv2.CfnWebACL.AssociationConfigProperty(
    request_body={
        "request_body_key": wafv2.CfnWebACL.RequestBodyAssociatedResourceTypeConfigProperty(
            default_size_inspection_limit="defaultSizeInspectionLimit"
        )
    }
)

Attributes

request_body

Customizes the maximum size of the request body that your protected CloudFront, API Gateway, Amazon Cognito, App Runner, and Verified Access resources forward to AWS WAF for inspection.

The default size is 16 KB (16,384 bytes). You can change the setting for any of the available resource types. .. epigraph:

You are charged additional fees when your protected resources forward body sizes that are larger than the default. For more information, see `AWS WAF Pricing <https://docs.aws.amazon.com/waf/pricing/>`_ .

Example JSON: { "API_GATEWAY": "KB_48", "APP_RUNNER_SERVICE": "KB_32" }

For Application Load Balancer and AWS AppSync , the limit is fixed at 8 KB (8,192 bytes).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-associationconfig.html#cfn-wafv2-webacl-associationconfig-requestbody

BlockActionProperty

class CfnWebACL.BlockActionProperty(*, custom_response=None)

Bases: object

Specifies that AWS WAF should block the request and optionally defines additional custom handling for the response to the web request.

This is used in the context of other settings, for example to specify values for a rule action or a web ACL default action.

Parameters:

custom_response (Union[IResolvable, CustomResponseProperty, Dict[str, Any], None]) –

Defines a custom response for the web request. For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

block_action_property = wafv2.CfnWebACL.BlockActionProperty(
    custom_response=wafv2.CfnWebACL.CustomResponseProperty(
        response_code=123,

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

Attributes

custom_response

Defines a custom response for the web request.

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

See:

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

BodyProperty

class CfnWebACL.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. When a web request body is larger than the limit, the underlying host service only forwards the contents that are within the limit to AWS WAF for inspection. - For Application Load Balancer and AWS AppSync , the limit is fixed at 8 KB (8,192 bytes). - For CloudFront, API Gateway, Amazon Cognito, App Runner, and Verified Access, the default limit is 16 KB (16,384 bytes), and you can increase the limit for each resource type 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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

body_property = wafv2.CfnWebACL.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. When a web request body is larger than the limit, the underlying host service only forwards the contents that are within the limit to AWS WAF for inspection.

  • For Application Load Balancer and AWS AppSync , the limit is fixed at 8 KB (8,192 bytes).

  • For CloudFront, API Gateway, Amazon Cognito, App Runner, and Verified Access, the default limit is 16 KB (16,384 bytes), and you can increase the limit for each resource type 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

See:

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

ByteMatchStatementProperty

class CfnWebACL.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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import 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.CfnWebACL.ByteMatchStatementProperty(
    field_to_match=wafv2.CfnWebACL.FieldToMatchProperty(
        all_query_arguments=all_query_arguments,
        body=wafv2.CfnWebACL.BodyProperty(
            oversize_handling="oversizeHandling"
        ),
        cookies=wafv2.CfnWebACL.CookiesProperty(
            match_pattern=wafv2.CfnWebACL.CookieMatchPatternProperty(
                all=all,
                excluded_cookies=["excludedCookies"],
                included_cookies=["includedCookies"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        headers=wafv2.CfnWebACL.HeadersProperty(
            match_pattern=wafv2.CfnWebACL.HeaderMatchPatternProperty(
                all=all,
                excluded_headers=["excludedHeaders"],
                included_headers=["includedHeaders"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        ja3_fingerprint=wafv2.CfnWebACL.JA3FingerprintProperty(
            fallback_behavior="fallbackBehavior"
        ),
        json_body=wafv2.CfnWebACL.JsonBodyProperty(
            match_pattern=wafv2.CfnWebACL.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.CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-bytematchstatement.html#cfn-wafv2-webacl-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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-bytematchstatement.html#cfn-wafv2-webacl-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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-bytematchstatement.html#cfn-wafv2-webacl-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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-bytematchstatement.html#cfn-wafv2-webacl-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.

See:

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

CaptchaActionProperty

class CfnWebACL.CaptchaActionProperty(*, custom_request_handling=None)

Bases: object

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.

Parameters:

custom_request_handling (Union[IResolvable, CustomRequestHandlingProperty, Dict[str, Any], None]) –

Defines custom handling for the web request, used when the CAPTCHA inspection determines that the request’s token is valid and unexpired. For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

captcha_action_property = wafv2.CfnWebACL.CaptchaActionProperty(
    custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
        insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
            name="name",
            value="value"
        )]
    )
)

Attributes

custom_request_handling

Defines custom handling for the web request, used when the CAPTCHA inspection determines that the request’s token is valid and unexpired.

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

See:

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

CaptchaConfigProperty

class CfnWebACL.CaptchaConfigProperty(*, immunity_time_property=None)

Bases: object

Specifies how AWS WAF should handle CAPTCHA evaluations for rules that don’t have their own CaptchaConfig settings.

If you don’t specify this, AWS WAF uses its default settings for CaptchaConfig .

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

captcha_config_property = wafv2.CfnWebACL.CaptchaConfigProperty(
    immunity_time_property=wafv2.CfnWebACL.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.

See:

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

ChallengeActionProperty

class CfnWebACL.ChallengeActionProperty(*, custom_request_handling=None)

Bases: object

Specifies that AWS WAF should run a Challenge check against the request to verify that the request is coming from a legitimate client session: - If the request includes a valid, unexpired challenge token, AWS WAF applies any custom request handling and labels that you’ve configured and then allows the web request inspection to proceed to the next rule, similar to a CountAction .

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

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

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

  • The HTTP status code 202 Request Accepted .

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

Challenges run silent browser interrogations in the background, and don’t generally affect the end user experience.

A challenge enforces token acquisition using an interstitial JavaScript challenge that inspects the client session for legitimate behavior. The challenge blocks bots or at least increases the cost of operating sophisticated bots.

After the client session successfully responds to the challenge, it receives a new token from AWS WAF , which the challenge script uses to resubmit the original request.

You can configure the expiration time in the ChallengeConfig 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.

Parameters:

custom_request_handling (Union[IResolvable, CustomRequestHandlingProperty, Dict[str, Any], None]) –

Defines custom handling for the web request, used when the challenge inspection determines that the request’s token is valid and unexpired. For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF developer guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

challenge_action_property = wafv2.CfnWebACL.ChallengeActionProperty(
    custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
        insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
            name="name",
            value="value"
        )]
    )
)

Attributes

custom_request_handling

Defines custom handling for the web request, used when the challenge inspection determines that the request’s token is valid and unexpired.

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

See:

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

ChallengeConfigProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

challenge_config_property = wafv2.CfnWebACL.ChallengeConfigProperty(
    immunity_time_property=wafv2.CfnWebACL.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.

See:

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

CookieMatchPatternProperty

class CfnWebACL.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": [ "session-id-time", "session-id" ] }

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

# all: Any

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

Attributes

all

Inspect all cookies.

See:

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

excluded_cookies

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

See:

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

included_cookies

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

See:

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

CookiesProperty

class CfnWebACL.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": [ "session-id-time", "session-id" ] }

  • 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. All does not require a match to be found in the keys and a match to be found in the values. It requires a match to be found in the keys or the values or both. To require a match in the keys and in the values, use a logical AND statement to combine two match rules, one that inspects the keys and another that inspects the 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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

# all: Any

cookies_property = wafv2.CfnWebACL.CookiesProperty(
    match_pattern=wafv2.CfnWebACL.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": [ "session-id-time", "session-id" ] }

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-cookies.html#cfn-wafv2-webacl-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.

All does not require a match to be found in the keys and a match to be found in the values. It requires a match to be found in the keys or the values or both. To require a match in the keys and in the values, use a logical AND statement to combine two match rules, one that inspects the keys and another that inspects the values.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-cookies.html#cfn-wafv2-webacl-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.

See:

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

CountActionProperty

class CfnWebACL.CountActionProperty(*, custom_request_handling=None)

Bases: object

Specifies that AWS WAF should count the request. Optionally defines additional custom handling for the request.

This is used in the context of other settings, for example to specify values for a rule action or a web ACL default action.

Parameters:

custom_request_handling (Union[IResolvable, CustomRequestHandlingProperty, Dict[str, Any], None]) –

Defines custom handling for the web request. For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

count_action_property = wafv2.CfnWebACL.CountActionProperty(
    custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
        insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
            name="name",
            value="value"
        )]
    )
)

Attributes

custom_request_handling

Defines custom handling for the web request.

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

See:

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

CustomHTTPHeaderProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

custom_hTTPHeader_property = wafv2.CfnWebACL.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 .

See:

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

value

The value of the custom header.

See:

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

CustomRequestHandlingProperty

class CfnWebACL.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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

custom_request_handling_property = wafv2.CfnWebACL.CustomRequestHandlingProperty(
    insert_headers=[wafv2.CfnWebACL.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 .

See:

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

CustomResponseBodyProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

custom_response_body_property = wafv2.CfnWebACL.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 .

See:

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

content_type

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

See:

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

CustomResponseProperty

class CfnWebACL.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 the block action.

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. You can specify any header name except for content-type . 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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

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

    # the properties below are optional
    custom_response_body_key="customResponseBodyKey",
    response_headers=[wafv2.CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-customresponse.html#cfn-wafv2-webacl-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 .

See:

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

response_headers

The HTTP headers to use in the response.

You can specify any header name except for content-type . 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 .

See:

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

DefaultActionProperty

class CfnWebACL.DefaultActionProperty(*, allow=None, block=None)

Bases: object

In a WebACL , this is the action that you want AWS WAF to perform when a web request doesn’t match any of the rules in the WebACL .

The default action must be a terminating action.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-defaultaction.html

ExampleMetadata:

fixture=_generated

Example:

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

default_action_property = wafv2.CfnWebACL.DefaultActionProperty(
    allow=wafv2.CfnWebACL.AllowActionProperty(
        custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
            insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                name="name",
                value="value"
            )]
        )
    ),
    block=wafv2.CfnWebACL.BlockActionProperty(
        custom_response=wafv2.CfnWebACL.CustomResponseProperty(
            response_code=123,

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

Attributes

allow

Specifies that AWS WAF should allow requests by default.

See:

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

block

Specifies that AWS WAF should block requests by default.

See:

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

ExcludedRuleProperty

class CfnWebACL.ExcludedRuleProperty(*, name)

Bases: object

Specifies a single rule in a rule group whose action you want to override to Count .

Instead of this option, use RuleActionOverrides . It accepts any valid action setting, including Count .

Parameters:

name (str) – The name of the rule whose action you want to override to Count .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-excludedrule.html

ExampleMetadata:

fixture=_generated

Example:

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

excluded_rule_property = wafv2.CfnWebACL.ExcludedRuleProperty(
    name="name"
)

Attributes

name

The name of the rule whose action you want to override to Count .

See:

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

FieldIdentifierProperty

class CfnWebACL.FieldIdentifierProperty(*, identifier)

Bases: object

The identifier of a field in the web request payload that contains customer data.

This data type is used to specify fields in the RequestInspection and RequestInspectionACFP configurations, which are used in the managed rule group configurations AWSManagedRulesATPRuleSet and AWSManagedRulesACFPRuleSet , respectively.

Parameters:

identifier (str) – The name of the field. When the PayloadType in the request inspection is JSON , this identifier must be in JSON pointer syntax. For example /form/username . For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer . When the PayloadType is FORM_ENCODED , use the HTML form names. For example, username . For more information, see the descriptions for each field type in the request inspection properties.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-fieldidentifier.html

ExampleMetadata:

fixture=_generated

Example:

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

field_identifier_property = wafv2.CfnWebACL.FieldIdentifierProperty(
    identifier="identifier"
)

Attributes

identifier

The name of the field.

When the PayloadType in the request inspection is JSON , this identifier must be in JSON pointer syntax. For example /form/username . For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer .

When the PayloadType is FORM_ENCODED , use the HTML form names. For example, username .

For more information, see the descriptions for each field type in the request inspection properties.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-fieldidentifier.html#cfn-wafv2-webacl-fieldidentifier-identifier

FieldToMatchProperty

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

Bases: object

Specifies a web request component to be used in a rule match statement or in a logging configuration.

  • In a rule statement, this is 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" } }

  • In a logging configuration, this is used in the RedactedFields property to specify a field to redact from the logging records. For this use case, note the following:

  • Even though all FieldToMatch settings are available, the only valid settings for field redaction are UriPath , QueryString , SingleHeader , and Method .

  • In this documentation, the descriptions of the individual fields talk about specifying the web request component to inspect, but for field redaction, you are specifying the component type to redact from the logs.

  • If you have request sampling enabled, the redacted fields configuration for logging has no impact on sampling. The only way to exclude fields from request sampling is by disabling sampling in the web ACL visibility configuration.

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. AWS WAF does not support inspecting the entire contents of the web request body if the body exceeds the limit for the resource type. When a web request body is larger than the limit, the underlying host service only forwards the contents that are within the limit to AWS WAF for inspection. - For Application Load Balancer and AWS AppSync , the limit is fixed at 8 KB (8,192 bytes). - For CloudFront, API Gateway, Amazon Cognito, App Runner, and Verified Access, the default limit is 16 KB (16,384 bytes), and you can increase the limit for each resource type in the web ACL 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.

  • ja3_fingerprint (Union[IResolvable, JA3FingerprintProperty, Dict[str, Any], None]) – Match against the request’s JA3 fingerprint. The JA3 fingerprint is a 32-character hash derived from the TLS Client Hello of an incoming request. This fingerprint serves as a unique identifier for the client’s TLS configuration. AWS WAF calculates and logs this fingerprint for each request that has enough TLS Client Hello information for the calculation. Almost all web requests include this information. .. epigraph:: You can use this choice only with a string match ByteMatchStatement with the PositionalConstraint set to EXACTLY . You can obtain the JA3 fingerprint for client requests from the web ACL logs. If AWS WAF is able to calculate the fingerprint, it includes it in the logs. For information about the logging fields, see Log fields in the AWS WAF Developer Guide . Provide the JA3 fingerprint string from the logs in your string match statement specification, to match with any future requests that have the same TLS configuration.

  • 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. AWS WAF does not support inspecting the entire contents of the web request body if the body exceeds the limit for the resource type. When a web request body is larger than the limit, the underlying host service only forwards the contents that are within the limit to AWS WAF for inspection. - For Application Load Balancer and AWS AppSync , the limit is fixed at 8 KB (8,192 bytes). - For CloudFront, API Gateway, Amazon Cognito, App Runner, and Verified Access, the default limit is 16 KB (16,384 bytes), and you can increase the limit for each resource type in the web ACL 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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import 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.CfnWebACL.FieldToMatchProperty(
    all_query_arguments=all_query_arguments,
    body=wafv2.CfnWebACL.BodyProperty(
        oversize_handling="oversizeHandling"
    ),
    cookies=wafv2.CfnWebACL.CookiesProperty(
        match_pattern=wafv2.CfnWebACL.CookieMatchPatternProperty(
            all=all,
            excluded_cookies=["excludedCookies"],
            included_cookies=["includedCookies"]
        ),
        match_scope="matchScope",
        oversize_handling="oversizeHandling"
    ),
    headers=wafv2.CfnWebACL.HeadersProperty(
        match_pattern=wafv2.CfnWebACL.HeaderMatchPatternProperty(
            all=all,
            excluded_headers=["excludedHeaders"],
            included_headers=["includedHeaders"]
        ),
        match_scope="matchScope",
        oversize_handling="oversizeHandling"
    ),
    ja3_fingerprint=wafv2.CfnWebACL.JA3FingerprintProperty(
        fallback_behavior="fallbackBehavior"
    ),
    json_body=wafv2.CfnWebACL.JsonBodyProperty(
        match_pattern=wafv2.CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-fieldtomatch.html#cfn-wafv2-webacl-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.

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

  • For Application Load Balancer and AWS AppSync , the limit is fixed at 8 KB (8,192 bytes).

  • For CloudFront, API Gateway, Amazon Cognito, App Runner, and Verified Access, the default limit is 16 KB (16,384 bytes), and you can increase the limit for each resource type in the web ACL AssociationConfig , for additional processing fees.

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-fieldtomatch.html#cfn-wafv2-webacl-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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-fieldtomatch.html#cfn-wafv2-webacl-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.

See:

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

ja3_fingerprint

Match against the request’s JA3 fingerprint.

The JA3 fingerprint is a 32-character hash derived from the TLS Client Hello of an incoming request. This fingerprint serves as a unique identifier for the client’s TLS configuration. AWS WAF calculates and logs this fingerprint for each request that has enough TLS Client Hello information for the calculation. Almost all web requests include this information. .. epigraph:

You can use this choice only with a string match ``ByteMatchStatement`` with the ``PositionalConstraint`` set to ``EXACTLY`` .

You can obtain the JA3 fingerprint for client requests from the web ACL logs. If AWS WAF is able to calculate the fingerprint, it includes it in the logs. For information about the logging fields, see Log fields in the AWS WAF Developer Guide .

Provide the JA3 fingerprint string from the logs in your string match statement specification, to match with any future requests that have the same TLS configuration.

See:

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

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.

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

  • For Application Load Balancer and AWS AppSync , the limit is fixed at 8 KB (8,192 bytes).

  • For CloudFront, API Gateway, Amazon Cognito, App Runner, and Verified Access, the default limit is 16 KB (16,384 bytes), and you can increase the limit for each resource type in the web ACL AssociationConfig , for additional processing fees.

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

See:

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

method

Inspect the HTTP method.

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

See:

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

query_string

Inspect the query string.

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-fieldtomatch.html#cfn-wafv2-webacl-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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-fieldtomatch.html#cfn-wafv2-webacl-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" }

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-fieldtomatch.html#cfn-wafv2-webacl-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 .

See:

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

ForwardedIPConfigurationProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

forwarded_iPConfiguration_property = wafv2.CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-forwardedipconfiguration.html#cfn-wafv2-webacl-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.
See:

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

GeoMatchStatementProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

geo_match_statement_property = wafv2.CfnWebACL.GeoMatchStatementProperty(
    country_codes=["countryCodes"],
    forwarded_ip_config=wafv2.CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-geomatchstatement.html#cfn-wafv2-webacl-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.
See:

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

HeaderMatchPatternProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

# all: Any

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

Attributes

all

Inspect all headers.

See:

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

excluded_headers

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

See:

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

included_headers

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

See:

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

HeadersProperty

class CfnWebACL.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. All does not require a match to be found in the keys and a match to be found in the values. It requires a match to be found in the keys or the values or both. To require a match in the keys and in the values, use a logical AND statement to combine two match rules, one that inspects the keys and another that inspects the 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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

# all: Any

headers_property = wafv2.CfnWebACL.HeadersProperty(
    match_pattern=wafv2.CfnWebACL.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" ] }

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-headers.html#cfn-wafv2-webacl-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.

All does not require a match to be found in the keys and a match to be found in the values. It requires a match to be found in the keys or the values or both. To require a match in the keys and in the values, use a logical AND statement to combine two match rules, one that inspects the keys and another that inspects the values.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-headers.html#cfn-wafv2-webacl-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.

See:

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

IPSetForwardedIPConfigurationProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import 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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ipsetforwardedipconfiguration.html#cfn-wafv2-webacl-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.
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ipsetforwardedipconfiguration.html#cfn-wafv2-webacl-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.

See:

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

IPSetReferenceStatementProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import 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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ipsetreferencestatement.html#cfn-wafv2-webacl-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.
See:

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

ImmunityTimePropertyProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

immunity_time_property_property = wafv2.CfnWebACL.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.

See:

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

JA3FingerprintProperty

class CfnWebACL.JA3FingerprintProperty(*, fallback_behavior)

Bases: object

Match against the request’s JA3 fingerprint.

The JA3 fingerprint is a 32-character hash derived from the TLS Client Hello of an incoming request. This fingerprint serves as a unique identifier for the client’s TLS configuration. AWS WAF calculates and logs this fingerprint for each request that has enough TLS Client Hello information for the calculation. Almost all web requests include this information. .. epigraph:

You can use this choice only with a string match ``ByteMatchStatement`` with the ``PositionalConstraint`` set to ``EXACTLY`` .

You can obtain the JA3 fingerprint for client requests from the web ACL logs. If AWS WAF is able to calculate the fingerprint, it includes it in the logs. For information about the logging fields, see Log fields in the AWS WAF Developer Guide .

Provide the JA3 fingerprint string from the logs in your string match statement specification, to match with any future requests that have the same TLS configuration.

Parameters:

fallback_behavior (str) – The match status to assign to the web request if the request doesn’t have a JA3 fingerprint. 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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ja3fingerprint.html

ExampleMetadata:

fixture=_generated

Example:

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

j_a3_fingerprint_property = wafv2.CfnWebACL.JA3FingerprintProperty(
    fallback_behavior="fallbackBehavior"
)

Attributes

fallback_behavior

The match status to assign to the web request if the request doesn’t have a JA3 fingerprint.

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.

See:

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

JsonBodyProperty

class CfnWebACL.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. All does not require a match to be found in the keys and a match to be found in the values. It requires a match to be found in the keys or the values or both. To require a match in the keys and in the values, use a logical AND statement to combine two match rules, one that inspects the keys and another that inspects the 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. When a web request body is larger than the limit, the underlying host service only forwards the contents that are within the limit to AWS WAF for inspection. - For Application Load Balancer and AWS AppSync , the limit is fixed at 8 KB (8,192 bytes). - For CloudFront, API Gateway, Amazon Cognito, App Runner, and Verified Access, the default limit is 16 KB (16,384 bytes), and you can increase the limit for each resource type 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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

# all: Any

json_body_property = wafv2.CfnWebACL.JsonBodyProperty(
    match_pattern=wafv2.CfnWebACL.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"}

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-jsonbody.html#cfn-wafv2-webacl-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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-jsonbody.html#cfn-wafv2-webacl-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.

All does not require a match to be found in the keys and a match to be found in the values. It requires a match to be found in the keys or the values or both. To require a match in the keys and in the values, use a logical AND statement to combine two match rules, one that inspects the keys and another that inspects the values.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-jsonbody.html#cfn-wafv2-webacl-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. When a web request body is larger than the limit, the underlying host service only forwards the contents that are within the limit to AWS WAF for inspection.

  • For Application Load Balancer and AWS AppSync , the limit is fixed at 8 KB (8,192 bytes).

  • For CloudFront, API Gateway, Amazon Cognito, App Runner, and Verified Access, the default limit is 16 KB (16,384 bytes), and you can increase the limit for each resource type 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

See:

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

JsonMatchPatternProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

# all: Any

json_match_pattern_property = wafv2.CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-jsonmatchpattern.html#cfn-wafv2-webacl-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.
See:

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

LabelMatchStatementProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

label_match_statement_property = wafv2.CfnWebACL.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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-labelmatchstatement.html#cfn-wafv2-webacl-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.

See:

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

LabelProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

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

Attributes

name

The label string.

See:

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

ManagedRuleGroupConfigProperty

class CfnWebACL.ManagedRuleGroupConfigProperty(*, aws_managed_rules_acfp_rule_set=None, aws_managed_rules_atp_rule_set=None, aws_managed_rules_bot_control_rule_set=None, login_path=None, password_field=None, payload_type=None, username_field=None)

Bases: object

Additional information that’s used by a managed rule group. Many managed rule groups don’t require this.

The rule groups used for intelligent threat mitigation require additional configuration:

  • Use the AWSManagedRulesACFPRuleSet configuration object to configure the account creation fraud prevention managed rule group. The configuration includes the registration and sign-up pages of your application and the locations in the account creation request payload of data, such as the user email and phone number fields.

  • Use the AWSManagedRulesATPRuleSet configuration object to configure the account takeover prevention managed rule group. The configuration includes the sign-in page of your application and the locations in the login request payload of data such as the username and password.

  • Use the AWSManagedRulesBotControlRuleSet configuration object to configure the protection level that you want the Bot Control rule group to use.

Parameters:
  • aws_managed_rules_acfp_rule_set (Union[IResolvable, AWSManagedRulesACFPRuleSetProperty, Dict[str, Any], None]) – Additional configuration for using the account creation fraud prevention (ACFP) managed rule group, AWSManagedRulesACFPRuleSet . Use this to provide account creation request information to the rule group. For web ACLs that protect CloudFront distributions, use this to also provide the information about how your distribution responds to account creation requests. For information about using the ACFP managed rule group, see AWS WAF Fraud Control account creation fraud prevention (ACFP) rule group and AWS WAF Fraud Control account creation fraud prevention (ACFP) in the AWS WAF Developer Guide .

  • aws_managed_rules_atp_rule_set (Union[IResolvable, AWSManagedRulesATPRuleSetProperty, Dict[str, Any], None]) – Additional configuration for using the account takeover prevention (ATP) managed rule group, AWSManagedRulesATPRuleSet . Use this to provide login request information to the rule group. For web ACLs that protect CloudFront distributions, use this to also provide the information about how your distribution responds to login requests. This configuration replaces the individual configuration fields in ManagedRuleGroupConfig and provides additional feature configuration. For information about using the ATP managed rule group, see AWS WAF Fraud Control account takeover prevention (ATP) rule group and AWS WAF Fraud Control account takeover prevention (ATP) in the AWS WAF Developer Guide .

  • aws_managed_rules_bot_control_rule_set (Union[IResolvable, AWSManagedRulesBotControlRuleSetProperty, Dict[str, Any], None]) –

    Additional configuration for using the Bot Control managed rule group. Use this to specify the inspection level that you want to use. For information about using the Bot Control managed rule group, see AWS WAF Bot Control rule group and AWS WAF Bot Control in the AWS WAF Developer Guide .

  • login_path (Optional[str]) –

    Instead of this setting, provide your configuration under AWSManagedRulesATPRuleSet .

  • password_field (Union[IResolvable, FieldIdentifierProperty, Dict[str, Any], None]) –

    Instead of this setting, provide your configuration under the request inspection configuration for AWSManagedRulesATPRuleSet or AWSManagedRulesACFPRuleSet .

  • payload_type (Optional[str]) –

    Instead of this setting, provide your configuration under the request inspection configuration for AWSManagedRulesATPRuleSet or AWSManagedRulesACFPRuleSet .

  • username_field (Union[IResolvable, FieldIdentifierProperty, Dict[str, Any], None]) –

    Instead of this setting, provide your configuration under the request inspection configuration for AWSManagedRulesATPRuleSet or AWSManagedRulesACFPRuleSet .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-managedrulegroupconfig.html

ExampleMetadata:

fixture=_generated

Example:

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

managed_rule_group_config_property = wafv2.CfnWebACL.ManagedRuleGroupConfigProperty(
    aws_managed_rules_acfp_rule_set=wafv2.CfnWebACL.AWSManagedRulesACFPRuleSetProperty(
        creation_path="creationPath",
        registration_page_path="registrationPagePath",
        request_inspection=wafv2.CfnWebACL.RequestInspectionACFPProperty(
            payload_type="payloadType",

            # the properties below are optional
            address_fields=[wafv2.CfnWebACL.FieldIdentifierProperty(
                identifier="identifier"
            )],
            email_field=wafv2.CfnWebACL.FieldIdentifierProperty(
                identifier="identifier"
            ),
            password_field=wafv2.CfnWebACL.FieldIdentifierProperty(
                identifier="identifier"
            ),
            phone_number_fields=[wafv2.CfnWebACL.FieldIdentifierProperty(
                identifier="identifier"
            )],
            username_field=wafv2.CfnWebACL.FieldIdentifierProperty(
                identifier="identifier"
            )
        ),

        # the properties below are optional
        enable_regex_in_path=False,
        response_inspection=wafv2.CfnWebACL.ResponseInspectionProperty(
            body_contains=wafv2.CfnWebACL.ResponseInspectionBodyContainsProperty(
                failure_strings=["failureStrings"],
                success_strings=["successStrings"]
            ),
            header=wafv2.CfnWebACL.ResponseInspectionHeaderProperty(
                failure_values=["failureValues"],
                name="name",
                success_values=["successValues"]
            ),
            json=wafv2.CfnWebACL.ResponseInspectionJsonProperty(
                failure_values=["failureValues"],
                identifier="identifier",
                success_values=["successValues"]
            ),
            status_code=wafv2.CfnWebACL.ResponseInspectionStatusCodeProperty(
                failure_codes=[123],
                success_codes=[123]
            )
        )
    ),
    aws_managed_rules_atp_rule_set=wafv2.CfnWebACL.AWSManagedRulesATPRuleSetProperty(
        login_path="loginPath",

        # the properties below are optional
        enable_regex_in_path=False,
        request_inspection=wafv2.CfnWebACL.RequestInspectionProperty(
            password_field=wafv2.CfnWebACL.FieldIdentifierProperty(
                identifier="identifier"
            ),
            payload_type="payloadType",
            username_field=wafv2.CfnWebACL.FieldIdentifierProperty(
                identifier="identifier"
            )
        ),
        response_inspection=wafv2.CfnWebACL.ResponseInspectionProperty(
            body_contains=wafv2.CfnWebACL.ResponseInspectionBodyContainsProperty(
                failure_strings=["failureStrings"],
                success_strings=["successStrings"]
            ),
            header=wafv2.CfnWebACL.ResponseInspectionHeaderProperty(
                failure_values=["failureValues"],
                name="name",
                success_values=["successValues"]
            ),
            json=wafv2.CfnWebACL.ResponseInspectionJsonProperty(
                failure_values=["failureValues"],
                identifier="identifier",
                success_values=["successValues"]
            ),
            status_code=wafv2.CfnWebACL.ResponseInspectionStatusCodeProperty(
                failure_codes=[123],
                success_codes=[123]
            )
        )
    ),
    aws_managed_rules_bot_control_rule_set=wafv2.CfnWebACL.AWSManagedRulesBotControlRuleSetProperty(
        inspection_level="inspectionLevel",

        # the properties below are optional
        enable_machine_learning=False
    ),
    login_path="loginPath",
    password_field=wafv2.CfnWebACL.FieldIdentifierProperty(
        identifier="identifier"
    ),
    payload_type="payloadType",
    username_field=wafv2.CfnWebACL.FieldIdentifierProperty(
        identifier="identifier"
    )
)

Attributes

aws_managed_rules_acfp_rule_set

Additional configuration for using the account creation fraud prevention (ACFP) managed rule group, AWSManagedRulesACFPRuleSet .

Use this to provide account creation request information to the rule group. For web ACLs that protect CloudFront distributions, use this to also provide the information about how your distribution responds to account creation requests.

For information about using the ACFP managed rule group, see AWS WAF Fraud Control account creation fraud prevention (ACFP) rule group and AWS WAF Fraud Control account creation fraud prevention (ACFP) in the AWS WAF Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-managedrulegroupconfig.html#cfn-wafv2-webacl-managedrulegroupconfig-awsmanagedrulesacfpruleset

aws_managed_rules_atp_rule_set

Additional configuration for using the account takeover prevention (ATP) managed rule group, AWSManagedRulesATPRuleSet .

Use this to provide login request information to the rule group. For web ACLs that protect CloudFront distributions, use this to also provide the information about how your distribution responds to login requests.

This configuration replaces the individual configuration fields in ManagedRuleGroupConfig and provides additional feature configuration.

For information about using the ATP managed rule group, see AWS WAF Fraud Control account takeover prevention (ATP) rule group and AWS WAF Fraud Control account takeover prevention (ATP) in the AWS WAF Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-managedrulegroupconfig.html#cfn-wafv2-webacl-managedrulegroupconfig-awsmanagedrulesatpruleset

aws_managed_rules_bot_control_rule_set

Additional configuration for using the Bot Control managed rule group.

Use this to specify the inspection level that you want to use. For information about using the Bot Control managed rule group, see AWS WAF Bot Control rule group and AWS WAF Bot Control in the AWS WAF Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-managedrulegroupconfig.html#cfn-wafv2-webacl-managedrulegroupconfig-awsmanagedrulesbotcontrolruleset

login_path
password_field

Instead of this setting, provide your configuration under the request inspection configuration for AWSManagedRulesATPRuleSet or AWSManagedRulesACFPRuleSet .

payload_type

Instead of this setting, provide your configuration under the request inspection configuration for AWSManagedRulesATPRuleSet or AWSManagedRulesACFPRuleSet .

username_field

Instead of this setting, provide your configuration under the request inspection configuration for AWSManagedRulesATPRuleSet or AWSManagedRulesACFPRuleSet .

ManagedRuleGroupStatementProperty

class CfnWebACL.ManagedRuleGroupStatementProperty(*, name, vendor_name, excluded_rules=None, managed_rule_group_configs=None, rule_action_overrides=None, scope_down_statement=None, version=None)

Bases: object

A rule statement used to run the rules that are defined in a managed rule group.

To use this, provide the vendor name and the name of the rule group in this statement. You can retrieve the required names through the API call ListAvailableManagedRuleGroups .

You cannot nest a ManagedRuleGroupStatement , for example for use inside a NotStatement or OrStatement . You cannot use a managed rule group statement inside another rule group. You can only use a managed rule group statement as a top-level statement in a rule that you define in a web ACL. .. epigraph:

You are charged additional fees when you use the AWS WAF Bot Control managed rule group ``AWSManagedRulesBotControlRuleSet`` , the AWS WAF Fraud Control account takeover prevention (ATP) managed rule group ``AWSManagedRulesATPRuleSet`` , or the AWS WAF Fraud Control account creation fraud prevention (ACFP) managed rule group ``AWSManagedRulesACFPRuleSet`` . For more information, see `AWS WAF Pricing <https://docs.aws.amazon.com/waf/pricing/>`_ .
Parameters:
  • name (str) – The name of the managed rule group. You use this, along with the vendor name, to identify the rule group.

  • vendor_name (str) – The name of the managed rule group vendor. You use this, along with the rule group name, to identify a rule group.

  • excluded_rules (Union[IResolvable, Sequence[Union[IResolvable, ExcludedRuleProperty, Dict[str, Any]]], None]) – Rules in the referenced rule group whose actions are set to Count . .. epigraph:: Instead of this option, use RuleActionOverrides . It accepts any valid action setting, including Count .

  • managed_rule_group_configs (Union[IResolvable, Sequence[Union[IResolvable, ManagedRuleGroupConfigProperty, Dict[str, Any]]], None]) – Additional information that’s used by a managed rule group. Many managed rule groups don’t require this. The rule groups used for intelligent threat mitigation require additional configuration: - Use the AWSManagedRulesACFPRuleSet configuration object to configure the account creation fraud prevention managed rule group. The configuration includes the registration and sign-up pages of your application and the locations in the account creation request payload of data, such as the user email and phone number fields. - Use the AWSManagedRulesATPRuleSet configuration object to configure the account takeover prevention managed rule group. The configuration includes the sign-in page of your application and the locations in the login request payload of data such as the username and password. - Use the AWSManagedRulesBotControlRuleSet configuration object to configure the protection level that you want the Bot Control rule group to use.

  • rule_action_overrides (Union[IResolvable, Sequence[Union[IResolvable, RuleActionOverrideProperty, Dict[str, Any]]], None]) – Action settings to use in the place of the rule actions that are configured inside the rule group. You specify one override for each rule whose action you want to change. You can use overrides for testing, for example you can override all of rule actions to Count and then monitor the resulting count metrics to understand how the rule group would handle your web traffic. You can also permanently override some or all actions, to modify how the rule group manages your web traffic.

  • 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 managed rule group. Requests are only evaluated by the rule group 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.

  • version (Optional[str]) – The version of the managed rule group to use. If you specify this, the version setting is fixed until you change it. If you don’t specify this, AWS WAF uses the vendor’s default version, and then keeps the version at the vendor’s default when the vendor updates the managed rule group settings.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-managedrulegroupstatement.html

ExampleMetadata:

fixture=_generated

Example:

.. rubric:: Attributes
excluded_rules

Rules in the referenced rule group whose actions are set to Count .

Instead of this option, use RuleActionOverrides . It accepts any valid action setting, including Count .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-managedrulegroupstatement.html#cfn-wafv2-webacl-managedrulegroupstatement-excludedrules

managed_rule_group_configs

Additional information that’s used by a managed rule group. Many managed rule groups don’t require this.

The rule groups used for intelligent threat mitigation require additional configuration:

  • Use the AWSManagedRulesACFPRuleSet configuration object to configure the account creation fraud prevention managed rule group. The configuration includes the registration and sign-up pages of your application and the locations in the account creation request payload of data, such as the user email and phone number fields.

  • Use the AWSManagedRulesATPRuleSet configuration object to configure the account takeover prevention managed rule group. The configuration includes the sign-in page of your application and the locations in the login request payload of data such as the username and password.

  • Use the AWSManagedRulesBotControlRuleSet configuration object to configure the protection level that you want the Bot Control rule group to use.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-managedrulegroupstatement.html#cfn-wafv2-webacl-managedrulegroupstatement-managedrulegroupconfigs

name

The name of the managed rule group.

You use this, along with the vendor name, to identify the rule group.

See:

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

rule_action_overrides

Action settings to use in the place of the rule actions that are configured inside the rule group.

You specify one override for each rule whose action you want to change.

You can use overrides for testing, for example you can override all of rule actions to Count and then monitor the resulting count metrics to understand how the rule group would handle your web traffic. You can also permanently override some or all actions, to modify how the rule group manages your web traffic.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-managedrulegroupstatement.html#cfn-wafv2-webacl-managedrulegroupstatement-ruleactionoverrides

scope_down_statement

An optional nested statement that narrows the scope of the web requests that are evaluated by the managed rule group.

Requests are only evaluated by the rule group 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.

See:

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

vendor_name

The name of the managed rule group vendor.

You use this, along with the rule group name, to identify a rule group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-managedrulegroupstatement.html#cfn-wafv2-webacl-managedrulegroupstatement-vendorname

version

The version of the managed rule group to use.

If you specify this, the version setting is fixed until you change it. If you don’t specify this, AWS WAF uses the vendor’s default version, and then keeps the version at the vendor’s default when the vendor updates the managed rule group settings.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-managedrulegroupstatement.html#cfn-wafv2-webacl-managedrulegroupstatement-version

NotStatementProperty

class CfnWebACL.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.

See:

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

ExampleMetadata:

fixture=_generated

Example:

.. rubric:: Attributes
statement

The statement to negate.

You can use any statement that can be nested.

See:

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

OrStatementProperty

class CfnWebACL.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.

See:

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

ExampleMetadata:

fixture=_generated

Example:

.. rubric:: Attributes
statements

The statements to combine with OR logic.

You can use any statements that can be nested.

See:

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

OverrideActionProperty

class CfnWebACL.OverrideActionProperty(*, count=None, none=None)

Bases: object

The action to use in the place of the action that results from the rule group evaluation.

Set the override action to none to leave the result of the rule group alone. Set it to count to override the result to count only.

You can only use this for rule statements that reference a rule group, like RuleGroupReferenceStatement and ManagedRuleGroupStatement . .. epigraph:

This option is usually set to none. It does not affect how the rules in the rule group are evaluated. If you want the rules in the rule group to only count matches, do not use this and instead use the rule action override option, with ``Count`` action, in your rule group reference statement settings.
Parameters:
  • count (Optional[Any]) – Override the rule group evaluation result to count only. .. epigraph:: This option is usually set to none. It does not affect how the rules in the rule group are evaluated. If you want the rules in the rule group to only count matches, do not use this and instead use the rule action override option, with Count action, in your rule group reference statement settings.

  • none (Optional[Any]) – Don’t override the rule group evaluation result. This is the most common setting.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-overrideaction.html

ExampleMetadata:

fixture=_generated

Example:

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

# count: Any
# none: Any

override_action_property = wafv2.CfnWebACL.OverrideActionProperty(
    count=count,
    none=none
)

Attributes

count

Override the rule group evaluation result to count only.

This option is usually set to none. It does not affect how the rules in the rule group are evaluated. If you want the rules in the rule group to only count matches, do not use this and instead use the rule action override option, with Count action, in your rule group reference statement settings.

See:

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

none

Don’t override the rule group evaluation result.

This is the most common setting.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-overrideaction.html#cfn-wafv2-webacl-overrideaction-none

RateBasedStatementCustomKeyProperty

class CfnWebACL.RateBasedStatementCustomKeyProperty(*, cookie=None, forwarded_ip=None, header=None, http_method=None, ip=None, label_namespace=None, query_argument=None, query_string=None, uri_path=None)

Bases: object

Specifies a single custom aggregate key for a rate-base rule.

Web requests that are missing any of the components specified in the aggregation keys are omitted from the rate-based rule evaluation and handling.

Parameters:
  • cookie (Union[IResolvable, RateLimitCookieProperty, Dict[str, Any], None]) – Use the value of a cookie in the request as an aggregate key. Each distinct value in the cookie contributes to the aggregation instance. If you use a single cookie as your custom key, then each value fully defines an aggregation instance.

  • forwarded_ip (Optional[Any]) – Use the first IP address in an HTTP header as an aggregate key. Each distinct forwarded IP address contributes to the aggregation instance. When you specify an IP or forwarded IP in the custom key settings, you must also specify at least one other key to use. You can aggregate on only the forwarded IP address by specifying FORWARDED_IP in your rate-based statement’s AggregateKeyType . With this option, you must specify the header to use in the rate-based rule’s ForwardedIPConfig property.

  • header (Union[IResolvable, RateLimitHeaderProperty, Dict[str, Any], None]) – Use the value of a header in the request as an aggregate key. Each distinct value in the header contributes to the aggregation instance. If you use a single header as your custom key, then each value fully defines an aggregation instance.

  • http_method (Optional[Any]) – Use the request’s HTTP method as an aggregate key. Each distinct HTTP method contributes to the aggregation instance. If you use just the HTTP method as your custom key, then each method fully defines an aggregation instance.

  • ip (Optional[Any]) – Use the request’s originating IP address as an aggregate key. Each distinct IP address contributes to the aggregation instance. When you specify an IP or forwarded IP in the custom key settings, you must also specify at least one other key to use. You can aggregate on only the IP address by specifying IP in your rate-based statement’s AggregateKeyType .

  • label_namespace (Union[IResolvable, RateLimitLabelNamespaceProperty, Dict[str, Any], None]) – Use the specified label namespace as an aggregate key. Each distinct fully qualified label name that has the specified label namespace contributes to the aggregation instance. If you use just one label namespace as your custom key, then each label name fully defines an aggregation instance. This uses only labels that have been added to the request by rules that are evaluated before this rate-based rule in the web ACL. For information about label namespaces and names, see Label syntax and naming requirements in the AWS WAF Developer Guide .

  • query_argument (Union[IResolvable, RateLimitQueryArgumentProperty, Dict[str, Any], None]) – Use the specified query argument as an aggregate key. Each distinct value for the named query argument contributes to the aggregation instance. If you use a single query argument as your custom key, then each value fully defines an aggregation instance.

  • query_string (Union[IResolvable, RateLimitQueryStringProperty, Dict[str, Any], None]) – Use the request’s query string as an aggregate key. Each distinct string contributes to the aggregation instance. If you use just the query string as your custom key, then each string fully defines an aggregation instance.

  • uri_path (Union[IResolvable, RateLimitUriPathProperty, Dict[str, Any], None]) – Use the request’s URI path as an aggregate key. Each distinct URI path contributes to the aggregation instance. If you use just the URI path as your custom key, then each URI path fully defines an aggregation instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratebasedstatementcustomkey.html

ExampleMetadata:

fixture=_generated

Example:

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

# forwarded_ip: Any
# http_method: Any
# ip: Any

rate_based_statement_custom_key_property = wafv2.CfnWebACL.RateBasedStatementCustomKeyProperty(
    cookie=wafv2.CfnWebACL.RateLimitCookieProperty(
        name="name",
        text_transformations=[wafv2.CfnWebACL.TextTransformationProperty(
            priority=123,
            type="type"
        )]
    ),
    forwarded_ip=forwarded_ip,
    header=wafv2.CfnWebACL.RateLimitHeaderProperty(
        name="name",
        text_transformations=[wafv2.CfnWebACL.TextTransformationProperty(
            priority=123,
            type="type"
        )]
    ),
    http_method=http_method,
    ip=ip,
    label_namespace=wafv2.CfnWebACL.RateLimitLabelNamespaceProperty(
        namespace="namespace"
    ),
    query_argument=wafv2.CfnWebACL.RateLimitQueryArgumentProperty(
        name="name",
        text_transformations=[wafv2.CfnWebACL.TextTransformationProperty(
            priority=123,
            type="type"
        )]
    ),
    query_string=wafv2.CfnWebACL.RateLimitQueryStringProperty(
        text_transformations=[wafv2.CfnWebACL.TextTransformationProperty(
            priority=123,
            type="type"
        )]
    ),
    uri_path=wafv2.CfnWebACL.RateLimitUriPathProperty(
        text_transformations=[wafv2.CfnWebACL.TextTransformationProperty(
            priority=123,
            type="type"
        )]
    )
)

Attributes

cookie

Use the value of a cookie in the request as an aggregate key.

Each distinct value in the cookie contributes to the aggregation instance. If you use a single cookie as your custom key, then each value fully defines an aggregation instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratebasedstatementcustomkey.html#cfn-wafv2-webacl-ratebasedstatementcustomkey-cookie

forwarded_ip

Use the first IP address in an HTTP header as an aggregate key.

Each distinct forwarded IP address contributes to the aggregation instance.

When you specify an IP or forwarded IP in the custom key settings, you must also specify at least one other key to use. You can aggregate on only the forwarded IP address by specifying FORWARDED_IP in your rate-based statement’s AggregateKeyType .

With this option, you must specify the header to use in the rate-based rule’s ForwardedIPConfig property.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratebasedstatementcustomkey.html#cfn-wafv2-webacl-ratebasedstatementcustomkey-forwardedip

header

Use the value of a header in the request as an aggregate key.

Each distinct value in the header contributes to the aggregation instance. If you use a single header as your custom key, then each value fully defines an aggregation instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratebasedstatementcustomkey.html#cfn-wafv2-webacl-ratebasedstatementcustomkey-header

http_method

Use the request’s HTTP method as an aggregate key.

Each distinct HTTP method contributes to the aggregation instance. If you use just the HTTP method as your custom key, then each method fully defines an aggregation instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratebasedstatementcustomkey.html#cfn-wafv2-webacl-ratebasedstatementcustomkey-httpmethod

ip

Use the request’s originating IP address as an aggregate key. Each distinct IP address contributes to the aggregation instance.

When you specify an IP or forwarded IP in the custom key settings, you must also specify at least one other key to use. You can aggregate on only the IP address by specifying IP in your rate-based statement’s AggregateKeyType .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratebasedstatementcustomkey.html#cfn-wafv2-webacl-ratebasedstatementcustomkey-ip

label_namespace

Use the specified label namespace as an aggregate key.

Each distinct fully qualified label name that has the specified label namespace contributes to the aggregation instance. If you use just one label namespace as your custom key, then each label name fully defines an aggregation instance.

This uses only labels that have been added to the request by rules that are evaluated before this rate-based rule in the web ACL.

For information about label namespaces and names, see Label syntax and naming requirements in the AWS WAF Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratebasedstatementcustomkey.html#cfn-wafv2-webacl-ratebasedstatementcustomkey-labelnamespace

query_argument

Use the specified query argument as an aggregate key.

Each distinct value for the named query argument contributes to the aggregation instance. If you use a single query argument as your custom key, then each value fully defines an aggregation instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratebasedstatementcustomkey.html#cfn-wafv2-webacl-ratebasedstatementcustomkey-queryargument

query_string

Use the request’s query string as an aggregate key.

Each distinct string contributes to the aggregation instance. If you use just the query string as your custom key, then each string fully defines an aggregation instance.

See:

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

uri_path

Use the request’s URI path as an aggregate key.

Each distinct URI path contributes to the aggregation instance. If you use just the URI path as your custom key, then each URI path fully defines an aggregation instance.

See:

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

RateBasedStatementProperty

class CfnWebACL.RateBasedStatementProperty(*, aggregate_key_type, limit, custom_keys=None, evaluation_window_sec=None, forwarded_ip_config=None, scope_down_statement=None)

Bases: object

A rate-based rule counts incoming requests and rate limits requests when they are coming at too fast a rate.

The rule categorizes requests according to your aggregation criteria, collects them into aggregation instances, and counts and rate limits the requests for each instance. .. epigraph:

If you change any of these settings in a rule that's currently in use, the change resets the rule's rate limiting counts. This can pause the rule's rate limiting activities for up to a minute.

You can specify individual aggregation keys, like IP address or HTTP method. You can also specify aggregation key combinations, like IP address and HTTP method, or HTTP method, query argument, and cookie.

Each unique set of values for the aggregation keys that you specify is a separate aggregation instance, with the value from each key contributing to the aggregation instance definition.

For example, assume the rule evaluates web requests with the following IP address and HTTP method values:

  • IP address 10.1.1.1, HTTP method POST

  • IP address 10.1.1.1, HTTP method GET

  • IP address 127.0.0.0, HTTP method POST

  • IP address 10.1.1.1, HTTP method GET

The rule would create different aggregation instances according to your aggregation criteria, for example:

  • If the aggregation criteria is just the IP address, then each individual address is an aggregation instance, and AWS WAF counts requests separately for each. The aggregation instances and request counts for our example would be the following:

  • IP address 10.1.1.1: count 3

  • IP address 127.0.0.0: count 1

  • If the aggregation criteria is HTTP method, then each individual HTTP method is an aggregation instance. The aggregation instances and request counts for our example would be the following:

  • HTTP method POST: count 2

  • HTTP method GET: count 2

  • If the aggregation criteria is IP address and HTTP method, then each IP address and each HTTP method would contribute to the combined aggregation instance. The aggregation instances and request counts for our example would be the following:

  • IP address 10.1.1.1, HTTP method POST: count 1

  • IP address 10.1.1.1, HTTP method GET: count 2

  • IP address 127.0.0.0, HTTP method POST: count 1

For any n-tuple of aggregation keys, each unique combination of values for the keys defines a separate aggregation instance, which AWS WAF counts and rate-limits individually.

You can optionally nest another statement inside the rate-based statement, to narrow the scope of the rule so that it only counts and rate limits requests that match the nested statement. You can use this nested scope-down statement in conjunction with your aggregation key specifications or you can just count and rate limit all requests that match the scope-down statement, without additional aggregation. When you choose to just manage all requests that match a scope-down statement, the aggregation instance is singular for the 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.

For additional information about the options, see Rate limiting web requests using rate-based rules in the AWS WAF Developer Guide .

If you only aggregate on the individual IP address or forwarded IP address, you can retrieve the list of IP addresses that AWS WAF is currently rate limiting for a rule through the API call GetRateBasedStatementManagedKeys . This option is not available for other aggregation configurations.

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 .

Parameters:
  • aggregate_key_type (str) – Setting that indicates how to aggregate the request counts. .. epigraph:: Web requests that are missing any of the components specified in the aggregation keys are omitted from the rate-based rule evaluation and handling. - CONSTANT - Count and limit the requests that match the rate-based rule’s scope-down statement. With this option, the counted requests aren’t further aggregated. The scope-down statement is the only specification used. When the count of all requests that satisfy the scope-down statement goes over the limit, AWS WAF applies the rule action to all requests that satisfy the scope-down statement. With this option, you must configure the ScopeDownStatement property. - CUSTOM_KEYS - Aggregate the request counts using one or more web request components as the aggregate keys. With this option, you must specify the aggregate keys in the CustomKeys property. To aggregate on only the IP address or only the forwarded IP address, don’t use custom keys. Instead, set the aggregate key type to IP or FORWARDED_IP . - FORWARDED_IP - Aggregate the request counts on the first IP address in an HTTP header. With this option, you must specify the header to use in the ForwardedIPConfig property. To aggregate on a combination of the forwarded IP address with other aggregate keys, use CUSTOM_KEYS . - IP - Aggregate the request counts on the IP address from the web request origin. To aggregate on a combination of the IP address with other aggregate keys, use CUSTOM_KEYS .

  • limit (Union[int, float]) – The limit on requests per 5-minute period for a single aggregation instance for the rate-based rule. If the rate-based statement includes a ScopeDownStatement , this limit is applied only to the requests that match the statement. Examples: - If you aggregate on just the IP address, this is the limit on requests from any single IP address. - If you aggregate on the HTTP method and the query argument name “city”, then this is the limit on requests for any single method, city pair.

  • custom_keys (Union[IResolvable, Sequence[Union[IResolvable, RateBasedStatementCustomKeyProperty, Dict[str, Any]]], None]) – Specifies the aggregate keys to use in a rate-base rule.

  • evaluation_window_sec (Union[int, float, None]) – The amount of time, in seconds, that AWS WAF should include in its request counts, looking back from the current time. For example, for a setting of 120, when AWS WAF checks the rate, it counts the requests for the 2 minutes immediately preceding the current time. Valid settings are 60, 120, 300, and 600. This setting doesn’t determine how often AWS WAF checks the rate, but how far back it looks each time it checks. AWS WAF checks the rate about every 10 seconds. Default: 300 (5 minutes)

  • 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 and managed by the rate-based statement. When you use a scope-down statement, the rate-based rule only tracks and rate limits requests that 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.

See:

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

ExampleMetadata:

fixture=_generated

Example:

.. rubric:: Attributes
aggregate_key_type

Setting that indicates how to aggregate the request counts.

Web requests that are missing any of the components specified in the aggregation keys are omitted from the rate-based rule evaluation and handling.

  • CONSTANT - Count and limit the requests that match the rate-based rule’s scope-down statement. With this option, the counted requests aren’t further aggregated. The scope-down statement is the only specification used. When the count of all requests that satisfy the scope-down statement goes over the limit, AWS WAF applies the rule action to all requests that satisfy the scope-down statement.

With this option, you must configure the ScopeDownStatement property.

  • CUSTOM_KEYS - Aggregate the request counts using one or more web request components as the aggregate keys.

With this option, you must specify the aggregate keys in the CustomKeys property.

To aggregate on only the IP address or only the forwarded IP address, don’t use custom keys. Instead, set the aggregate key type to IP or FORWARDED_IP .

  • FORWARDED_IP - Aggregate the request counts on the first IP address in an HTTP header.

With this option, you must specify the header to use in the ForwardedIPConfig property.

To aggregate on a combination of the forwarded IP address with other aggregate keys, use CUSTOM_KEYS .

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

To aggregate on a combination of the IP address with other aggregate keys, use CUSTOM_KEYS .

See:

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

custom_keys

Specifies the aggregate keys to use in a rate-base rule.

See:

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

evaluation_window_sec

The amount of time, in seconds, that AWS WAF should include in its request counts, looking back from the current time.

For example, for a setting of 120, when AWS WAF checks the rate, it counts the requests for the 2 minutes immediately preceding the current time. Valid settings are 60, 120, 300, and 600.

This setting doesn’t determine how often AWS WAF checks the rate, but how far back it looks each time it checks. AWS WAF checks the rate about every 10 seconds.

Default: 300 (5 minutes)

See:

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

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.

See:

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

limit

The limit on requests per 5-minute period for a single aggregation instance for the rate-based rule.

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

Examples:

  • If you aggregate on just the IP address, this is the limit on requests from any single IP address.

  • If you aggregate on the HTTP method and the query argument name “city”, then this is the limit on requests for any single method, city pair.

See:

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

scope_down_statement

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

When you use a scope-down statement, the rate-based rule only tracks and rate limits requests that 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.

See:

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

RateLimitCookieProperty

class CfnWebACL.RateLimitCookieProperty(*, name, text_transformations)

Bases: object

Specifies a cookie as an aggregate key for a rate-based rule.

Each distinct value in the cookie contributes to the aggregation instance. If you use a single cookie as your custom key, then each value fully defines an aggregation instance.

Parameters:
  • name (str) – The name of the cookie to use.

  • 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. Text transformations are used in rule match statements, to transform the FieldToMatch request component before inspecting it, and they’re used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, AWS WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the transformed component contents.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratelimitcookie.html

ExampleMetadata:

fixture=_generated

Example:

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

rate_limit_cookie_property = wafv2.CfnWebACL.RateLimitCookieProperty(
    name="name",
    text_transformations=[wafv2.CfnWebACL.TextTransformationProperty(
        priority=123,
        type="type"
    )]
)

Attributes

name

The name of the cookie to use.

See:

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

text_transformations

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

Text transformations are used in rule match statements, to transform the FieldToMatch request component before inspecting it, and they’re used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, AWS WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the transformed component contents.

See:

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

RateLimitHeaderProperty

class CfnWebACL.RateLimitHeaderProperty(*, name, text_transformations)

Bases: object

Specifies a header as an aggregate key for a rate-based rule.

Each distinct value in the header contributes to the aggregation instance. If you use a single header as your custom key, then each value fully defines an aggregation instance.

Parameters:
  • name (str) – The name of the header to use.

  • 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. Text transformations are used in rule match statements, to transform the FieldToMatch request component before inspecting it, and they’re used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, AWS WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the transformed component contents.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratelimitheader.html

ExampleMetadata:

fixture=_generated

Example:

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

rate_limit_header_property = wafv2.CfnWebACL.RateLimitHeaderProperty(
    name="name",
    text_transformations=[wafv2.CfnWebACL.TextTransformationProperty(
        priority=123,
        type="type"
    )]
)

Attributes

name

The name of the header to use.

See:

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

text_transformations

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

Text transformations are used in rule match statements, to transform the FieldToMatch request component before inspecting it, and they’re used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, AWS WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the transformed component contents.

See:

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

RateLimitLabelNamespaceProperty

class CfnWebACL.RateLimitLabelNamespaceProperty(*, namespace)

Bases: object

Specifies a label namespace to use as an aggregate key for a rate-based rule.

Each distinct fully qualified label name that has the specified label namespace contributes to the aggregation instance. If you use just one label namespace as your custom key, then each label name fully defines an aggregation instance.

This uses only labels that have been added to the request by rules that are evaluated before this rate-based rule in the web ACL.

For information about label namespaces and names, see Label syntax and naming requirements in the AWS WAF Developer Guide .

Parameters:

namespace (str) – The namespace to use for aggregation.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratelimitlabelnamespace.html

ExampleMetadata:

fixture=_generated

Example:

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

rate_limit_label_namespace_property = wafv2.CfnWebACL.RateLimitLabelNamespaceProperty(
    namespace="namespace"
)

Attributes

namespace

The namespace to use for aggregation.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratelimitlabelnamespace.html#cfn-wafv2-webacl-ratelimitlabelnamespace-namespace

RateLimitQueryArgumentProperty

class CfnWebACL.RateLimitQueryArgumentProperty(*, name, text_transformations)

Bases: object

Specifies a query argument in the request as an aggregate key for a rate-based rule.

Each distinct value for the named query argument contributes to the aggregation instance. If you use a single query argument as your custom key, then each value fully defines an aggregation instance.

Parameters:
  • name (str) – The name of the query argument to use.

  • 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. Text transformations are used in rule match statements, to transform the FieldToMatch request component before inspecting it, and they’re used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, AWS WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the transformed component contents.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratelimitqueryargument.html

ExampleMetadata:

fixture=_generated

Example:

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

rate_limit_query_argument_property = wafv2.CfnWebACL.RateLimitQueryArgumentProperty(
    name="name",
    text_transformations=[wafv2.CfnWebACL.TextTransformationProperty(
        priority=123,
        type="type"
    )]
)

Attributes

name

The name of the query argument to use.

See:

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

text_transformations

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

Text transformations are used in rule match statements, to transform the FieldToMatch request component before inspecting it, and they’re used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, AWS WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the transformed component contents.

See:

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

RateLimitQueryStringProperty

class CfnWebACL.RateLimitQueryStringProperty(*, text_transformations)

Bases: object

Specifies the request’s query string as an aggregate key for a rate-based rule.

Each distinct string contributes to the aggregation instance. If you use just the query string as your custom key, then each string fully defines an aggregation instance.

Parameters:

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. Text transformations are used in rule match statements, to transform the FieldToMatch request component before inspecting it, and they’re used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, AWS WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the transformed component contents.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratelimitquerystring.html

ExampleMetadata:

fixture=_generated

Example:

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

rate_limit_query_string_property = wafv2.CfnWebACL.RateLimitQueryStringProperty(
    text_transformations=[wafv2.CfnWebACL.TextTransformationProperty(
        priority=123,
        type="type"
    )]
)

Attributes

text_transformations

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

Text transformations are used in rule match statements, to transform the FieldToMatch request component before inspecting it, and they’re used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, AWS WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the transformed component contents.

See:

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

RateLimitUriPathProperty

class CfnWebACL.RateLimitUriPathProperty(*, text_transformations)

Bases: object

Specifies the request’s URI path as an aggregate key for a rate-based rule.

Each distinct URI path contributes to the aggregation instance. If you use just the URI path as your custom key, then each URI path fully defines an aggregation instance.

Parameters:

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. Text transformations are used in rule match statements, to transform the FieldToMatch request component before inspecting it, and they’re used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, AWS WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the transformed component contents.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratelimituripath.html

ExampleMetadata:

fixture=_generated

Example:

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

rate_limit_uri_path_property = wafv2.CfnWebACL.RateLimitUriPathProperty(
    text_transformations=[wafv2.CfnWebACL.TextTransformationProperty(
        priority=123,
        type="type"
    )]
)

Attributes

text_transformations

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

Text transformations are used in rule match statements, to transform the FieldToMatch request component before inspecting it, and they’re used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, AWS WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the transformed component contents.

See:

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

RegexMatchStatementProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import 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.CfnWebACL.RegexMatchStatementProperty(
    field_to_match=wafv2.CfnWebACL.FieldToMatchProperty(
        all_query_arguments=all_query_arguments,
        body=wafv2.CfnWebACL.BodyProperty(
            oversize_handling="oversizeHandling"
        ),
        cookies=wafv2.CfnWebACL.CookiesProperty(
            match_pattern=wafv2.CfnWebACL.CookieMatchPatternProperty(
                all=all,
                excluded_cookies=["excludedCookies"],
                included_cookies=["includedCookies"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        headers=wafv2.CfnWebACL.HeadersProperty(
            match_pattern=wafv2.CfnWebACL.HeaderMatchPatternProperty(
                all=all,
                excluded_headers=["excludedHeaders"],
                included_headers=["includedHeaders"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        ja3_fingerprint=wafv2.CfnWebACL.JA3FingerprintProperty(
            fallback_behavior="fallbackBehavior"
        ),
        json_body=wafv2.CfnWebACL.JsonBodyProperty(
            match_pattern=wafv2.CfnWebACL.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.CfnWebACL.TextTransformationProperty(
        priority=123,
        type="type"
    )]
)

Attributes

field_to_match

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

See:

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

regex_string

The string representing the regular expression.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-regexmatchstatement.html#cfn-wafv2-webacl-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.

See:

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

RegexPatternSetReferenceStatementProperty

class CfnWebACL.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 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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import 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.CfnWebACL.RegexPatternSetReferenceStatementProperty(
    arn="arn",
    field_to_match=wafv2.CfnWebACL.FieldToMatchProperty(
        all_query_arguments=all_query_arguments,
        body=wafv2.CfnWebACL.BodyProperty(
            oversize_handling="oversizeHandling"
        ),
        cookies=wafv2.CfnWebACL.CookiesProperty(
            match_pattern=wafv2.CfnWebACL.CookieMatchPatternProperty(
                all=all,
                excluded_cookies=["excludedCookies"],
                included_cookies=["includedCookies"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        headers=wafv2.CfnWebACL.HeadersProperty(
            match_pattern=wafv2.CfnWebACL.HeaderMatchPatternProperty(
                all=all,
                excluded_headers=["excludedHeaders"],
                included_headers=["includedHeaders"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        ja3_fingerprint=wafv2.CfnWebACL.JA3FingerprintProperty(
            fallback_behavior="fallbackBehavior"
        ),
        json_body=wafv2.CfnWebACL.JsonBodyProperty(
            match_pattern=wafv2.CfnWebACL.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.CfnWebACL.TextTransformationProperty(
        priority=123,
        type="type"
    )]
)

Attributes

arn

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

See:

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

field_to_match

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-regexpatternsetreferencestatement.html#cfn-wafv2-webacl-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.

See:

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

RequestBodyAssociatedResourceTypeConfigProperty

class CfnWebACL.RequestBodyAssociatedResourceTypeConfigProperty(*, default_size_inspection_limit)

Bases: object

Customizes the maximum size of the request body that your protected CloudFront, API Gateway, Amazon Cognito, App Runner, and Verified Access resources forward to AWS WAF for inspection.

The default size is 16 KB (16,384 bytes). You can change the setting for any of the available resource types. .. epigraph:

You are charged additional fees when your protected resources forward body sizes that are larger than the default. For more information, see `AWS WAF Pricing <https://docs.aws.amazon.com/waf/pricing/>`_ .

Example JSON: { "API_GATEWAY": "KB_48", "APP_RUNNER_SERVICE": "KB_32" }

For Application Load Balancer and AWS AppSync , the limit is fixed at 8 KB (8,192 bytes).

This is used in the AssociationConfig of the web ACL.

Parameters:

default_size_inspection_limit (str) – Specifies the maximum size of the web request body component that an associated CloudFront, API Gateway, Amazon Cognito, App Runner, or Verified Access resource should send to AWS WAF for inspection. This applies to statements in the web ACL that inspect the body or JSON body. Default: 16 KB (16,384 bytes)

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-requestbodyassociatedresourcetypeconfig.html

ExampleMetadata:

fixture=_generated

Example:

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

request_body_associated_resource_type_config_property = wafv2.CfnWebACL.RequestBodyAssociatedResourceTypeConfigProperty(
    default_size_inspection_limit="defaultSizeInspectionLimit"
)

Attributes

default_size_inspection_limit

Specifies the maximum size of the web request body component that an associated CloudFront, API Gateway, Amazon Cognito, App Runner, or Verified Access resource should send to AWS WAF for inspection.

This applies to statements in the web ACL that inspect the body or JSON body.

Default: 16 KB (16,384 bytes)

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-requestbodyassociatedresourcetypeconfig.html#cfn-wafv2-webacl-requestbodyassociatedresourcetypeconfig-defaultsizeinspectionlimit

RequestInspectionACFPProperty

class CfnWebACL.RequestInspectionACFPProperty(*, payload_type, address_fields=None, email_field=None, password_field=None, phone_number_fields=None, username_field=None)

Bases: object

The criteria for inspecting account creation requests, used by the ACFP rule group to validate and track account creation attempts.

This is part of the AWSManagedRulesACFPRuleSet configuration in ManagedRuleGroupConfig .

In these settings, you specify how your application accepts account creation attempts by providing the request payload type and the names of the fields within the request body where the username, password, email, and primary address and phone number fields are provided.

Parameters:
  • payload_type (str) – The payload type for your account creation endpoint, either JSON or form encoded.

  • address_fields (Union[IResolvable, Sequence[Union[IResolvable, FieldIdentifierProperty, Dict[str, Any]]], None]) –

    The names of the fields in the request payload that contain your customer’s primary physical address. Order the address fields in the array exactly as they are ordered in the request payload. How you specify the address fields depends on the request inspection payload type. - For JSON payloads, specify the field identifiers in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer . For example, for the JSON payload { "form": { "primaryaddressline1": "THE_ADDRESS1", "primaryaddressline2": "THE_ADDRESS2", "primaryaddressline3": "THE_ADDRESS3" } } , the address field idenfiers are /form/primaryaddressline1 , /form/primaryaddressline2 , and /form/primaryaddressline3 . - For form encoded payload types, use the HTML form names. For example, for an HTML form with input elements named primaryaddressline1 , primaryaddressline2 , and primaryaddressline3 , the address fields identifiers are primaryaddressline1 , primaryaddressline2 , and primaryaddressline3 .

  • email_field (Union[IResolvable, FieldIdentifierProperty, Dict[str, Any], None]) –

    The name of the field in the request payload that contains your customer’s email. How you specify this depends on the request inspection payload type. - For JSON payloads, specify the field name in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer . For example, for the JSON payload { "form": { "email": "THE_EMAIL" } } , the email field specification is /form/email . - For form encoded payload types, use the HTML form names. For example, for an HTML form with the input element named email1 , the email field specification is email1 .

  • password_field (Union[IResolvable, FieldIdentifierProperty, Dict[str, Any], None]) –

    The name of the field in the request payload that contains your customer’s password. How you specify this depends on the request inspection payload type. - For JSON payloads, specify the field name in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer . For example, for the JSON payload { "form": { "password": "THE_PASSWORD" } } , the password field specification is /form/password . - For form encoded payload types, use the HTML form names. For example, for an HTML form with the input element named password1 , the password field specification is password1 .

  • phone_number_fields (Union[IResolvable, Sequence[Union[IResolvable, FieldIdentifierProperty, Dict[str, Any]]], None]) –

    The names of the fields in the request payload that contain your customer’s primary phone number. Order the phone number fields in the array exactly as they are ordered in the request payload. How you specify the phone number fields depends on the request inspection payload type. - For JSON payloads, specify the field identifiers in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer . For example, for the JSON payload { "form": { "primaryphoneline1": "THE_PHONE1", "primaryphoneline2": "THE_PHONE2", "primaryphoneline3": "THE_PHONE3" } } , the phone number field identifiers are /form/primaryphoneline1 , /form/primaryphoneline2 , and /form/primaryphoneline3 . - For form encoded payload types, use the HTML form names. For example, for an HTML form with input elements named primaryphoneline1 , primaryphoneline2 , and primaryphoneline3 , the phone number field identifiers are primaryphoneline1 , primaryphoneline2 , and primaryphoneline3 .

  • username_field (Union[IResolvable, FieldIdentifierProperty, Dict[str, Any], None]) –

    The name of the field in the request payload that contains your customer’s username. How you specify this depends on the request inspection payload type. - For JSON payloads, specify the field name in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer . For example, for the JSON payload { "form": { "username": "THE_USERNAME" } } , the username field specification is /form/username . - For form encoded payload types, use the HTML form names. For example, for an HTML form with the input element named username1 , the username field specification is username1

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-requestinspectionacfp.html

ExampleMetadata:

fixture=_generated

Example:

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

request_inspection_aCFPProperty = wafv2.CfnWebACL.RequestInspectionACFPProperty(
    payload_type="payloadType",

    # the properties below are optional
    address_fields=[wafv2.CfnWebACL.FieldIdentifierProperty(
        identifier="identifier"
    )],
    email_field=wafv2.CfnWebACL.FieldIdentifierProperty(
        identifier="identifier"
    ),
    password_field=wafv2.CfnWebACL.FieldIdentifierProperty(
        identifier="identifier"
    ),
    phone_number_fields=[wafv2.CfnWebACL.FieldIdentifierProperty(
        identifier="identifier"
    )],
    username_field=wafv2.CfnWebACL.FieldIdentifierProperty(
        identifier="identifier"
    )
)

Attributes

address_fields

The names of the fields in the request payload that contain your customer’s primary physical address.

Order the address fields in the array exactly as they are ordered in the request payload.

How you specify the address fields depends on the request inspection payload type.

  • For JSON payloads, specify the field identifiers in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer .

For example, for the JSON payload { "form": { "primaryaddressline1": "THE_ADDRESS1", "primaryaddressline2": "THE_ADDRESS2", "primaryaddressline3": "THE_ADDRESS3" } } , the address field idenfiers are /form/primaryaddressline1 , /form/primaryaddressline2 , and /form/primaryaddressline3 .

  • For form encoded payload types, use the HTML form names.

For example, for an HTML form with input elements named primaryaddressline1 , primaryaddressline2 , and primaryaddressline3 , the address fields identifiers are primaryaddressline1 , primaryaddressline2 , and primaryaddressline3 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-requestinspectionacfp.html#cfn-wafv2-webacl-requestinspectionacfp-addressfields

email_field

The name of the field in the request payload that contains your customer’s email.

How you specify this depends on the request inspection payload type.

  • For JSON payloads, specify the field name in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer .

For example, for the JSON payload { "form": { "email": "THE_EMAIL" } } , the email field specification is /form/email .

  • For form encoded payload types, use the HTML form names.

For example, for an HTML form with the input element named email1 , the email field specification is email1 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-requestinspectionacfp.html#cfn-wafv2-webacl-requestinspectionacfp-emailfield

password_field

The name of the field in the request payload that contains your customer’s password.

How you specify this depends on the request inspection payload type.

  • For JSON payloads, specify the field name in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer .

For example, for the JSON payload { "form": { "password": "THE_PASSWORD" } } , the password field specification is /form/password .

  • For form encoded payload types, use the HTML form names.

For example, for an HTML form with the input element named password1 , the password field specification is password1 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-requestinspectionacfp.html#cfn-wafv2-webacl-requestinspectionacfp-passwordfield

payload_type

The payload type for your account creation endpoint, either JSON or form encoded.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-requestinspectionacfp.html#cfn-wafv2-webacl-requestinspectionacfp-payloadtype

phone_number_fields

The names of the fields in the request payload that contain your customer’s primary phone number.

Order the phone number fields in the array exactly as they are ordered in the request payload.

How you specify the phone number fields depends on the request inspection payload type.

  • For JSON payloads, specify the field identifiers in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer .

For example, for the JSON payload { "form": { "primaryphoneline1": "THE_PHONE1", "primaryphoneline2": "THE_PHONE2", "primaryphoneline3": "THE_PHONE3" } } , the phone number field identifiers are /form/primaryphoneline1 , /form/primaryphoneline2 , and /form/primaryphoneline3 .

  • For form encoded payload types, use the HTML form names.

For example, for an HTML form with input elements named primaryphoneline1 , primaryphoneline2 , and primaryphoneline3 , the phone number field identifiers are primaryphoneline1 , primaryphoneline2 , and primaryphoneline3 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-requestinspectionacfp.html#cfn-wafv2-webacl-requestinspectionacfp-phonenumberfields

username_field

The name of the field in the request payload that contains your customer’s username.

How you specify this depends on the request inspection payload type.

  • For JSON payloads, specify the field name in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer .

For example, for the JSON payload { "form": { "username": "THE_USERNAME" } } , the username field specification is /form/username .

  • For form encoded payload types, use the HTML form names.

For example, for an HTML form with the input element named username1 , the username field specification is username1

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-requestinspectionacfp.html#cfn-wafv2-webacl-requestinspectionacfp-usernamefield

RequestInspectionProperty

class CfnWebACL.RequestInspectionProperty(*, password_field, payload_type, username_field)

Bases: object

The criteria for inspecting login requests, used by the ATP rule group to validate credentials usage.

This is part of the AWSManagedRulesATPRuleSet configuration in ManagedRuleGroupConfig .

In these settings, you specify how your application accepts login attempts by providing the request payload type and the names of the fields within the request body where the username and password are provided.

Parameters:
  • password_field (Union[IResolvable, FieldIdentifierProperty, Dict[str, Any]]) –

    The name of the field in the request payload that contains your customer’s password. How you specify this depends on the request inspection payload type. - For JSON payloads, specify the field name in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer . For example, for the JSON payload { "form": { "password": "THE_PASSWORD" } } , the password field specification is /form/password . - For form encoded payload types, use the HTML form names. For example, for an HTML form with the input element named password1 , the password field specification is password1 .

  • payload_type (str) – The payload type for your login endpoint, either JSON or form encoded.

  • username_field (Union[IResolvable, FieldIdentifierProperty, Dict[str, Any]]) –

    The name of the field in the request payload that contains your customer’s username. How you specify this depends on the request inspection payload type. - For JSON payloads, specify the field name in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer . For example, for the JSON payload { "form": { "username": "THE_USERNAME" } } , the username field specification is /form/username . - For form encoded payload types, use the HTML form names. For example, for an HTML form with the input element named username1 , the username field specification is username1

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-requestinspection.html

ExampleMetadata:

fixture=_generated

Example:

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

request_inspection_property = wafv2.CfnWebACL.RequestInspectionProperty(
    password_field=wafv2.CfnWebACL.FieldIdentifierProperty(
        identifier="identifier"
    ),
    payload_type="payloadType",
    username_field=wafv2.CfnWebACL.FieldIdentifierProperty(
        identifier="identifier"
    )
)

Attributes

password_field

The name of the field in the request payload that contains your customer’s password.

How you specify this depends on the request inspection payload type.

  • For JSON payloads, specify the field name in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer .

For example, for the JSON payload { "form": { "password": "THE_PASSWORD" } } , the password field specification is /form/password .

  • For form encoded payload types, use the HTML form names.

For example, for an HTML form with the input element named password1 , the password field specification is password1 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-requestinspection.html#cfn-wafv2-webacl-requestinspection-passwordfield

payload_type

The payload type for your login endpoint, either JSON or form encoded.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-requestinspection.html#cfn-wafv2-webacl-requestinspection-payloadtype

username_field

The name of the field in the request payload that contains your customer’s username.

How you specify this depends on the request inspection payload type.

  • For JSON payloads, specify the field name in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer .

For example, for the JSON payload { "form": { "username": "THE_USERNAME" } } , the username field specification is /form/username .

  • For form encoded payload types, use the HTML form names.

For example, for an HTML form with the input element named username1 , the username field specification is username1

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-requestinspection.html#cfn-wafv2-webacl-requestinspection-usernamefield

ResponseInspectionBodyContainsProperty

class CfnWebACL.ResponseInspectionBodyContainsProperty(*, failure_strings, success_strings)

Bases: object

Configures inspection of the response body.

AWS WAF can inspect the first 65,536 bytes (64 KB) of the response body. This is part of the ResponseInspection configuration for AWSManagedRulesATPRuleSet and AWSManagedRulesACFPRuleSet . .. epigraph:

Response inspection is available only in web ACLs that protect Amazon CloudFront distributions.
Parameters:
  • failure_strings (Sequence[str]) – Strings in the body of the response that indicate a failed login or account creation attempt. To be counted as a failure, the string can be anywhere in the body and must be an exact match, including case. Each string must be unique among the success and failure strings. JSON example: "FailureStrings": [ "Request failed" ]

  • success_strings (Sequence[str]) – Strings in the body of the response that indicate a successful login or account creation attempt. To be counted as a success, the string can be anywhere in the body and must be an exact match, including case. Each string must be unique among the success and failure strings. JSON examples: "SuccessStrings": [ "Login successful" ] and "SuccessStrings": [ "Account creation successful", "Welcome to our site!" ]

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspectionbodycontains.html

ExampleMetadata:

fixture=_generated

Example:

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

response_inspection_body_contains_property = wafv2.CfnWebACL.ResponseInspectionBodyContainsProperty(
    failure_strings=["failureStrings"],
    success_strings=["successStrings"]
)

Attributes

failure_strings

Strings in the body of the response that indicate a failed login or account creation attempt.

To be counted as a failure, the string can be anywhere in the body and must be an exact match, including case. Each string must be unique among the success and failure strings.

JSON example: "FailureStrings": [ "Request failed" ]

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspectionbodycontains.html#cfn-wafv2-webacl-responseinspectionbodycontains-failurestrings

success_strings

Strings in the body of the response that indicate a successful login or account creation attempt.

To be counted as a success, the string can be anywhere in the body and must be an exact match, including case. Each string must be unique among the success and failure strings.

JSON examples: "SuccessStrings": [ "Login successful" ] and "SuccessStrings": [ "Account creation successful", "Welcome to our site!" ]

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspectionbodycontains.html#cfn-wafv2-webacl-responseinspectionbodycontains-successstrings

ResponseInspectionHeaderProperty

class CfnWebACL.ResponseInspectionHeaderProperty(*, failure_values, name, success_values)

Bases: object

Configures inspection of the response header. This is part of the ResponseInspection configuration for AWSManagedRulesATPRuleSet and AWSManagedRulesACFPRuleSet .

Response inspection is available only in web ACLs that protect Amazon CloudFront distributions.

Parameters:
  • failure_values (Sequence[str]) – Values in the response header with the specified name that indicate a failed login or account creation attempt. To be counted as a failure, the value must be an exact match, including case. Each value must be unique among the success and failure values. JSON examples: "FailureValues": [ "LoginFailed", "Failed login" ] and "FailureValues": [ "AccountCreationFailed" ]

  • name (str) – The name of the header to match against. The name must be an exact match, including case. JSON example: "Name": [ "RequestResult" ]

  • success_values (Sequence[str]) – Values in the response header with the specified name that indicate a successful login or account creation attempt. To be counted as a success, the value must be an exact match, including case. Each value must be unique among the success and failure values. JSON examples: "SuccessValues": [ "LoginPassed", "Successful login" ] and "SuccessValues": [ "AccountCreated", "Successful account creation" ]

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspectionheader.html

ExampleMetadata:

fixture=_generated

Example:

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

response_inspection_header_property = wafv2.CfnWebACL.ResponseInspectionHeaderProperty(
    failure_values=["failureValues"],
    name="name",
    success_values=["successValues"]
)

Attributes

failure_values

Values in the response header with the specified name that indicate a failed login or account creation attempt.

To be counted as a failure, the value must be an exact match, including case. Each value must be unique among the success and failure values.

JSON examples: "FailureValues": [ "LoginFailed", "Failed login" ] and "FailureValues": [ "AccountCreationFailed" ]

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspectionheader.html#cfn-wafv2-webacl-responseinspectionheader-failurevalues

name

The name of the header to match against. The name must be an exact match, including case.

JSON example: "Name": [ "RequestResult" ]

See:

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

success_values

Values in the response header with the specified name that indicate a successful login or account creation attempt.

To be counted as a success, the value must be an exact match, including case. Each value must be unique among the success and failure values.

JSON examples: "SuccessValues": [ "LoginPassed", "Successful login" ] and "SuccessValues": [ "AccountCreated", "Successful account creation" ]

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspectionheader.html#cfn-wafv2-webacl-responseinspectionheader-successvalues

ResponseInspectionJsonProperty

class CfnWebACL.ResponseInspectionJsonProperty(*, failure_values, identifier, success_values)

Bases: object

Configures inspection of the response JSON.

AWS WAF can inspect the first 65,536 bytes (64 KB) of the response JSON. This is part of the ResponseInspection configuration for AWSManagedRulesATPRuleSet and AWSManagedRulesACFPRuleSet . .. epigraph:

Response inspection is available only in web ACLs that protect Amazon CloudFront distributions.
Parameters:
  • failure_values (Sequence[str]) – Values for the specified identifier in the response JSON that indicate a failed login or account creation attempt. To be counted as a failure, the value must be an exact match, including case. Each value must be unique among the success and failure values. JSON example: "FailureValues": [ "False", "Failed" ]

  • identifier (str) – The identifier for the value to match against in the JSON. The identifier must be an exact match, including case. JSON examples: "Identifier": [ "/login/success" ] and "Identifier": [ "/sign-up/success" ]

  • success_values (Sequence[str]) – Values for the specified identifier in the response JSON that indicate a successful login or account creation attempt. To be counted as a success, the value must be an exact match, including case. Each value must be unique among the success and failure values. JSON example: "SuccessValues": [ "True", "Succeeded" ]

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspectionjson.html

ExampleMetadata:

fixture=_generated

Example:

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

response_inspection_json_property = wafv2.CfnWebACL.ResponseInspectionJsonProperty(
    failure_values=["failureValues"],
    identifier="identifier",
    success_values=["successValues"]
)

Attributes

failure_values

Values for the specified identifier in the response JSON that indicate a failed login or account creation attempt.

To be counted as a failure, the value must be an exact match, including case. Each value must be unique among the success and failure values.

JSON example: "FailureValues": [ "False", "Failed" ]

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspectionjson.html#cfn-wafv2-webacl-responseinspectionjson-failurevalues

identifier

The identifier for the value to match against in the JSON.

The identifier must be an exact match, including case.

JSON examples: "Identifier": [ "/login/success" ] and "Identifier": [ "/sign-up/success" ]

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspectionjson.html#cfn-wafv2-webacl-responseinspectionjson-identifier

success_values

Values for the specified identifier in the response JSON that indicate a successful login or account creation attempt.

To be counted as a success, the value must be an exact match, including case. Each value must be unique among the success and failure values.

JSON example: "SuccessValues": [ "True", "Succeeded" ]

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspectionjson.html#cfn-wafv2-webacl-responseinspectionjson-successvalues

ResponseInspectionProperty

class CfnWebACL.ResponseInspectionProperty(*, body_contains=None, header=None, json=None, status_code=None)

Bases: object

The criteria for inspecting responses to login requests and account creation requests, used by the ATP and ACFP rule groups to track login and account creation success and failure rates.

Response inspection is available only in web ACLs that protect Amazon CloudFront distributions.

The rule groups evaluates the responses that your protected resources send back to client login and account creation attempts, keeping count of successful and failed attempts from each IP address and client session. Using this information, the rule group labels and mitigates requests from client sessions and IP addresses with too much suspicious activity in a short amount of time.

This is part of the AWSManagedRulesATPRuleSet and AWSManagedRulesACFPRuleSet configurations in ManagedRuleGroupConfig .

Enable response inspection by configuring exactly one component of the response to inspect, for example, Header or StatusCode . You can’t configure more than one component for inspection. If you don’t configure any of the response inspection options, response inspection is disabled.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspection.html

ExampleMetadata:

fixture=_generated

Example:

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

response_inspection_property = wafv2.CfnWebACL.ResponseInspectionProperty(
    body_contains=wafv2.CfnWebACL.ResponseInspectionBodyContainsProperty(
        failure_strings=["failureStrings"],
        success_strings=["successStrings"]
    ),
    header=wafv2.CfnWebACL.ResponseInspectionHeaderProperty(
        failure_values=["failureValues"],
        name="name",
        success_values=["successValues"]
    ),
    json=wafv2.CfnWebACL.ResponseInspectionJsonProperty(
        failure_values=["failureValues"],
        identifier="identifier",
        success_values=["successValues"]
    ),
    status_code=wafv2.CfnWebACL.ResponseInspectionStatusCodeProperty(
        failure_codes=[123],
        success_codes=[123]
    )
)

Attributes

body_contains

Configures inspection of the response body for success and failure indicators.

AWS WAF can inspect the first 65,536 bytes (64 KB) of the response body.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspection.html#cfn-wafv2-webacl-responseinspection-bodycontains

header

Configures inspection of the response header for success and failure indicators.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspection.html#cfn-wafv2-webacl-responseinspection-header

json

Configures inspection of the response JSON for success and failure indicators.

AWS WAF can inspect the first 65,536 bytes (64 KB) of the response JSON.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspection.html#cfn-wafv2-webacl-responseinspection-json

status_code

Configures inspection of the response status code for success and failure indicators.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspection.html#cfn-wafv2-webacl-responseinspection-statuscode

ResponseInspectionStatusCodeProperty

class CfnWebACL.ResponseInspectionStatusCodeProperty(*, failure_codes, success_codes)

Bases: object

Configures inspection of the response status code. This is part of the ResponseInspection configuration for AWSManagedRulesATPRuleSet and AWSManagedRulesACFPRuleSet .

Response inspection is available only in web ACLs that protect Amazon CloudFront distributions.

Parameters:
  • failure_codes (Union[IResolvable, Sequence[Union[int, float]]]) – Status codes in the response that indicate a failed login or account creation attempt. To be counted as a failure, the response status code must match one of these. Each code must be unique among the success and failure status codes. JSON example: "FailureCodes": [ 400, 404 ]

  • success_codes (Union[IResolvable, Sequence[Union[int, float]]]) – Status codes in the response that indicate a successful login or account creation attempt. To be counted as a success, the response status code must match one of these. Each code must be unique among the success and failure status codes. JSON example: "SuccessCodes": [ 200, 201 ]

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspectionstatuscode.html

ExampleMetadata:

fixture=_generated

Example:

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

response_inspection_status_code_property = wafv2.CfnWebACL.ResponseInspectionStatusCodeProperty(
    failure_codes=[123],
    success_codes=[123]
)

Attributes

failure_codes

Status codes in the response that indicate a failed login or account creation attempt.

To be counted as a failure, the response status code must match one of these. Each code must be unique among the success and failure status codes.

JSON example: "FailureCodes": [ 400, 404 ]

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspectionstatuscode.html#cfn-wafv2-webacl-responseinspectionstatuscode-failurecodes

success_codes

Status codes in the response that indicate a successful login or account creation attempt.

To be counted as a success, the response status code must match one of these. Each code must be unique among the success and failure status codes.

JSON example: "SuccessCodes": [ 200, 201 ]

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-responseinspectionstatuscode.html#cfn-wafv2-webacl-responseinspectionstatuscode-successcodes

RuleActionOverrideProperty

class CfnWebACL.RuleActionOverrideProperty(*, action_to_use, name)

Bases: object

Action setting to use in the place of a rule action that is configured inside the rule group.

You specify one override for each rule whose action you want to change.

You can use overrides for testing, for example you can override all of rule actions to Count and then monitor the resulting count metrics to understand how the rule group would handle your web traffic. You can also permanently override some or all actions, to modify how the rule group manages your web traffic.

Parameters:
  • action_to_use (Union[IResolvable, RuleActionProperty, Dict[str, Any]]) – The override action to use, in place of the configured action of the rule in the rule group.

  • name (str) – The name of the rule to override.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ruleactionoverride.html

ExampleMetadata:

fixture=_generated

Example:

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

rule_action_override_property = wafv2.CfnWebACL.RuleActionOverrideProperty(
    action_to_use=wafv2.CfnWebACL.RuleActionProperty(
        allow=wafv2.CfnWebACL.AllowActionProperty(
            custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
                insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                    name="name",
                    value="value"
                )]
            )
        ),
        block=wafv2.CfnWebACL.BlockActionProperty(
            custom_response=wafv2.CfnWebACL.CustomResponseProperty(
                response_code=123,

                # the properties below are optional
                custom_response_body_key="customResponseBodyKey",
                response_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                    name="name",
                    value="value"
                )]
            )
        ),
        captcha=wafv2.CfnWebACL.CaptchaActionProperty(
            custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
                insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                    name="name",
                    value="value"
                )]
            )
        ),
        challenge=wafv2.CfnWebACL.ChallengeActionProperty(
            custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
                insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                    name="name",
                    value="value"
                )]
            )
        ),
        count=wafv2.CfnWebACL.CountActionProperty(
            custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
                insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                    name="name",
                    value="value"
                )]
            )
        )
    ),
    name="name"
)

Attributes

action_to_use

The override action to use, in place of the configured action of the rule in the rule group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ruleactionoverride.html#cfn-wafv2-webacl-ruleactionoverride-actiontouse

name

The name of the rule to override.

See:

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

RuleActionProperty

class CfnWebACL.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 (Union[IResolvable, AllowActionProperty, Dict[str, Any], None]) – Instructs AWS WAF to allow the web request.

  • block (Union[IResolvable, BlockActionProperty, Dict[str, Any], None]) – Instructs AWS WAF to block the web request.

  • captcha (Union[IResolvable, CaptchaActionProperty, Dict[str, Any], None]) – 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 (Union[IResolvable, ChallengeActionProperty, Dict[str, Any], None]) – Instructs AWS WAF to run a Challenge check against the web request.

  • count (Union[IResolvable, CountActionProperty, Dict[str, Any], None]) – Instructs AWS WAF to count the web request and then continue evaluating the request using the remaining rules in the web ACL.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

rule_action_property = wafv2.CfnWebACL.RuleActionProperty(
    allow=wafv2.CfnWebACL.AllowActionProperty(
        custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
            insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                name="name",
                value="value"
            )]
        )
    ),
    block=wafv2.CfnWebACL.BlockActionProperty(
        custom_response=wafv2.CfnWebACL.CustomResponseProperty(
            response_code=123,

            # the properties below are optional
            custom_response_body_key="customResponseBodyKey",
            response_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                name="name",
                value="value"
            )]
        )
    ),
    captcha=wafv2.CfnWebACL.CaptchaActionProperty(
        custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
            insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                name="name",
                value="value"
            )]
        )
    ),
    challenge=wafv2.CfnWebACL.ChallengeActionProperty(
        custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
            insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                name="name",
                value="value"
            )]
        )
    ),
    count=wafv2.CfnWebACL.CountActionProperty(
        custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
            insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                name="name",
                value="value"
            )]
        )
    )
)

Attributes

allow

Instructs AWS WAF to allow the web request.

See:

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

block

Instructs AWS WAF to block the web request.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ruleaction.html#cfn-wafv2-webacl-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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ruleaction.html#cfn-wafv2-webacl-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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ruleaction.html#cfn-wafv2-webacl-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.

See:

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

RuleGroupReferenceStatementProperty

class CfnWebACL.RuleGroupReferenceStatementProperty(*, arn, excluded_rules=None, rule_action_overrides=None)

Bases: object

A rule statement used to run the rules that are defined in a RuleGroup .

To use this, create a rule group with your rules, then provide the ARN of the rule group in this statement.

You cannot nest a RuleGroupReferenceStatement , for example for use inside a NotStatement or OrStatement . You cannot use a rule group reference statement inside another rule group. You can only reference a rule group as a top-level statement within a rule that you define in a web ACL.

Parameters:
  • arn (str) – The Amazon Resource Name (ARN) of the entity.

  • excluded_rules (Union[IResolvable, Sequence[Union[IResolvable, ExcludedRuleProperty, Dict[str, Any]]], None]) – Rules in the referenced rule group whose actions are set to Count . .. epigraph:: Instead of this option, use RuleActionOverrides . It accepts any valid action setting, including Count .

  • rule_action_overrides (Union[IResolvable, Sequence[Union[IResolvable, RuleActionOverrideProperty, Dict[str, Any]]], None]) – Action settings to use in the place of the rule actions that are configured inside the rule group. You specify one override for each rule whose action you want to change. You can use overrides for testing, for example you can override all of rule actions to Count and then monitor the resulting count metrics to understand how the rule group would handle your web traffic. You can also permanently override some or all actions, to modify how the rule group manages your web traffic.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-rulegroupreferencestatement.html

ExampleMetadata:

fixture=_generated

Example:

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

rule_group_reference_statement_property = wafv2.CfnWebACL.RuleGroupReferenceStatementProperty(
    arn="arn",

    # the properties below are optional
    excluded_rules=[wafv2.CfnWebACL.ExcludedRuleProperty(
        name="name"
    )],
    rule_action_overrides=[wafv2.CfnWebACL.RuleActionOverrideProperty(
        action_to_use=wafv2.CfnWebACL.RuleActionProperty(
            allow=wafv2.CfnWebACL.AllowActionProperty(
                custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
                    insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                        name="name",
                        value="value"
                    )]
                )
            ),
            block=wafv2.CfnWebACL.BlockActionProperty(
                custom_response=wafv2.CfnWebACL.CustomResponseProperty(
                    response_code=123,

                    # the properties below are optional
                    custom_response_body_key="customResponseBodyKey",
                    response_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                        name="name",
                        value="value"
                    )]
                )
            ),
            captcha=wafv2.CfnWebACL.CaptchaActionProperty(
                custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
                    insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                        name="name",
                        value="value"
                    )]
                )
            ),
            challenge=wafv2.CfnWebACL.ChallengeActionProperty(
                custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
                    insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                        name="name",
                        value="value"
                    )]
                )
            ),
            count=wafv2.CfnWebACL.CountActionProperty(
                custom_request_handling=wafv2.CfnWebACL.CustomRequestHandlingProperty(
                    insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
                        name="name",
                        value="value"
                    )]
                )
            )
        ),
        name="name"
    )]
)

Attributes

arn

The Amazon Resource Name (ARN) of the entity.

See:

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

excluded_rules

Rules in the referenced rule group whose actions are set to Count .

Instead of this option, use RuleActionOverrides . It accepts any valid action setting, including Count .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-rulegroupreferencestatement.html#cfn-wafv2-webacl-rulegroupreferencestatement-excludedrules

rule_action_overrides

Action settings to use in the place of the rule actions that are configured inside the rule group.

You specify one override for each rule whose action you want to change.

You can use overrides for testing, for example you can override all of rule actions to Count and then monitor the resulting count metrics to understand how the rule group would handle your web traffic. You can also permanently override some or all actions, to modify how the rule group manages your web traffic.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-rulegroupreferencestatement.html#cfn-wafv2-webacl-rulegroupreferencestatement-ruleactionoverrides

RuleProperty

class CfnWebACL.RuleProperty(*, name, priority, statement, visibility_config, action=None, captcha_config=None, challenge_config=None, override_action=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 manage in some way.

Each rule includes one top-level Statement that AWS WAF uses to identify matching web requests, and parameters that govern how AWS WAF handles them.

Parameters:
  • name (str) – The name of the rule. If you change the name of a Rule after you create it and you want the rule’s metric name to reflect the change, update the metric name in the rule’s VisibilityConfig settings. AWS WAF doesn’t automatically update the metric name when you update the rule name.

  • 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. If you change the name of a Rule after you create it and you want the rule’s metric name to reflect the change, update the metric name as well. AWS WAF doesn’t automatically update the metric name.

  • action (Union[IResolvable, RuleActionProperty, Dict[str, Any], None]) – The action that AWS WAF should take on a web request when it matches the rule’s statement. Settings at the web ACL level can override the rule action setting. This is used only for rules whose statements don’t reference a rule group. Rule statements that reference a rule group are RuleGroupReferenceStatement and ManagedRuleGroupStatement . You must set either this Action setting or the rule’s OverrideAction , but not both: - If the rule statement doesn’t reference a rule group, you must set this rule action setting and you must not set the rule’s override action setting. - If the rule statement references a rule group, you must not set this action setting, because the actions are already set on the rules inside the rule group. You must set the rule’s override action setting to indicate specifically whether to override the actions that are set on the rules in the rule group.

  • 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.

  • override_action (Union[IResolvable, OverrideActionProperty, Dict[str, Any], None]) – The override action to apply to the rules in a rule group, instead of the individual rule action settings. This is used only for rules whose statements reference a rule group. Rule statements that reference a rule group are RuleGroupReferenceStatement and ManagedRuleGroupStatement . Set the override action to none to leave the rule group rule actions in effect. Set it to count to only count matches, regardless of the rule action settings. You must set either this OverrideAction setting or the Action setting, but not both: - If the rule statement references a rule group, you must set this override action setting and you must not set the rule’s action setting. - If the rule statement doesn’t reference a rule group, you must set the rule action setting and you must not set the rule’s override action setting.

  • 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 .

See:

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

ExampleMetadata:

fixture=_generated

Example:

.. rubric:: Attributes
action

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

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

This is used only for rules whose statements don’t reference a rule group. Rule statements that reference a rule group are RuleGroupReferenceStatement and ManagedRuleGroupStatement .

You must set either this Action setting or the rule’s OverrideAction , but not both:

  • If the rule statement doesn’t reference a rule group, you must set this rule action setting and you must not set the rule’s override action setting.

  • If the rule statement references a rule group, you must not set this action setting, because the actions are already set on the rules inside the rule group. You must set the rule’s override action setting to indicate specifically whether to override the actions that are set on the rules in the rule group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-rule.html#cfn-wafv2-webacl-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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-rule.html#cfn-wafv2-webacl-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.

See:

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

name

The name of the rule.

If you change the name of a Rule after you create it and you want the rule’s metric name to reflect the change, update the metric name in the rule’s VisibilityConfig settings. AWS WAF doesn’t automatically update the metric name when you update the rule name.

See:

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

override_action

The override action to apply to the rules in a rule group, instead of the individual rule action settings.

This is used only for rules whose statements reference a rule group. Rule statements that reference a rule group are RuleGroupReferenceStatement and ManagedRuleGroupStatement .

Set the override action to none to leave the rule group rule actions in effect. Set it to count to only count matches, regardless of the rule action settings.

You must set either this OverrideAction setting or the Action setting, but not both:

  • If the rule statement references a rule group, you must set this override action setting and you must not set the rule’s action setting.

  • If the rule statement doesn’t reference a rule group, you must set the rule action setting and you must not set the rule’s override action setting.

See:

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

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-rule.html#cfn-wafv2-webacl-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 .

See:

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

statement

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

See:

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

visibility_config

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

If you change the name of a Rule after you create it and you want the rule’s metric name to reflect the change, update the metric name as well. AWS WAF doesn’t automatically update the metric name.

See:

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

SingleHeaderProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

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

Attributes

name

The name of the query header to inspect.

See:

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

SingleQueryArgumentProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

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

Attributes

name

The name of the query argument to inspect.

See:

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

SizeConstraintStatementProperty

class CfnWebACL.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 in the body up to the limit for the web ACL and protected resource type. If you know that the request body for your web requests should never exceed the inspection limit, you can use a size constraint statement to block requests that have a larger request body size. For more information about the inspection limits, see Body and JsonBody settings for the FieldToMatch data type.

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import 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.CfnWebACL.SizeConstraintStatementProperty(
    comparison_operator="comparisonOperator",
    field_to_match=wafv2.CfnWebACL.FieldToMatchProperty(
        all_query_arguments=all_query_arguments,
        body=wafv2.CfnWebACL.BodyProperty(
            oversize_handling="oversizeHandling"
        ),
        cookies=wafv2.CfnWebACL.CookiesProperty(
            match_pattern=wafv2.CfnWebACL.CookieMatchPatternProperty(
                all=all,
                excluded_cookies=["excludedCookies"],
                included_cookies=["includedCookies"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        headers=wafv2.CfnWebACL.HeadersProperty(
            match_pattern=wafv2.CfnWebACL.HeaderMatchPatternProperty(
                all=all,
                excluded_headers=["excludedHeaders"],
                included_headers=["includedHeaders"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        ja3_fingerprint=wafv2.CfnWebACL.JA3FingerprintProperty(
            fallback_behavior="fallbackBehavior"
        ),
        json_body=wafv2.CfnWebACL.JsonBodyProperty(
            match_pattern=wafv2.CfnWebACL.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.CfnWebACL.TextTransformationProperty(
        priority=123,
        type="type"
    )]
)

Attributes

comparison_operator

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

See:

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

field_to_match

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

See:

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

size

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-sizeconstraintstatement.html#cfn-wafv2-webacl-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.

See:

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

SqliMatchStatementProperty

class CfnWebACL.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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import 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.CfnWebACL.SqliMatchStatementProperty(
    field_to_match=wafv2.CfnWebACL.FieldToMatchProperty(
        all_query_arguments=all_query_arguments,
        body=wafv2.CfnWebACL.BodyProperty(
            oversize_handling="oversizeHandling"
        ),
        cookies=wafv2.CfnWebACL.CookiesProperty(
            match_pattern=wafv2.CfnWebACL.CookieMatchPatternProperty(
                all=all,
                excluded_cookies=["excludedCookies"],
                included_cookies=["includedCookies"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        headers=wafv2.CfnWebACL.HeadersProperty(
            match_pattern=wafv2.CfnWebACL.HeaderMatchPatternProperty(
                all=all,
                excluded_headers=["excludedHeaders"],
                included_headers=["includedHeaders"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        ja3_fingerprint=wafv2.CfnWebACL.JA3FingerprintProperty(
            fallback_behavior="fallbackBehavior"
        ),
        json_body=wafv2.CfnWebACL.JsonBodyProperty(
            match_pattern=wafv2.CfnWebACL.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.CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-sqlimatchstatement.html#cfn-wafv2-webacl-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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-sqlimatchstatement.html#cfn-wafv2-webacl-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.

See:

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

StatementProperty

class CfnWebACL.StatementProperty(*, and_statement=None, byte_match_statement=None, geo_match_statement=None, ip_set_reference_statement=None, label_match_statement=None, managed_rule_group_statement=None, not_statement=None, or_statement=None, rate_based_statement=None, regex_match_statement=None, regex_pattern_set_reference_statement=None, rule_group_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.

  • managed_rule_group_statement (Union[IResolvable, ManagedRuleGroupStatementProperty, Dict[str, Any], None]) –

    A rule statement used to run the rules that are defined in a managed rule group. To use this, provide the vendor name and the name of the rule group in this statement. You can retrieve the required names through the API call ListAvailableManagedRuleGroups . You cannot nest a ManagedRuleGroupStatement , for example for use inside a NotStatement or OrStatement . It can only be referenced as a top-level statement within a rule. .. epigraph:: You are charged additional fees when you use the AWS WAF Bot Control managed rule group AWSManagedRulesBotControlRuleSet , the AWS WAF Fraud Control account takeover prevention (ATP) managed rule group AWSManagedRulesATPRuleSet , or the AWS WAF Fraud Control account creation fraud prevention (ACFP) managed rule group AWSManagedRulesACFPRuleSet . For more information, see AWS WAF Pricing .

  • 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 counts incoming requests and rate limits requests when they are coming at too fast a rate. The rule categorizes requests according to your aggregation criteria, collects them into aggregation instances, and counts and rate limits the requests for each instance. .. epigraph:: If you change any of these settings in a rule that’s currently in use, the change resets the rule’s rate limiting counts. This can pause the rule’s rate limiting activities for up to a minute. You can specify individual aggregation keys, like IP address or HTTP method. You can also specify aggregation key combinations, like IP address and HTTP method, or HTTP method, query argument, and cookie. Each unique set of values for the aggregation keys that you specify is a separate aggregation instance, with the value from each key contributing to the aggregation instance definition. For example, assume the rule evaluates web requests with the following IP address and HTTP method values: - IP address 10.1.1.1, HTTP method POST - IP address 10.1.1.1, HTTP method GET - IP address 127.0.0.0, HTTP method POST - IP address 10.1.1.1, HTTP method GET The rule would create different aggregation instances according to your aggregation criteria, for example: - If the aggregation criteria is just the IP address, then each individual address is an aggregation instance, and AWS WAF counts requests separately for each. The aggregation instances and request counts for our example would be the following: - IP address 10.1.1.1: count 3 - IP address 127.0.0.0: count 1 - If the aggregation criteria is HTTP method, then each individual HTTP method is an aggregation instance. The aggregation instances and request counts for our example would be the following: - HTTP method POST: count 2 - HTTP method GET: count 2 - If the aggregation criteria is IP address and HTTP method, then each IP address and each HTTP method would contribute to the combined aggregation instance. The aggregation instances and request counts for our example would be the following: - IP address 10.1.1.1, HTTP method POST: count 1 - IP address 10.1.1.1, HTTP method GET: count 2 - IP address 127.0.0.0, HTTP method POST: count 1 For any n-tuple of aggregation keys, each unique combination of values for the keys defines a separate aggregation instance, which AWS WAF counts and rate-limits individually. You can optionally nest another statement inside the rate-based statement, to narrow the scope of the rule so that it only counts and rate limits requests that match the nested statement. You can use this nested scope-down statement in conjunction with your aggregation key specifications or you can just count and rate limit all requests that match the scope-down statement, without additional aggregation. When you choose to just manage all requests that match a scope-down statement, the aggregation instance is singular for the 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. For additional information about the options, see Rate limiting web requests using rate-based rules in the AWS WAF Developer Guide . If you only aggregate on the individual IP address or forwarded IP address, you can retrieve the list of IP addresses that AWS WAF is currently rate limiting for a rule through the API call GetRateBasedStatementManagedKeys . This option is not available for other aggregation configurations. 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 .

  • 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.

  • rule_group_reference_statement (Union[IResolvable, RuleGroupReferenceStatementProperty, Dict[str, Any], None]) – A rule statement used to run the rules that are defined in a RuleGroup . To use this, create a rule group with your rules, then provide the ARN of the rule group in this statement. You cannot nest a RuleGroupReferenceStatement , for example for use inside a NotStatement or OrStatement . You cannot use a rule group reference statement inside another rule group. You can only reference a rule group as a top-level statement within a rule that you define in a web ACL.

  • 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 in the body up to the limit for the web ACL and protected resource type. If you know that the request body for your web requests should never exceed the inspection limit, you can use a size constraint statement to block requests that have a larger request body size. For more information about the inspection limits, see Body and JsonBody settings for the FieldToMatch data type. 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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-statement.html

ExampleMetadata:

fixture=_generated

Example:

.. rubric:: 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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-statement.html#cfn-wafv2-webacl-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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-statement.html#cfn-wafv2-webacl-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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-statement.html#cfn-wafv2-webacl-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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-statement.html#cfn-wafv2-webacl-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.

See:

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

managed_rule_group_statement

A rule statement used to run the rules that are defined in a managed rule group.

To use this, provide the vendor name and the name of the rule group in this statement. You can retrieve the required names through the API call ListAvailableManagedRuleGroups .

You cannot nest a ManagedRuleGroupStatement , for example for use inside a NotStatement or OrStatement . It can only be referenced as a top-level statement within a rule. .. epigraph:

You are charged additional fees when you use the AWS WAF Bot Control managed rule group ``AWSManagedRulesBotControlRuleSet`` , the AWS WAF Fraud Control account takeover prevention (ATP) managed rule group ``AWSManagedRulesATPRuleSet`` , or the AWS WAF Fraud Control account creation fraud prevention (ACFP) managed rule group ``AWSManagedRulesACFPRuleSet`` . For more information, see `AWS WAF Pricing <https://docs.aws.amazon.com/waf/pricing/>`_ .
See:

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

not_statement

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

You provide one Statement within the NotStatement .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-statement.html#cfn-wafv2-webacl-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 .

See:

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

rate_based_statement

A rate-based rule counts incoming requests and rate limits requests when they are coming at too fast a rate.

The rule categorizes requests according to your aggregation criteria, collects them into aggregation instances, and counts and rate limits the requests for each instance. .. epigraph:

If you change any of these settings in a rule that's currently in use, the change resets the rule's rate limiting counts. This can pause the rule's rate limiting activities for up to a minute.

You can specify individual aggregation keys, like IP address or HTTP method. You can also specify aggregation key combinations, like IP address and HTTP method, or HTTP method, query argument, and cookie.

Each unique set of values for the aggregation keys that you specify is a separate aggregation instance, with the value from each key contributing to the aggregation instance definition.

For example, assume the rule evaluates web requests with the following IP address and HTTP method values:

  • IP address 10.1.1.1, HTTP method POST

  • IP address 10.1.1.1, HTTP method GET

  • IP address 127.0.0.0, HTTP method POST

  • IP address 10.1.1.1, HTTP method GET

The rule would create different aggregation instances according to your aggregation criteria, for example:

  • If the aggregation criteria is just the IP address, then each individual address is an aggregation instance, and AWS WAF counts requests separately for each. The aggregation instances and request counts for our example would be the following:

  • IP address 10.1.1.1: count 3

  • IP address 127.0.0.0: count 1

  • If the aggregation criteria is HTTP method, then each individual HTTP method is an aggregation instance. The aggregation instances and request counts for our example would be the following:

  • HTTP method POST: count 2

  • HTTP method GET: count 2

  • If the aggregation criteria is IP address and HTTP method, then each IP address and each HTTP method would contribute to the combined aggregation instance. The aggregation instances and request counts for our example would be the following:

  • IP address 10.1.1.1, HTTP method POST: count 1

  • IP address 10.1.1.1, HTTP method GET: count 2

  • IP address 127.0.0.0, HTTP method POST: count 1

For any n-tuple of aggregation keys, each unique combination of values for the keys defines a separate aggregation instance, which AWS WAF counts and rate-limits individually.

You can optionally nest another statement inside the rate-based statement, to narrow the scope of the rule so that it only counts and rate limits requests that match the nested statement. You can use this nested scope-down statement in conjunction with your aggregation key specifications or you can just count and rate limit all requests that match the scope-down statement, without additional aggregation. When you choose to just manage all requests that match a scope-down statement, the aggregation instance is singular for the 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.

For additional information about the options, see Rate limiting web requests using rate-based rules in the AWS WAF Developer Guide .

If you only aggregate on the individual IP address or forwarded IP address, you can retrieve the list of IP addresses that AWS WAF is currently rate limiting for a rule through the API call GetRateBasedStatementManagedKeys . This option is not available for other aggregation configurations.

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 .

See:

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

regex_match_statement

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-statement.html#cfn-wafv2-webacl-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.

See:

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

rule_group_reference_statement

A rule statement used to run the rules that are defined in a RuleGroup .

To use this, create a rule group with your rules, then provide the ARN of the rule group in this statement.

You cannot nest a RuleGroupReferenceStatement , for example for use inside a NotStatement or OrStatement . You cannot use a rule group reference statement inside another rule group. You can only reference a rule group as a top-level statement within a rule that you define in a web ACL.

See:

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

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 in the body up to the limit for the web ACL and protected resource type. If you know that the request body for your web requests should never exceed the inspection limit, you can use a size constraint statement to block requests that have a larger request body size. For more information about the inspection limits, see Body and JsonBody settings for the FieldToMatch data type.

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-statement.html#cfn-wafv2-webacl-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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-statement.html#cfn-wafv2-webacl-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.

See:

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

TextTransformationProperty

class CfnWebACL.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) – For detailed descriptions of each of the transformation types, see Text transformations in the AWS WAF Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

text_transformation_property = wafv2.CfnWebACL.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.

See:

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

type

//docs.aws.amazon.com/waf/latest/developerguide/waf-rule-statement-transformation.html>`_ in the AWS WAF Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-texttransformation.html#cfn-wafv2-webacl-texttransformation-type

Type:

For detailed descriptions of each of the transformation types, see `Text transformations <https

VisibilityConfigProperty

class CfnWebACL.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. .. epigraph:: Request sampling doesn’t provide a field redaction option, and any field redaction that you specify in your logging configuration doesn’t affect sampling. The only way to exclude fields from request sampling is by disabling sampling in the web ACL visibility configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import aws_wafv2 as wafv2

visibility_config_property = wafv2.CfnWebACL.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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-visibilityconfig.html#cfn-wafv2-webacl-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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-visibilityconfig.html#cfn-wafv2-webacl-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. .. epigraph:

Request sampling doesn't provide a field redaction option, and any field redaction that you specify in your logging configuration doesn't affect sampling. The only way to exclude fields from request sampling is by disabling sampling in the web ACL visibility configuration.
See:

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

XssMatchStatementProperty

class CfnWebACL.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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-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.
from aws_cdk import 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.CfnWebACL.XssMatchStatementProperty(
    field_to_match=wafv2.CfnWebACL.FieldToMatchProperty(
        all_query_arguments=all_query_arguments,
        body=wafv2.CfnWebACL.BodyProperty(
            oversize_handling="oversizeHandling"
        ),
        cookies=wafv2.CfnWebACL.CookiesProperty(
            match_pattern=wafv2.CfnWebACL.CookieMatchPatternProperty(
                all=all,
                excluded_cookies=["excludedCookies"],
                included_cookies=["includedCookies"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        headers=wafv2.CfnWebACL.HeadersProperty(
            match_pattern=wafv2.CfnWebACL.HeaderMatchPatternProperty(
                all=all,
                excluded_headers=["excludedHeaders"],
                included_headers=["includedHeaders"]
            ),
            match_scope="matchScope",
            oversize_handling="oversizeHandling"
        ),
        ja3_fingerprint=wafv2.CfnWebACL.JA3FingerprintProperty(
            fallback_behavior="fallbackBehavior"
        ),
        json_body=wafv2.CfnWebACL.JsonBodyProperty(
            match_pattern=wafv2.CfnWebACL.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.CfnWebACL.TextTransformationProperty(
        priority=123,
        type="type"
    )]
)

Attributes

field_to_match

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-xssmatchstatement.html#cfn-wafv2-webacl-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.

See:

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