feat(aa): add a string method to all rule struct.
This commit is contained in:
parent
e9fa0660f8
commit
5483668574
20 changed files with 337 additions and 34 deletions
|
|
@ -10,6 +10,12 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
tokATTRIBUTES = "xattrs"
|
||||
tokFLAGS = "flags"
|
||||
tokPROFILE = "profile"
|
||||
)
|
||||
|
||||
// Profile represents a single AppArmor profile.
|
||||
type Profile struct {
|
||||
RuleBase
|
||||
|
|
@ -40,6 +46,11 @@ func (p *Profile) Equals(other any) bool {
|
|||
slices.Equal(p.Flags, o.Flags)
|
||||
}
|
||||
|
||||
func (p *Profile) String() string {
|
||||
return renderTemplate(tokPROFILE, p)
|
||||
}
|
||||
|
||||
|
||||
// AddRule adds a new rule to the profile from a log map.
|
||||
func (p *Profile) AddRule(log map[string]string) {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue