up
This commit is contained in:
parent
dc39866250
commit
d851490790
|
@ -11,7 +11,6 @@ import (
|
||||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||||
"github.com/crowdsecurity/crowdsec/pkg/waf"
|
"github.com/crowdsecurity/crowdsec/pkg/waf"
|
||||||
"github.com/crowdsecurity/go-cs-lib/ptr"
|
"github.com/crowdsecurity/go-cs-lib/ptr"
|
||||||
"github.com/davecgh/go-spew/spew"
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
log "github.com/sirupsen/logrus"
|
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()
|
WafRuleHits.With(prometheus.Labels{"rule_id": fmt.Sprintf("%d", rule.Rule().ID()), "type": kind}).Inc()
|
||||||
|
|
||||||
spew.Dump(waf.WaapRulesDetails)
|
|
||||||
|
|
||||||
name := "NOT_SET"
|
name := "NOT_SET"
|
||||||
version := "NOT_SET"
|
version := "NOT_SET"
|
||||||
hash := "NOT_SET"
|
hash := "NOT_SET"
|
||||||
|
|
|
@ -49,6 +49,7 @@ type RulesDetails struct {
|
||||||
var WaapRulesDetails = make(map[int]RulesDetails)
|
var WaapRulesDetails = make(map[int]RulesDetails)
|
||||||
|
|
||||||
func LoadCollection(pattern string) ([]WaapCollection, error) {
|
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)
|
ret := make([]WaapCollection, 0)
|
||||||
|
|
||||||
for _, waapRule := range waapRules {
|
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)
|
log.Errorf("unable to convert rule %s : %s", rule.Name, err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
log.Infof("Adding rule %s", strRule)
|
log.Debugf("Adding rule %s", strRule)
|
||||||
waapCol.Rules = append(waapCol.Rules, strRule)
|
waapCol.Rules = append(waapCol.Rules, strRule)
|
||||||
|
|
||||||
//We only take the first id, as it's the one of the "main" rule
|
//We only take the first id, as it's the one of the "main" rule
|
||||||
|
|
Loading…
Reference in a new issue