feat(aa-log): improve log to rule conversion.
This commit is contained in:
parent
75a8ef2906
commit
9aaf109383
1 changed files with 12 additions and 5 deletions
|
|
@ -143,7 +143,13 @@ var (
|
||||||
"rlimits": newRlimitFromLog,
|
"rlimits": newRlimitFromLog,
|
||||||
"namespace": newUsernsFromLog,
|
"namespace": newUsernsFromLog,
|
||||||
"cap": newCapabilityFromLog,
|
"cap": newCapabilityFromLog,
|
||||||
"net": newNetworkFromLog,
|
"net": func(log map[string]string) Rule {
|
||||||
|
if log["family"] == "unix" {
|
||||||
|
return newUnixFromLog(log)
|
||||||
|
} else {
|
||||||
|
return newNetworkFromLog(log)
|
||||||
|
}
|
||||||
|
},
|
||||||
"posix_mqueue": newMqueueFromLog,
|
"posix_mqueue": newMqueueFromLog,
|
||||||
"sysv_mqueue": newMqueueFromLog,
|
"sysv_mqueue": newMqueueFromLog,
|
||||||
"signal": newSignalFromLog,
|
"signal": newSignalFromLog,
|
||||||
|
|
@ -176,6 +182,7 @@ var (
|
||||||
"open": newFileFromLog,
|
"open": newFileFromLog,
|
||||||
"rename_dest": newFileFromLog,
|
"rename_dest": newFileFromLog,
|
||||||
"rename_src": newFileFromLog,
|
"rename_src": newFileFromLog,
|
||||||
|
"rmdir": newFileFromLog,
|
||||||
"truncate": newFileFromLog,
|
"truncate": newFileFromLog,
|
||||||
"unlink": newFileFromLog,
|
"unlink": newFileFromLog,
|
||||||
}
|
}
|
||||||
|
|
@ -219,7 +226,7 @@ func (p *Profile) AddRule(log map[string]string) {
|
||||||
case strings.Contains(log["operation"], "dbus"):
|
case strings.Contains(log["operation"], "dbus"):
|
||||||
p.Rules = append(p.Rules, newDbusFromLog(log))
|
p.Rules = append(p.Rules, newDbusFromLog(log))
|
||||||
default:
|
default:
|
||||||
fmt.Printf("unknown log type: %s\n", log["operation"])
|
fmt.Printf("unknown log type: %s:%v\n", log["operation"], log)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue