feat(aa): modify the apparmor struct to support multiple profiles and subprofile.

This commit is contained in:
Alexandre Pujol 2024-04-15 14:09:04 +01:00
parent 507002c660
commit 4b753210e7
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
12 changed files with 467 additions and 394 deletions

View file

@ -299,8 +299,8 @@ func TestAppArmorLogs_ParseToProfiles(t *testing.T) {
aaLogs: append(append(refKmod, refPowerProfiles...), refKmod...),
want: aa.AppArmorProfiles{
"kmod": &aa.AppArmorProfile{
Profile: aa.Profile{
Name: "kmod",
Profiles: []*aa.Profile{{
Header: aa.Header{Name: "kmod"},
Rules: aa.Rules{
&aa.Unix{
Rule: aa.Rule{FileInherit: true},
@ -315,11 +315,11 @@ func TestAppArmorLogs_ParseToProfiles(t *testing.T) {
Protocol: "0",
},
},
},
}},
},
"power-profiles-daemon": &aa.AppArmorProfile{
Profile: aa.Profile{
Name: "power-profiles-daemon",
Profiles: []*aa.Profile{{
Header: aa.Header{Name: "power-profiles-daemon"},
Rules: aa.Rules{
&aa.Dbus{
Access: "send",
@ -331,7 +331,7 @@ func TestAppArmorLogs_ParseToProfiles(t *testing.T) {
PeerLabel: "dbus-daemon",
},
},
},
}},
},
},
},