Skip to content

Commit

Permalink
fix: The child profile should inherit rules from parent without attac…
Browse files Browse the repository at this point in the history
…k protection rules
  • Loading branch information
Danny-Wei committed Nov 12, 2024
1 parent edf6f07 commit 6cee760
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/profile/apparmor/apparmor.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ func GenerateEnhanceProtectProfile(enhanceProtect *varmor.EnhanceProtect, profil

// Attack Protection
index := 0
parentBaseRules := baseRules
for _, attackProtectionRule := range enhanceProtect.AttackProtectionRules {
if len(attackProtectionRule.Targets) == 0 {
for _, rule := range attackProtectionRule.Rules {
Expand All @@ -362,7 +363,7 @@ func GenerateEnhanceProtectProfile(enhanceProtect *varmor.EnhanceProtect, profil
// build a child profile for certain binaries
childProfileName := fmt.Sprintf("child_%d", index)
childProfilePath := fmt.Sprintf("%s//%s", profileName, childProfileName)
childProfileRules := baseRules
childProfileRules := parentBaseRules
index += 1

for _, rule := range attackProtectionRule.Rules {
Expand Down

0 comments on commit 6cee760

Please sign in to comment.