rule_groups
Creates, updates, deletes, gets or lists a rule_groups resource.
Overview
| Name | rule_groups |
| Type | Resource |
| Id | aws.wafv2.rule_groups |
Fields
The following fields are returned by SELECT queries:
- list_rule_groups
- get_rule_group
| Name | Datatype | Description |
|---|---|---|
next_marker | string | When you request a list of objects with a Limit setting, if the number of objects that are still available for retrieval exceeds the limit, WAF returns a NextMarker value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request. (pattern: <code>.\S.</code>) |
rule_groups | array | Array of rule groups. If you specified a Limit in your request, this might not be the full list. |
| Name | Datatype | Description |
|---|---|---|
lock_token | string | A token used for optimistic locking. WAF returns a token to your get and list requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like update and delete. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a WAFOptimisticLockException. If this happens, perform another get, and use the new token returned by that operation. (pattern: <code>^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$</code>) |
rule_group | object | A rule group defines a collection of rules to inspect and control web requests that you can use in a WebACL. When you create a rule group, you define an immutable capacity limit. If you update a rule group, you must stay within the capacity. This allows others to reuse the rule group with confidence in its capacity requirements. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_rule_groups | select | region | Retrieves an array of RuleGroupSummary objects for the rule groups that you manage. | |
get_rule_group | select | region | Retrieves the specified RuleGroup. | |
create_rule_group | insert | region, Name, Scope, Capacity, VisibilityConfig | Creates a RuleGroup per the specifications provided. A rule group defines a collection of rules to inspect and control web requests that you can use in a WebACL. When you create a rule group, you define an immutable capacity limit. If you update a rule group, you must stay within the capacity. This allows others to reuse the rule group with confidence in its capacity requirements. | |
update_rule_group | update | region, Name, Scope, Id, VisibilityConfig, LockToken | Updates the specified RuleGroup. This operation completely replaces the mutable specifications that you already have for the rule group with the ones that you provide to this call. To modify a rule group, do the following: Retrieve it by calling GetRuleGroup Update its settings as needed Provide the complete rule group specification to this call A rule group defines a collection of rules to inspect and control web requests that you can use in a WebACL. When you create a rule group, you define an immutable capacity limit. If you update a rule group, you must stay within the capacity. This allows others to reuse the rule group with confidence in its capacity requirements. Temporary inconsistencies during updates When you create or change a web ACL or other WAF resources, the changes take a small amount of time to propagate to all areas where the resources are stored. The propagation time can be from a few seconds to a number of minutes. The following are examples of the temporary inconsistencies that you might notice during change propagation: After you create a web ACL, if you try to associate it with a resource, you might get an exception indicating that the web ACL is unavailable. After you add a rule group to a web ACL, the new rule group rules might be in effect in one area where the web ACL is used and not in another. After you change a rule action setting, you might see the old action in some places and the new action in others. After you add an IP address to an IP set that is in use in a blocking rule, the new address might be blocked in one area while still allowed in another. | |
delete_rule_group | delete | region | Deletes the specified RuleGroup. | |
delete_firewall_manager_rule_groups | delete | region | Deletes all rule groups that are managed by Firewall Manager from the specified WebACL. You can only use this if ManagedByFirewallManager and RetrofittedByFirewallManager are both false in the web ACL. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- list_rule_groups
- get_rule_group
Retrieves an array of RuleGroupSummary objects for the rule groups that you manage.
SELECT
next_marker,
rule_groups
FROM aws.wafv2.rule_groups
WHERE region = '{{ region }}' -- required
;
Retrieves the specified RuleGroup.
SELECT
lock_token,
rule_group
FROM aws.wafv2.rule_groups
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_rule_group
- Manifest
Creates a RuleGroup per the specifications provided. A rule group defines a collection of rules to inspect and control web requests that you can use in a WebACL. When you create a rule group, you define an immutable capacity limit. If you update a rule group, you must stay within the capacity. This allows others to reuse the rule group with confidence in its capacity requirements.
INSERT INTO aws.wafv2.rule_groups (
Name,
Scope,
Capacity,
Description,
Rules,
VisibilityConfig,
Tags,
CustomResponseBodies,
MonetizationConfig,
region
)
SELECT
'{{ Name }}' /* required */,
'{{ Scope }}' /* required */,
{{ Capacity }} /* required */,
'{{ Description }}',
'{{ Rules }}',
'{{ VisibilityConfig }}' /* required */,
'{{ Tags }}',
'{{ CustomResponseBodies }}',
'{{ MonetizationConfig }}',
'{{ region }}'
RETURNING
summary
;
# Description fields are for documentation purposes
- name: rule_groups
props:
- name: region
value: "{{ region }}"
description: Required parameter for the rule_groups resource.
- name: Name
value: "{{ Name }}"
description: |
The name of the rule group. You cannot change the name of a rule group after you create it.
- name: Scope
value: "{{ Scope }}"
description: |
Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use CLOUDFRONT. To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows: CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT --region=us-east-1. API and SDKs - For all calls, use the Region endpoint us-east-1.
valid_values: ['CLOUDFRONT', 'REGIONAL']
- name: Capacity
value: {{ Capacity }}
description: |
The web ACL capacity units (WCUs) required for this rule group. When you create your own rule group, you define this, and you cannot change it after creation. When you add or modify the rules in a rule group, WAF enforces this limit. You can check the capacity for a set of rules using CheckCapacity. WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. 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. For more information, see WAF web ACL capacity units (WCU) in the WAF Developer Guide.
- name: Description
value: "{{ Description }}"
description: |
A description of the rule group that helps with identification.
- name: Rules
description: |
The Rule statements used to identify the web requests that you want to manage. Each rule includes one top-level statement that WAF uses to identify matching web requests, and parameters that govern how WAF handles them.
value:
- Name: "{{ Name }}"
Priority: {{ Priority }}
Statement:
ByteMatchStatement:
SearchString: "{{ SearchString }}"
FieldToMatch:
SingleHeader:
Name: "{{ Name }}"
SingleQueryArgument:
Name: "{{ Name }}"
AllQueryArguments: "{{ AllQueryArguments }}"
UriPath: "{{ UriPath }}"
QueryString: "{{ QueryString }}"
Body:
OversizeHandling: "{{ OversizeHandling }}"
Method: "{{ Method }}"
JsonBody:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
InvalidFallbackBehavior: "{{ InvalidFallbackBehavior }}"
OversizeHandling: "{{ OversizeHandling }}"
Headers:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
OversizeHandling: "{{ OversizeHandling }}"
Cookies:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
OversizeHandling: "{{ OversizeHandling }}"
HeaderOrder:
OversizeHandling: "{{ OversizeHandling }}"
JA3Fingerprint:
FallbackBehavior: "{{ FallbackBehavior }}"
JA4Fingerprint:
FallbackBehavior: "{{ FallbackBehavior }}"
UriFragment:
FallbackBehavior: "{{ FallbackBehavior }}"
TextTransformations:
- Priority: {{ Priority }}
Type: "{{ Type }}"
PreParseTextTransformations:
- Priority: {{ Priority }}
Type: "{{ Type }}"
PositionalConstraint: "{{ PositionalConstraint }}"
SqliMatchStatement:
FieldToMatch:
SingleHeader:
Name: "{{ Name }}"
SingleQueryArgument:
Name: "{{ Name }}"
AllQueryArguments: "{{ AllQueryArguments }}"
UriPath: "{{ UriPath }}"
QueryString: "{{ QueryString }}"
Body:
OversizeHandling: "{{ OversizeHandling }}"
Method: "{{ Method }}"
JsonBody:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
InvalidFallbackBehavior: "{{ InvalidFallbackBehavior }}"
OversizeHandling: "{{ OversizeHandling }}"
Headers:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
OversizeHandling: "{{ OversizeHandling }}"
Cookies:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
OversizeHandling: "{{ OversizeHandling }}"
HeaderOrder:
OversizeHandling: "{{ OversizeHandling }}"
JA3Fingerprint:
FallbackBehavior: "{{ FallbackBehavior }}"
JA4Fingerprint:
FallbackBehavior: "{{ FallbackBehavior }}"
UriFragment:
FallbackBehavior: "{{ FallbackBehavior }}"
TextTransformations:
- Priority: {{ Priority }}
Type: "{{ Type }}"
PreParseTextTransformations:
- Priority: {{ Priority }}
Type: "{{ Type }}"
SensitivityLevel: "{{ SensitivityLevel }}"
XssMatchStatement:
FieldToMatch:
SingleHeader:
Name: "{{ Name }}"
SingleQueryArgument:
Name: "{{ Name }}"
AllQueryArguments: "{{ AllQueryArguments }}"
UriPath: "{{ UriPath }}"
QueryString: "{{ QueryString }}"
Body:
OversizeHandling: "{{ OversizeHandling }}"
Method: "{{ Method }}"
JsonBody:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
InvalidFallbackBehavior: "{{ InvalidFallbackBehavior }}"
OversizeHandling: "{{ OversizeHandling }}"
Headers:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
OversizeHandling: "{{ OversizeHandling }}"
Cookies:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
OversizeHandling: "{{ OversizeHandling }}"
HeaderOrder:
OversizeHandling: "{{ OversizeHandling }}"
JA3Fingerprint:
FallbackBehavior: "{{ FallbackBehavior }}"
JA4Fingerprint:
FallbackBehavior: "{{ FallbackBehavior }}"
UriFragment:
FallbackBehavior: "{{ FallbackBehavior }}"
TextTransformations:
- Priority: {{ Priority }}
Type: "{{ Type }}"
PreParseTextTransformations:
- Priority: {{ Priority }}
Type: "{{ Type }}"
SizeConstraintStatement:
FieldToMatch:
SingleHeader:
Name: "{{ Name }}"
SingleQueryArgument:
Name: "{{ Name }}"
AllQueryArguments: "{{ AllQueryArguments }}"
UriPath: "{{ UriPath }}"
QueryString: "{{ QueryString }}"
Body:
OversizeHandling: "{{ OversizeHandling }}"
Method: "{{ Method }}"
JsonBody:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
InvalidFallbackBehavior: "{{ InvalidFallbackBehavior }}"
OversizeHandling: "{{ OversizeHandling }}"
Headers:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
OversizeHandling: "{{ OversizeHandling }}"
Cookies:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
OversizeHandling: "{{ OversizeHandling }}"
HeaderOrder:
OversizeHandling: "{{ OversizeHandling }}"
JA3Fingerprint:
FallbackBehavior: "{{ FallbackBehavior }}"
JA4Fingerprint:
FallbackBehavior: "{{ FallbackBehavior }}"
UriFragment:
FallbackBehavior: "{{ FallbackBehavior }}"
ComparisonOperator: "{{ ComparisonOperator }}"
Size: {{ Size }}
TextTransformations:
- Priority: {{ Priority }}
Type: "{{ Type }}"
PreParseTextTransformations:
- Priority: {{ Priority }}
Type: "{{ Type }}"
GeoMatchStatement:
CountryCodes:
- "{{ CountryCodes }}"
ForwardedIPConfig:
HeaderName: "{{ HeaderName }}"
FallbackBehavior: "{{ FallbackBehavior }}"
RuleGroupReferenceStatement:
ARN: "{{ ARN }}"
ExcludedRules:
- Name: "{{ Name }}"
RuleActionOverrides:
- Name: "{{ Name }}"
ActionToUse:
Block: "{{ Block }}"
Allow: "{{ Allow }}"
Count: "{{ Count }}"
Captcha: "{{ Captcha }}"
Challenge: "{{ Challenge }}"
Monetize: "{{ Monetize }}"
IPSetReferenceStatement:
ARN: "{{ ARN }}"
IPSetForwardedIPConfig:
HeaderName: "{{ HeaderName }}"
FallbackBehavior: "{{ FallbackBehavior }}"
Position: "{{ Position }}"
RegexPatternSetReferenceStatement:
ARN: "{{ ARN }}"
FieldToMatch:
SingleHeader:
Name: "{{ Name }}"
SingleQueryArgument:
Name: "{{ Name }}"
AllQueryArguments: "{{ AllQueryArguments }}"
UriPath: "{{ UriPath }}"
QueryString: "{{ QueryString }}"
Body:
OversizeHandling: "{{ OversizeHandling }}"
Method: "{{ Method }}"
JsonBody:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
InvalidFallbackBehavior: "{{ InvalidFallbackBehavior }}"
OversizeHandling: "{{ OversizeHandling }}"
Headers:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
OversizeHandling: "{{ OversizeHandling }}"
Cookies:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
OversizeHandling: "{{ OversizeHandling }}"
HeaderOrder:
OversizeHandling: "{{ OversizeHandling }}"
JA3Fingerprint:
FallbackBehavior: "{{ FallbackBehavior }}"
JA4Fingerprint:
FallbackBehavior: "{{ FallbackBehavior }}"
UriFragment:
FallbackBehavior: "{{ FallbackBehavior }}"
TextTransformations:
- Priority: {{ Priority }}
Type: "{{ Type }}"
PreParseTextTransformations:
- Priority: {{ Priority }}
Type: "{{ Type }}"
RateBasedStatement:
Limit: {{ Limit }}
EvaluationWindowSec: {{ EvaluationWindowSec }}
AggregateKeyType: "{{ AggregateKeyType }}"
ScopeDownStatement:
ByteMatchStatement:
SearchString: "{{ SearchString }}"
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
PositionalConstraint: "{{ PositionalConstraint }}"
SqliMatchStatement:
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
SensitivityLevel: "{{ SensitivityLevel }}"
XssMatchStatement:
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
SizeConstraintStatement:
FieldToMatch: "{{ FieldToMatch }}"
ComparisonOperator: "{{ ComparisonOperator }}"
Size: {{ Size }}
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
GeoMatchStatement:
CountryCodes: "{{ CountryCodes }}"
ForwardedIPConfig: "{{ ForwardedIPConfig }}"
RuleGroupReferenceStatement:
ARN: "{{ ARN }}"
ExcludedRules: "{{ ExcludedRules }}"
RuleActionOverrides: "{{ RuleActionOverrides }}"
IPSetReferenceStatement:
ARN: "{{ ARN }}"
IPSetForwardedIPConfig: "{{ IPSetForwardedIPConfig }}"
RegexPatternSetReferenceStatement:
ARN: "{{ ARN }}"
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
RateBasedStatement:
Limit: {{ Limit }}
EvaluationWindowSec: {{ EvaluationWindowSec }}
AggregateKeyType: "{{ AggregateKeyType }}"
ScopeDownStatement: "{{ ScopeDownStatement }}"
ForwardedIPConfig: "{{ ForwardedIPConfig }}"
CustomKeys: "{{ CustomKeys }}"
AndStatement:
Statements: "{{ Statements }}"
OrStatement:
Statements: "{{ Statements }}"
NotStatement:
Statement: "{{ Statement }}"
ManagedRuleGroupStatement:
VendorName: "{{ VendorName }}"
Name: "{{ Name }}"
Version: "{{ Version }}"
ExcludedRules: "{{ ExcludedRules }}"
ScopeDownStatement: "{{ ScopeDownStatement }}"
ManagedRuleGroupConfigs: "{{ ManagedRuleGroupConfigs }}"
RuleActionOverrides: "{{ RuleActionOverrides }}"
LabelMatchStatement:
Scope: "{{ Scope }}"
Key: "{{ Key }}"
RegexMatchStatement:
RegexString: "{{ RegexString }}"
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
AsnMatchStatement:
AsnList: "{{ AsnList }}"
ForwardedIPConfig: "{{ ForwardedIPConfig }}"
ForwardedIPConfig:
HeaderName: "{{ HeaderName }}"
FallbackBehavior: "{{ FallbackBehavior }}"
CustomKeys:
- Header:
Name: "{{ Name }}"
TextTransformations: "{{ TextTransformations }}"
Cookie:
Name: "{{ Name }}"
TextTransformations: "{{ TextTransformations }}"
QueryArgument:
Name: "{{ Name }}"
TextTransformations: "{{ TextTransformations }}"
QueryString:
TextTransformations: "{{ TextTransformations }}"
HTTPMethod: "{{ HTTPMethod }}"
ForwardedIP: "{{ ForwardedIP }}"
IP: "{{ IP }}"
LabelNamespace:
Namespace: "{{ Namespace }}"
UriPath:
TextTransformations: "{{ TextTransformations }}"
JA3Fingerprint:
FallbackBehavior: "{{ FallbackBehavior }}"
JA4Fingerprint:
FallbackBehavior: "{{ FallbackBehavior }}"
ASN: "{{ ASN }}"
AndStatement:
Statements:
- ByteMatchStatement:
SearchString: "{{ SearchString }}"
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
PositionalConstraint: "{{ PositionalConstraint }}"
SqliMatchStatement:
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
SensitivityLevel: "{{ SensitivityLevel }}"
XssMatchStatement:
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
SizeConstraintStatement:
FieldToMatch: "{{ FieldToMatch }}"
ComparisonOperator: "{{ ComparisonOperator }}"
Size: {{ Size }}
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
GeoMatchStatement:
CountryCodes: "{{ CountryCodes }}"
ForwardedIPConfig: "{{ ForwardedIPConfig }}"
RuleGroupReferenceStatement:
ARN: "{{ ARN }}"
ExcludedRules: "{{ ExcludedRules }}"
RuleActionOverrides: "{{ RuleActionOverrides }}"
IPSetReferenceStatement:
ARN: "{{ ARN }}"
IPSetForwardedIPConfig: "{{ IPSetForwardedIPConfig }}"
RegexPatternSetReferenceStatement:
ARN: "{{ ARN }}"
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
RateBasedStatement:
Limit: {{ Limit }}
EvaluationWindowSec: {{ EvaluationWindowSec }}
AggregateKeyType: "{{ AggregateKeyType }}"
ScopeDownStatement: "{{ ScopeDownStatement }}"
ForwardedIPConfig: "{{ ForwardedIPConfig }}"
CustomKeys: "{{ CustomKeys }}"
AndStatement:
Statements: "{{ Statements }}"
OrStatement:
Statements: "{{ Statements }}"
NotStatement:
Statement: "{{ Statement }}"
ManagedRuleGroupStatement:
VendorName: "{{ VendorName }}"
Name: "{{ Name }}"
Version: "{{ Version }}"
ExcludedRules: "{{ ExcludedRules }}"
ScopeDownStatement: "{{ ScopeDownStatement }}"
ManagedRuleGroupConfigs: "{{ ManagedRuleGroupConfigs }}"
RuleActionOverrides: "{{ RuleActionOverrides }}"
LabelMatchStatement:
Scope: "{{ Scope }}"
Key: "{{ Key }}"
RegexMatchStatement:
RegexString: "{{ RegexString }}"
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
AsnMatchStatement:
AsnList: "{{ AsnList }}"
ForwardedIPConfig: "{{ ForwardedIPConfig }}"
OrStatement:
Statements:
- ByteMatchStatement:
SearchString: "{{ SearchString }}"
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
PositionalConstraint: "{{ PositionalConstraint }}"
SqliMatchStatement:
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
SensitivityLevel: "{{ SensitivityLevel }}"
XssMatchStatement:
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
SizeConstraintStatement:
FieldToMatch: "{{ FieldToMatch }}"
ComparisonOperator: "{{ ComparisonOperator }}"
Size: {{ Size }}
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
GeoMatchStatement:
CountryCodes: "{{ CountryCodes }}"
ForwardedIPConfig: "{{ ForwardedIPConfig }}"
RuleGroupReferenceStatement:
ARN: "{{ ARN }}"
ExcludedRules: "{{ ExcludedRules }}"
RuleActionOverrides: "{{ RuleActionOverrides }}"
IPSetReferenceStatement:
ARN: "{{ ARN }}"
IPSetForwardedIPConfig: "{{ IPSetForwardedIPConfig }}"
RegexPatternSetReferenceStatement:
ARN: "{{ ARN }}"
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
RateBasedStatement:
Limit: {{ Limit }}
EvaluationWindowSec: {{ EvaluationWindowSec }}
AggregateKeyType: "{{ AggregateKeyType }}"
ScopeDownStatement: "{{ ScopeDownStatement }}"
ForwardedIPConfig: "{{ ForwardedIPConfig }}"
CustomKeys: "{{ CustomKeys }}"
AndStatement:
Statements: "{{ Statements }}"
OrStatement:
Statements: "{{ Statements }}"
NotStatement:
Statement: "{{ Statement }}"
ManagedRuleGroupStatement:
VendorName: "{{ VendorName }}"
Name: "{{ Name }}"
Version: "{{ Version }}"
ExcludedRules: "{{ ExcludedRules }}"
ScopeDownStatement: "{{ ScopeDownStatement }}"
ManagedRuleGroupConfigs: "{{ ManagedRuleGroupConfigs }}"
RuleActionOverrides: "{{ RuleActionOverrides }}"
LabelMatchStatement:
Scope: "{{ Scope }}"
Key: "{{ Key }}"
RegexMatchStatement:
RegexString: "{{ RegexString }}"
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
AsnMatchStatement:
AsnList: "{{ AsnList }}"
ForwardedIPConfig: "{{ ForwardedIPConfig }}"
NotStatement:
Statement:
ByteMatchStatement:
SearchString: "{{ SearchString }}"
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
PositionalConstraint: "{{ PositionalConstraint }}"
SqliMatchStatement:
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
SensitivityLevel: "{{ SensitivityLevel }}"
XssMatchStatement:
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
SizeConstraintStatement:
FieldToMatch: "{{ FieldToMatch }}"
ComparisonOperator: "{{ ComparisonOperator }}"
Size: {{ Size }}
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
GeoMatchStatement:
CountryCodes: "{{ CountryCodes }}"
ForwardedIPConfig: "{{ ForwardedIPConfig }}"
RuleGroupReferenceStatement:
ARN: "{{ ARN }}"
ExcludedRules: "{{ ExcludedRules }}"
RuleActionOverrides: "{{ RuleActionOverrides }}"
IPSetReferenceStatement:
ARN: "{{ ARN }}"
IPSetForwardedIPConfig: "{{ IPSetForwardedIPConfig }}"
RegexPatternSetReferenceStatement:
ARN: "{{ ARN }}"
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
RateBasedStatement:
Limit: {{ Limit }}
EvaluationWindowSec: {{ EvaluationWindowSec }}
AggregateKeyType: "{{ AggregateKeyType }}"
ScopeDownStatement: "{{ ScopeDownStatement }}"
ForwardedIPConfig: "{{ ForwardedIPConfig }}"
CustomKeys: "{{ CustomKeys }}"
AndStatement:
Statements: "{{ Statements }}"
OrStatement:
Statements: "{{ Statements }}"
NotStatement:
Statement: "{{ Statement }}"
ManagedRuleGroupStatement:
VendorName: "{{ VendorName }}"
Name: "{{ Name }}"
Version: "{{ Version }}"
ExcludedRules: "{{ ExcludedRules }}"
ScopeDownStatement: "{{ ScopeDownStatement }}"
ManagedRuleGroupConfigs: "{{ ManagedRuleGroupConfigs }}"
RuleActionOverrides: "{{ RuleActionOverrides }}"
LabelMatchStatement:
Scope: "{{ Scope }}"
Key: "{{ Key }}"
RegexMatchStatement:
RegexString: "{{ RegexString }}"
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
AsnMatchStatement:
AsnList: "{{ AsnList }}"
ForwardedIPConfig: "{{ ForwardedIPConfig }}"
ManagedRuleGroupStatement:
VendorName: "{{ VendorName }}"
Name: "{{ Name }}"
Version: "{{ Version }}"
ExcludedRules:
- Name: "{{ Name }}"
ScopeDownStatement:
ByteMatchStatement:
SearchString: "{{ SearchString }}"
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
PositionalConstraint: "{{ PositionalConstraint }}"
SqliMatchStatement:
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
SensitivityLevel: "{{ SensitivityLevel }}"
XssMatchStatement:
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
SizeConstraintStatement:
FieldToMatch: "{{ FieldToMatch }}"
ComparisonOperator: "{{ ComparisonOperator }}"
Size: {{ Size }}
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
GeoMatchStatement:
CountryCodes: "{{ CountryCodes }}"
ForwardedIPConfig: "{{ ForwardedIPConfig }}"
RuleGroupReferenceStatement:
ARN: "{{ ARN }}"
ExcludedRules: "{{ ExcludedRules }}"
RuleActionOverrides: "{{ RuleActionOverrides }}"
IPSetReferenceStatement:
ARN: "{{ ARN }}"
IPSetForwardedIPConfig: "{{ IPSetForwardedIPConfig }}"
RegexPatternSetReferenceStatement:
ARN: "{{ ARN }}"
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
RateBasedStatement:
Limit: {{ Limit }}
EvaluationWindowSec: {{ EvaluationWindowSec }}
AggregateKeyType: "{{ AggregateKeyType }}"
ScopeDownStatement: "{{ ScopeDownStatement }}"
ForwardedIPConfig: "{{ ForwardedIPConfig }}"
CustomKeys: "{{ CustomKeys }}"
AndStatement:
Statements: "{{ Statements }}"
OrStatement:
Statements: "{{ Statements }}"
NotStatement:
Statement: "{{ Statement }}"
ManagedRuleGroupStatement:
VendorName: "{{ VendorName }}"
Name: "{{ Name }}"
Version: "{{ Version }}"
ExcludedRules: "{{ ExcludedRules }}"
ScopeDownStatement: "{{ ScopeDownStatement }}"
ManagedRuleGroupConfigs: "{{ ManagedRuleGroupConfigs }}"
RuleActionOverrides: "{{ RuleActionOverrides }}"
LabelMatchStatement:
Scope: "{{ Scope }}"
Key: "{{ Key }}"
RegexMatchStatement:
RegexString: "{{ RegexString }}"
FieldToMatch: "{{ FieldToMatch }}"
TextTransformations: "{{ TextTransformations }}"
PreParseTextTransformations: "{{ PreParseTextTransformations }}"
AsnMatchStatement:
AsnList: "{{ AsnList }}"
ForwardedIPConfig: "{{ ForwardedIPConfig }}"
ManagedRuleGroupConfigs:
- LoginPath: "{{ LoginPath }}"
PayloadType: "{{ PayloadType }}"
UsernameField:
Identifier: "{{ Identifier }}"
PasswordField:
Identifier: "{{ Identifier }}"
AWSManagedRulesBotControlRuleSet:
InspectionLevel: "{{ InspectionLevel }}"
EnableMachineLearning: {{ EnableMachineLearning }}
AWSManagedRulesATPRuleSet:
LoginPath: "{{ LoginPath }}"
RequestInspection: "{{ RequestInspection }}"
ResponseInspection: "{{ ResponseInspection }}"
EnableRegexInPath: {{ EnableRegexInPath }}
AWSManagedRulesACFPRuleSet:
CreationPath: "{{ CreationPath }}"
RegistrationPagePath: "{{ RegistrationPagePath }}"
RequestInspection: "{{ RequestInspection }}"
ResponseInspection: "{{ ResponseInspection }}"
EnableRegexInPath: {{ EnableRegexInPath }}
AWSManagedRulesAntiDDoSRuleSet:
ClientSideActionConfig: "{{ ClientSideActionConfig }}"
SensitivityToBlock: "{{ SensitivityToBlock }}"
RuleActionOverrides:
- Name: "{{ Name }}"
ActionToUse:
Block: "{{ Block }}"
Allow: "{{ Allow }}"
Count: "{{ Count }}"
Captcha: "{{ Captcha }}"
Challenge: "{{ Challenge }}"
Monetize: "{{ Monetize }}"
LabelMatchStatement:
Scope: "{{ Scope }}"
Key: "{{ Key }}"
RegexMatchStatement:
RegexString: "{{ RegexString }}"
FieldToMatch:
SingleHeader:
Name: "{{ Name }}"
SingleQueryArgument:
Name: "{{ Name }}"
AllQueryArguments: "{{ AllQueryArguments }}"
UriPath: "{{ UriPath }}"
QueryString: "{{ QueryString }}"
Body:
OversizeHandling: "{{ OversizeHandling }}"
Method: "{{ Method }}"
JsonBody:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
InvalidFallbackBehavior: "{{ InvalidFallbackBehavior }}"
OversizeHandling: "{{ OversizeHandling }}"
Headers:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
OversizeHandling: "{{ OversizeHandling }}"
Cookies:
MatchPattern: "{{ MatchPattern }}"
MatchScope: "{{ MatchScope }}"
OversizeHandling: "{{ OversizeHandling }}"
HeaderOrder:
OversizeHandling: "{{ OversizeHandling }}"
JA3Fingerprint:
FallbackBehavior: "{{ FallbackBehavior }}"
JA4Fingerprint:
FallbackBehavior: "{{ FallbackBehavior }}"
UriFragment:
FallbackBehavior: "{{ FallbackBehavior }}"
TextTransformations:
- Priority: {{ Priority }}
Type: "{{ Type }}"
PreParseTextTransformations:
- Priority: {{ Priority }}
Type: "{{ Type }}"
AsnMatchStatement:
AsnList:
- {{ AsnList }}
ForwardedIPConfig:
HeaderName: "{{ HeaderName }}"
FallbackBehavior: "{{ FallbackBehavior }}"
Action:
Block:
CustomResponse:
ResponseCode: {{ ResponseCode }}
CustomResponseBodyKey: "{{ CustomResponseBodyKey }}"
ResponseHeaders:
- Name: "{{ Name }}"
Value: "{{ Value }}"
Allow:
CustomRequestHandling:
InsertHeaders:
- Name: "{{ Name }}"
Value: "{{ Value }}"
Count:
CustomRequestHandling:
InsertHeaders:
- Name: "{{ Name }}"
Value: "{{ Value }}"
Captcha:
CustomRequestHandling:
InsertHeaders:
- Name: "{{ Name }}"
Value: "{{ Value }}"
Challenge:
CustomRequestHandling:
InsertHeaders:
- Name: "{{ Name }}"
Value: "{{ Value }}"
Monetize:
PriceMultiplier: "{{ PriceMultiplier }}"
OverrideAction:
Count:
CustomRequestHandling:
InsertHeaders:
- Name: "{{ Name }}"
Value: "{{ Value }}"
None: "{{ None }}"
RuleLabels: "{{ RuleLabels }}"
VisibilityConfig:
SampledRequestsEnabled: {{ SampledRequestsEnabled }}
CloudWatchMetricsEnabled: {{ CloudWatchMetricsEnabled }}
MetricName: "{{ MetricName }}"
CaptchaConfig:
ImmunityTimeProperty:
ImmunityTime: {{ ImmunityTime }}
ChallengeConfig:
ImmunityTimeProperty:
ImmunityTime: {{ ImmunityTime }}
- name: VisibilityConfig
description: |
Defines and enables Amazon CloudWatch metrics and web request sample collection.
value:
SampledRequestsEnabled: {{ SampledRequestsEnabled }}
CloudWatchMetricsEnabled: {{ CloudWatchMetricsEnabled }}
MetricName: "{{ MetricName }}"
- name: Tags
description: |
An array of key:value pairs to associate with the resource.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: CustomResponseBodies
value: "{{ CustomResponseBodies }}"
description: |
A map of custom response keys and content bodies. When you create a rule with a block action, you can send a custom response to the web request. You define these for the rule group, and then use them in the rules that you define in the rule group. For information about customizing web requests and responses, see Customizing web requests and responses in WAF in the WAF Developer Guide. For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.
- name: MonetizationConfig
description: |
The monetization configuration for the rule group. Provide this when any rule in the rule group uses the Monetize action.
value:
CryptoConfig:
PaymentNetworks:
- Chain: "{{ Chain }}"
WalletAddress: "{{ WalletAddress }}"
Prices: "{{ Prices }}"
CurrencyMode: "{{ CurrencyMode }}"
UPDATE examples
- update_rule_group
Updates the specified RuleGroup. This operation completely replaces the mutable specifications that you already have for the rule group with the ones that you provide to this call. To modify a rule group, do the following: Retrieve it by calling GetRuleGroup Update its settings as needed Provide the complete rule group specification to this call A rule group defines a collection of rules to inspect and control web requests that you can use in a WebACL. When you create a rule group, you define an immutable capacity limit. If you update a rule group, you must stay within the capacity. This allows others to reuse the rule group with confidence in its capacity requirements. Temporary inconsistencies during updates When you create or change a web ACL or other WAF resources, the changes take a small amount of time to propagate to all areas where the resources are stored. The propagation time can be from a few seconds to a number of minutes. The following are examples of the temporary inconsistencies that you might notice during change propagation: After you create a web ACL, if you try to associate it with a resource, you might get an exception indicating that the web ACL is unavailable. After you add a rule group to a web ACL, the new rule group rules might be in effect in one area where the web ACL is used and not in another. After you change a rule action setting, you might see the old action in some places and the new action in others. After you add an IP address to an IP set that is in use in a blocking rule, the new address might be blocked in one area while still allowed in another.
UPDATE aws.wafv2.rule_groups
SET
Name = '{{ Name }}',
Scope = '{{ Scope }}',
Id = '{{ Id }}',
Description = '{{ Description }}',
Rules = '{{ Rules }}',
VisibilityConfig = '{{ VisibilityConfig }}',
LockToken = '{{ LockToken }}',
CustomResponseBodies = '{{ CustomResponseBodies }}',
MonetizationConfig = '{{ MonetizationConfig }}'
WHERE
region = '{{ region }}' --required
AND Name = '{{ Name }}' --required
AND Scope = '{{ Scope }}' --required
AND Id = '{{ Id }}' --required
AND VisibilityConfig = '{{ VisibilityConfig }}' --required
AND LockToken = '{{ LockToken }}' --required
RETURNING
next_lock_token;
DELETE examples
- delete_rule_group
- delete_firewall_manager_rule_groups
Deletes the specified RuleGroup.
DELETE FROM aws.wafv2.rule_groups
WHERE region = '{{ region }}' --required
;
Deletes all rule groups that are managed by Firewall Manager from the specified WebACL. You can only use this if ManagedByFirewallManager and RetrofittedByFirewallManager are both false in the web ACL.
DELETE FROM aws.wafv2.rule_groups
WHERE region = '{{ region }}' --required
;