feat(aa): add the Kind struct to manage aa rules.
This commit is contained in:
parent
1333ec2025
commit
3b0944c615
23 changed files with 239 additions and 223 deletions
|
|
@ -9,10 +9,10 @@ import (
|
|||
"slices"
|
||||
)
|
||||
|
||||
const tokCAPABILITY = "capability"
|
||||
const CAPABILITY Kind = "capability"
|
||||
|
||||
func init() {
|
||||
requirements[tokCAPABILITY] = requirement{
|
||||
requirements[CAPABILITY] = requirement{
|
||||
"name": {
|
||||
"audit_control", "audit_read", "audit_write", "block_suspend", "bpf",
|
||||
"checkpoint_restore", "chown", "dac_override", "dac_read_search",
|
||||
|
|
@ -36,7 +36,7 @@ func newCapabilityFromLog(log map[string]string) Rule {
|
|||
return &Capability{
|
||||
RuleBase: newRuleFromLog(log),
|
||||
Qualifier: newQualifierFromLog(log),
|
||||
Names: Must(toValues(tokCAPABILITY, "name", log["capname"])),
|
||||
Names: Must(toValues(CAPABILITY, "name", log["capname"])),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -70,6 +70,6 @@ func (r *Capability) Constraint() constraint {
|
|||
return blockKind
|
||||
}
|
||||
|
||||
func (r *Capability) Kind() string {
|
||||
return tokCAPABILITY
|
||||
func (r *Capability) Kind() Kind {
|
||||
return CAPABILITY
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue