|
@@ -10,6 +10,7 @@ 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/prometheus/client_golang/prometheus"
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
|
|
+ log "github.com/sirupsen/logrus"
|
|
)
|
|
)
|
|
|
|
|
|
func EventFromRequest(r waf.ParsedRequest) (types.Event, error) {
|
|
func EventFromRequest(r waf.ParsedRequest) (types.Event, error) {
|
|
@@ -115,11 +116,12 @@ func (r *WafRunner) AccumulateTxToEvent(tx experimental.FullTransaction, kind st
|
|
return true
|
|
return true
|
|
})
|
|
})
|
|
|
|
|
|
- r.logger.Infof("variables addr in AccumulateTxToEvent: %p", tx.Variables())
|
|
|
|
//log.Infof("variables: %s", spew.Sdump(tx.Variables()))
|
|
//log.Infof("variables: %s", spew.Sdump(tx.Variables()))
|
|
//log.Infof("tx variables: %+v", tx.Collection(variables.TX))
|
|
//log.Infof("tx variables: %+v", tx.Collection(variables.TX))
|
|
//log.Infof("TX %s", spew.Sdump(tx.MatchedRules()))
|
|
//log.Infof("TX %s", spew.Sdump(tx.MatchedRules()))
|
|
|
|
+
|
|
for _, rule := range tx.MatchedRules() {
|
|
for _, rule := range tx.MatchedRules() {
|
|
|
|
+ log.Infof("Matched rules ID: %+v", rule.Rule().ID())
|
|
if rule.Message() == "" {
|
|
if rule.Message() == "" {
|
|
continue
|
|
continue
|
|
}
|
|
}
|