Table of Contents
WAFRegional.Client¶A low-level client representing AWS WAF Regional:
client = session.create_client('waf-regional')
These are the available methods:
associate_web_acl()can_paginate()create_byte_match_set()create_ip_set()create_rate_based_rule()create_rule()create_size_constraint_set()create_sql_injection_match_set()create_web_acl()create_xss_match_set()delete_byte_match_set()delete_ip_set()delete_rate_based_rule()delete_rule()delete_size_constraint_set()delete_sql_injection_match_set()delete_web_acl()delete_xss_match_set()disassociate_web_acl()generate_presigned_url()get_byte_match_set()get_change_token()get_change_token_status()get_ip_set()get_paginator()get_rate_based_rule()get_rate_based_rule_managed_keys()get_rule()get_sampled_requests()get_size_constraint_set()get_sql_injection_match_set()get_waiter()get_web_acl()get_web_acl_for_resource()get_xss_match_set()list_byte_match_sets()list_ip_sets()list_rate_based_rules()list_resources_for_web_acl()list_rules()list_size_constraint_sets()list_sql_injection_match_sets()list_web_acls()list_xss_match_sets()update_byte_match_set()update_ip_set()update_rate_based_rule()update_rule()update_size_constraint_set()update_sql_injection_match_set()update_web_acl()update_xss_match_set()associate_web_acl(**kwargs)¶Associates a web ACL with a resource.
See also: AWS API Documentation
Request Syntax
response = client.associate_web_acl(
WebACLId='string',
ResourceArn='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
can_paginate(operation_name)¶Check if an operation can be paginated.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Returns: | True if the operation can be paginated,
False otherwise. |
create_byte_match_set(**kwargs)¶Creates a ByteMatchSet . You then use UpdateByteMatchSet to identify the part of a web request that you want AWS WAF to inspect, such as the values of the User-Agent header or the query string. For example, you can create a ByteMatchSet that matches any requests with User-Agent headers that contain the string BadBot . You can then configure AWS WAF to reject those requests.
To create and configure a ByteMatchSet , perform the following steps:
ChangeToken parameter of a CreateByteMatchSet request.CreateByteMatchSet request.GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateByteMatchSet request.For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_byte_match_set(
Name='string',
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ByteMatchSet': {
'ByteMatchSetId': 'string',
'Name': 'string',
'ByteMatchTuples': [
{
'FieldToMatch': {
'Type': 'URI'|'QUERY_STRING'|'HEADER'|'METHOD'|'BODY',
'Data': 'string'
},
'TargetString': b'bytes',
'TextTransformation': 'NONE'|'COMPRESS_WHITE_SPACE'|'HTML_ENTITY_DECODE'|'LOWERCASE'|'CMD_LINE'|'URL_DECODE',
'PositionalConstraint': 'EXACTLY'|'STARTS_WITH'|'ENDS_WITH'|'CONTAINS'|'CONTAINS_WORD'
},
]
},
'ChangeToken': 'string'
}
Response Structure
|
create_ip_set(**kwargs)¶Creates an IPSet , which you use to specify which web requests you want to allow or block based on the IP addresses that the requests originate from. For example, if you’re receiving a lot of requests from one or more individual IP addresses or one or more ranges of IP addresses and you want to block the requests, you can create an IPSet that contains those IP addresses and then configure AWS WAF to block the requests.
To create and configure an IPSet , perform the following steps:
ChangeToken parameter of a CreateIPSet request.CreateIPSet request.GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateIPSet request.UpdateIPSet request to specify the IP addresses that you want AWS WAF to watch for.For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_ip_set(
Name='string',
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'IPSet': {
'IPSetId': 'string',
'Name': 'string',
'IPSetDescriptors': [
{
'Type': 'IPV4'|'IPV6',
'Value': 'string'
},
]
},
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example creates an IP match set named MyIPSetFriendlyName.
response = client.create_ip_set(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
Name='MyIPSetFriendlyName',
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'IPSet': {
'IPSetDescriptors': [
{
'Type': 'IPV4',
'Value': '192.0.2.44/32',
},
],
'IPSetId': 'example1ds3t-46da-4fdb-b8d5-abc321j569j5',
'Name': 'MyIPSetFriendlyName',
},
'ResponseMetadata': {
'...': '...',
},
}
create_rate_based_rule(**kwargs)¶Creates a RateBasedRule . The RateBasedRule contains a RateLimit , which specifies the maximum number of requests that AWS WAF allows from a specified IP address in a five-minute period. The RateBasedRule also contains the IPSet objects, ByteMatchSet objects, and other predicates that identify the requests that you want to count or block if these requests exceed the RateLimit .
If you add more than one predicate to a RateBasedRule , a request not only must exceed the RateLimit , but it also must match all the specifications to be counted or blocked. For example, suppose you add the following to a RateBasedRule :
IPSet that matches the IP address 192.0.2.44/32ByteMatchSet that matches BadBot in the User-Agent headerFurther, you specify a RateLimit of 15,000.
You then add the RateBasedRule to a WebACL and specify that you want to block requests that meet the conditions in the rule. For a request to be blocked, it must come from the IP address 192.0.2.44 and the User-Agent header in the request must contain the value BadBot . Further, requests that match these two conditions must be received at a rate of more than 15,000 requests every five minutes. If both conditions are met and the rate is exceeded, AWS WAF blocks the requests. If the rate drops below 15,000 for a five-minute period, AWS WAF no longer blocks the requests.
As a second example, suppose you want to limit requests to a particular page on your site. To do this, you could add the following to a RateBasedRule :
ByteMatchSet with FieldToMatch of URIPositionalConstraint of STARTS_WITHTargetString of loginFurther, you specify a RateLimit of 15,000.
By adding this RateBasedRule to a WebACL , you could limit requests to your login page without affecting the rest of your site.
To create and configure a RateBasedRule , perform the following steps:
ChangeToken parameter of a CreateRule request.CreateRateBasedRule request.GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateRule request.UpdateRateBasedRule request to specify the predicates that you want to include in the rule.WebACL that contains the RateBasedRule . For more information, see CreateWebACL .For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_rate_based_rule(
Name='string',
MetricName='string',
RateKey='IP',
RateLimit=123,
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Rule': {
'RuleId': 'string',
'Name': 'string',
'MetricName': 'string',
'MatchPredicates': [
{
'Negated': True|False,
'Type': 'IPMatch'|'ByteMatch'|'SqlInjectionMatch'|'SizeConstraint'|'XssMatch',
'DataId': 'string'
},
],
'RateKey': 'IP',
'RateLimit': 123
},
'ChangeToken': 'string'
}
Response Structure
|
create_rule(**kwargs)¶Creates a Rule , which contains the IPSet objects, ByteMatchSet objects, and other predicates that identify the requests that you want to block. If you add more than one predicate to a Rule , a request must match all of the specifications to be allowed or blocked. For example, suppose you add the following to a Rule :
IPSet that matches the IP address 192.0.2.44/32ByteMatchSet that matches BadBot in the User-Agent headerYou then add the Rule to a WebACL and specify that you want to blocks requests that satisfy the Rule . For a request to be blocked, it must come from the IP address 192.0.2.44 and the User-Agent header in the request must contain the value BadBot .
To create and configure a Rule , perform the following steps:
Rule . For more information, see CreateByteMatchSet , CreateIPSet , and CreateSqlInjectionMatchSet .ChangeToken parameter of a CreateRule request.CreateRule request.GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateRule request.UpdateRule request to specify the predicates that you want to include in the Rule .WebACL that contains the Rule . For more information, see CreateWebACL .For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_rule(
Name='string',
MetricName='string',
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Rule': {
'RuleId': 'string',
'Name': 'string',
'MetricName': 'string',
'Predicates': [
{
'Negated': True|False,
'Type': 'IPMatch'|'ByteMatch'|'SqlInjectionMatch'|'SizeConstraint'|'XssMatch',
'DataId': 'string'
},
]
},
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example creates a rule named WAFByteHeaderRule.
response = client.create_rule(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
MetricName='WAFByteHeaderRule',
Name='WAFByteHeaderRule',
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'Rule': {
'MetricName': 'WAFByteHeaderRule',
'Name': 'WAFByteHeaderRule',
'Predicates': [
{
'DataId': 'MyByteMatchSetID',
'Negated': False,
'Type': 'ByteMatch',
},
],
'RuleId': 'WAFRule-1-Example',
},
'ResponseMetadata': {
'...': '...',
},
}
create_size_constraint_set(**kwargs)¶Creates a SizeConstraintSet . You then use UpdateSizeConstraintSet to identify the part of a web request that you want AWS WAF to check for length, such as the length of the User-Agent header or the length of the query string. For example, you can create a SizeConstraintSet that matches any requests that have a query string that is longer than 100 bytes. You can then configure AWS WAF to reject those requests.
To create and configure a SizeConstraintSet , perform the following steps:
ChangeToken parameter of a CreateSizeConstraintSet request.CreateSizeConstraintSet request.GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateSizeConstraintSet request.For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_size_constraint_set(
Name='string',
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'SizeConstraintSet': {
'SizeConstraintSetId': 'string',
'Name': 'string',
'SizeConstraints': [
{
'FieldToMatch': {
'Type': 'URI'|'QUERY_STRING'|'HEADER'|'METHOD'|'BODY',
'Data': 'string'
},
'TextTransformation': 'NONE'|'COMPRESS_WHITE_SPACE'|'HTML_ENTITY_DECODE'|'LOWERCASE'|'CMD_LINE'|'URL_DECODE',
'ComparisonOperator': 'EQ'|'NE'|'LE'|'LT'|'GE'|'GT',
'Size': 123
},
]
},
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example creates size constraint set named MySampleSizeConstraintSet.
response = client.create_size_constraint_set(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
Name='MySampleSizeConstraintSet',
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'SizeConstraintSet': {
'Name': 'MySampleSizeConstraintSet',
'SizeConstraintSetId': 'example1ds3t-46da-4fdb-b8d5-abc321j569j5',
'SizeConstraints': [
{
'ComparisonOperator': 'GT',
'FieldToMatch': {
'Type': 'QUERY_STRING',
},
'Size': 0,
'TextTransformation': 'NONE',
},
],
},
'ResponseMetadata': {
'...': '...',
},
}
create_sql_injection_match_set(**kwargs)¶Creates a SqlInjectionMatchSet , which you use to allow, block, or count requests that contain snippets of SQL code in a specified part of web requests. AWS WAF searches for character sequences that are likely to be malicious strings.
To create and configure a SqlInjectionMatchSet , perform the following steps:
ChangeToken parameter of a CreateSqlInjectionMatchSet request.CreateSqlInjectionMatchSet request.GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateSqlInjectionMatchSet request.For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_sql_injection_match_set(
Name='string',
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'SqlInjectionMatchSet': {
'SqlInjectionMatchSetId': 'string',
'Name': 'string',
'SqlInjectionMatchTuples': [
{
'FieldToMatch': {
'Type': 'URI'|'QUERY_STRING'|'HEADER'|'METHOD'|'BODY',
'Data': 'string'
},
'TextTransformation': 'NONE'|'COMPRESS_WHITE_SPACE'|'HTML_ENTITY_DECODE'|'LOWERCASE'|'CMD_LINE'|'URL_DECODE'
},
]
},
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example creates a SQL injection match set named MySQLInjectionMatchSet.
response = client.create_sql_injection_match_set(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
Name='MySQLInjectionMatchSet',
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'SqlInjectionMatchSet': {
'Name': 'MySQLInjectionMatchSet',
'SqlInjectionMatchSetId': 'example1ds3t-46da-4fdb-b8d5-abc321j569j5',
'SqlInjectionMatchTuples': [
{
'FieldToMatch': {
'Type': 'QUERY_STRING',
},
'TextTransformation': 'URL_DECODE',
},
],
},
'ResponseMetadata': {
'...': '...',
},
}
create_web_acl(**kwargs)¶Creates a WebACL , which contains the Rules that identify the CloudFront web requests that you want to allow, block, or count. AWS WAF evaluates Rules in order based on the value of Priority for each Rule .
You also specify a default action, either ALLOW or BLOCK . If a web request doesn’t match any of the Rules in a WebACL , AWS WAF responds to the request with the default action.
To create and configure a WebACL , perform the following steps:
ByteMatchSet objects and other predicates that you want to include in Rules . For more information, see CreateByteMatchSet , UpdateByteMatchSet , CreateIPSet , UpdateIPSet , CreateSqlInjectionMatchSet , and UpdateSqlInjectionMatchSet .Rules that you want to include in the WebACL . For more information, see CreateRule and UpdateRule .ChangeToken parameter of a CreateWebACL request.CreateWebACL request.GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateWebACL request.Rules that you want to include in the WebACL , to specify the default action, and to associate the WebACL with a CloudFront distribution.For more information about how to use the AWS WAF API, see the AWS WAF Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_web_acl(
Name='string',
MetricName='string',
DefaultAction={
'Type': 'BLOCK'|'ALLOW'|'COUNT'
},
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'WebACL': {
'WebACLId': 'string',
'Name': 'string',
'MetricName': 'string',
'DefaultAction': {
'Type': 'BLOCK'|'ALLOW'|'COUNT'
},
'Rules': [
{
'Priority': 123,
'RuleId': 'string',
'Action': {
'Type': 'BLOCK'|'ALLOW'|'COUNT'
},
'Type': 'REGULAR'|'RATE_BASED'
},
]
},
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example creates a web ACL named CreateExample.
response = client.create_web_acl(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
DefaultAction={
'Type': 'ALLOW',
},
MetricName='CreateExample',
Name='CreateExample',
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'WebACL': {
'DefaultAction': {
'Type': 'ALLOW',
},
'MetricName': 'CreateExample',
'Name': 'CreateExample',
'Rules': [
{
'Action': {
'Type': 'ALLOW',
},
'Priority': 1,
'RuleId': 'WAFRule-1-Example',
},
],
'WebACLId': 'example-46da-4444-5555-example',
},
'ResponseMetadata': {
'...': '...',
},
}
create_xss_match_set(**kwargs)¶Creates an XssMatchSet , which you use to allow, block, or count requests that contain cross-site scripting attacks in the specified part of web requests. AWS WAF searches for character sequences that are likely to be malicious strings.
To create and configure an XssMatchSet , perform the following steps:
ChangeToken parameter of a CreateXssMatchSet request.CreateXssMatchSet request.GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateXssMatchSet request.For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_xss_match_set(
Name='string',
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'XssMatchSet': {
'XssMatchSetId': 'string',
'Name': 'string',
'XssMatchTuples': [
{
'FieldToMatch': {
'Type': 'URI'|'QUERY_STRING'|'HEADER'|'METHOD'|'BODY',
'Data': 'string'
},
'TextTransformation': 'NONE'|'COMPRESS_WHITE_SPACE'|'HTML_ENTITY_DECODE'|'LOWERCASE'|'CMD_LINE'|'URL_DECODE'
},
]
},
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example creates an XSS match set named MySampleXssMatchSet.
response = client.create_xss_match_set(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
Name='MySampleXssMatchSet',
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'XssMatchSet': {
'Name': 'MySampleXssMatchSet',
'XssMatchSetId': 'example1ds3t-46da-4fdb-b8d5-abc321j569j5',
'XssMatchTuples': [
{
'FieldToMatch': {
'Type': 'QUERY_STRING',
},
'TextTransformation': 'URL_DECODE',
},
],
},
'ResponseMetadata': {
'...': '...',
},
}
delete_byte_match_set(**kwargs)¶Permanently deletes a ByteMatchSet . You can’t delete a ByteMatchSet if it’s still used in any Rules or if it still includes any ByteMatchTuple objects (any filters).
If you just want to remove a ByteMatchSet from a Rule , use UpdateRule .
To permanently delete a ByteMatchSet , perform the following steps:
ByteMatchSet to remove filters, if any. For more information, see UpdateByteMatchSet .ChangeToken parameter of a DeleteByteMatchSet request.DeleteByteMatchSet request.See also: AWS API Documentation
Request Syntax
response = client.delete_byte_match_set(
ByteMatchSetId='string',
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example deletes a byte match set with the ID exampleIDs3t-46da-4fdb-b8d5-abc321j569j5.
response = client.delete_byte_match_set(
ByteMatchSetId='exampleIDs3t-46da-4fdb-b8d5-abc321j569j5',
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'ResponseMetadata': {
'...': '...',
},
}
delete_ip_set(**kwargs)¶Permanently deletes an IPSet . You can’t delete an IPSet if it’s still used in any Rules or if it still includes any IP addresses.
If you just want to remove an IPSet from a Rule , use UpdateRule .
To permanently delete an IPSet from AWS WAF, perform the following steps:
IPSet to remove IP address ranges, if any. For more information, see UpdateIPSet .ChangeToken parameter of a DeleteIPSet request.DeleteIPSet request.See also: AWS API Documentation
Request Syntax
response = client.delete_ip_set(
IPSetId='string',
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example deletes an IP match set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
response = client.delete_ip_set(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
IPSetId='example1ds3t-46da-4fdb-b8d5-abc321j569j5',
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'ResponseMetadata': {
'...': '...',
},
}
delete_rate_based_rule(**kwargs)¶Permanently deletes a RateBasedRule . You can’t delete a rule if it’s still used in any WebACL objects or if it still includes any predicates, such as ByteMatchSet objects.
If you just want to remove a rule from a WebACL , use UpdateWebACL .
To permanently delete a RateBasedRule from AWS WAF, perform the following steps:
RateBasedRule to remove predicates, if any. For more information, see UpdateRateBasedRule .ChangeToken parameter of a DeleteRateBasedRule request.DeleteRateBasedRule request.See also: AWS API Documentation
Request Syntax
response = client.delete_rate_based_rule(
RuleId='string',
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
delete_rule(**kwargs)¶Permanently deletes a Rule . You can’t delete a Rule if it’s still used in any WebACL objects or if it still includes any predicates, such as ByteMatchSet objects.
If you just want to remove a Rule from a WebACL , use UpdateWebACL .
To permanently delete a Rule from AWS WAF, perform the following steps:
Rule to remove predicates, if any. For more information, see UpdateRule .ChangeToken parameter of a DeleteRule request.DeleteRule request.See also: AWS API Documentation
Request Syntax
response = client.delete_rule(
RuleId='string',
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example deletes a rule with the ID WAFRule-1-Example.
response = client.delete_rule(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
RuleId='WAFRule-1-Example',
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'ResponseMetadata': {
'...': '...',
},
}
delete_size_constraint_set(**kwargs)¶Permanently deletes a SizeConstraintSet . You can’t delete a SizeConstraintSet if it’s still used in any Rules or if it still includes any SizeConstraint objects (any filters).
If you just want to remove a SizeConstraintSet from a Rule , use UpdateRule .
To permanently delete a SizeConstraintSet , perform the following steps:
SizeConstraintSet to remove filters, if any. For more information, see UpdateSizeConstraintSet .ChangeToken parameter of a DeleteSizeConstraintSet request.DeleteSizeConstraintSet request.See also: AWS API Documentation
Request Syntax
response = client.delete_size_constraint_set(
SizeConstraintSetId='string',
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example deletes a size constraint set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
response = client.delete_size_constraint_set(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
SizeConstraintSetId='example1ds3t-46da-4fdb-b8d5-abc321j569j5',
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'ResponseMetadata': {
'...': '...',
},
}
delete_sql_injection_match_set(**kwargs)¶Permanently deletes a SqlInjectionMatchSet . You can’t delete a SqlInjectionMatchSet if it’s still used in any Rules or if it still contains any SqlInjectionMatchTuple objects.
If you just want to remove a SqlInjectionMatchSet from a Rule , use UpdateRule .
To permanently delete a SqlInjectionMatchSet from AWS WAF, perform the following steps:
SqlInjectionMatchSet to remove filters, if any. For more information, see UpdateSqlInjectionMatchSet .ChangeToken parameter of a DeleteSqlInjectionMatchSet request.DeleteSqlInjectionMatchSet request.See also: AWS API Documentation
Request Syntax
response = client.delete_sql_injection_match_set(
SqlInjectionMatchSetId='string',
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example deletes a SQL injection match set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
response = client.delete_sql_injection_match_set(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
SqlInjectionMatchSetId='example1ds3t-46da-4fdb-b8d5-abc321j569j5',
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'ResponseMetadata': {
'...': '...',
},
}
delete_web_acl(**kwargs)¶Permanently deletes a WebACL . You can’t delete a WebACL if it still contains any Rules .
To delete a WebACL , perform the following steps:
WebACL to remove Rules , if any. For more information, see UpdateWebACL .ChangeToken parameter of a DeleteWebACL request.DeleteWebACL request.See also: AWS API Documentation
Request Syntax
response = client.delete_web_acl(
WebACLId='string',
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example deletes a web ACL with the ID example-46da-4444-5555-example.
response = client.delete_web_acl(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
WebACLId='example-46da-4444-5555-example',
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'ResponseMetadata': {
'...': '...',
},
}
delete_xss_match_set(**kwargs)¶Permanently deletes an XssMatchSet . You can’t delete an XssMatchSet if it’s still used in any Rules or if it still contains any XssMatchTuple objects.
If you just want to remove an XssMatchSet from a Rule , use UpdateRule .
To permanently delete an XssMatchSet from AWS WAF, perform the following steps:
XssMatchSet to remove filters, if any. For more information, see UpdateXssMatchSet .ChangeToken parameter of a DeleteXssMatchSet request.DeleteXssMatchSet request.See also: AWS API Documentation
Request Syntax
response = client.delete_xss_match_set(
XssMatchSetId='string',
ChangeToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example deletes an XSS match set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
response = client.delete_xss_match_set(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
XssMatchSetId='example1ds3t-46da-4fdb-b8d5-abc321j569j5',
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'ResponseMetadata': {
'...': '...',
},
}
disassociate_web_acl(**kwargs)¶Removes a web ACL from the specified resource.
See also: AWS API Documentation
Request Syntax
response = client.disassociate_web_acl(
ResourceArn='string'
)
| Parameters: | ResourceArn (string) – [REQUIRED] The ARN (Amazon Resource Name) of the resource from which the web ACL is being removed. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{}
Response Structure
|
generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
| Parameters: |
|
|---|---|
| Returns: | The presigned url |
get_byte_match_set(**kwargs)¶Returns the ByteMatchSet specified by ByteMatchSetId .
See also: AWS API Documentation
Request Syntax
response = client.get_byte_match_set(
ByteMatchSetId='string'
)
| Parameters: | ByteMatchSetId (string) – [REQUIRED] The |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'ByteMatchSet': {
'ByteMatchSetId': 'string',
'Name': 'string',
'ByteMatchTuples': [
{
'FieldToMatch': {
'Type': 'URI'|'QUERY_STRING'|'HEADER'|'METHOD'|'BODY',
'Data': 'string'
},
'TargetString': b'bytes',
'TextTransformation': 'NONE'|'COMPRESS_WHITE_SPACE'|'HTML_ENTITY_DECODE'|'LOWERCASE'|'CMD_LINE'|'URL_DECODE',
'PositionalConstraint': 'EXACTLY'|'STARTS_WITH'|'ENDS_WITH'|'CONTAINS'|'CONTAINS_WORD'
},
]
}
}
Response Structure
|
Examples
The following example returns the details of a byte match set with the ID exampleIDs3t-46da-4fdb-b8d5-abc321j569j5.
response = client.get_byte_match_set(
ByteMatchSetId='exampleIDs3t-46da-4fdb-b8d5-abc321j569j5',
)
print(response)
Expected Output:
{
'ByteMatchSet': {
'ByteMatchSetId': 'exampleIDs3t-46da-4fdb-b8d5-abc321j569j5',
'ByteMatchTuples': [
{
'FieldToMatch': {
'Data': 'referer',
'Type': 'HEADER',
},
'PositionalConstraint': 'CONTAINS',
'TargetString': 'badrefer1',
'TextTransformation': 'NONE',
},
],
'Name': 'ByteMatchNameExample',
},
'ResponseMetadata': {
'...': '...',
},
}
get_change_token()¶When you want to create, update, or delete AWS WAF objects, get a change token and include the change token in the create, update, or delete request. Change tokens ensure that your application doesn’t submit conflicting requests to AWS WAF.
Each create, update, or delete request must use a unique change token. If your application submits a GetChangeToken request and then submits a second GetChangeToken request before submitting a create, update, or delete request, the second GetChangeToken request returns the same value as the first GetChangeToken request.
When you use a change token in a create, update, or delete request, the status of the change token changes to PENDING , which indicates that AWS WAF is propagating the change to all AWS WAF servers. Use GetChangeTokenStatus to determine the status of your change token.
See also: AWS API Documentation
Request Syntax
response = client.get_change_token()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example returns a change token to use for a create, update or delete operation.
response = client.get_change_token(
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'ResponseMetadata': {
'...': '...',
},
}
get_change_token_status(**kwargs)¶Returns the status of a ChangeToken that you got by calling GetChangeToken . ChangeTokenStatus is one of the following values:
PROVISIONED : You requested the change token by calling GetChangeToken , but you haven’t used it yet in a call to create, update, or delete an AWS WAF object.PENDING : AWS WAF is propagating the create, update, or delete request to all AWS WAF servers.IN_SYNC : Propagation is complete.See also: AWS API Documentation
Request Syntax
response = client.get_change_token_status(
ChangeToken='string'
)
| Parameters: | ChangeToken (string) – [REQUIRED] The change token for which you want to get the status. This change token was previously returned in the |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'ChangeTokenStatus': 'PROVISIONED'|'PENDING'|'INSYNC'
}
Response Structure
|
Examples
The following example returns the status of a change token with the ID abcd12f2-46da-4fdb-b8d5-fbd4c466928f.
response = client.get_change_token_status(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
)
print(response)
Expected Output:
{
'ChangeTokenStatus': 'PENDING',
'ResponseMetadata': {
'...': '...',
},
}
get_ip_set(**kwargs)¶Returns the IPSet that is specified by IPSetId .
See also: AWS API Documentation
Request Syntax
response = client.get_ip_set(
IPSetId='string'
)
| Parameters: | IPSetId (string) – [REQUIRED] The |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'IPSet': {
'IPSetId': 'string',
'Name': 'string',
'IPSetDescriptors': [
{
'Type': 'IPV4'|'IPV6',
'Value': 'string'
},
]
}
}
Response Structure
|
Examples
The following example returns the details of an IP match set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
response = client.get_ip_set(
IPSetId='example1ds3t-46da-4fdb-b8d5-abc321j569j5',
)
print(response)
Expected Output:
{
'IPSet': {
'IPSetDescriptors': [
{
'Type': 'IPV4',
'Value': '192.0.2.44/32',
},
],
'IPSetId': 'example1ds3t-46da-4fdb-b8d5-abc321j569j5',
'Name': 'MyIPSetFriendlyName',
},
'ResponseMetadata': {
'...': '...',
},
}
get_paginator(operation_name)¶Create a paginator for an operation.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Raises: | OperationNotPageableError – Raised if the operation is not
pageable. You can use the client.can_paginate method to
check if an operation is pageable. |
| Return type: | L{botocore.paginate.Paginator} |
| Returns: | A paginator object. |
get_rate_based_rule(**kwargs)¶Returns the RateBasedRule that is specified by the RuleId that you included in the GetRateBasedRule request.
See also: AWS API Documentation
Request Syntax
response = client.get_rate_based_rule(
RuleId='string'
)
| Parameters: | RuleId (string) – [REQUIRED] The |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'Rule': {
'RuleId': 'string',
'Name': 'string',
'MetricName': 'string',
'MatchPredicates': [
{
'Negated': True|False,
'Type': 'IPMatch'|'ByteMatch'|'SqlInjectionMatch'|'SizeConstraint'|'XssMatch',
'DataId': 'string'
},
],
'RateKey': 'IP',
'RateLimit': 123
}
}
Response Structure
|
get_rate_based_rule_managed_keys(**kwargs)¶Returns an array of IP addresses currently being blocked by the RateBasedRule that is specified by the RuleId . The maximum number of managed keys that will be blocked is 10,000. If more than 10,000 addresses exceed the rate limit, the 10,000 addresses with the highest rates will be blocked.
See also: AWS API Documentation
Request Syntax
response = client.get_rate_based_rule_managed_keys(
RuleId='string',
NextMarker='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ManagedKeys': [
'string',
],
'NextMarker': 'string'
}
Response Structure
|
get_rule(**kwargs)¶Returns the Rule that is specified by the RuleId that you included in the GetRule request.
See also: AWS API Documentation
Request Syntax
response = client.get_rule(
RuleId='string'
)
| Parameters: | RuleId (string) – [REQUIRED] The |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'Rule': {
'RuleId': 'string',
'Name': 'string',
'MetricName': 'string',
'Predicates': [
{
'Negated': True|False,
'Type': 'IPMatch'|'ByteMatch'|'SqlInjectionMatch'|'SizeConstraint'|'XssMatch',
'DataId': 'string'
},
]
}
}
Response Structure
|
Examples
The following example returns the details of a rule with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
response = client.get_rule(
RuleId='example1ds3t-46da-4fdb-b8d5-abc321j569j5',
)
print(response)
Expected Output:
{
'Rule': {
'MetricName': 'WAFByteHeaderRule',
'Name': 'WAFByteHeaderRule',
'Predicates': [
{
'DataId': 'MyByteMatchSetID',
'Negated': False,
'Type': 'ByteMatch',
},
],
'RuleId': 'example1ds3t-46da-4fdb-b8d5-abc321j569j5',
},
'ResponseMetadata': {
'...': '...',
},
}
get_sampled_requests(**kwargs)¶Gets detailed information about a specified number of requests–a sample–that AWS WAF randomly selects from among the first 5,000 requests that your AWS resource received during a time range that you choose. You can specify a sample size of up to 500 requests, and you can specify any time range in the previous three hours.
GetSampledRequestsreturns a time range, which is usually the time range that you specified. However, if your resource (such as a CloudFront distribution) received 5,000 requests before the specified time range elapsed,GetSampledRequestsreturns an updated time range. This new time range indicates the actual period during which AWS WAF selected the requests in the sample.
See also: AWS API Documentation
Request Syntax
response = client.get_sampled_requests(
WebAclId='string',
RuleId='string',
TimeWindow={
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1)
},
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'SampledRequests': [
{
'Request': {
'ClientIP': 'string',
'Country': 'string',
'URI': 'string',
'Method': 'string',
'HTTPVersion': 'string',
'Headers': [
{
'Name': 'string',
'Value': 'string'
},
]
},
'Weight': 123,
'Timestamp': datetime(2015, 1, 1),
'Action': 'string'
},
],
'PopulationSize': 123,
'TimeWindow': {
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1)
}
}
Response Structure
|
Examples
The following example returns detailed information about 100 requests –a sample– that AWS WAF randomly selects from among the first 5,000 requests that your AWS resource received between the time period 2016-09-27T15:50Z to 2016-09-27T15:50Z.
response = client.get_sampled_requests(
MaxItems=100,
RuleId='WAFRule-1-Example',
TimeWindow={
'EndTime': datetime(2016, 9, 27, 15, 50, 0, 1, 271, 0),
'StartTime': datetime(2016, 9, 27, 15, 50, 0, 1, 271, 0),
},
WebAclId='createwebacl-1472061481310',
)
print(response)
Expected Output:
{
'PopulationSize': 50,
'SampledRequests': [
{
'Action': 'BLOCK',
'Request': {
'ClientIP': '192.0.2.44',
'Country': 'US',
'HTTPVersion': 'HTTP/1.1',
'Headers': [
{
'Name': 'User-Agent',
'Value': 'BadBot ',
},
],
'Method': 'HEAD',
},
'Timestamp': datetime(2016, 9, 27, 14, 55, 0, 1, 271, 0),
'Weight': 1,
},
],
'TimeWindow': {
'EndTime': datetime(2016, 9, 27, 15, 50, 0, 1, 271, 0),
'StartTime': datetime(2016, 9, 27, 14, 50, 0, 1, 271, 0),
},
'ResponseMetadata': {
'...': '...',
},
}
get_size_constraint_set(**kwargs)¶Returns the SizeConstraintSet specified by SizeConstraintSetId .
See also: AWS API Documentation
Request Syntax
response = client.get_size_constraint_set(
SizeConstraintSetId='string'
)
| Parameters: | SizeConstraintSetId (string) – [REQUIRED] The |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'SizeConstraintSet': {
'SizeConstraintSetId': 'string',
'Name': 'string',
'SizeConstraints': [
{
'FieldToMatch': {
'Type': 'URI'|'QUERY_STRING'|'HEADER'|'METHOD'|'BODY',
'Data': 'string'
},
'TextTransformation': 'NONE'|'COMPRESS_WHITE_SPACE'|'HTML_ENTITY_DECODE'|'LOWERCASE'|'CMD_LINE'|'URL_DECODE',
'ComparisonOperator': 'EQ'|'NE'|'LE'|'LT'|'GE'|'GT',
'Size': 123
},
]
}
}
Response Structure
|
Examples
The following example returns the details of a size constraint match set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
response = client.get_size_constraint_set(
SizeConstraintSetId='example1ds3t-46da-4fdb-b8d5-abc321j569j5',
)
print(response)
Expected Output:
{
'SizeConstraintSet': {
'Name': 'MySampleSizeConstraintSet',
'SizeConstraintSetId': 'example1ds3t-46da-4fdb-b8d5-abc321j569j5',
'SizeConstraints': [
{
'ComparisonOperator': 'GT',
'FieldToMatch': {
'Type': 'QUERY_STRING',
},
'Size': 0,
'TextTransformation': 'NONE',
},
],
},
'ResponseMetadata': {
'...': '...',
},
}
get_sql_injection_match_set(**kwargs)¶Returns the SqlInjectionMatchSet that is specified by SqlInjectionMatchSetId .
See also: AWS API Documentation
Request Syntax
response = client.get_sql_injection_match_set(
SqlInjectionMatchSetId='string'
)
| Parameters: | SqlInjectionMatchSetId (string) – [REQUIRED] The |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'SqlInjectionMatchSet': {
'SqlInjectionMatchSetId': 'string',
'Name': 'string',
'SqlInjectionMatchTuples': [
{
'FieldToMatch': {
'Type': 'URI'|'QUERY_STRING'|'HEADER'|'METHOD'|'BODY',
'Data': 'string'
},
'TextTransformation': 'NONE'|'COMPRESS_WHITE_SPACE'|'HTML_ENTITY_DECODE'|'LOWERCASE'|'CMD_LINE'|'URL_DECODE'
},
]
}
}
Response Structure
|
Examples
The following example returns the details of a SQL injection match set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
response = client.get_sql_injection_match_set(
SqlInjectionMatchSetId='example1ds3t-46da-4fdb-b8d5-abc321j569j5',
)
print(response)
Expected Output:
{
'SqlInjectionMatchSet': {
'Name': 'MySQLInjectionMatchSet',
'SqlInjectionMatchSetId': 'example1ds3t-46da-4fdb-b8d5-abc321j569j5',
'SqlInjectionMatchTuples': [
{
'FieldToMatch': {
'Type': 'QUERY_STRING',
},
'TextTransformation': 'URL_DECODE',
},
],
},
'ResponseMetadata': {
'...': '...',
},
}
get_waiter(waiter_name)¶get_web_acl(**kwargs)¶Returns the WebACL that is specified by WebACLId .
See also: AWS API Documentation
Request Syntax
response = client.get_web_acl(
WebACLId='string'
)
| Parameters: | WebACLId (string) – [REQUIRED] The |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'WebACL': {
'WebACLId': 'string',
'Name': 'string',
'MetricName': 'string',
'DefaultAction': {
'Type': 'BLOCK'|'ALLOW'|'COUNT'
},
'Rules': [
{
'Priority': 123,
'RuleId': 'string',
'Action': {
'Type': 'BLOCK'|'ALLOW'|'COUNT'
},
'Type': 'REGULAR'|'RATE_BASED'
},
]
}
}
Response Structure
|
Examples
The following example returns the details of a web ACL with the ID createwebacl-1472061481310.
response = client.get_web_acl(
WebACLId='createwebacl-1472061481310',
)
print(response)
Expected Output:
{
'WebACL': {
'DefaultAction': {
'Type': 'ALLOW',
},
'MetricName': 'CreateExample',
'Name': 'CreateExample',
'Rules': [
{
'Action': {
'Type': 'ALLOW',
},
'Priority': 1,
'RuleId': 'WAFRule-1-Example',
},
],
'WebACLId': 'createwebacl-1472061481310',
},
'ResponseMetadata': {
'...': '...',
},
}
get_web_acl_for_resource(**kwargs)¶Returns the web ACL for the specified resource.
See also: AWS API Documentation
Request Syntax
response = client.get_web_acl_for_resource(
ResourceArn='string'
)
| Parameters: | ResourceArn (string) – [REQUIRED] The ARN (Amazon Resource Name) of the resource for which to get the web ACL. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'WebACLSummary': {
'WebACLId': 'string',
'Name': 'string'
}
}
Response Structure
|
get_xss_match_set(**kwargs)¶Returns the XssMatchSet that is specified by XssMatchSetId .
See also: AWS API Documentation
Request Syntax
response = client.get_xss_match_set(
XssMatchSetId='string'
)
| Parameters: | XssMatchSetId (string) – [REQUIRED] The |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'XssMatchSet': {
'XssMatchSetId': 'string',
'Name': 'string',
'XssMatchTuples': [
{
'FieldToMatch': {
'Type': 'URI'|'QUERY_STRING'|'HEADER'|'METHOD'|'BODY',
'Data': 'string'
},
'TextTransformation': 'NONE'|'COMPRESS_WHITE_SPACE'|'HTML_ENTITY_DECODE'|'LOWERCASE'|'CMD_LINE'|'URL_DECODE'
},
]
}
}
Response Structure
|
Examples
The following example returns the details of an XSS match set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
response = client.get_xss_match_set(
XssMatchSetId='example1ds3t-46da-4fdb-b8d5-abc321j569j5',
)
print(response)
Expected Output:
{
'XssMatchSet': {
'Name': 'MySampleXssMatchSet',
'XssMatchSetId': 'example1ds3t-46da-4fdb-b8d5-abc321j569j5',
'XssMatchTuples': [
{
'FieldToMatch': {
'Type': 'QUERY_STRING',
},
'TextTransformation': 'URL_DECODE',
},
],
},
'ResponseMetadata': {
'...': '...',
},
}
list_byte_match_sets(**kwargs)¶Returns an array of ByteMatchSetSummary objects.
See also: AWS API Documentation
Request Syntax
response = client.list_byte_match_sets(
NextMarker='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'NextMarker': 'string',
'ByteMatchSets': [
{
'ByteMatchSetId': 'string',
'Name': 'string'
},
]
}
Response Structure
|
list_ip_sets(**kwargs)¶Returns an array of IPSetSummary objects in the response.
See also: AWS API Documentation
Request Syntax
response = client.list_ip_sets(
NextMarker='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'NextMarker': 'string',
'IPSets': [
{
'IPSetId': 'string',
'Name': 'string'
},
]
}
Response Structure
|
Examples
The following example returns an array of up to 100 IP match sets.
response = client.list_ip_sets(
Limit=100,
)
print(response)
Expected Output:
{
'IPSets': [
{
'IPSetId': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'Name': 'MyIPSetFriendlyName',
},
],
'ResponseMetadata': {
'...': '...',
},
}
list_rate_based_rules(**kwargs)¶Returns an array of RuleSummary objects.
See also: AWS API Documentation
Request Syntax
response = client.list_rate_based_rules(
NextMarker='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'NextMarker': 'string',
'Rules': [
{
'RuleId': 'string',
'Name': 'string'
},
]
}
Response Structure
|
list_resources_for_web_acl(**kwargs)¶Returns an array of resources associated with the specified web ACL.
See also: AWS API Documentation
Request Syntax
response = client.list_resources_for_web_acl(
WebACLId='string'
)
| Parameters: | WebACLId (string) – [REQUIRED] The unique identifier (ID) of the web ACL for which to list the associated resources. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'ResourceArns': [
'string',
]
}
Response Structure
|
list_rules(**kwargs)¶Returns an array of RuleSummary objects.
See also: AWS API Documentation
Request Syntax
response = client.list_rules(
NextMarker='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'NextMarker': 'string',
'Rules': [
{
'RuleId': 'string',
'Name': 'string'
},
]
}
Response Structure
|
Examples
The following example returns an array of up to 100 rules.
response = client.list_rules(
Limit=100,
)
print(response)
Expected Output:
{
'Rules': [
{
'Name': 'WAFByteHeaderRule',
'RuleId': 'WAFRule-1-Example',
},
],
'ResponseMetadata': {
'...': '...',
},
}
list_size_constraint_sets(**kwargs)¶Returns an array of SizeConstraintSetSummary objects.
See also: AWS API Documentation
Request Syntax
response = client.list_size_constraint_sets(
NextMarker='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'NextMarker': 'string',
'SizeConstraintSets': [
{
'SizeConstraintSetId': 'string',
'Name': 'string'
},
]
}
Response Structure
|
Examples
The following example returns an array of up to 100 size contraint match sets.
response = client.list_size_constraint_sets(
Limit=100,
)
print(response)
Expected Output:
{
'SizeConstraintSets': [
{
'Name': 'MySampleSizeConstraintSet',
'SizeConstraintSetId': 'example1ds3t-46da-4fdb-b8d5-abc321j569j5',
},
],
'ResponseMetadata': {
'...': '...',
},
}
list_sql_injection_match_sets(**kwargs)¶Returns an array of SqlInjectionMatchSet objects.
See also: AWS API Documentation
Request Syntax
response = client.list_sql_injection_match_sets(
NextMarker='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'NextMarker': 'string',
'SqlInjectionMatchSets': [
{
'SqlInjectionMatchSetId': 'string',
'Name': 'string'
},
]
}
Response Structure
|
Examples
The following example returns an array of up to 100 SQL injection match sets.
response = client.list_sql_injection_match_sets(
Limit=100,
)
print(response)
Expected Output:
{
'SqlInjectionMatchSets': [
{
'Name': 'MySQLInjectionMatchSet',
'SqlInjectionMatchSetId': 'example1ds3t-46da-4fdb-b8d5-abc321j569j5',
},
],
'ResponseMetadata': {
'...': '...',
},
}
list_web_acls(**kwargs)¶Returns an array of WebACLSummary objects in the response.
See also: AWS API Documentation
Request Syntax
response = client.list_web_acls(
NextMarker='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'NextMarker': 'string',
'WebACLs': [
{
'WebACLId': 'string',
'Name': 'string'
},
]
}
Response Structure
|
Examples
The following example returns an array of up to 100 web ACLs.
response = client.list_web_acls(
Limit=100,
)
print(response)
Expected Output:
{
'WebACLs': [
{
'Name': 'WebACLexample',
'WebACLId': 'webacl-1472061481310',
},
],
'ResponseMetadata': {
'...': '...',
},
}
list_xss_match_sets(**kwargs)¶Returns an array of XssMatchSet objects.
See also: AWS API Documentation
Request Syntax
response = client.list_xss_match_sets(
NextMarker='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'NextMarker': 'string',
'XssMatchSets': [
{
'XssMatchSetId': 'string',
'Name': 'string'
},
]
}
Response Structure
|
Examples
The following example returns an array of up to 100 XSS match sets.
response = client.list_xss_match_sets(
Limit=100,
)
print(response)
Expected Output:
{
'XssMatchSets': [
{
'Name': 'MySampleXssMatchSet',
'XssMatchSetId': 'example1ds3t-46da-4fdb-b8d5-abc321j569j5',
},
],
'ResponseMetadata': {
'...': '...',
},
}
update_byte_match_set(**kwargs)¶Inserts or deletes ByteMatchTuple objects (filters) in a ByteMatchSet . For each ByteMatchTuple object, you specify the following values:
ByteMatchSetUpdate object, you delete the existing object and add a new one.User-Agent header.TargetString in the ByteMatchTuple data type.For example, you can add a ByteMatchSetUpdate object that matches web requests in which User-Agent headers contain the string BadBot . You can then configure AWS WAF to block those requests.
To create and configure a ByteMatchSet , perform the following steps:
ByteMatchSet. For more information, see CreateByteMatchSet .ChangeToken parameter of an UpdateByteMatchSet request.UpdateByteMatchSet request to specify the part of the request that you want AWS WAF to inspect (for example, the header or the URI) and the value that you want AWS WAF to watch for.For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.update_byte_match_set(
ByteMatchSetId='string',
ChangeToken='string',
Updates=[
{
'Action': 'INSERT'|'DELETE',
'ByteMatchTuple': {
'FieldToMatch': {
'Type': 'URI'|'QUERY_STRING'|'HEADER'|'METHOD'|'BODY',
'Data': 'string'
},
'TargetString': b'bytes',
'TextTransformation': 'NONE'|'COMPRESS_WHITE_SPACE'|'HTML_ENTITY_DECODE'|'LOWERCASE'|'CMD_LINE'|'URL_DECODE',
'PositionalConstraint': 'EXACTLY'|'STARTS_WITH'|'ENDS_WITH'|'CONTAINS'|'CONTAINS_WORD'
}
},
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example deletes a ByteMatchTuple object (filters) in an byte match set with the ID exampleIDs3t-46da-4fdb-b8d5-abc321j569j5.
response = client.update_byte_match_set(
ByteMatchSetId='exampleIDs3t-46da-4fdb-b8d5-abc321j569j5',
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
Updates=[
{
'Action': 'DELETE',
'ByteMatchTuple': {
'FieldToMatch': {
'Data': 'referer',
'Type': 'HEADER',
},
'PositionalConstraint': 'CONTAINS',
'TargetString': 'badrefer1',
'TextTransformation': 'NONE',
},
},
],
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'ResponseMetadata': {
'...': '...',
},
}
update_ip_set(**kwargs)¶Inserts or deletes IPSetDescriptor objects in an IPSet . For each IPSetDescriptor object, you specify the following values:
IPSetDescriptor object, you delete the existing object and add a new one.IPv4 or IPv6 .192.0.2.0/24 (for the range of IP addresses from 192.0.2.0 to 192.0.2.255 ) or 192.0.2.44/32 (for the individual IP address 192.0.2.44 ).AWS WAF supports /8, /16, /24, and /32 IP address ranges for IPv4, and /24, /32, /48, /56, /64 and /128 for IPv6. For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing .
IPv6 addresses can be represented using any of the following formats:
You use an IPSet to specify which web requests you want to allow or block based on the IP addresses that the requests originated from. For example, if you’re receiving a lot of requests from one or a small number of IP addresses and you want to block the requests, you can create an IPSet that specifies those IP addresses, and then configure AWS WAF to block the requests.
To create and configure an IPSet , perform the following steps:
ChangeToken parameter of an UpdateIPSet request.UpdateIPSet request to specify the IP addresses that you want AWS WAF to watch for.When you update an IPSet , you specify the IP addresses that you want to add and/or the IP addresses that you want to delete. If you want to change an IP address, you delete the existing IP address and add the new one.
For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.update_ip_set(
IPSetId='string',
ChangeToken='string',
Updates=[
{
'Action': 'INSERT'|'DELETE',
'IPSetDescriptor': {
'Type': 'IPV4'|'IPV6',
'Value': 'string'
}
},
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example deletes an IPSetDescriptor object in an IP match set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
response = client.update_ip_set(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
IPSetId='example1ds3t-46da-4fdb-b8d5-abc321j569j5',
Updates=[
{
'Action': 'DELETE',
'IPSetDescriptor': {
'Type': 'IPV4',
'Value': '192.0.2.44/32',
},
},
],
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'ResponseMetadata': {
'...': '...',
},
}
update_rate_based_rule(**kwargs)¶Inserts or deletes Predicate objects in a rule and updates the RateLimit in the rule.
Each Predicate object identifies a predicate, such as a ByteMatchSet or an IPSet , that specifies the web requests that you want to block or count. The RateLimit specifies the number of requests every five minutes that triggers the rule.
If you add more than one predicate to a RateBasedRule , a request must match all the predicates and exceed the RateLimit to be counted or blocked. For example, suppose you add the following to a RateBasedRule :
IPSet that matches the IP address 192.0.2.44/32ByteMatchSet that matches BadBot in the User-Agent headerFurther, you specify a RateLimit of 15,000.
You then add the RateBasedRule to a WebACL and specify that you want to block requests that satisfy the rule. For a request to be blocked, it must come from the IP address 192.0.2.44 and the User-Agent header in the request must contain the value BadBot . Further, requests that match these two conditions much be received at a rate of more than 15,000 every five minutes. If the rate drops below this limit, AWS WAF no longer blocks the requests.
As a second example, suppose you want to limit requests to a particular page on your site. To do this, you could add the following to a RateBasedRule :
ByteMatchSet with FieldToMatch of URIPositionalConstraint of STARTS_WITHTargetString of loginFurther, you specify a RateLimit of 15,000.
By adding this RateBasedRule to a WebACL , you could limit requests to your login page without affecting the rest of your site.
See also: AWS API Documentation
Request Syntax
response = client.update_rate_based_rule(
RuleId='string',
ChangeToken='string',
Updates=[
{
'Action': 'INSERT'|'DELETE',
'Predicate': {
'Negated': True|False,
'Type': 'IPMatch'|'ByteMatch'|'SqlInjectionMatch'|'SizeConstraint'|'XssMatch',
'DataId': 'string'
}
},
],
RateLimit=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
update_rule(**kwargs)¶Inserts or deletes Predicate objects in a Rule . Each Predicate object identifies a predicate, such as a ByteMatchSet or an IPSet , that specifies the web requests that you want to allow, block, or count. If you add more than one predicate to a Rule , a request must match all of the specifications to be allowed, blocked, or counted. For example, suppose you add the following to a Rule :
ByteMatchSet that matches the value BadBot in the User-Agent headerIPSet that matches the IP address 192.0.2.44You then add the Rule to a WebACL and specify that you want to block requests that satisfy the Rule . For a request to be blocked, the User-Agent header in the request must contain the value BadBot and the request must originate from the IP address 192.0.2.44.
To create and configure a Rule , perform the following steps:
Rule .Rule . See CreateRule .GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateRule request.UpdateRule request to add predicates to the Rule .WebACL that contains the Rule . See CreateWebACL .If you want to replace one ByteMatchSet or IPSet with another, you delete the existing one and add the new one.
For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.update_rule(
RuleId='string',
ChangeToken='string',
Updates=[
{
'Action': 'INSERT'|'DELETE',
'Predicate': {
'Negated': True|False,
'Type': 'IPMatch'|'ByteMatch'|'SqlInjectionMatch'|'SizeConstraint'|'XssMatch',
'DataId': 'string'
}
},
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example deletes a Predicate object in a rule with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
response = client.update_rule(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
RuleId='example1ds3t-46da-4fdb-b8d5-abc321j569j5',
Updates=[
{
'Action': 'DELETE',
'Predicate': {
'DataId': 'MyByteMatchSetID',
'Negated': False,
'Type': 'ByteMatch',
},
},
],
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'ResponseMetadata': {
'...': '...',
},
}
update_size_constraint_set(**kwargs)¶Inserts or deletes SizeConstraint objects (filters) in a SizeConstraintSet . For each SizeConstraint object, you specify the following values:
SizeConstraintSetUpdate object, you delete the existing object and add a new one.User-Agent header.8192 bytes of your request to AWS WAF.ComparisonOperator used for evaluating the selected part of the request against the specified Size , such as equals, greater than, less than, and so on.For example, you can add a SizeConstraintSetUpdate object that matches web requests in which the length of the User-Agent header is greater than 100 bytes. You can then configure AWS WAF to block those requests.
To create and configure a SizeConstraintSet , perform the following steps:
SizeConstraintSet. For more information, see CreateSizeConstraintSet .ChangeToken parameter of an UpdateSizeConstraintSet request.UpdateSizeConstraintSet request to specify the part of the request that you want AWS WAF to inspect (for example, the header or the URI) and the value that you want AWS WAF to watch for.For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.update_size_constraint_set(
SizeConstraintSetId='string',
ChangeToken='string',
Updates=[
{
'Action': 'INSERT'|'DELETE',
'SizeConstraint': {
'FieldToMatch': {
'Type': 'URI'|'QUERY_STRING'|'HEADER'|'METHOD'|'BODY',
'Data': 'string'
},
'TextTransformation': 'NONE'|'COMPRESS_WHITE_SPACE'|'HTML_ENTITY_DECODE'|'LOWERCASE'|'CMD_LINE'|'URL_DECODE',
'ComparisonOperator': 'EQ'|'NE'|'LE'|'LT'|'GE'|'GT',
'Size': 123
}
},
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example deletes a SizeConstraint object (filters) in a size constraint set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
response = client.update_size_constraint_set(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
SizeConstraintSetId='example1ds3t-46da-4fdb-b8d5-abc321j569j5',
Updates=[
{
'Action': 'DELETE',
'SizeConstraint': {
'ComparisonOperator': 'GT',
'FieldToMatch': {
'Type': 'QUERY_STRING',
},
'Size': 0,
'TextTransformation': 'NONE',
},
},
],
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'ResponseMetadata': {
'...': '...',
},
}
update_sql_injection_match_set(**kwargs)¶Inserts or deletes SqlInjectionMatchTuple objects (filters) in a SqlInjectionMatchSet . For each SqlInjectionMatchTuple object, you specify the following values:
Action : Whether to insert the object into or delete the object from the array. To change a SqlInjectionMatchTuple , you delete the existing object and add a new one.FieldToMatch : The part of web requests that you want AWS WAF to inspect and, if you want AWS WAF to inspect a header, the name of the header.TextTransformation : Which text transformation, if any, to perform on the web request before inspecting the request for snippets of malicious SQL code.You use SqlInjectionMatchSet objects to specify which CloudFront requests you want to allow, block, or count. For example, if you’re receiving requests that contain snippets of SQL code in the query string and you want to block the requests, you can create a SqlInjectionMatchSet with the applicable settings, and then configure AWS WAF to block the requests.
To create and configure a SqlInjectionMatchSet , perform the following steps:
ChangeToken parameter of an UpdateIPSet request.UpdateSqlInjectionMatchSet request to specify the parts of web requests that you want AWS WAF to inspect for snippets of SQL code.For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.update_sql_injection_match_set(
SqlInjectionMatchSetId='string',
ChangeToken='string',
Updates=[
{
'Action': 'INSERT'|'DELETE',
'SqlInjectionMatchTuple': {
'FieldToMatch': {
'Type': 'URI'|'QUERY_STRING'|'HEADER'|'METHOD'|'BODY',
'Data': 'string'
},
'TextTransformation': 'NONE'|'COMPRESS_WHITE_SPACE'|'HTML_ENTITY_DECODE'|'LOWERCASE'|'CMD_LINE'|'URL_DECODE'
}
},
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example deletes a SqlInjectionMatchTuple object (filters) in a SQL injection match set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
response = client.update_sql_injection_match_set(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
SqlInjectionMatchSetId='example1ds3t-46da-4fdb-b8d5-abc321j569j5',
Updates=[
{
'Action': 'DELETE',
'SqlInjectionMatchTuple': {
'FieldToMatch': {
'Type': 'QUERY_STRING',
},
'TextTransformation': 'URL_DECODE',
},
},
],
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'ResponseMetadata': {
'...': '...',
},
}
update_web_acl(**kwargs)¶Inserts or deletes ActivatedRule objects in a WebACL . Each Rule identifies web requests that you want to allow, block, or count. When you update a WebACL , you specify the following values:
WebACL , either ALLOW or BLOCK . AWS WAF performs the default action if a request doesn’t match the criteria in any of the Rules in a WebACL .Rules that you want to add and/or delete. If you want to replace one Rule with another, you delete the existing Rule and add the new one.Rule , whether you want AWS WAF to allow requests, block requests, or count requests that match the conditions in the Rule .Rules in a WebACL . If you add more than one Rule to a WebACL , AWS WAF evaluates each request against the Rules in order based on the value of Priority . (The Rule that has the lowest value for Priority is evaluated first.) When a web request matches all of the predicates (such as ByteMatchSets and IPSets ) in a Rule , AWS WAF immediately takes the corresponding action, allow or block, and doesn’t evaluate the request against the remaining Rules in the WebACL , if any.To create and configure a WebACL , perform the following steps:
Rules . For more information, see CreateByteMatchSet , UpdateByteMatchSet , CreateIPSet , UpdateIPSet , CreateSqlInjectionMatchSet , and UpdateSqlInjectionMatchSet .Rules that you want to include in the WebACL . For more information, see CreateRule and UpdateRule .WebACL . See CreateWebACL .GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateWebACL request.UpdateWebACL request to specify the Rules that you want to include in the WebACL , to specify the default action, and to associate the WebACL with a CloudFront distribution.Be aware that if you try to add a RATE_BASED rule to a web ACL without setting the rule type when first creating the rule, the UpdateWebACL request will fail because the request tries to add a REGULAR rule (the default rule type) with the specified ID, which does not exist.
For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.update_web_acl(
WebACLId='string',
ChangeToken='string',
Updates=[
{
'Action': 'INSERT'|'DELETE',
'ActivatedRule': {
'Priority': 123,
'RuleId': 'string',
'Action': {
'Type': 'BLOCK'|'ALLOW'|'COUNT'
},
'Type': 'REGULAR'|'RATE_BASED'
}
},
],
DefaultAction={
'Type': 'BLOCK'|'ALLOW'|'COUNT'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example deletes an ActivatedRule object in a WebACL with the ID webacl-1472061481310.
response = client.update_web_acl(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
DefaultAction={
'Type': 'ALLOW',
},
Updates=[
{
'Action': 'DELETE',
'ActivatedRule': {
'Action': {
'Type': 'ALLOW',
},
'Priority': 1,
'RuleId': 'WAFRule-1-Example',
},
},
],
WebACLId='webacl-1472061481310',
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'ResponseMetadata': {
'...': '...',
},
}
update_xss_match_set(**kwargs)¶Inserts or deletes XssMatchTuple objects (filters) in an XssMatchSet . For each XssMatchTuple object, you specify the following values:
Action : Whether to insert the object into or delete the object from the array. To change a XssMatchTuple , you delete the existing object and add a new one.FieldToMatch : The part of web requests that you want AWS WAF to inspect and, if you want AWS WAF to inspect a header, the name of the header.TextTransformation : Which text transformation, if any, to perform on the web request before inspecting the request for cross-site scripting attacks.You use XssMatchSet objects to specify which CloudFront requests you want to allow, block, or count. For example, if you’re receiving requests that contain cross-site scripting attacks in the request body and you want to block the requests, you can create an XssMatchSet with the applicable settings, and then configure AWS WAF to block the requests.
To create and configure an XssMatchSet , perform the following steps:
ChangeToken parameter of an UpdateIPSet request.UpdateXssMatchSet request to specify the parts of web requests that you want AWS WAF to inspect for cross-site scripting attacks.For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .
See also: AWS API Documentation
Request Syntax
response = client.update_xss_match_set(
XssMatchSetId='string',
ChangeToken='string',
Updates=[
{
'Action': 'INSERT'|'DELETE',
'XssMatchTuple': {
'FieldToMatch': {
'Type': 'URI'|'QUERY_STRING'|'HEADER'|'METHOD'|'BODY',
'Data': 'string'
},
'TextTransformation': 'NONE'|'COMPRESS_WHITE_SPACE'|'HTML_ENTITY_DECODE'|'LOWERCASE'|'CMD_LINE'|'URL_DECODE'
}
},
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ChangeToken': 'string'
}
Response Structure
|
Examples
The following example deletes an XssMatchTuple object (filters) in an XssMatchSet with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
response = client.update_xss_match_set(
ChangeToken='abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
Updates=[
{
'Action': 'DELETE',
'XssMatchTuple': {
'FieldToMatch': {
'Type': 'QUERY_STRING',
},
'TextTransformation': 'URL_DECODE',
},
},
],
XssMatchSetId='example1ds3t-46da-4fdb-b8d5-abc321j569j5',
)
print(response)
Expected Output:
{
'ChangeToken': 'abcd12f2-46da-4fdb-b8d5-fbd4c466928f',
'ResponseMetadata': {
'...': '...',
},
}
The available paginators are: