CfnWebACL
- class aws_cdk.aws_wafv2.CfnWebACL(scope_, id, *, default_action, scope, visibility_config, captcha_config=None, challenge_config=None, custom_response_bodies=None, description=None, name=None, rules=None, tags=None, token_domains=None)
Bases:
CfnResource
A CloudFormation
AWS::WAFv2::WebACL
.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 has an action defined (allow, block, or count) for requests that match the statement of the rule. In the web ACL, you specify 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 contain rule statements that you define explicitly and rule statements that reference rule groups and managed rule groups. 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, or an AWS App Runner service.- CloudformationResource:
AWS::WAFv2::WebACL
- Link:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-webacl.html
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 # all: Any # all_query_arguments: Any # count: Any # method: Any # none: Any # query_string: Any # single_header: Any # single_query_argument: Any # statement_property_: wafv2.CfnWebACL.StatementProperty # uri_path: Any cfn_web_aCL = wafv2.CfnWebACL(self, "MyCfnWebACL", default_action=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" )] ) ) ), scope="scope", visibility_config=wafv2.CfnWebACL.VisibilityConfigProperty( cloud_watch_metrics_enabled=False, metric_name="metricName", sampled_requests_enabled=False ), # the properties below are optional captcha_config=wafv2.CfnWebACL.CaptchaConfigProperty( immunity_time_property=wafv2.CfnWebACL.ImmunityTimePropertyProperty( immunity_time=123 ) ), challenge_config=wafv2.CfnWebACL.ChallengeConfigProperty( immunity_time_property=wafv2.CfnWebACL.ImmunityTimePropertyProperty( immunity_time=123 ) ), custom_response_bodies={ "custom_response_bodies_key": wafv2.CfnWebACL.CustomResponseBodyProperty( content="content", content_type="contentType" ) }, description="description", name="name", rules=[wafv2.CfnWebACL.RuleProperty( name="name", priority=123, statement=wafv2.CfnWebACL.StatementProperty( and_statement=wafv2.CfnWebACL.AndStatementProperty( statements=[statement_property_] ), byte_match_statement=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" ), 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" ), geo_match_statement=wafv2.CfnWebACL.GeoMatchStatementProperty( country_codes=["countryCodes"], forwarded_ip_config=wafv2.CfnWebACL.ForwardedIPConfigurationProperty( fallback_behavior="fallbackBehavior", header_name="headerName" ) ), ip_set_reference_statement={ "arn": "arn", # the properties below are optional "ip_set_forwarded_ip_config": { "fallback_behavior": "fallbackBehavior", "header_name": "headerName", "position": "position" } }, label_match_statement=wafv2.CfnWebACL.LabelMatchStatementProperty( key="key", scope="scope" ), managed_rule_group_statement=wafv2.CfnWebACL.ManagedRuleGroupStatementProperty( name="name", vendor_name="vendorName", # the properties below are optional excluded_rules=[wafv2.CfnWebACL.ExcludedRuleProperty( name="name" )], managed_rule_group_configs=[wafv2.CfnWebACL.ManagedRuleGroupConfigProperty( aws_managed_rules_atp_rule_set=wafv2.CfnWebACL.AWSManagedRulesATPRuleSetProperty( login_path="loginPath", # the properties below are optional 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" ), login_path="loginPath", password_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ), payload_type="payloadType", username_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ) )], 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" )], scope_down_statement=statement_property_, version="version" ), not_statement=wafv2.CfnWebACL.NotStatementProperty( statement=statement_property_ ), or_statement=wafv2.CfnWebACL.OrStatementProperty( statements=[statement_property_] ), rate_based_statement=wafv2.CfnWebACL.RateBasedStatementProperty( aggregate_key_type="aggregateKeyType", limit=123, # the properties below are optional forwarded_ip_config=wafv2.CfnWebACL.ForwardedIPConfigurationProperty( fallback_behavior="fallbackBehavior", header_name="headerName" ), scope_down_statement=statement_property_ ), regex_match_statement=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" ), 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" )] ), regex_pattern_set_reference_statement=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" ), 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" )] ), rule_group_reference_statement=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" )] ), size_constraint_statement=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" ), 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" )] ), sqli_match_statement=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" ), 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" ), xss_match_statement=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" ), 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" )] ) ), visibility_config=wafv2.CfnWebACL.VisibilityConfigProperty( cloud_watch_metrics_enabled=False, metric_name="metricName", sampled_requests_enabled=False ), # the properties below are optional action=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" )] ) ) ), captcha_config=wafv2.CfnWebACL.CaptchaConfigProperty( immunity_time_property=wafv2.CfnWebACL.ImmunityTimePropertyProperty( immunity_time=123 ) ), challenge_config=wafv2.CfnWebACL.ChallengeConfigProperty( immunity_time_property=wafv2.CfnWebACL.ImmunityTimePropertyProperty( immunity_time=123 ) ), override_action=wafv2.CfnWebACL.OverrideActionProperty( count=count, none=none ), rule_labels=[wafv2.CfnWebACL.LabelProperty( name="name" )] )], tags=[CfnTag( key="key", value="value" )], token_domains=["tokenDomains"] )
Create a new
AWS::WAFv2::WebACL
.- Parameters:
scope (
str
) –scope in which this resource is defined.
id (
str
) –scoped id of the resource.
default_action (
Union
[IResolvable
,DefaultActionProperty
,Dict
[str
,Any
]]) – The action to perform if none of theRules
contained in theWebACL
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, or an AWS App Runner service. Valid Values are
CLOUDFRONT
andREGIONAL
. .. epigraph:: ForCLOUDFRONT
, 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, seeWebACLAssociation
.visibility_config (
Union
[IResolvable
,VisibilityConfigProperty
,Dict
[str
,Any
]]) – Defines and enables Amazon CloudWatch metrics and web request sample collection.captcha_config (
Union
[IResolvable
,CaptchaConfigProperty
,Dict
[str
,Any
],None
]) – Specifies how AWS WAF should handleCAPTCHA
evaluations for rules that don’t have their ownCaptchaConfig
settings. If you don’t specify this, AWS WAF uses its default settings forCaptchaConfig
.challenge_config (
Union
[IResolvable
,ChallengeConfigProperty
,Dict
[str
,Any
],None
]) – Specifies how AWS WAF should handle challenge evaluations for rules that don’t have their ownChallengeConfig
settings. If you don’t specify this, AWS WAF uses its default settings forChallengeConfig
.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 allow, block, or count. Each rule includes one top-level statement that AWS WAF uses to identify matching web requests, and parameters that govern how AWS WAF handles them.tags (
Optional
[Sequence
[Union
[CfnTag
,Dict
[str
,Any
]]]]) – Key:value pairs associated with an AWS resource. The key:value pair can be anything you define. Typically, the tag key represents a category (such as “environment”) and the tag value represents a specific value within that category (such as “test,” “development,” or “production”). You can add up to 50 tags to each AWS resource. .. epigraph:: To modify tags on existing resources, use the AWS WAF APIs or command line interface. With AWS CloudFormation , you can only add tags to AWS WAF resources during resource creation.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_depends_on(target)
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
- Parameters:
target (
CfnResource
)- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str
)value (
Any
)
- See:
- Return type:
None
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
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 toaddOverride
will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.- Parameters:
path (
str
) –The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
value (
Any
) –The value. Could be primitive or complex.
- Return type:
None
- add_property_deletion_override(property_path)
Adds an override that deletes the value of a property from the resource definition.
- Parameters:
property_path (
str
) – The path to the property.- Return type:
None
- add_property_override(property_path, value)
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.- Parameters:
property_path (
str
) – The path of the property.value (
Any
) – The value.
- Return type:
None
- apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
).- Parameters:
policy (
Optional
[RemovalPolicy
])apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.
- Return type:
None
- get_att(attribute_name)
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g.
resource.arn
), but this can be used for future compatibility in case there is no generated attribute.- Parameters:
attribute_name (
str
) – The name of the attribute.- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
)- See:
- Return type:
Any
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- inspect(inspector)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector
) –tree inspector to collect and process attributes.
- Return type:
None
- override_logical_id(new_logical_id)
Overrides the auto-generated logical ID with a specific ID.
- Parameters:
new_logical_id (
str
) – The new logical ID to use for this stack element.- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::WAFv2::WebACL'
- 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 ownCaptchaConfig
settings.If you don’t specify this, AWS WAF uses its default settings for
CaptchaConfig
.
- 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.If you don’t specify this, AWS WAF uses its default settings for
ChallengeConfig
.
- creation_stack
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- custom_response_bodies
A map of custom response keys and content bodies.
When you create a rule with a block action, you can send a custom response to the web request. You define these for the 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 .
- default_action
The action to perform if none of the
Rules
contained in theWebACL
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.
You cannot change the name of a web ACL after you create it.
- node
The construct tree node associated with this construct.
- ref
Return a string that will be resolved to a CloudFormation
{ Ref }
for this element.If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through
Lazy.any({ produce: resource.ref })
.
- rules
The rule statements used to identify the web requests that you want to allow, block, or count.
Each rule includes one top-level statement that AWS WAF uses to identify matching web requests, and parameters that govern how AWS WAF handles them.
- scope
Specifies whether this is for an Amazon CloudFront distribution or for a regional application.
A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AWS AppSync GraphQL API, an Amazon Cognito user pool, or an AWS App Runner service. Valid Values are
CLOUDFRONT
andREGIONAL
. .. 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
.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- tags
value pairs associated with an AWS resource.
The key:value pair can be anything you define. Typically, the tag key represents a category (such as “environment”) and the tag value represents a specific value within that category (such as “test,” “development,” or “production”). You can add up to 50 tags to each AWS resource. .. epigraph:
To modify tags on existing resources, use the AWS WAF APIs or command line interface. With AWS CloudFormation , you can only add tags to AWS WAF resources during resource creation.
- token_domains
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.
- 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(construct)
Check whether the given construct is a CfnResource.
- Parameters:
construct (
IConstruct
)- Return type:
bool
- classmethod is_construct(x)
Return whether the given object is a Construct.
- Parameters:
x (
Any
)- Return type:
bool
AWSManagedRulesATPRuleSetProperty
- class CfnWebACL.AWSManagedRulesATPRuleSetProperty(*, login_path, 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 URLhttps://example.com/web/login
, you would provide the path/web/login
. The rule group inspects only HTTPPOST
requests to your specified login endpoint.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.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 a_wSManaged_rules_aTPRule_set_property = wafv2.CfnWebACL.AWSManagedRulesATPRuleSetProperty( login_path="loginPath", # the properties below are optional 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
- 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
.The rule group inspects only HTTP
POST
requests to your specified login endpoint.
- request_inspection
The criteria for inspecting login requests, used by the ATP rule group to validate credentials usage.
- 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.
AWSManagedRulesBotControlRuleSetProperty
- class CfnWebACL.AWSManagedRulesBotControlRuleSetProperty(*, inspection_level)
Bases:
object
Details for your use of the Bot Control managed rule group, 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 .- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 a_wSManaged_rules_bot_control_rule_set_property = wafv2.CfnWebACL.AWSManagedRulesBotControlRuleSetProperty( inspection_level="inspectionLevel" )
Attributes
- 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 .
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 .
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 allow_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 .
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 theAndStatement
.- Parameters:
statements (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,StatementProperty
,Dict
[str
,Any
]]]]) – The statements to combine with AND logic. You can use any statements that can be nested.- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 # all: Any # all_query_arguments: Any # method: Any # query_string: Any # single_header: Any # single_query_argument: Any # statement_property_: wafv2.CfnWebACL.StatementProperty # uri_path: Any and_statement_property = wafv2.CfnWebACL.AndStatementProperty( statements=[wafv2.CfnWebACL.StatementProperty( and_statement=wafv2.CfnWebACL.AndStatementProperty( statements=[statement_property_] ), byte_match_statement=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" ), 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" ), geo_match_statement=wafv2.CfnWebACL.GeoMatchStatementProperty( country_codes=["countryCodes"], forwarded_ip_config=wafv2.CfnWebACL.ForwardedIPConfigurationProperty( fallback_behavior="fallbackBehavior", header_name="headerName" ) ), ip_set_reference_statement={ "arn": "arn", # the properties below are optional "ip_set_forwarded_ip_config": { "fallback_behavior": "fallbackBehavior", "header_name": "headerName", "position": "position" } }, label_match_statement=wafv2.CfnWebACL.LabelMatchStatementProperty( key="key", scope="scope" ), managed_rule_group_statement=wafv2.CfnWebACL.ManagedRuleGroupStatementProperty( name="name", vendor_name="vendorName", # the properties below are optional excluded_rules=[wafv2.CfnWebACL.ExcludedRuleProperty( name="name" )], managed_rule_group_configs=[wafv2.CfnWebACL.ManagedRuleGroupConfigProperty( aws_managed_rules_atp_rule_set=wafv2.CfnWebACL.AWSManagedRulesATPRuleSetProperty( login_path="loginPath", # the properties below are optional 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" ), login_path="loginPath", password_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ), payload_type="payloadType", username_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ) )], 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" )], scope_down_statement=statement_property_, version="version" ), not_statement=wafv2.CfnWebACL.NotStatementProperty( statement=statement_property_ ), or_statement=wafv2.CfnWebACL.OrStatementProperty( statements=[statement_property_] ), rate_based_statement=wafv2.CfnWebACL.RateBasedStatementProperty( aggregate_key_type="aggregateKeyType", limit=123, # the properties below are optional forwarded_ip_config=wafv2.CfnWebACL.ForwardedIPConfigurationProperty( fallback_behavior="fallbackBehavior", header_name="headerName" ), scope_down_statement=statement_property_ ), regex_match_statement=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" ), 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" )] ), regex_pattern_set_reference_statement=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" ), 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" )] ), rule_group_reference_statement=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" )] ), size_constraint_statement=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" ), 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" )] ), sqli_match_statement=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" ), 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" ), xss_match_statement=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" ), 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
- statements
The statements to combine with AND logic.
You can use any statements that can be nested.
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 .
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 block_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 .
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. If the body is larger than the limit, the underlying host service only forwards the contents that are below the limit to AWS WAF for inspection. The default limit is 8 KB (8,192 kilobytes) for regional resources and 16 KB (16,384 kilobytes) for CloudFront distributions. For CloudFront distributions, you can increase the limit in the web ACLAssociationConfig
, 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 theMATCH
orNO_MATCH
settings for oversize handling with your rule and web ACL action settings, so that you block any request whose body is over the limit. Default:CONTINUE
- Link:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-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. import aws_cdk.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. If the body is larger than the limit, the underlying host service only forwards the contents that are below the limit to AWS WAF for inspection.
The default limit is 8 KB (8,192 kilobytes) for regional resources and 16 KB (16,384 kilobytes) for CloudFront distributions. For CloudFront distributions, you can increase the limit in the web ACL
AssociationConfig
, for additional processing fees.The options for oversize handling are the following:
CONTINUE
- Inspect the available body contents normally, according to the rule inspection criteria.MATCH
- Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request.NO_MATCH
- Treat the web request as not matching the rule statement.
You can combine the
MATCH
orNO_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
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 forSearchString
. Valid values include the following: CONTAINS The specified part of the web request must include the value ofSearchString
, but the location doesn’t matter. CONTAINS_WORD The specified part of the web request must include the value ofSearchString
, andSearchString
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 ofSearchString
. STARTS_WITH The value ofSearchString
must appear at the beginning of the specified part of the web request. ENDS_WITH The value ofSearchString
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 byFieldToMatch
, 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 inFieldToMatch
. 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 ofType
isHEADER
and the value ofData
isUser-Agent
. If you want to search theUser-Agent
header for the valueBadBot
, you provide the stringBadBot
in the value ofSearchString
. You must specify eitherSearchString
orSearchStringBase64
in aByteMatchStatement
.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 inSearchString
instead. You must specify eitherSearchString
orSearchStringBase64
in aByteMatchStatement
.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 # all: Any # all_query_arguments: Any # method: Any # query_string: Any # single_header: Any # single_query_argument: Any # uri_path: Any byte_match_statement_property = wafv2.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" ), 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.
- 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
, andSearchString
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.
- 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
isHEADER
and the value ofData
isUser-Agent
. If you want to search theUser-Agent
header for the valueBadBot
, you provide the stringBadBot
in the value ofSearchString
.You must specify either
SearchString
orSearchStringBase64
in aByteMatchStatement
.
- 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
orSearchStringBase64
in aByteMatchStatement
.
- 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.
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 aCountAction
.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 ofcaptcha
.The HTTP status code
405 Method Not Allowed
.If the request contains an
Accept
header with a value oftext/html
, the response includes aCAPTCHA
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 .- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 captcha_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 .
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 ownCaptchaConfig
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 aCAPTCHA
timestamp in the token remains valid after the client successfully solves aCAPTCHA
puzzle.- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 captcha_config_property = wafv2.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 aCAPTCHA
puzzle.
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 aCountAction
.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 ofchallenge
.The HTTP status code
202 Request Accepted
.If the request contains an
Accept
header with a value oftext/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 .
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 challenge_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 .
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.- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 challenge_config_property = wafv2.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.
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 .
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 count_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 .
CustomHTTPHeaderProperty
- class CfnWebACL.CustomHTTPHeaderProperty(*, name, value)
Bases:
object
A custom header for custom request and response handling.
This is used in
CustomResponse
andCustomRequestHandling
.- 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 namex-amzn-waf-
, to avoid confusion with the headers that are already in the request. For example, for the header namesample
, AWS WAF inserts the headerx-amzn-waf-sample
.value (
str
) – The value of the custom header.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 custom_hTTPHeader_property = wafv2.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 namesample
, AWS WAF inserts the headerx-amzn-waf-sample
.
- value
The value of the custom header.
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, andAllowAction
.For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF Developer Guide .
- Parameters:
insert_headers (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,CustomHTTPHeaderProperty
,Dict
[str
,Any
]]]]) –The HTTP headers to insert into the request. Duplicate header names are not allowed. For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 custom_request_handling_property = wafv2.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 .
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 theContent
string.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 custom_response_body_property = wafv2.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 .
- content_type
The type of content in the payload that you are defining in the
Content
string.
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 theCustomResponseBodies
setting for theWebACL
orRuleGroup
where you want to use it. Then, in the rule action or web ACL default actionBlockAction
setting, you reference the response body using this key.response_headers (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,CustomHTTPHeaderProperty
,Dict
[str
,Any
]]],None
]) –The HTTP headers to use in the response. Duplicate header names are not allowed. For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 custom_response_property = wafv2.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 theWebACL
orRuleGroup
where you want to use it. Then, in the rule action or web ACL default actionBlockAction
setting, you reference the response body using this key.
- 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 .
- response_headers
The HTTP headers to use in the response. Duplicate header names are not allowed.
For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .
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 theWebACL
.The default action must be a terminating action.
- Parameters:
allow (
Union
[IResolvable
,AllowActionProperty
,Dict
[str
,Any
],None
]) – Specifies that AWS WAF should allow requests by default.block (
Union
[IResolvable
,BlockActionProperty
,Dict
[str
,Any
],None
]) – Specifies that AWS WAF should block requests by default.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 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.
- block
Specifies that AWS WAF should block requests by default.
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, includingCount
.- Parameters:
name (
str
) – The name of the rule whose action you want to override toCount
.- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 excluded_rule_property = wafv2.CfnWebACL.ExcludedRuleProperty( name="name" )
Attributes
- name
The name of the rule whose action you want to override to
Count
.
FieldIdentifierProperty
- class CfnWebACL.FieldIdentifierProperty(*, identifier)
Bases:
object
The identifier of the username or password field, used in the
ManagedRuleGroupConfig
settings.- Parameters:
identifier (
str
) – The name of the username or password field, used in theManagedRuleGroupConfig
settings. When thePayloadType
isJSON
, the 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 thePayloadType
isFORM_ENCODED
, use the HTML form names. For example,username
.- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 field_identifier_property = wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" )
Attributes
- identifier
The name of the username or password field, used in the
ManagedRuleGroupConfig
settings.When the
PayloadType
isJSON
, the 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
isFORM_ENCODED
, use the HTML form names. For example,username
.
FieldToMatchProperty
- class CfnWebACL.FieldToMatchProperty(*, all_query_arguments=None, body=None, cookies=None, headers=None, json_body=None, method=None, query_string=None, single_header=None, single_query_argument=None, uri_path=None)
Bases:
object
The part of the web request that you want AWS WAF to inspect.
Include the single
FieldToMatch
type that you want to inspect, with additional specifications as needed, according to the type. You specify a single request component inFieldToMatch
for each rule statement that requires it. To inspect more than one component of the web request, create a separate rule statement for each component.Example JSON for a
QueryString
field to match:"FieldToMatch": { "QueryString": {} }
Example JSON for a
Method
field to match specification:"FieldToMatch": { "Method": { "Name": "DELETE" } }
- Parameters:
all_query_arguments (
Optional
[Any
]) – Inspect all query arguments.body (
Union
[IResolvable
,BodyProperty
,Dict
[str
,Any
],None
]) – Inspect the request body as plain text. The request body immediately follows the request headers. This is the part of a request that contains any additional data that you want to send to your web server as the HTTP request body, such as data from a form. A limited amount of the request body is forwarded to AWS WAF for inspection by the underlying host service. For regional resources, the limit is 8 KB (8,192 kilobytes) and for CloudFront distributions, the limit is 16 KB (16,384 kilobytes). For CloudFront distributions, you can increase the limit in the web ACL’sAssociationConfig
, for additional processing fees. For information about how to handle oversized request bodies, see theBody
object configuration.cookies (
Union
[IResolvable
,CookiesProperty
,Dict
[str
,Any
],None
]) – Inspect the request cookies. You must configure scope and pattern matching filters in theCookies
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 theCookies
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 theHeaders
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 theHeaders
object. AWS WAF applies the pattern matching filters to the headers that it receives from the underlying host service.json_body (
Union
[IResolvable
,JsonBodyProperty
,Dict
[str
,Any
],None
]) – Inspect the request body as JSON. The request body immediately follows the request headers. This is the part of a request that contains any additional data that you want to send to your web server as the HTTP request body, such as data from a form. A limited amount of the request body is forwarded to AWS WAF for inspection by the underlying host service. For regional resources, the limit is 8 KB (8,192 kilobytes) and for CloudFront distributions, the limit is 16 KB (16,384 kilobytes). For CloudFront distributions, you can increase the limit in the web ACL’sAssociationConfig
, for additional processing fees. For information about how to handle oversized request bodies, see theJsonBody
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
orReferer
. This setting isn’t case sensitive. Example JSON:"SingleHeader": { "Name": "haystack" }
Alternately, you can filter and inspect all headers with theHeaders
FieldToMatch
setting.single_query_argument (
Optional
[Any
]) – Inspect a single query argument. Provide the name of the query argument to inspect, such as UserName or SalesRegion . The name can be up to 30 characters long and isn’t case sensitive. Example JSON:"SingleQueryArgument": { "Name": "myArgument" }
uri_path (
Optional
[Any
]) – Inspect the request URI path. This is the part of the web request that identifies a resource, for example,/images/daily-ad.jpg
.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 # all: Any # all_query_arguments: Any # method: Any # query_string: Any # single_header: Any # single_query_argument: Any # uri_path: Any field_to_match_property = wafv2.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" ), 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.
- body
Inspect the request body as plain text.
The request body immediately follows the request headers. This is the part of a request that contains any additional data that you want to send to your web server as the HTTP request body, such as data from a form.
A limited amount of the request body is forwarded to AWS WAF for inspection by the underlying host service. For regional resources, the limit is 8 KB (8,192 kilobytes) and for CloudFront distributions, the limit is 16 KB (16,384 kilobytes). For CloudFront distributions, you can increase the limit in the web ACL’s
AssociationConfig
, for additional processing fees.For information about how to handle oversized request bodies, see the
Body
object configuration.
- 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.
- 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.
- json_body
Inspect the request body as JSON.
The request body immediately follows the request headers. This is the part of a request that contains any additional data that you want to send to your web server as the HTTP request body, such as data from a form.
A limited amount of the request body is forwarded to AWS WAF for inspection by the underlying host service. For regional resources, the limit is 8 KB (8,192 kilobytes) and for CloudFront distributions, the limit is 16 KB (16,384 kilobytes). For CloudFront distributions, you can increase the limit in the web ACL’s
AssociationConfig
, for additional processing fees.For information about how to handle oversized request bodies, see the
JsonBody
object configuration.
- method
Inspect the HTTP method.
The method indicates the type of operation that the request is asking the origin to perform.
- query_string
Inspect the query string.
This is the part of a URL that appears after a
?
character, if any.
- single_header
Inspect a single header.
Provide the name of the header to inspect, for example,
User-Agent
orReferer
. 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
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
Inspect the request URI path.
This is the part of the web request that identifies a resource, for example,
/images/daily-ad.jpg
.
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
andRateBasedStatement
. ForIPSetReferenceStatement
, useIPSetForwardedIPConfig
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 toX-Forwarded-For
. .. epigraph:: If the specified header isn’t present in the request, AWS WAF doesn’t apply the rule to the web request at all.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 forwarded_iPConfiguration_property = wafv2.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.
- 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.
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>
andawswaf: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>
andawswaf:forwardedip:geo:country:<ISO country code>
.For additional details, see Geographic match rule statement in the AWS WAF Developer Guide .
- Parameters:
country_codes (
Optional
[Sequence
[str
]]) – An array of two-character country codes that you want to match against, for example,[ "US", "CN" ]
, from the alpha-2 country ISO codes of the ISO 3166 international standard. When you use a geo match statement just for the region and country labels that it adds to requests, you still have to supply a country code for the rule to evaluate. In this case, you configure the rule to only count matching requests, but it will still generate logging and count metrics for any matches. You can reduce the logging and metrics that the rule produces by specifying a country that’s unlikely to be a source of traffic to your site.forwarded_ip_config (
Union
[IResolvable
,ForwardedIPConfigurationProperty
,Dict
[str
,Any
],None
]) – The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that’s reported by the web request origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name. .. epigraph:: If the specified header isn’t present in the request, AWS WAF doesn’t apply the rule to the web request at all.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 geo_match_statement_property = wafv2.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.
- 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.
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
, orExcludedHeaders
.Example JSON:
"MatchPattern": { "ExcludedHeaders": {"KeyToExclude1", "KeyToExclude2"} }
- Parameters:
all (
Optional
[Any
]) – Inspect all headers.excluded_headers (
Optional
[Sequence
[str
]]) – Inspect only the headers whose keys don’t match any of the strings specified here.included_headers (
Optional
[Sequence
[str
]]) – Inspect only the headers that have a key that matches one of the strings specified here.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 # all: Any header_match_pattern_property = wafv2.CfnWebACL.HeaderMatchPatternProperty( all=all, excluded_headers=["excludedHeaders"], included_headers=["includedHeaders"] )
Attributes
- all
Inspect all headers.
- excluded_headers
Inspect only the headers whose keys don’t match any of the strings specified here.
- included_headers
Inspect only the headers that have a key that matches one of the strings specified here.
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: eitherAll
,IncludedHeaders
, orExcludedHeaders
. Example JSON:"MatchPattern": { "ExcludedHeaders": {"KeyToExclude1", "KeyToExclude2"} }
match_scope (
str
) – The parts of the headers to match with the rule inspection criteria. If you specifyAll
, AWS WAF inspects both keys and values.oversize_handling (
str
) – What AWS WAF should do if the headers of the request are more numerous or larger than AWS WAF can inspect. AWS WAF does not support inspecting the entire contents of request headers when they exceed 8 KB (8192 bytes) or 200 total headers. The underlying host service forwards a maximum of 200 headers and at most 8 KB of header contents to AWS WAF . The options for oversize handling are the following: -CONTINUE
- Inspect the available headers normally, according to the rule inspection criteria. -MATCH
- Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request. -NO_MATCH
- Treat the web request as not matching the rule statement.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 # all: Any headers_property = wafv2.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
, orExcludedHeaders
.Example JSON:
"MatchPattern": { "ExcludedHeaders": {"KeyToExclude1", "KeyToExclude2"} }
- 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.
- 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.
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
. ForGeoMatchStatement
andRateBasedStatement
, useForwardedIPConfig
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 toX-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 be10.1.1.1, 127.0.0.0, 10.10.10.10
where the first IP address identifies the original client and the rest identify proxies that the request went through. The options for this setting are the following: - FIRST - Inspect the first IP address in the list of IP addresses in the header. This is usually the client’s original IP. - LAST - Inspect the last IP address in the list of IP addresses in the header. - ANY - Inspect all IP addresses in the header for a match. If the header contains more than 10 IP addresses, AWS WAF inspects the last 10.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 i_pSet_forwarded_iPConfiguration_property = { "fallback_behavior": "fallbackBehavior", "header_name": "headerName", "position": "position" }
Attributes
- fallback_behavior
The match status to assign to the web request if the request doesn’t have a valid IP address in the specified position.
If the specified header isn’t present in the request, AWS WAF doesn’t apply the rule to the web request at all.
You can specify the following fallback behaviors:
MATCH
- Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request.NO_MATCH
- Treat the web request as not matching the rule statement.
- 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.
- 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.
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 theIPSet
that this statement references.ip_set_forwarded_ip_config (
Union
[IResolvable
,IPSetForwardedIPConfigurationProperty
,Dict
[str
,Any
],None
]) – The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that’s reported by the web request origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name. .. epigraph:: If the specified header isn’t present in the request, AWS WAF doesn’t apply the rule to the web request at all.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 i_pSet_reference_statement_property = { "arn": "arn", # the properties below are optional "ip_set_forwarded_ip_config": { "fallback_behavior": "fallbackBehavior", "header_name": "headerName", "position": "position" } }
Attributes
- arn
The Amazon Resource Name (ARN) of the
IPSet
that this statement references.
- 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.
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 successfulCAPTCHA
or challenge response.- Parameters:
immunity_time (
Union
[int
,float
]) – The amount of time, in seconds, that aCAPTCHA
or challenge timestamp is considered valid by AWS WAF . The default setting is 300. For the Challenge action, the minimum setting is 300.- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 immunity_time_property_property = wafv2.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.
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 theMatchPattern
. If you specifyAll
, AWS WAF matches against keys and values.invalid_fallback_behavior (
Optional
[str
]) – What AWS WAF should do if it fails to completely parse the JSON body. The options are the following:. -EVALUATE_AS_STRING
- Inspect the body as plain text. AWS WAF applies the text transformations and inspection criteria that you defined for the JSON inspection to the body text string. -MATCH
- Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request. -NO_MATCH
- Treat the web request as not matching the rule statement. If you don’t provide this setting, AWS WAF parses and evaluates the content only up to the first parsing failure that it encounters. AWS WAF does its best to parse the entire JSON body, but might be forced to stop for reasons such as invalid characters, duplicate keys, truncation, and any content whose root node isn’t an object or an array. AWS WAF parses the JSON in the following examples as two valid key, value pairs: - Missing comma:{"key1":"value1""key2":"value2"}
- Missing colon:{"key1":"value1","key2""value2"}
- Extra colons:{"key1"::"value1","key2""value2"}
oversize_handling (
Optional
[str
]) – What AWS WAF should do if the body is larger than AWS WAF can inspect. AWS WAF does not support inspecting the entire contents of the web request body if the body exceeds the limit for the resource type. If the body is larger than the limit, the underlying host service only forwards the contents that are below the limit to AWS WAF for inspection. The default limit is 8 KB (8,192 kilobytes) for regional resources and 16 KB (16,384 kilobytes) for CloudFront distributions. For CloudFront distributions, you can increase the limit in the web ACLAssociationConfig
, 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 theMATCH
orNO_MATCH
settings for oversize handling with your rule and web ACL action settings, so that you block any request whose body is over the limit. Default:CONTINUE
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 # all: Any json_body_property = wafv2.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"}
- Link:
- 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.
- match_scope
The parts of the JSON to match against using the
MatchPattern
.If you specify
All
, AWS WAF matches against keys and values.
- oversize_handling
What AWS WAF should do if the body is larger than AWS WAF can inspect.
AWS WAF does not support inspecting the entire contents of the web request body if the body exceeds the limit for the resource type. If the body is larger than the limit, the underlying host service only forwards the contents that are below the limit to AWS WAF for inspection.
The default limit is 8 KB (8,192 kilobytes) for regional resources and 16 KB (16,384 kilobytes) for CloudFront distributions. For CloudFront distributions, you can increase the limit in the web ACL
AssociationConfig
, for additional processing fees.The options for oversize handling are the following:
CONTINUE
- Inspect the available body contents normally, according to the rule inspection criteria.MATCH
- Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request.NO_MATCH
- Treat the web request as not matching the rule statement.
You can combine the
MATCH
orNO_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
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
optionJsonBody
.- Parameters:
all (
Optional
[Any
]) – Match all of the elements. See alsoMatchScope
in theJsonBody
FieldToMatch
specification. You must specify either this setting or theIncludedPaths
setting, but not both.included_paths (
Optional
[Sequence
[str
]]) –Match only the specified include paths. See also
MatchScope
in theJsonBody
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 theAll
setting, but not both. .. epigraph:: Don’t use this option to include all paths. Instead, use theAll
setting.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 # all: Any json_match_pattern_property = wafv2.CfnWebACL.JsonMatchPatternProperty( all=all, included_paths=["includedPaths"] )
Attributes
- all
Match all of the elements. See also
MatchScope
in theJsonBody
FieldToMatch
specification.You must specify either this setting or the
IncludedPaths
setting, but not both.
- included_paths
Match only the specified include paths. See also
MatchScope
in theJsonBody
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.
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’sScope
setting:. - If theScope
indicatesLABEL
, 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 theScope
indicatesNAMESPACE
, 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 exampleNS1:NS2:name
.scope (
str
) – Specify whether you want to match using the label name or just the namespace.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 label_match_statement_property = wafv2.CfnWebACL.LabelMatchStatementProperty( key="key", scope="scope" )
Attributes
- key
.
If the
Scope
indicatesLABEL
, 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
indicatesNAMESPACE
, then this specification can include any number of contiguous namespace strings, and can include the entire label namespace prefix from the rule group or web ACL where the label originates.
Labels are case sensitive and components of a label must be separated by colon, for example
NS1:NS2:name
.- Link:
- 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.
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.- Link:
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. import aws_cdk.aws_wafv2 as wafv2 label_property = wafv2.CfnWebACL.LabelProperty( name="name" )
Attributes
ManagedRuleGroupConfigProperty
- class CfnWebACL.ManagedRuleGroupConfigProperty(*, 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.
Use the
AWSManagedRulesBotControlRuleSet
configuration object to configure the protection level that you want the Bot Control rule group to use.- Parameters:
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 inManagedRuleGroupConfig
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
orAWSManagedRulesACFPRuleSet
.payload_type (
Optional
[str
]) –Instead of this setting, provide your configuration under the request inspection configuration for
AWSManagedRulesATPRuleSet
orAWSManagedRulesACFPRuleSet
.username_field (
Union
[IResolvable
,FieldIdentifierProperty
,Dict
[str
,Any
],None
]) –Instead of this setting, provide your configuration under the request inspection configuration for
AWSManagedRulesATPRuleSet
orAWSManagedRulesACFPRuleSet
.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 managed_rule_group_config_property = wafv2.CfnWebACL.ManagedRuleGroupConfigProperty( aws_managed_rules_atp_rule_set=wafv2.CfnWebACL.AWSManagedRulesATPRuleSetProperty( login_path="loginPath", # the properties below are optional 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" ), login_path="loginPath", password_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ), payload_type="payloadType", username_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ) )
Attributes
- 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 .
- 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 .
- login_path
Instead of this setting, provide your configuration under
AWSManagedRulesATPRuleSet
.
- password_field
Instead of this setting, provide your configuration under the request inspection configuration for
AWSManagedRulesATPRuleSet
orAWSManagedRulesACFPRuleSet
.
- payload_type
Instead of this setting, provide your configuration under the request inspection configuration for
AWSManagedRulesATPRuleSet
orAWSManagedRulesACFPRuleSet
.
- username_field
Instead of this setting, provide your configuration under the request inspection configuration for
AWSManagedRulesATPRuleSet
orAWSManagedRulesACFPRuleSet
.
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 cannot nest a
ManagedRuleGroupStatement
, for example for use inside aNotStatement
orOrStatement
. It can only be referenced as a top-level statement within a rule.- 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 toCount
. .. epigraph:: Instead of this option, useRuleActionOverrides
. It accepts any valid action setting, includingCount
.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 theAWSManagedRulesACFPRuleSet
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 theAWSManagedRulesATPRuleSet
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 theAWSManagedRulesBotControlRuleSet
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 toCount
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 nestableStatement
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.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 # all: Any # all_query_arguments: Any # method: Any # query_string: Any # single_header: Any # single_query_argument: Any # statement_property_: wafv2.CfnWebACL.StatementProperty # uri_path: Any managed_rule_group_statement_property = wafv2.CfnWebACL.ManagedRuleGroupStatementProperty( name="name", vendor_name="vendorName", # the properties below are optional excluded_rules=[wafv2.CfnWebACL.ExcludedRuleProperty( name="name" )], managed_rule_group_configs=[wafv2.CfnWebACL.ManagedRuleGroupConfigProperty( aws_managed_rules_atp_rule_set=wafv2.CfnWebACL.AWSManagedRulesATPRuleSetProperty( login_path="loginPath", # the properties below are optional 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" ), login_path="loginPath", password_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ), payload_type="payloadType", username_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ) )], 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" )], scope_down_statement=wafv2.CfnWebACL.StatementProperty( and_statement=wafv2.CfnWebACL.AndStatementProperty( statements=[statement_property_] ), byte_match_statement=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" ), 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" ), geo_match_statement=wafv2.CfnWebACL.GeoMatchStatementProperty( country_codes=["countryCodes"], forwarded_ip_config=wafv2.CfnWebACL.ForwardedIPConfigurationProperty( fallback_behavior="fallbackBehavior", header_name="headerName" ) ), ip_set_reference_statement={ "arn": "arn", # the properties below are optional "ip_set_forwarded_ip_config": { "fallback_behavior": "fallbackBehavior", "header_name": "headerName", "position": "position" } }, label_match_statement=wafv2.CfnWebACL.LabelMatchStatementProperty( key="key", scope="scope" ), managed_rule_group_statement=wafv2.CfnWebACL.ManagedRuleGroupStatementProperty( name="name", vendor_name="vendorName", # the properties below are optional excluded_rules=[wafv2.CfnWebACL.ExcludedRuleProperty( name="name" )], managed_rule_group_configs=[wafv2.CfnWebACL.ManagedRuleGroupConfigProperty( aws_managed_rules_atp_rule_set=wafv2.CfnWebACL.AWSManagedRulesATPRuleSetProperty( login_path="loginPath", # the properties below are optional 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" ), login_path="loginPath", password_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ), payload_type="payloadType", username_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ) )], 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" )], scope_down_statement=statement_property_, version="version" ), not_statement=wafv2.CfnWebACL.NotStatementProperty( statement=statement_property_ ), or_statement=wafv2.CfnWebACL.OrStatementProperty( statements=[statement_property_] ), rate_based_statement=wafv2.CfnWebACL.RateBasedStatementProperty( aggregate_key_type="aggregateKeyType", limit=123, # the properties below are optional forwarded_ip_config=wafv2.CfnWebACL.ForwardedIPConfigurationProperty( fallback_behavior="fallbackBehavior", header_name="headerName" ), scope_down_statement=statement_property_ ), regex_match_statement=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" ), 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" )] ), regex_pattern_set_reference_statement=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" ), 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" )] ), rule_group_reference_statement=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" )] ), size_constraint_statement=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" ), 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" )] ), sqli_match_statement=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" ), 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" ), xss_match_statement=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" ), 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" )] ) ), version="version" )
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, includingCount
.
- 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.
- name
The name of the managed rule group.
You use this, along with the vendor name, to identify the rule group.
- 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.
- 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.
- vendor_name
The name of the managed rule group vendor.
You use this, along with the rule group name, to identify a rule group.
- 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.
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 theNotStatement
.- Parameters:
statement (
Union
[IResolvable
,StatementProperty
,Dict
[str
,Any
]]) – The statement to negate. You can use any statement that can be nested.- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 # all: Any # all_query_arguments: Any # method: Any # query_string: Any # single_header: Any # single_query_argument: Any # statement_property_: wafv2.CfnWebACL.StatementProperty # uri_path: Any not_statement_property = wafv2.CfnWebACL.NotStatementProperty( statement=wafv2.CfnWebACL.StatementProperty( and_statement=wafv2.CfnWebACL.AndStatementProperty( statements=[statement_property_] ), byte_match_statement=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" ), 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" ), geo_match_statement=wafv2.CfnWebACL.GeoMatchStatementProperty( country_codes=["countryCodes"], forwarded_ip_config=wafv2.CfnWebACL.ForwardedIPConfigurationProperty( fallback_behavior="fallbackBehavior", header_name="headerName" ) ), ip_set_reference_statement={ "arn": "arn", # the properties below are optional "ip_set_forwarded_ip_config": { "fallback_behavior": "fallbackBehavior", "header_name": "headerName", "position": "position" } }, label_match_statement=wafv2.CfnWebACL.LabelMatchStatementProperty( key="key", scope="scope" ), managed_rule_group_statement=wafv2.CfnWebACL.ManagedRuleGroupStatementProperty( name="name", vendor_name="vendorName", # the properties below are optional excluded_rules=[wafv2.CfnWebACL.ExcludedRuleProperty( name="name" )], managed_rule_group_configs=[wafv2.CfnWebACL.ManagedRuleGroupConfigProperty( aws_managed_rules_atp_rule_set=wafv2.CfnWebACL.AWSManagedRulesATPRuleSetProperty( login_path="loginPath", # the properties below are optional 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" ), login_path="loginPath", password_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ), payload_type="payloadType", username_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ) )], 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" )], scope_down_statement=statement_property_, version="version" ), not_statement=wafv2.CfnWebACL.NotStatementProperty( statement=statement_property_ ), or_statement=wafv2.CfnWebACL.OrStatementProperty( statements=[statement_property_] ), rate_based_statement=wafv2.CfnWebACL.RateBasedStatementProperty( aggregate_key_type="aggregateKeyType", limit=123, # the properties below are optional forwarded_ip_config=wafv2.CfnWebACL.ForwardedIPConfigurationProperty( fallback_behavior="fallbackBehavior", header_name="headerName" ), scope_down_statement=statement_property_ ), regex_match_statement=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" ), 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" )] ), regex_pattern_set_reference_statement=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" ), 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" )] ), rule_group_reference_statement=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" )] ), size_constraint_statement=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" ), 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" )] ), sqli_match_statement=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" ), 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" ), xss_match_statement=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" ), 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
- statement
The statement to negate.
You can use any statement that can be nested.
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 theOrStatement
.- Parameters:
statements (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,StatementProperty
,Dict
[str
,Any
]]]]) – The statements to combine with OR logic. You can use any statements that can be nested.- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 # all: Any # all_query_arguments: Any # method: Any # query_string: Any # single_header: Any # single_query_argument: Any # statement_property_: wafv2.CfnWebACL.StatementProperty # uri_path: Any or_statement_property = wafv2.CfnWebACL.OrStatementProperty( statements=[wafv2.CfnWebACL.StatementProperty( and_statement=wafv2.CfnWebACL.AndStatementProperty( statements=[statement_property_] ), byte_match_statement=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" ), 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" ), geo_match_statement=wafv2.CfnWebACL.GeoMatchStatementProperty( country_codes=["countryCodes"], forwarded_ip_config=wafv2.CfnWebACL.ForwardedIPConfigurationProperty( fallback_behavior="fallbackBehavior", header_name="headerName" ) ), ip_set_reference_statement={ "arn": "arn", # the properties below are optional "ip_set_forwarded_ip_config": { "fallback_behavior": "fallbackBehavior", "header_name": "headerName", "position": "position" } }, label_match_statement=wafv2.CfnWebACL.LabelMatchStatementProperty( key="key", scope="scope" ), managed_rule_group_statement=wafv2.CfnWebACL.ManagedRuleGroupStatementProperty( name="name", vendor_name="vendorName", # the properties below are optional excluded_rules=[wafv2.CfnWebACL.ExcludedRuleProperty( name="name" )], managed_rule_group_configs=[wafv2.CfnWebACL.ManagedRuleGroupConfigProperty( aws_managed_rules_atp_rule_set=wafv2.CfnWebACL.AWSManagedRulesATPRuleSetProperty( login_path="loginPath", # the properties below are optional 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" ), login_path="loginPath", password_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ), payload_type="payloadType", username_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ) )], 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" )], scope_down_statement=statement_property_, version="version" ), not_statement=wafv2.CfnWebACL.NotStatementProperty( statement=statement_property_ ), or_statement=wafv2.CfnWebACL.OrStatementProperty( statements=[statement_property_] ), rate_based_statement=wafv2.CfnWebACL.RateBasedStatementProperty( aggregate_key_type="aggregateKeyType", limit=123, # the properties below are optional forwarded_ip_config=wafv2.CfnWebACL.ForwardedIPConfigurationProperty( fallback_behavior="fallbackBehavior", header_name="headerName" ), scope_down_statement=statement_property_ ), regex_match_statement=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" ), 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" )] ), regex_pattern_set_reference_statement=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" ), 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" )] ), rule_group_reference_statement=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" )] ), size_constraint_statement=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" ), 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" )] ), sqli_match_statement=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" ), 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" ), xss_match_statement=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" ), 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
- statements
The statements to combine with OR logic.
You can use any statements that can be nested.
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
andManagedRuleGroupStatement
. .. 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, withCount
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.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 # count: 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.
- none
Don’t override the rule group evaluation result.
This is the most common setting.
RateBasedStatementProperty
- class CfnWebACL.RateBasedStatementProperty(*, aggregate_key_type, limit, forwarded_ip_config=None, scope_down_statement=None)
Bases:
object
A rate-based rule tracks the rate of requests for each originating IP address, and triggers the rule action when the rate exceeds a limit that you specify on the number of requests in any 5-minute time span.
You can use this to put a temporary block on requests from an IP address that is sending excessive requests.
AWS WAF tracks and manages web requests separately for each instance of a rate-based rule that you use. For example, if you provide the same rate-based rule settings in two web ACLs, each of the two rule statements represents a separate instance of the rate-based rule and gets its own tracking and management by AWS WAF . If you define a rate-based rule inside a rule group, and then use that rule group in multiple places, each use creates a separate instance of the rate-based rule that gets its own tracking and management by AWS WAF .
When the rule action triggers, AWS WAF blocks additional requests from the IP address until the request rate falls below the limit.
You can optionally nest another statement inside the rate-based statement, to narrow the scope of the rule so that it only counts requests that match the nested statement. For example, based on recent requests that you have seen from an attacker, you might create a rate-based rule with a nested AND rule statement that contains the following nested statements:
An IP match statement with an IP set that specifies the address 192.0.2.44.
A string match statement that searches in the User-Agent header for the string BadBot.
In this rate-based rule, you also define a rate limit. For this example, the rate limit is 1,000. Requests that meet the criteria of both of the nested statements are counted. If the count exceeds 1,000 requests per five minutes, the rule action triggers. Requests that do not meet the criteria of both of the nested statements are not counted towards the rate limit and are not affected by this rule.
You cannot nest a
RateBasedStatement
inside another statement, for example inside aNotStatement
orOrStatement
. You can define aRateBasedStatement
inside a web ACL and inside a rule group.- Parameters:
aggregate_key_type (
str
) – Setting that indicates how to aggregate the request counts. The options are the following:. -IP
- Aggregate the request counts on the IP address from the web request origin. -FORWARDED_IP
- Aggregate the request counts on the first IP address in an HTTP header. If you use this, configure theForwardedIPConfig
, to specify the header to use. .. epigraph:: You can only use theIP
andFORWARDED_IP
key types.limit (
Union
[int
,float
]) – The limit on requests per 5-minute period for a single originating IP address. If the statement includes aScopeDownStatement
, this limit is applied only to the requests that match the statement.forwarded_ip_config (
Union
[IResolvable
,ForwardedIPConfigurationProperty
,Dict
[str
,Any
],None
]) – The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that’s reported by the web request origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name. .. epigraph:: If the specified header isn’t present in the request, AWS WAF doesn’t apply the rule to the web request at all. This is required if you specify a forwarded IP in the rule’s aggregate key settings.scope_down_statement (
Union
[IResolvable
,StatementProperty
,Dict
[str
,Any
],None
]) – An optional nested statement that narrows the scope of the web requests that are evaluated by the rate-based statement. Requests are only tracked by the rate-based statement if they match the scope-down statement. You can use any nestableStatement
in the scope-down statement, and you can nest statements at any level, the same as you can for a rule statement.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 # all: Any # all_query_arguments: Any # method: Any # query_string: Any # single_header: Any # single_query_argument: Any # statement_property_: wafv2.CfnWebACL.StatementProperty # uri_path: Any rate_based_statement_property = wafv2.CfnWebACL.RateBasedStatementProperty( aggregate_key_type="aggregateKeyType", limit=123, # the properties below are optional forwarded_ip_config=wafv2.CfnWebACL.ForwardedIPConfigurationProperty( fallback_behavior="fallbackBehavior", header_name="headerName" ), scope_down_statement=wafv2.CfnWebACL.StatementProperty( and_statement=wafv2.CfnWebACL.AndStatementProperty( statements=[statement_property_] ), byte_match_statement=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" ), 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" ), geo_match_statement=wafv2.CfnWebACL.GeoMatchStatementProperty( country_codes=["countryCodes"], forwarded_ip_config=wafv2.CfnWebACL.ForwardedIPConfigurationProperty( fallback_behavior="fallbackBehavior", header_name="headerName" ) ), ip_set_reference_statement={ "arn": "arn", # the properties below are optional "ip_set_forwarded_ip_config": { "fallback_behavior": "fallbackBehavior", "header_name": "headerName", "position": "position" } }, label_match_statement=wafv2.CfnWebACL.LabelMatchStatementProperty( key="key", scope="scope" ), managed_rule_group_statement=wafv2.CfnWebACL.ManagedRuleGroupStatementProperty( name="name", vendor_name="vendorName", # the properties below are optional excluded_rules=[wafv2.CfnWebACL.ExcludedRuleProperty( name="name" )], managed_rule_group_configs=[wafv2.CfnWebACL.ManagedRuleGroupConfigProperty( aws_managed_rules_atp_rule_set=wafv2.CfnWebACL.AWSManagedRulesATPRuleSetProperty( login_path="loginPath", # the properties below are optional 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" ), login_path="loginPath", password_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ), payload_type="payloadType", username_field=wafv2.CfnWebACL.FieldIdentifierProperty( identifier="identifier" ) )], 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" )], scope_down_statement=statement_property_, version="version" ), not_statement=wafv2.CfnWebACL.NotStatementProperty( statement=statement_property_ ), or_statement=wafv2.CfnWebACL.OrStatementProperty( statements=[statement_property_] ), rate_based_statement=wafv2.CfnWebACL.RateBasedStatementProperty( aggregate_key_type="aggregateKeyType", limit=123, # the properties below are optional forwarded_ip_config=wafv2.CfnWebACL.ForwardedIPConfigurationProperty( fallback_behavior="fallbackBehavior", header_name="headerName" ), scope_down_statement=statement_property_ ), regex_match_statement=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" ), 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" )] ), regex_pattern_set_reference_statement=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" ), 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" )] ), rule_group_reference_statement=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" )] ), size_constraint_statement=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" ), 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" )] ), sqli_match_statement=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" ), 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" ), xss_match_statement=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" ), 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
- aggregate_key_type
.
IP
- Aggregate the request counts on the IP address from the web request origin.FORWARDED_IP
- Aggregate the request counts on the first IP address in an HTTP header. If you use this, configure theForwardedIPConfig
, to specify the header to use.
You can only use the
IP
andFORWARDED_IP
key types.- Link:
- Type:
Setting that indicates how to aggregate the request counts. The options are the following
- forwarded_ip_config
The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that’s reported by the web request origin.
Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name. .. epigraph:
If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.
This is required if you specify a forwarded IP in the rule’s aggregate key settings.
- limit
The limit on requests per 5-minute period for a single originating IP address.
If the statement includes a
ScopeDownStatement
, this limit is applied only to the requests that match the statement.
- scope_down_statement
An optional nested statement that narrows the scope of the web requests that are evaluated by the rate-based statement.
Requests are only tracked by the rate-based statement if they match the scope-down statement. You can use any nestable
Statement
in the scope-down statement, and you can nest statements at any level, the same as you can for a rule statement.
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 byFieldToMatch
, starting from the lowest priority setting, before inspecting the content for a match.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 # all: Any # all_query_arguments: Any # method: Any # query_string: Any # single_header: Any # single_query_argument: Any # uri_path: Any regex_match_statement_property = wafv2.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" ), 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.
- regex_string
The string representing the regular expression.
- 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.
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 theRegexPatternSet
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 byFieldToMatch
, starting from the lowest priority setting, before inspecting the content for a match.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 # all: Any # all_query_arguments: Any # method: Any # query_string: Any # single_header: Any # single_query_argument: Any # uri_path: Any regex_pattern_set_reference_statement_property = wafv2.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" ), 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.
- field_to_match
The part of the web request that you want AWS WAF to inspect.
- 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.
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 inManagedRuleGroupConfig
.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 namedpassword1
, the password field specification ispassword1
.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 namedusername1
, the username field specification isusername1
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 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 ispassword1
.
- payload_type
The payload type for your login endpoint, either JSON or form encoded.
- 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 isusername1
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 forAWSManagedRulesATPRuleSet
andAWSManagedRulesACFPRuleSet
. .. 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!" ]
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 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" ]
- 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!" ]
ResponseInspectionHeaderProperty
- class CfnWebACL.ResponseInspectionHeaderProperty(*, failure_values, name, success_values)
Bases:
object
Configures inspection of the response header. This is part of the
ResponseInspection
configuration forAWSManagedRulesATPRuleSet
andAWSManagedRulesACFPRuleSet
.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" ]
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 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" ]
- name
The name of the header to match against. The name must be an exact match, including case.
JSON example:
"Name": [ "RequestResult" ]
- 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" ]
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 forAWSManagedRulesATPRuleSet
andAWSManagedRulesACFPRuleSet
. .. 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" ]
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 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" ]
- 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" ]
- 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" ]
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
andAWSManagedRulesACFPRuleSet
configurations inManagedRuleGroupConfig
.Enable response inspection by configuring exactly one component of the response to inspect, for example,
Header
orStatusCode
. 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:
body_contains (
Union
[IResolvable
,ResponseInspectionBodyContainsProperty
,Dict
[str
,Any
],None
]) – 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.header (
Union
[IResolvable
,ResponseInspectionHeaderProperty
,Dict
[str
,Any
],None
]) – Configures inspection of the response header for success and failure indicators.json (
Union
[IResolvable
,ResponseInspectionJsonProperty
,Dict
[str
,Any
],None
]) – 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.status_code (
Union
[IResolvable
,ResponseInspectionStatusCodeProperty
,Dict
[str
,Any
],None
]) – Configures inspection of the response status code for success and failure indicators.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_wafv2 as wafv2 response_inspection_property = wafv2.CfnWebACL.ResponseInspectionProperty( body_contains=wafv2.CfnWebACL.ResponseInspectionBodyCon