Browse Source

add debug

alteredCoder 2 years ago
parent
commit
4332598cd1
1 changed files with 3 additions and 1 deletions
  1. 3 1
      pkg/acquisition/modules/waf/utils.go

+ 3 - 1
pkg/acquisition/modules/waf/utils.go

@@ -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
 		}
 		}