feat(aa-log): also decode comm.

This commit is contained in:
Alexandre Pujol 2023-02-08 16:29:37 +00:00
parent f20ccedf4f
commit 6665e3861f
Failed to generate hash of commit

View file

@ -189,9 +189,13 @@ func NewApparmorLogs(file io.Reader, profile string) AppArmorLogs {
} }
} }
aa["profile"] = decodeHex(aa["profile"]) aa["profile"] = decodeHex(aa["profile"])
if name, ok := aa["name"]; ok { toDecode := []string{"profile", "name", "comm"}
aa["name"] = decodeHex(name) for _, name := range toDecode {
if value, ok := aa[name]; ok {
aa[name] = decodeHex(value)
}
} }
aaLogs = append(aaLogs, aa) aaLogs = append(aaLogs, aa)
} }
@ -285,7 +289,7 @@ func init() {
func main() { func main() {
flag.Parse() flag.Parse()
if help { if help {
fmt.Printf(`aa-log [-h] [-d] [-f file] [profile] fmt.Printf(`aa-log [-h] [-s] [-f file] [profile]
Review AppArmor generated messages in a colorful way. Review AppArmor generated messages in a colorful way.
It can be given an optional profile name to filter the output with. It can be given an optional profile name to filter the output with.