Skip to content

Commit

Permalink
fix: reduce noise in output
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>
  • Loading branch information
fzipi committed Sep 22, 2024
1 parent 81f0e99 commit 503bb77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion internal/quantitative/local_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ func crsWAF(prefix string, paranoiaLevel int) coraza.WAF {
}

func obtainStatusCodeFromInterruptionOrDefault(it *types.Interruption, defaultStatusCode int) int {
log.Debug().Msgf("Interruption: %s", it.Action)
if it.Action == "deny" {
statusCode := it.Status
if statusCode == 0 {
Expand Down
7 changes: 3 additions & 4 deletions internal/quantitative/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewCorpus(corpusType corpus.Type) corpus.Corpus {

// RunQuantitativeTests runs all quantitative tests
func RunQuantitativeTests(params Params, out *output.Output) error {
out.Println("Running quantitative tests")
out.Println(":hourglass: Running quantitative tests")

log.Trace().Msgf("Lines: %d", params.Lines)
log.Trace().Msgf("Fast: %d", params.Fast)
Expand All @@ -70,7 +70,7 @@ func RunQuantitativeTests(params Params, out *output.Output) error {

startTime := time.Now()
// create a new corpusRunner
corpusRunner := NewCorpus(corpus.Leipzig).
corpusRunner := NewCorpus(params.Corpus).
WithSize(params.CorpusSize).
WithYear(params.CorpusYear).
WithSource(params.CorpusSource).
Expand Down Expand Up @@ -136,12 +136,11 @@ func doEngineCall(engine LocalEngine, payload string, specificRule int, stats *Q
log.Trace().Msgf("Rules: %v", matchedRules)
if status == http.StatusForbidden {
// append the line to the false positives
log.Debug().Msgf("False positive with string: %s", payload)
log.Trace().Msgf("False positive with string: %s", payload)
log.Trace().Msgf("=> rules matched: %+v", matchedRules)
for rule, data := range matchedRules {
// check if we only want to show false positives for a specific rule
if wantSpecificRuleResults(specificRule, rule) {
log.Debug().Msgf("rule %d does not match the specific rule we wanted %d", rule, specificRule)
continue
}
stats.addFalsePositive(rule)
Expand Down

0 comments on commit 503bb77

Please sign in to comment.