Skip to content

Commit

Permalink
internal/appsec: add manual keep for ruleset tagged spans
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellzy committed Apr 4, 2022
1 parent 89f9ef8 commit 69a1bbb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/appsec/waf.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"sync/atomic"
"time"

"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext"
"gopkg.in/DataDog/dd-trace-go.v1/internal/appsec/dyngo"
"gopkg.in/DataDog/dd-trace-go.v1/internal/appsec/dyngo/instrumentation/grpcsec"
"gopkg.in/DataDog/dd-trace-go.v1/internal/appsec/dyngo/instrumentation/httpsec"
Expand Down Expand Up @@ -150,6 +151,7 @@ func newHTTPWAFEventListener(handle *waf.Handle, addresses []string, timeout tim
op.AddTag(eventRulesErrorsTag, rInfo.Errors)
op.AddTag(eventRulesLoadedTag, float64(rInfo.Loaded))
op.AddTag(eventRulesFailedTag, float64(rInfo.Failed))
op.AddTag(ext.ManualKeep, true)
})

// Log the attacks if any
Expand Down Expand Up @@ -237,6 +239,7 @@ func newGRPCWAFEventListener(handle *waf.Handle, _ []string, timeout time.Durati
op.AddTag(eventRulesErrorsTag, rInfo.Errors)
op.AddTag(eventRulesLoadedTag, float64(rInfo.Loaded))
op.AddTag(eventRulesFailedTag, float64(rInfo.Failed))
op.AddTag(ext.ManualKeep, true)
})
if len(events) > 0 && limiter.Allow() {
op.AddSecurityEvents(events...)
Expand Down

0 comments on commit 69a1bbb

Please sign in to comment.