@jaypie/constructs 1.2.39 → 1.2.40
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.
|
@@ -22,6 +22,17 @@ export interface JaypieWafConfig {
|
|
|
22
22
|
* @default true
|
|
23
23
|
*/
|
|
24
24
|
logBucket?: boolean | s3.IBucket;
|
|
25
|
+
/**
|
|
26
|
+
* Override actions for specific rules within managed rule groups.
|
|
27
|
+
* Key is the managed rule group name; value is an array of rule action overrides.
|
|
28
|
+
* @example
|
|
29
|
+
* managedRuleOverrides: {
|
|
30
|
+
* AWSManagedRulesCommonRuleSet: [
|
|
31
|
+
* { name: "SizeRestrictions_BODY", actionToUse: { count: {} } },
|
|
32
|
+
* ],
|
|
33
|
+
* }
|
|
34
|
+
*/
|
|
35
|
+
managedRuleOverrides?: Record<string, wafv2.CfnWebACL.RuleActionOverrideProperty[]>;
|
|
25
36
|
/**
|
|
26
37
|
* Managed rule group names to apply
|
|
27
38
|
* @default ["AWSManagedRulesCommonRuleSet", "AWSManagedRulesKnownBadInputsRuleSet"]
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -2648,11 +2648,12 @@ class JaypieDistribution extends constructs.Construct {
|
|
|
2648
2648
|
}
|
|
2649
2649
|
else {
|
|
2650
2650
|
// Create new WebACL
|
|
2651
|
-
const { managedRules = DEFAULT_MANAGED_RULES, rateLimitPerIp = DEFAULT_RATE_LIMIT, } = wafConfig;
|
|
2651
|
+
const { managedRuleOverrides, managedRules = DEFAULT_MANAGED_RULES, rateLimitPerIp = DEFAULT_RATE_LIMIT, } = wafConfig;
|
|
2652
2652
|
let priority = 0;
|
|
2653
2653
|
const rules = [];
|
|
2654
2654
|
// Add managed rule groups
|
|
2655
2655
|
for (const ruleName of managedRules) {
|
|
2656
|
+
const ruleActionOverrides = managedRuleOverrides?.[ruleName];
|
|
2656
2657
|
rules.push({
|
|
2657
2658
|
name: ruleName,
|
|
2658
2659
|
priority: priority++,
|
|
@@ -2661,6 +2662,7 @@ class JaypieDistribution extends constructs.Construct {
|
|
|
2661
2662
|
managedRuleGroupStatement: {
|
|
2662
2663
|
name: ruleName,
|
|
2663
2664
|
vendorName: "AWS",
|
|
2665
|
+
...(ruleActionOverrides && { ruleActionOverrides }),
|
|
2664
2666
|
},
|
|
2665
2667
|
},
|
|
2666
2668
|
visibilityConfig: {
|