Skip to content

Commit

Permalink
fix(apparmor): clone non conflicting proc rules to from source
Browse files Browse the repository at this point in the history
subprofiles

Signed-off-by: daemon1024 <[email protected]>
  • Loading branch information
daemon1024 committed Oct 30, 2024
1 parent 4731b3c commit 011bfcd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions KubeArmor/enforcer/appArmorProfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,12 @@ func (ae *AppArmorEnforcer) GenerateProfileBody(securityPolicies []tp.SecurityPo
ae.Logger.Errf("Error while copying global rules to local profile for %s: %s", source, err.Error())
continue
}
for proc, config := range profile.ProcessPaths {
add := checkIfGlobalRuleToBeAdded(proc, val.ProcessPaths)
if add {
newval.ProcessPaths[proc] = config
}
}
for file, config := range profile.FilePaths {
add := checkIfGlobalRuleToBeAdded(file, val.FilePaths)
if add {
Expand Down

0 comments on commit 011bfcd

Please sign in to comment.