Skip to content

Commit

Permalink
Control checksums feature from a global cfg item
Browse files Browse the repository at this point in the history
Previously it was enabled only if at least 1 rule had a checksum item
configured.
Enable by default md5.
  • Loading branch information
gustavo-iniguez-goya committed Nov 10, 2023
1 parent 6d056b8 commit 6b3a5da
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions daemon/rule/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func (l *Loader) EnableChecksums(enable bool) {
log.Debug("[rules loader] EnableChecksums: %v", enable)
l.checkSums = enable
procmon.EventsCache.SetComputeChecksums(enable)
procmon.EventsCache.AddChecksumHash(string(OpProcessHashMD5))
}

// HasChecksums checks if the rule will check for binary checksum matches
Expand Down Expand Up @@ -209,13 +210,11 @@ func (l *Loader) loadRule(fileName string) error {
}
} else {
if err := r.Operator.Compile(); err != nil {
l.HasChecksums(r.Operator.Operand)
log.Warning("Operator.Compile() error: %s: %s", err, r.Operator.Data)
return fmt.Errorf("(1) Error compiling rule: %s", err)
}
if r.Operator.Type == List {
for i := 0; i < len(r.Operator.List); i++ {
l.HasChecksums(r.Operator.List[i].Operand)
if err := r.Operator.List[i].Compile(); err != nil {
log.Warning("Operator.Compile() error: %s: ", err)
return fmt.Errorf("(1) Error compiling list rule: %s", err)
Expand Down

0 comments on commit 6b3a5da

Please sign in to comment.