feat(aa-log): add support for mqueue.
This commit is contained in:
parent
319b976beb
commit
735e3529fb
5 changed files with 38 additions and 3 deletions
|
|
@ -4,19 +4,29 @@
|
|||
|
||||
package aa
|
||||
|
||||
import "strings"
|
||||
|
||||
type Mqueue struct {
|
||||
Qualifier
|
||||
Access string
|
||||
Type string
|
||||
Label string
|
||||
Name string
|
||||
}
|
||||
|
||||
func MqueueFromLog(log map[string]string) ApparmorRule {
|
||||
mqueueType := "posix"
|
||||
if strings.Contains(log["class"], "posix") {
|
||||
mqueueType = "posix"
|
||||
} else if strings.Contains(log["class"], "sysv") {
|
||||
mqueueType = "sysv"
|
||||
}
|
||||
return &Mqueue{
|
||||
Qualifier: NewQualifierFromLog(log),
|
||||
Access: maskToAccess[log["requested_mask"]],
|
||||
Type: log["type"],
|
||||
Access: maskToAccess[log["requested"]],
|
||||
Type: mqueueType,
|
||||
Label: log["label"],
|
||||
Name: log["name"],
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue