diff --git a/pkg/acquisition/modules/appsec/appsec.go b/pkg/acquisition/modules/appsec/appsec.go index 54e0da446..030724fc3 100644 --- a/pkg/acquisition/modules/appsec/appsec.go +++ b/pkg/acquisition/modules/appsec/appsec.go @@ -268,6 +268,8 @@ func (w *AppsecSource) StreamingAcquisition(out chan types.Event, t *tomb.Tomb) }) <-t.Dying() w.logger.Infof("Stopping Appsec server on %s%s", w.config.ListenAddr, w.config.Path) + //xx let's clean up the appsec runners :) + appsec.AppsecRulesDetails = make(map[int]appsec.RulesDetails) w.server.Shutdown(context.TODO()) return nil }) diff --git a/pkg/appsec/appsec_rules_collection.go b/pkg/appsec/appsec_rules_collection.go index f6a135cae..2024673c3 100644 --- a/pkg/appsec/appsec_rules_collection.go +++ b/pkg/appsec/appsec_rules_collection.go @@ -43,7 +43,7 @@ type RulesDetails struct { Name string } -// Should it be a global ? +// FIXME: this shouldn't be a global // Is using the id is a good idea ? might be too specific to coraza and not easily reusable var AppsecRulesDetails = make(map[int]RulesDetails) diff --git a/pkg/appsec/loader.go b/pkg/appsec/loader.go index fa13cb03d..86c1dc0a8 100644 --- a/pkg/appsec/loader.go +++ b/pkg/appsec/loader.go @@ -15,6 +15,7 @@ var hub *cwhub.Hub //FIXME: this is a temporary hack to make the hub available i func LoadAppsecRules(hubInstance *cwhub.Hub) error { hub = hubInstance + appsecRules = make(map[string]AppsecCollectionConfig) for _, hubAppsecRuleItem := range hub.GetItemMap(cwhub.APPSEC_RULES) { if !hubAppsecRuleItem.State.Installed {