Skip to content

Commit 2169385

Browse files
Added the URI path to the custom aggregation keys that you can specify for a rate-based rule.
1 parent 945e2ca commit 2169385

13 files changed

+315
-17
lines changed

generator/ServiceModels/wafv2/wafv2-2019-07-29.api.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3190,7 +3190,8 @@
31903190
"HTTPMethod":{"shape":"RateLimitHTTPMethod"},
31913191
"ForwardedIP":{"shape":"RateLimitForwardedIP"},
31923192
"IP":{"shape":"RateLimitIP"},
3193-
"LabelNamespace":{"shape":"RateLimitLabelNamespace"}
3193+
"LabelNamespace":{"shape":"RateLimitLabelNamespace"},
3194+
"UriPath":{"shape":"RateLimitUriPath"}
31943195
}
31953196
},
31963197
"RateBasedStatementCustomKeys":{
@@ -3273,6 +3274,13 @@
32733274
"TextTransformations":{"shape":"TextTransformations"}
32743275
}
32753276
},
3277+
"RateLimitUriPath":{
3278+
"type":"structure",
3279+
"required":["TextTransformations"],
3280+
"members":{
3281+
"TextTransformations":{"shape":"TextTransformations"}
3282+
}
3283+
},
32763284
"RedactedFields":{
32773285
"type":"list",
32783286
"member":{"shape":"FieldToMatch"},

generator/ServiceModels/wafv2/wafv2-2019-07-29.docs.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,9 @@
315315
}
316316
},
317317
"CookieMatchPattern": {
318-
"base": "<p>The filter to use to identify the subset of cookies to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedCookies</code>, or <code>ExcludedCookies</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"IncludedCookies\": {\"KeyToInclude1\", \"KeyToInclude2\", \"KeyToInclude3\"} }</code> </p>",
318+
"base": "<p>The filter to use to identify the subset of cookies to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedCookies</code>, or <code>ExcludedCookies</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"IncludedCookies\": [ \"session-id-time\", \"session-id\" ] }</code> </p>",
319319
"refs": {
320-
"Cookies$MatchPattern": "<p>The filter to use to identify the subset of cookies to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedCookies</code>, or <code>ExcludedCookies</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"IncludedCookies\": {\"KeyToInclude1\", \"KeyToInclude2\", \"KeyToInclude3\"} }</code> </p>"
320+
"Cookies$MatchPattern": "<p>The filter to use to identify the subset of cookies to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedCookies</code>, or <code>ExcludedCookies</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"IncludedCookies\": [ \"session-id-time\", \"session-id\" ] }</code> </p>"
321321
}
322322
},
323323
"CookieNames": {
@@ -1043,9 +1043,9 @@
10431043
}
10441044
},
10451045
"HeaderMatchPattern": {
1046-
"base": "<p>The filter to use to identify the subset of headers to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedHeaders</code>, or <code>ExcludedHeaders</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"ExcludedHeaders\": {\"KeyToExclude1\", \"KeyToExclude2\"} }</code> </p>",
1046+
"base": "<p>The filter to use to identify the subset of headers to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedHeaders</code>, or <code>ExcludedHeaders</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"ExcludedHeaders\": [ \"KeyToExclude1\", \"KeyToExclude2\" ] }</code> </p>",
10471047
"refs": {
1048-
"Headers$MatchPattern": "<p>The filter to use to identify the subset of headers to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedHeaders</code>, or <code>ExcludedHeaders</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"ExcludedHeaders\": {\"KeyToExclude1\", \"KeyToExclude2\"} }</code> </p>"
1048+
"Headers$MatchPattern": "<p>The filter to use to identify the subset of headers to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedHeaders</code>, or <code>ExcludedHeaders</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"ExcludedHeaders\": [ \"KeyToExclude1\", \"KeyToExclude2\" ] }</code> </p>"
10491049
}
10501050
},
10511051
"HeaderName": {
@@ -1854,6 +1854,12 @@
18541854
"RateBasedStatementCustomKey$QueryString": "<p>Use the request's query string as an aggregate key. Each distinct string contributes to the aggregation instance. If you use just the query string as your custom key, then each string fully defines an aggregation instance. </p>"
18551855
}
18561856
},
1857+
"RateLimitUriPath": {
1858+
"base": "<p>Specifies the request's URI path as an aggregate key for a rate-based rule. Each distinct URI path contributes to the aggregation instance. If you use just the URI path as your custom key, then each URI path fully defines an aggregation instance. </p>",
1859+
"refs": {
1860+
"RateBasedStatementCustomKey$UriPath": "<p>Use the request's URI path as an aggregate key. Each distinct URI path contributes to the aggregation instance. If you use just the URI path as your custom key, then each URI path fully defines an aggregation instance. </p>"
1861+
}
1862+
},
18571863
"RedactedFields": {
18581864
"base": null,
18591865
"refs": {
@@ -2445,6 +2451,7 @@
24452451
"RateLimitHeader$TextTransformations": "<p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. Text transformations are used in rule match statements, to transform the <code>FieldToMatch</code> request component before inspecting it, and they're used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the component contents. </p>",
24462452
"RateLimitQueryArgument$TextTransformations": "<p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. Text transformations are used in rule match statements, to transform the <code>FieldToMatch</code> request component before inspecting it, and they're used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the component contents. </p>",
24472453
"RateLimitQueryString$TextTransformations": "<p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. Text transformations are used in rule match statements, to transform the <code>FieldToMatch</code> request component before inspecting it, and they're used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the component contents. </p>",
2454+
"RateLimitUriPath$TextTransformations": "<p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. Text transformations are used in rule match statements, to transform the <code>FieldToMatch</code> request component before inspecting it, and they're used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the component contents. </p>",
24482455
"RegexMatchStatement$TextTransformations": "<p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. Text transformations are used in rule match statements, to transform the <code>FieldToMatch</code> request component before inspecting it, and they're used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the component contents. </p>",
24492456
"RegexPatternSetReferenceStatement$TextTransformations": "<p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. Text transformations are used in rule match statements, to transform the <code>FieldToMatch</code> request component before inspecting it, and they're used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the component contents. </p>",
24502457
"SizeConstraintStatement$TextTransformations": "<p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. Text transformations are used in rule match statements, to transform the <code>FieldToMatch</code> request component before inspecting it, and they're used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the component contents. </p>",

generator/ServiceModels/wafv2/wafv2-2019-07-29.normal.json

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@
13611361
"documentation":"<p>Inspect only the cookies whose keys don't match any of the strings specified here. </p>"
13621362
}
13631363
},
1364-
"documentation":"<p>The filter to use to identify the subset of cookies to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedCookies</code>, or <code>ExcludedCookies</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"IncludedCookies\": {\"KeyToInclude1\", \"KeyToInclude2\", \"KeyToInclude3\"} }</code> </p>"
1364+
"documentation":"<p>The filter to use to identify the subset of cookies to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedCookies</code>, or <code>ExcludedCookies</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"IncludedCookies\": [ \"session-id-time\", \"session-id\" ] }</code> </p>"
13651365
},
13661366
"CookieNames":{
13671367
"type":"list",
@@ -1379,7 +1379,7 @@
13791379
"members":{
13801380
"MatchPattern":{
13811381
"shape":"CookieMatchPattern",
1382-
"documentation":"<p>The filter to use to identify the subset of cookies to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedCookies</code>, or <code>ExcludedCookies</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"IncludedCookies\": {\"KeyToInclude1\", \"KeyToInclude2\", \"KeyToInclude3\"} }</code> </p>"
1382+
"documentation":"<p>The filter to use to identify the subset of cookies to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedCookies</code>, or <code>ExcludedCookies</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"IncludedCookies\": [ \"session-id-time\", \"session-id\" ] }</code> </p>"
13831383
},
13841384
"MatchScope":{
13851385
"shape":"MapMatchScope",
@@ -3056,7 +3056,7 @@
30563056
"documentation":"<p>Inspect only the headers whose keys don't match any of the strings specified here. </p>"
30573057
}
30583058
},
3059-
"documentation":"<p>The filter to use to identify the subset of headers to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedHeaders</code>, or <code>ExcludedHeaders</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"ExcludedHeaders\": {\"KeyToExclude1\", \"KeyToExclude2\"} }</code> </p>"
3059+
"documentation":"<p>The filter to use to identify the subset of headers to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedHeaders</code>, or <code>ExcludedHeaders</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"ExcludedHeaders\": [ \"KeyToExclude1\", \"KeyToExclude2\" ] }</code> </p>"
30603060
},
30613061
"HeaderName":{"type":"string"},
30623062
"HeaderNames":{
@@ -3087,7 +3087,7 @@
30873087
"members":{
30883088
"MatchPattern":{
30893089
"shape":"HeaderMatchPattern",
3090-
"documentation":"<p>The filter to use to identify the subset of headers to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedHeaders</code>, or <code>ExcludedHeaders</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"ExcludedHeaders\": {\"KeyToExclude1\", \"KeyToExclude2\"} }</code> </p>"
3090+
"documentation":"<p>The filter to use to identify the subset of headers to inspect in a web request. </p> <p>You must specify exactly one setting: either <code>All</code>, <code>IncludedHeaders</code>, or <code>ExcludedHeaders</code>.</p> <p>Example JSON: <code>\"MatchPattern\": { \"ExcludedHeaders\": [ \"KeyToExclude1\", \"KeyToExclude2\" ] }</code> </p>"
30913091
},
30923092
"MatchScope":{
30933093
"shape":"MapMatchScope",
@@ -4550,6 +4550,10 @@
45504550
"LabelNamespace":{
45514551
"shape":"RateLimitLabelNamespace",
45524552
"documentation":"<p>Use the specified label namespace as an aggregate key. Each distinct fully qualified label name that has the specified label namespace contributes to the aggregation instance. If you use just one label namespace as your custom key, then each label name fully defines an aggregation instance. </p> <p>This uses only labels that have been added to the request by rules that are evaluated before this rate-based rule in the web ACL. </p> <p>For information about label namespaces and names, see <a href=\"https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-label-requirements.html\">Label syntax and naming requirements</a> in the <i>WAF Developer Guide</i>.</p>"
4553+
},
4554+
"UriPath":{
4555+
"shape":"RateLimitUriPath",
4556+
"documentation":"<p>Use the request's URI path as an aggregate key. Each distinct URI path contributes to the aggregation instance. If you use just the URI path as your custom key, then each URI path fully defines an aggregation instance. </p>"
45534557
}
45544558
},
45554559
"documentation":"<p>Specifies a single custom aggregate key for a rate-base rule. </p> <note> <p>Web requests that are missing any of the components specified in the aggregation keys are omitted from the rate-based rule evaluation and handling. </p> </note>"
@@ -4673,6 +4677,17 @@
46734677
},
46744678
"documentation":"<p>Specifies the request's query string as an aggregate key for a rate-based rule. Each distinct string contributes to the aggregation instance. If you use just the query string as your custom key, then each string fully defines an aggregation instance. </p>"
46754679
},
4680+
"RateLimitUriPath":{
4681+
"type":"structure",
4682+
"required":["TextTransformations"],
4683+
"members":{
4684+
"TextTransformations":{
4685+
"shape":"TextTransformations",
4686+
"documentation":"<p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. Text transformations are used in rule match statements, to transform the <code>FieldToMatch</code> request component before inspecting it, and they're used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the component contents. </p>"
4687+
}
4688+
},
4689+
"documentation":"<p>Specifies the request's URI path as an aggregate key for a rate-based rule. Each distinct URI path contributes to the aggregation instance. If you use just the URI path as your custom key, then each URI path fully defines an aggregation instance. </p>"
4690+
},
46764691
"RedactedFields":{
46774692
"type":"list",
46784693
"member":{"shape":"FieldToMatch"},

sdk/src/Services/WAFV2/Generated/Model/CookieMatchPattern.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ namespace Amazon.WAFV2.Model
3838
/// </para>
3939
///
4040
/// <para>
41-
/// Example JSON: <code>"MatchPattern": { "IncludedCookies": {"KeyToInclude1", "KeyToInclude2",
42-
/// "KeyToInclude3"} }</code>
41+
/// Example JSON: <code>"MatchPattern": { "IncludedCookies": [ "session-id-time", "session-id"
42+
/// ] }</code>
4343
/// </para>
4444
/// </summary>
4545
public partial class CookieMatchPattern

sdk/src/Services/WAFV2/Generated/Model/Cookies.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ public partial class Cookies
6262
/// </para>
6363
///
6464
/// <para>
65-
/// Example JSON: <code>"MatchPattern": { "IncludedCookies": {"KeyToInclude1", "KeyToInclude2",
66-
/// "KeyToInclude3"} }</code>
65+
/// Example JSON: <code>"MatchPattern": { "IncludedCookies": [ "session-id-time", "session-id"
66+
/// ] }</code>
6767
/// </para>
6868
/// </summary>
6969
[AWSProperty(Required=true)]

sdk/src/Services/WAFV2/Generated/Model/HeaderMatchPattern.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ namespace Amazon.WAFV2.Model
3838
/// </para>
3939
///
4040
/// <para>
41-
/// Example JSON: <code>"MatchPattern": { "ExcludedHeaders": {"KeyToExclude1", "KeyToExclude2"}
42-
/// }</code>
41+
/// Example JSON: <code>"MatchPattern": { "ExcludedHeaders": [ "KeyToExclude1", "KeyToExclude2"
42+
/// ] }</code>
4343
/// </para>
4444
/// </summary>
4545
public partial class HeaderMatchPattern

sdk/src/Services/WAFV2/Generated/Model/Headers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ public partial class Headers
6767
/// </para>
6868
///
6969
/// <para>
70-
/// Example JSON: <code>"MatchPattern": { "ExcludedHeaders": {"KeyToExclude1", "KeyToExclude2"}
71-
/// }</code>
70+
/// Example JSON: <code>"MatchPattern": { "ExcludedHeaders": [ "KeyToExclude1", "KeyToExclude2"
71+
/// ] }</code>
7272
/// </para>
7373
/// </summary>
7474
[AWSProperty(Required=true)]

sdk/src/Services/WAFV2/Generated/Model/Internal/MarshallTransformations/RateBasedStatementCustomKeyMarshaller.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,17 @@ public void Marshall(RateBasedStatementCustomKey requestObject, JsonMarshallerCo
133133
context.Writer.WriteObjectEnd();
134134
}
135135

136+
if(requestObject.IsSetUriPath())
137+
{
138+
context.Writer.WritePropertyName("UriPath");
139+
context.Writer.WriteObjectStart();
140+
141+
var marshaller = RateLimitUriPathMarshaller.Instance;
142+
marshaller.Marshall(requestObject.UriPath, context);
143+
144+
context.Writer.WriteObjectEnd();
145+
}
146+
136147
}
137148

138149
/// <summary>

sdk/src/Services/WAFV2/Generated/Model/Internal/MarshallTransformations/RateBasedStatementCustomKeyUnmarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ public RateBasedStatementCustomKey Unmarshall(JsonUnmarshallerContext context)
112112
unmarshalledObject.QueryString = unmarshaller.Unmarshall(context);
113113
continue;
114114
}
115+
if (context.TestExpression("UriPath", targetDepth))
116+
{
117+
var unmarshaller = RateLimitUriPathUnmarshaller.Instance;
118+
unmarshalledObject.UriPath = unmarshaller.Unmarshall(context);
119+
continue;
120+
}
115121
}
116122

117123
return unmarshalledObject;

0 commit comments

Comments
 (0)