feat(aa-log): add a new constructors for aa rules.

This commit is contained in:
Alexandre Pujol 2023-08-17 23:05:07 +01:00
parent a8470dfa38
commit 4f40cb6d78
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
2 changed files with 146 additions and 0 deletions

38
pkg/aa/template.go Normal file
View file

@ -0,0 +1,38 @@
// apparmor.d - Full set of apparmor profiles
// Copyright (C) 2021-2023 Alexandre Pujol <alexandre@pujol.io>
// SPDX-License-Identifier: GPL-2.0-only
package aa
import (
_ "embed"
"strings"
)
// TODO: Should be a map of slice, not exhausive yet
var maskToAccess = map[string]string{
"a": "w",
"c": "w",
"d": "w",
"k": "rk",
"l": "l",
"m": "rm",
"r": "r",
"ra": "rw",
"read write": "read write",
"read": "read",
"readby": "readby",
"receive": "receive",
"rm": "rm",
"rw": "rw",
"send receive": "send receive",
"send": "send",
"w": "w",
"wc": "w",
"wr": "rw",
"wrc": "rw",
"wrd": "rw",
"write": "write",
"x": "rix",
}