@@ -217,7 +217,7 @@ private void applyConfig(Object config_, AppSecModuleConfigurer.Reconfiguration
217
217
List <String > errors = new ArrayList <>();
218
218
try {
219
219
// ddwaf_init/update
220
- success = initializeNewWafCtx (reconf , config , curCtxAndAddresses , errors );
220
+ success = initializeNewWafCtx (reconf , config , curCtxAndAddresses );
221
221
} catch (Exception e ) {
222
222
throw new AppSecModuleActivationException ("Could not initialize/update waf" , e );
223
223
} finally {
@@ -226,18 +226,13 @@ private void applyConfig(Object config_, AppSecModuleConfigurer.Reconfiguration
226
226
} else {
227
227
WafMetricCollector .get ().wafUpdates (currentRulesVersion , success );
228
228
}
229
- if (!errors .isEmpty ()) {
230
- log .error ("Errors during WAF initialization: {}" , errors );
231
- WafMetricCollector .get ().addWafConfigError (errors .size ());
232
- }
233
229
}
234
230
}
235
231
236
232
private boolean initializeNewWafCtx (
237
233
AppSecModuleConfigurer .Reconfiguration reconf ,
238
234
CurrentAppSecConfig config ,
239
- CtxAndAddresses prevContextAndAddresses ,
240
- List <String > errors )
235
+ CtxAndAddresses prevContextAndAddresses )
241
236
throws AppSecModuleActivationException , IOException {
242
237
CtxAndAddresses newContextAndAddresses ;
243
238
RuleSetInfo initReport = null ;
@@ -285,10 +280,9 @@ private boolean initializeNewWafCtx(
285
280
if (initReport != null
286
281
&& initReport .getErrors () != null
287
282
&& !initReport .getErrors ().isEmpty ()) {
288
- errors .addAll (
289
- initReport .getErrors ().values ().stream ()
290
- .flatMap (List ::stream )
291
- .collect (Collectors .toList ()));
283
+
284
+ WafMetricCollector .get ()
285
+ .addWafConfigError (initReport .getErrors ().values ().stream ().mapToInt (List ::size ).sum ());
292
286
}
293
287
} catch (InvalidRuleSetException irse ) {
294
288
initReport = irse .ruleSetInfo ;
0 commit comments