elastic / elastic/go-libaudit

Cannot add rules with multiple key filters

Open
#158 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
162
Forks
74
PR merge metrics
No merged PRs in 30d

Description

Hello! Thanks for this great project!

I've encountered a problem: parsed rules with multiple key filters (`-F key=`) cannot be added to the kernel - an "invalid argument" error is returned.

I use the library like this:

```go
ruleWithTwoKeyFormats := "-a always,exit -F arch=b64 -S open,truncate,ftruncate,creat,openat,open_by_handle_at -F exit=-EACCES -F key=firstkey -F key=secondkey"

r, err := flags.Parse(ruleWithTwoKeyFormats)
if err != nil {
return err
}

data, err := rule.Build(r)
if err != nil {
return err
}

if err := client.AddRule(data); err != nil {
return err
}

fmt.Println("added rule")
```

When `-k ` syntax is used instead of `-F key=`, it works correctly. Mixing both formats again leads to this error.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.