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){