Skip to content

Commit

Permalink
allow empty syscall filter entry
Browse files Browse the repository at this point in the history
  • Loading branch information
imreACTmd committed Jul 9, 2018
1 parent 5054f06 commit 6f032c7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
4 changes: 0 additions & 4 deletions audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,6 @@ func createFilters(config *viper.Viper) ([]AuditFilter, error) {
return filters, fmt.Errorf("Filter %d is missing the `regex` entry", i+1)
}

if af.syscall == "" {
return filters, fmt.Errorf("Filter %d is missing the `syscall` entry", i+1)
}

if af.messageType == 0 {
return filters, fmt.Errorf("Filter %d is missing the `message_type` entry", i+1)
}
Expand Down
9 changes: 0 additions & 9 deletions audit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,6 @@ func Test_createFilters(t *testing.T) {
assert.EqualError(t, err, "Filter 1 is missing the `message_type` entry")
assert.Empty(t, f)

// Missing message_type
c = viper.New()
rf = make([]interface{}, 0)
rf = append(rf, map[interface{}]interface{}{"message_type": "1", "regex": "1"})
c.Set("filters", rf)
f, err = createFilters(c)
assert.EqualError(t, err, "Filter 1 is missing the `syscall` entry")
assert.Empty(t, f)

// Good with strings
c = viper.New()
rf = make([]interface{}, 0)
Expand Down

0 comments on commit 6f032c7

Please sign in to comment.