feat(aa): improve rule creation from log.
This commit is contained in:
parent
13de4182c8
commit
c7485326e8
15 changed files with 62 additions and 57 deletions
|
|
@ -11,13 +11,9 @@ type File struct {
|
|||
Target string
|
||||
}
|
||||
|
||||
func FileFromLog(log map[string]string, noNewPrivs, fileInherit bool) ApparmorRule {
|
||||
owner := false
|
||||
if log["fsuid"] == log["ouid"] && log["OUID"] != "root" {
|
||||
owner = true
|
||||
}
|
||||
func FileFromLog(log map[string]string) ApparmorRule {
|
||||
return &File{
|
||||
Qualifier: NewQualifier(owner, noNewPrivs, fileInherit),
|
||||
Qualifier: NewQualifierFromLog(log),
|
||||
Path: log["name"],
|
||||
Access: maskToAccess[log["requested_mask"]],
|
||||
Target: log["target"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue