From 0026eacaa74c51dcd9a9a6b7f952211a9ba71c2d Mon Sep 17 00:00:00 2001 From: Ark2307 Date: Wed, 18 Dec 2024 14:15:22 +0530 Subject: [PATCH] Adding check only for metered accounts --- .../main/java/com/akto/listener/InitializerListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/src/main/java/com/akto/listener/InitializerListener.java b/apps/dashboard/src/main/java/com/akto/listener/InitializerListener.java index 4567c35154..f1e67c1893 100644 --- a/apps/dashboard/src/main/java/com/akto/listener/InitializerListener.java +++ b/apps/dashboard/src/main/java/com/akto/listener/InitializerListener.java @@ -2842,12 +2842,16 @@ private static void addDefaultAdvancedFilters(BackwardCompatibility backwardComp " value:\n" + " regex: .*localhost.*"; + if(!DashboardMode.isMetered()){ + contentBlock = "id: DEFAULT_BLOCK_FILTER\nfilter:\n response_code:\n gte: 400"; + } + AdvancedTrafficFiltersAction action = new AdvancedTrafficFiltersAction(); action.setYamlContent(contentAllow); action.saveYamlTemplateForTrafficFilters(); - if(backwardCompatibility.getAddDefaultFilters() != 0){ + if(backwardCompatibility.getAddDefaultFilters() != 0 && DashboardMode.isMetered()){ Bson defaultFilterQ = Filters.eq(Constants.ID, "DEFAULT_BLOCK_FILTER"); YamlTemplate blockTemplate = AdvancedTrafficFiltersDao.instance.findOne(defaultFilterQ); if((blockTemplate.getUpdatedAt() - blockTemplate.getCreatedAt()) <= 10){