Skip to content

Commit

Permalink
processing: remove handler to be more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
markuskont committed Apr 12, 2023
1 parent 5605332 commit 28664dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func run(cmd *cobra.Command, args []string) {
Size: viper.GetDuration("sysmon.buckets.connection.duration"),
},
},
ResultHandler: func() processing.MapHandlerFunc {
SuricataHandler: func() processing.MapHandlerFunc {
if !viper.GetBool("suricata.enabled") {
return nil
}
Expand Down
12 changes: 6 additions & 6 deletions processing/winlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ type Winlog struct {

buckets *winlogBuckets

// ResultHandler assigns resulting correlations to correct suricata worker
ResultHandler MapHandlerFunc
// SuricataHandler assigns resulting correlations to correct suricata worker
SuricataHandler MapHandlerFunc

// weather to keep network events in buckets or not
// for potential out of order messages, is memory intentsive
Expand Down Expand Up @@ -215,10 +215,10 @@ func (c *Winlog) sendCorrelated(e datamodels.Map, key string) error {
return err
}
c.chCorrelated <- EncodedEntry{Entry: data, Key: key}
if c.ResultHandler != nil {
if c.SuricataHandler != nil {
dest := make(datamodels.Map)
deepCopyMap(e, dest)
c.ResultHandler(dest)
c.SuricataHandler(dest)
c.Stats.CountCorrFwd++
}
if c.writerCorrelate != nil {
Expand Down Expand Up @@ -251,7 +251,7 @@ type WinlogConfig struct {
ChanCorrelated chan EncodedEntry
ChanOnlyNetwork chan EncodedEntry
ForwardNetworkEvents bool
ResultHandler MapHandlerFunc
SuricataHandler MapHandlerFunc
}

func newWinlog(c WinlogConfig, cmdPersist []Bucket, corrWriter io.WriteCloser) (*Winlog, error) {
Expand Down Expand Up @@ -300,7 +300,7 @@ func newWinlog(c WinlogConfig, cmdPersist []Bucket, corrWriter io.WriteCloser) (
w.chOnlyNetwork = make(chan EncodedEntry)
}
w.forwardNetEvents = c.ForwardNetworkEvents
w.ResultHandler = c.ResultHandler
w.SuricataHandler = c.SuricataHandler

return w, nil
}

0 comments on commit 28664dd

Please sign in to comment.