This commit is contained in:
Sebastien Blot 2023-11-27 13:41:00 +01:00
parent dc39866250
commit d851490790
No known key found for this signature in database
GPG key ID: DFC2902F40449F6A
2 changed files with 2 additions and 4 deletions

View file

@ -11,7 +11,6 @@ import (
"github.com/crowdsecurity/crowdsec/pkg/types"
"github.com/crowdsecurity/crowdsec/pkg/waf"
"github.com/crowdsecurity/go-cs-lib/ptr"
"github.com/davecgh/go-spew/spew"
"github.com/prometheus/client_golang/prometheus"
log "github.com/sirupsen/logrus"
)
@ -204,8 +203,6 @@ func (r *WaapRunner) AccumulateTxToEvent(evt *types.Event, req waf.ParsedRequest
WafRuleHits.With(prometheus.Labels{"rule_id": fmt.Sprintf("%d", rule.Rule().ID()), "type": kind}).Inc()
spew.Dump(waf.WaapRulesDetails)
name := "NOT_SET"
version := "NOT_SET"
hash := "NOT_SET"

View file

@ -49,6 +49,7 @@ type RulesDetails struct {
var WaapRulesDetails = make(map[int]RulesDetails)
func LoadCollection(pattern string) ([]WaapCollection, error) {
//FIXME: have a proper logger here, inheriting from waap-config to have consistent log levels
ret := make([]WaapCollection, 0)
for _, waapRule := range waapRules {
@ -106,7 +107,7 @@ func LoadCollection(pattern string) ([]WaapCollection, error) {
log.Errorf("unable to convert rule %s : %s", rule.Name, err)
return nil, err
}
log.Infof("Adding rule %s", strRule)
log.Debugf("Adding rule %s", strRule)
waapCol.Rules = append(waapCol.Rules, strRule)
//We only take the first id, as it's the one of the "main" rule