mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 08:34:40 +01:00
Control checksums feature from a global cfg item
Previously it was enabled only if at least 1 rule had a checksum item configured. Enable by default md5.
This commit is contained in:
parent
6d056b8a7b
commit
6b3a5da343
1 changed files with 1 additions and 2 deletions
|
@ -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
|
||||
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue