From a078ae765db2802cb4afac4543ded39a66767e1e Mon Sep 17 00:00:00 2001 From: daknhh Date: Wed, 17 Apr 2024 15:51:02 +0200 Subject: [PATCH] adjust functionname --- lib/tools/helpers/web-application-firewall/statements.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tools/helpers/web-application-firewall/statements.ts b/lib/tools/helpers/web-application-firewall/statements.ts index e479c389..88ed23ea 100644 --- a/lib/tools/helpers/web-application-firewall/statements.ts +++ b/lib/tools/helpers/web-application-firewall/statements.ts @@ -44,7 +44,7 @@ export function transformWafRuleStatements(rule: Rule, prefix: string, stage: st } else if (orStatement) { statement = { orStatement }; } else if (rateBasedStatement) { - const newstatement = handleRateStatement(rateBasedStatement, prefix, stage, webAclName, ipSets, regexPatternSets); + const newstatement = handleRateBasedStatement(rateBasedStatement, prefix, stage, webAclName, ipSets, regexPatternSets); statement = newstatement; } else { @@ -152,7 +152,7 @@ function handleAndOrStatement(statements: wafv2.CfnWebACL.StatementProperty[], p } const rateBasedStatement = statements[i].rateBasedStatement as wafv2.CfnWebACL.RateBasedStatementProperty | undefined; if(rateBasedStatement && (ipSets || regexPatternSets)) { - const adjustedstatement = handleRateStatement(rateBasedStatement, prefix, stage, webAclName, ipSets, regexPatternSets); + const adjustedstatement = handleRateBasedStatement(rateBasedStatement, prefix, stage, webAclName, ipSets, regexPatternSets); statements[i] = adjustedstatement as wafv2.CfnWebACL.StatementProperty; } } @@ -160,14 +160,14 @@ function handleAndOrStatement(statements: wafv2.CfnWebACL.StatementProperty[], p /** - * Function to transform RuleStatements in And- and OrStatements + * Function to transform RuleStatements in RateBasedStatements * @param statements wafv2.CfnWebACL.RateBasedStatementProperty * @param prefix string * @param stage string * @param ipSets cdk.aws_wafv2.CfnIPSet[] * @param regexPatternSets cdk.aws_wafv2.CfnRegexPatternSet[] */ -function handleRateStatement(rateBasedStatement: wafv2.CfnWebACL.RateBasedStatementProperty, prefix: string, stage: string, webAclName: string, ipSets?: cdk.aws_wafv2.CfnIPSet[], regexPatternSets?: cdk.aws_wafv2.CfnRegexPatternSet[]) { +function handleRateBasedStatement(rateBasedStatement: wafv2.CfnWebACL.RateBasedStatementProperty, prefix: string, stage: string, webAclName: string, ipSets?: cdk.aws_wafv2.CfnIPSet[], regexPatternSets?: cdk.aws_wafv2.CfnRegexPatternSet[]) { const scopeDownStatement = rateBasedStatement.scopeDownStatement as wafv2.CfnWebACL.StatementProperty | undefined; if(scopeDownStatement) { const ipSetReferenceStatement = scopeDownStatement.ipSetReferenceStatement as wafv2.CfnWebACL.IPSetReferenceStatementProperty | undefined;