interface CfnRuleGroupProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.WAFv2.CfnRuleGroupProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awswafv2#CfnRuleGroupProps |
Java | software.amazon.awscdk.services.wafv2.CfnRuleGroupProps |
Python | aws_cdk.aws_wafv2.CfnRuleGroupProps |
TypeScript | aws-cdk-lib » aws_wafv2 » CfnRuleGroupProps |
Properties for defining a CfnRuleGroup
.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-rulegroup.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_wafv2 as wafv2 } from 'aws-cdk-lib';
declare const all: any;
declare const allow: any;
declare const allQueryArguments: any;
declare const block: any;
declare const captcha: any;
declare const challenge: any;
declare const count: any;
declare const forwardedIp: any;
declare const httpMethod: any;
declare const ip: any;
declare const method: any;
declare const queryString: any;
declare const singleHeader: any;
declare const singleQueryArgument: any;
declare const statementProperty_: wafv2.CfnRuleGroup.StatementProperty;
declare const uriPath: any;
const cfnRuleGroupProps: wafv2.CfnRuleGroupProps = {
capacity: 123,
scope: 'scope',
visibilityConfig: {
cloudWatchMetricsEnabled: false,
metricName: 'metricName',
sampledRequestsEnabled: false,
},
// the properties below are optional
availableLabels: [{
name: 'name',
}],
consumedLabels: [{
name: 'name',
}],
customResponseBodies: {
customResponseBodiesKey: {
content: 'content',
contentType: 'contentType',
},
},
description: 'description',
name: 'name',
rules: [{
name: 'name',
priority: 123,
statement: {
andStatement: {
statements: [statementProperty_],
},
byteMatchStatement: {
fieldToMatch: {
allQueryArguments: allQueryArguments,
body: {
oversizeHandling: 'oversizeHandling',
},
cookies: {
matchPattern: {
all: all,
excludedCookies: ['excludedCookies'],
includedCookies: ['includedCookies'],
},
matchScope: 'matchScope',
oversizeHandling: 'oversizeHandling',
},
headers: {
matchPattern: {
all: all,
excludedHeaders: ['excludedHeaders'],
includedHeaders: ['includedHeaders'],
},
matchScope: 'matchScope',
oversizeHandling: 'oversizeHandling',
},
ja3Fingerprint: {
fallbackBehavior: 'fallbackBehavior',
},
jsonBody: {
matchPattern: {
all: all,
includedPaths: ['includedPaths'],
},
matchScope: 'matchScope',
// the properties below are optional
invalidFallbackBehavior: 'invalidFallbackBehavior',
oversizeHandling: 'oversizeHandling',
},
method: method,
queryString: queryString,
singleHeader: singleHeader,
singleQueryArgument: singleQueryArgument,
uriPath: uriPath,
},
positionalConstraint: 'positionalConstraint',
textTransformations: [{
priority: 123,
type: 'type',
}],
// the properties below are optional
searchString: 'searchString',
searchStringBase64: 'searchStringBase64',
},
geoMatchStatement: {
countryCodes: ['countryCodes'],
forwardedIpConfig: {
fallbackBehavior: 'fallbackBehavior',
headerName: 'headerName',
},
},
ipSetReferenceStatement: {
arn: 'arn',
// the properties below are optional
ipSetForwardedIpConfig: {
fallbackBehavior: 'fallbackBehavior',
headerName: 'headerName',
position: 'position',
},
},
labelMatchStatement: {
key: 'key',
scope: 'scope',
},
notStatement: {
statement: statementProperty_,
},
orStatement: {
statements: [statementProperty_],
},
rateBasedStatement: {
aggregateKeyType: 'aggregateKeyType',
limit: 123,
// the properties below are optional
customKeys: [{
cookie: {
name: 'name',
textTransformations: [{
priority: 123,
type: 'type',
}],
},
forwardedIp: forwardedIp,
header: {
name: 'name',
textTransformations: [{
priority: 123,
type: 'type',
}],
},
httpMethod: httpMethod,
ip: ip,
labelNamespace: {
namespace: 'namespace',
},
queryArgument: {
name: 'name',
textTransformations: [{
priority: 123,
type: 'type',
}],
},
queryString: {
textTransformations: [{
priority: 123,
type: 'type',
}],
},
uriPath: {
textTransformations: [{
priority: 123,
type: 'type',
}],
},
}],
evaluationWindowSec: 123,
forwardedIpConfig: {
fallbackBehavior: 'fallbackBehavior',
headerName: 'headerName',
},
scopeDownStatement: statementProperty_,
},
regexMatchStatement: {
fieldToMatch: {
allQueryArguments: allQueryArguments,
body: {
oversizeHandling: 'oversizeHandling',
},
cookies: {
matchPattern: {
all: all,
excludedCookies: ['excludedCookies'],
includedCookies: ['includedCookies'],
},
matchScope: 'matchScope',
oversizeHandling: 'oversizeHandling',
},
headers: {
matchPattern: {
all: all,
excludedHeaders: ['excludedHeaders'],
includedHeaders: ['includedHeaders'],
},
matchScope: 'matchScope',
oversizeHandling: 'oversizeHandling',
},
ja3Fingerprint: {
fallbackBehavior: 'fallbackBehavior',
},
jsonBody: {
matchPattern: {
all: all,
includedPaths: ['includedPaths'],
},
matchScope: 'matchScope',
// the properties below are optional
invalidFallbackBehavior: 'invalidFallbackBehavior',
oversizeHandling: 'oversizeHandling',
},
method: method,
queryString: queryString,
singleHeader: singleHeader,
singleQueryArgument: singleQueryArgument,
uriPath: uriPath,
},
regexString: 'regexString',
textTransformations: [{
priority: 123,
type: 'type',
}],
},
regexPatternSetReferenceStatement: {
arn: 'arn',
fieldToMatch: {
allQueryArguments: allQueryArguments,
body: {
oversizeHandling: 'oversizeHandling',
},
cookies: {
matchPattern: {
all: all,
excludedCookies: ['excludedCookies'],
includedCookies: ['includedCookies'],
},
matchScope: 'matchScope',
oversizeHandling: 'oversizeHandling',
},
headers: {
matchPattern: {
all: all,
excludedHeaders: ['excludedHeaders'],
includedHeaders: ['includedHeaders'],
},
matchScope: 'matchScope',
oversizeHandling: 'oversizeHandling',
},
ja3Fingerprint: {
fallbackBehavior: 'fallbackBehavior',
},
jsonBody: {
matchPattern: {
all: all,
includedPaths: ['includedPaths'],
},
matchScope: 'matchScope',
// the properties below are optional
invalidFallbackBehavior: 'invalidFallbackBehavior',
oversizeHandling: 'oversizeHandling',
},
method: method,
queryString: queryString,
singleHeader: singleHeader,
singleQueryArgument: singleQueryArgument,
uriPath: uriPath,
},
textTransformations: [{
priority: 123,
type: 'type',
}],
},
sizeConstraintStatement: {
comparisonOperator: 'comparisonOperator',
fieldToMatch: {
allQueryArguments: allQueryArguments,
body: {
oversizeHandling: 'oversizeHandling',
},
cookies: {
matchPattern: {
all: all,
excludedCookies: ['excludedCookies'],
includedCookies: ['includedCookies'],
},
matchScope: 'matchScope',
oversizeHandling: 'oversizeHandling',
},
headers: {
matchPattern: {
all: all,
excludedHeaders: ['excludedHeaders'],
includedHeaders: ['includedHeaders'],
},
matchScope: 'matchScope',
oversizeHandling: 'oversizeHandling',
},
ja3Fingerprint: {
fallbackBehavior: 'fallbackBehavior',
},
jsonBody: {
matchPattern: {
all: all,
includedPaths: ['includedPaths'],
},
matchScope: 'matchScope',
// the properties below are optional
invalidFallbackBehavior: 'invalidFallbackBehavior',
oversizeHandling: 'oversizeHandling',
},
method: method,
queryString: queryString,
singleHeader: singleHeader,
singleQueryArgument: singleQueryArgument,
uriPath: uriPath,
},
size: 123,
textTransformations: [{
priority: 123,
type: 'type',
}],
},
sqliMatchStatement: {
fieldToMatch: {
allQueryArguments: allQueryArguments,
body: {
oversizeHandling: 'oversizeHandling',
},
cookies: {
matchPattern: {
all: all,
excludedCookies: ['excludedCookies'],
includedCookies: ['includedCookies'],
},
matchScope: 'matchScope',
oversizeHandling: 'oversizeHandling',
},
headers: {
matchPattern: {
all: all,
excludedHeaders: ['excludedHeaders'],
includedHeaders: ['includedHeaders'],
},
matchScope: 'matchScope',
oversizeHandling: 'oversizeHandling',
},
ja3Fingerprint: {
fallbackBehavior: 'fallbackBehavior',
},
jsonBody: {
matchPattern: {
all: all,
includedPaths: ['includedPaths'],
},
matchScope: 'matchScope',
// the properties below are optional
invalidFallbackBehavior: 'invalidFallbackBehavior',
oversizeHandling: 'oversizeHandling',
},
method: method,
queryString: queryString,
singleHeader: singleHeader,
singleQueryArgument: singleQueryArgument,
uriPath: uriPath,
},
textTransformations: [{
priority: 123,
type: 'type',
}],
// the properties below are optional
sensitivityLevel: 'sensitivityLevel',
},
xssMatchStatement: {
fieldToMatch: {
allQueryArguments: allQueryArguments,
body: {
oversizeHandling: 'oversizeHandling',
},
cookies: {
matchPattern: {
all: all,
excludedCookies: ['excludedCookies'],
includedCookies: ['includedCookies'],
},
matchScope: 'matchScope',
oversizeHandling: 'oversizeHandling',
},
headers: {
matchPattern: {
all: all,
excludedHeaders: ['excludedHeaders'],
includedHeaders: ['includedHeaders'],
},
matchScope: 'matchScope',
oversizeHandling: 'oversizeHandling',
},
ja3Fingerprint: {
fallbackBehavior: 'fallbackBehavior',
},
jsonBody: {
matchPattern: {
all: all,
includedPaths: ['includedPaths'],
},
matchScope: 'matchScope',
// the properties below are optional
invalidFallbackBehavior: 'invalidFallbackBehavior',
oversizeHandling: 'oversizeHandling',
},
method: method,
queryString: queryString,
singleHeader: singleHeader,
singleQueryArgument: singleQueryArgument,
uriPath: uriPath,
},
textTransformations: [{
priority: 123,
type: 'type',
}],
},
},
visibilityConfig: {
cloudWatchMetricsEnabled: false,
metricName: 'metricName',
sampledRequestsEnabled: false,
},
// the properties below are optional
action: {
allow: allow,
block: block,
captcha: captcha,
challenge: challenge,
count: count,
},
captchaConfig: {
immunityTimeProperty: {
immunityTime: 123,
},
},
challengeConfig: {
immunityTimeProperty: {
immunityTime: 123,
},
},
ruleLabels: [{
name: 'name',
}],
}],
tags: [{
key: 'key',
value: 'value',
}],
};
Properties
Name | Type | Description |
---|---|---|
capacity | number | The web ACL capacity units (WCUs) required for this rule group. |
scope | string | Specifies whether this is for an Amazon CloudFront distribution or for a regional application. |
visibility | IResolvable | Visibility | Defines and enables Amazon CloudWatch metrics and web request sample collection. |
available | IResolvable | IResolvable | Label [] | The labels that one or more rules in this rule group add to matching web requests. |
consumed | IResolvable | IResolvable | Label [] | The labels that one or more rules in this rule group match against in label match statements. |
custom | IResolvable | { [string]: IResolvable | Custom } | A map of custom response keys and content bodies. |
description? | string | A description of the rule group that helps with identification. |
name? | string | The name of the rule group. |
rules? | IResolvable | IResolvable | Rule [] | The rule statements used to identify the web requests that you want to allow, block, or count. |
tags? | Cfn [] | Key:value pairs associated with an AWS resource. |
capacity
Type:
number
The web ACL capacity units (WCUs) required for this rule group.
When you create your own rule group, you define this, and you cannot change it after creation. When you add or modify the rules in a rule group, AWS WAF enforces this limit.
AWS WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. AWS WAF calculates capacity differently for each rule type, to reflect the relative cost of each rule. Simple rules that cost little to run use fewer WCUs than more complex rules that use more processing power. Rule group capacity is fixed at creation, which helps users plan their web ACL WCU usage when they use a rule group. The WCU limit for web ACLs is 1,500.
scope
Type:
string
Specifies whether this is for an Amazon CloudFront distribution or for a regional application.
A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AWS AppSync GraphQL API, an Amazon Cognito user pool, an AWS App Runner service, or an AWS Verified Access instance. Valid Values are CLOUDFRONT
and REGIONAL
.
For
CLOUDFRONT
, you must create your WAFv2 resources in the US East (N. Virginia) Region,us-east-1
.
visibilityConfig
Type:
IResolvable
|
Visibility
Defines and enables Amazon CloudWatch metrics and web request sample collection.
availableLabels?
Type:
IResolvable
|
IResolvable
|
Label
[]
(optional)
The labels that one or more rules in this rule group add to matching web requests.
These labels are defined in the RuleLabels
for a Rule
.
consumedLabels?
Type:
IResolvable
|
IResolvable
|
Label
[]
(optional)
The labels that one or more rules in this rule group match against in label match statements.
These labels are defined in a LabelMatchStatement
specification, in the Statement
definition of a rule.
customResponseBodies?
Type:
IResolvable
| { [string]:
IResolvable
|
Custom
}
(optional)
A map of custom response keys and content bodies.
When you create a rule with a block action, you can send a custom response to the web request. You define these for the rule group, and then use them in the rules that you define in the rule group.
For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF Developer Guide .
For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .
description?
Type:
string
(optional)
A description of the rule group that helps with identification.
name?
Type:
string
(optional)
The name of the rule group.
You cannot change the name of a rule group after you create it.
rules?
Type:
IResolvable
|
IResolvable
|
Rule
[]
(optional)
The rule statements used to identify the web requests that you want to allow, block, or count.
Each rule includes one top-level statement that AWS WAF uses to identify matching web requests, and parameters that govern how AWS WAF handles them.
tags?
Type:
Cfn
[]
(optional)
Key:value pairs associated with an AWS resource.
The key:value pair can be anything you define. Typically, the tag key represents a category (such as "environment") and the tag value represents a specific value within that category (such as "test," "development," or "production"). You can add up to 50 tags to each AWS resource.
To modify tags on existing resources, use the AWS WAF APIs or command line interface. With AWS CloudFormation , you can only add tags to AWS WAF resources during resource creation.