fix the reload process for appsec (#2750)
This commit is contained in:
parent
f156f178cd
commit
685cda545b
|
@ -268,6 +268,8 @@ func (w *AppsecSource) StreamingAcquisition(out chan types.Event, t *tomb.Tomb)
|
||||||
})
|
})
|
||||||
<-t.Dying()
|
<-t.Dying()
|
||||||
w.logger.Infof("Stopping Appsec server on %s%s", w.config.ListenAddr, w.config.Path)
|
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())
|
w.server.Shutdown(context.TODO())
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
|
@ -43,7 +43,7 @@ type RulesDetails struct {
|
||||||
Name string
|
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
|
// Is using the id is a good idea ? might be too specific to coraza and not easily reusable
|
||||||
var AppsecRulesDetails = make(map[int]RulesDetails)
|
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 {
|
func LoadAppsecRules(hubInstance *cwhub.Hub) error {
|
||||||
|
|
||||||
hub = hubInstance
|
hub = hubInstance
|
||||||
|
appsecRules = make(map[string]AppsecCollectionConfig)
|
||||||
|
|
||||||
for _, hubAppsecRuleItem := range hub.GetItemMap(cwhub.APPSEC_RULES) {
|
for _, hubAppsecRuleItem := range hub.GetItemMap(cwhub.APPSEC_RULES) {
|
||||||
if !hubAppsecRuleItem.State.Installed {
|
if !hubAppsecRuleItem.State.Installed {
|
||||||
|
|
Loading…
Reference in a new issue