feat(aa-log): ensure unix rule are not confused with network unix rule.

Both are technically the same, we simply prioritize `unix` to `network unix`.
This commit is contained in:
Alexandre Pujol 2024-02-29 00:20:37 +00:00
parent e3daaf3d4c
commit e616b9b3fc
Failed to generate hash of commit

View file

@ -85,7 +85,11 @@ func (p *AppArmorProfile) AddRule(log map[string]string) {
case "cap":
p.Rules = append(p.Rules, CapabilityFromLog(log))
case "net":
p.Rules = append(p.Rules, NetworkFromLog(log))
if log["family"] == "unix" {
p.Rules = append(p.Rules, UnixFromLog(log))
} else {
p.Rules = append(p.Rules, NetworkFromLog(log))
}
case "mount":
switch log["operation"] {
case "mount":