feat(aa): rewrite the toAccess function to parse, convert and verify the access values.

This commit is contained in:
Alexandre Pujol 2024-05-25 22:14:43 +01:00
parent 05de39d92a
commit 656aa15836
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
10 changed files with 134 additions and 53 deletions

View file

@ -4,7 +4,9 @@
package aa
import "slices"
import (
"slices"
)
const tokPTRACE = "ptrace"
@ -27,7 +29,7 @@ func newPtraceFromLog(log map[string]string) Rule {
return &Ptrace{
RuleBase: newRuleFromLog(log),
Qualifier: newQualifierFromLog(log),
Access: toAccess(tokPTRACE, log["requested_mask"]),
Access: Must(toAccess(tokPTRACE, log["requested_mask"])),
Peer: log["peer"],
}
}