fix the reload process for appsec (#2750)
This commit is contained in:
parent
f156f178cd
commit
685cda545b
3 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
})
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue