Skip to content

Commit

Permalink
[CWS] add early drop of useless notifications in windows probe (#31034)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux authored Nov 13, 2024
1 parent acdd783 commit a7db6c7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/security/probe/probe_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,15 @@ func (p *WindowsProbe) setupEtw(ecb etwCallback) error {

}

func shouldEarlyDropNotif(n interface{}) bool {
switch n.(type) {
case *closeArgs, *cleanupArgs, *createHandleArgs:
return true
default:
return false
}
}

// Start processing events
func (p *WindowsProbe) Start() error {

Expand All @@ -728,6 +737,10 @@ func (p *WindowsProbe) Start() error {
go func() {
defer p.fimwg.Done()
err := p.setupEtw(func(n interface{}, pid uint32) {
if shouldEarlyDropNotif(n) {
return
}

if p.blockonchannelsend {
p.onETWNotification <- etwNotification{n, pid}
} else {
Expand Down

0 comments on commit a7db6c7

Please sign in to comment.