@jaypie/constructs 1.2.47 → 1.2.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -42,6 +42,30 @@ export interface JaypieWafConfig {
|
|
|
42
42
|
* }
|
|
43
43
|
*/
|
|
44
44
|
managedRuleOverrides?: Record<string, wafv2.CfnWebACL.RuleActionOverrideProperty[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Optional scope-down statements per managed rule group. When supplied,
|
|
47
|
+
* the managed rule group only evaluates requests that match the
|
|
48
|
+
* scope-down statement. Key is the managed rule group name; value is a
|
|
49
|
+
* `CfnWebACL.StatementProperty`.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* // Only run AWSManagedRulesCommonRuleSet for non-/chat paths
|
|
53
|
+
* managedRuleScopeDowns: {
|
|
54
|
+
* AWSManagedRulesCommonRuleSet: {
|
|
55
|
+
* notStatement: {
|
|
56
|
+
* statement: {
|
|
57
|
+
* byteMatchStatement: {
|
|
58
|
+
* fieldToMatch: { uriPath: {} },
|
|
59
|
+
* positionalConstraint: "STARTS_WITH",
|
|
60
|
+
* searchString: "/chat",
|
|
61
|
+
* textTransformations: [{ priority: 0, type: "NONE" }],
|
|
62
|
+
* },
|
|
63
|
+
* },
|
|
64
|
+
* },
|
|
65
|
+
* },
|
|
66
|
+
* }
|
|
67
|
+
*/
|
|
68
|
+
managedRuleScopeDowns?: Record<string, wafv2.CfnWebACL.StatementProperty>;
|
|
45
69
|
/**
|
|
46
70
|
* Managed rule group names to apply
|
|
47
71
|
* @default ["AWSManagedRulesCommonRuleSet", "AWSManagedRulesKnownBadInputsRuleSet"]
|
package/dist/esm/index.js
CHANGED
|
@@ -2619,12 +2619,13 @@ class JaypieDistribution extends Construct {
|
|
|
2619
2619
|
}
|
|
2620
2620
|
else {
|
|
2621
2621
|
// Create new WebACL
|
|
2622
|
-
const { managedRuleOverrides, managedRules = DEFAULT_MANAGED_RULES, rateLimitPerIp = DEFAULT_RATE_LIMIT, } = wafConfig;
|
|
2622
|
+
const { managedRuleOverrides, managedRuleScopeDowns, managedRules = DEFAULT_MANAGED_RULES, rateLimitPerIp = DEFAULT_RATE_LIMIT, } = wafConfig;
|
|
2623
2623
|
let priority = 0;
|
|
2624
2624
|
const rules = [];
|
|
2625
2625
|
// Add managed rule groups
|
|
2626
2626
|
for (const ruleName of managedRules) {
|
|
2627
2627
|
const ruleActionOverrides = managedRuleOverrides?.[ruleName];
|
|
2628
|
+
const scopeDownStatement = managedRuleScopeDowns?.[ruleName];
|
|
2628
2629
|
rules.push({
|
|
2629
2630
|
name: ruleName,
|
|
2630
2631
|
priority: priority++,
|
|
@@ -2634,6 +2635,7 @@ class JaypieDistribution extends Construct {
|
|
|
2634
2635
|
name: ruleName,
|
|
2635
2636
|
vendorName: "AWS",
|
|
2636
2637
|
...(ruleActionOverrides && { ruleActionOverrides }),
|
|
2638
|
+
...(scopeDownStatement && { scopeDownStatement }),
|
|
2637
2639
|
},
|
|
2638
2640
|
},
|
|
2639
2641
|
visibilityConfig: {
|