feat(aa-log): allow profile selection for dbus rules.

This commit is contained in:
Alexandre Pujol 2022-06-05 14:54:26 +01:00
parent f6b6e99cde
commit 671dcca38d
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC

View File

@ -89,7 +89,7 @@ func NewApparmorLogs(file io.Reader, profile string) AppArmorLogs {
log := "" log := ""
exp := "apparmor=(\"DENIED\"|\"ALLOWED\"|\"AUDIT\")" exp := "apparmor=(\"DENIED\"|\"ALLOWED\"|\"AUDIT\")"
if profile != "" { if profile != "" {
exp = fmt.Sprintf(exp+".* profile=\"%s.*\"", profile) exp = fmt.Sprintf(exp+".* (profile=\"%s.*\"|label=\"%s.*\")", profile, profile)
} }
isAppArmorLog := regexp.MustCompile(exp) isAppArmorLog := regexp.MustCompile(exp)