feat(aa-log): add -r option to convert the log into rules.

This commit is contained in:
Alexandre Pujol 2023-08-17 23:14:11 +01:00
parent d06a474b0c
commit 9650df00e3
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
2 changed files with 25 additions and 5 deletions

View file

@ -25,6 +25,14 @@ func Test_app(t *testing.T) {
rules: false,
wantErr: false,
},
{
name: "Test audit.log to rules",
logger: "auditd",
path: "../../tests/audit.log",
profile: "",
rules: rules,
wantErr: false,
},
{
name: "Test Dbus Session",
logger: "systemd",
@ -52,7 +60,7 @@ func Test_app(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if err := aaLog(tt.logger, tt.path, tt.profile); (err != nil) != tt.wantErr {
if err := aaLog(tt.logger, tt.path, tt.profile, tt.rules); (err != nil) != tt.wantErr {
t.Errorf("aaLog() error = %v, wantErr %v", err, tt.wantErr)
}
})