Skip to content

Commit

Permalink
apparmor-enforcer: skip non-regular profiles
Browse files Browse the repository at this point in the history
SUSE creates few symbolic links in the `/etc/apparmor.d/` folder.
Kubearmor gives out error since the current check if based on IsDir()
and the sym links are not covered in that check. Now we are checking if
the file is a regular file and only use it in that case.

Signed-off-by: Rahul Jadhav <[email protected]>
  • Loading branch information
nyrahul committed Apr 6, 2022
1 parent 13417ca commit c1903f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion KubeArmor/enforcer/appArmorEnforcer.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ func NewAppArmorEnforcer(node tp.Node, logger *fd.Feeder) *AppArmorEnforcer {
}

for _, file := range files {
if file.IsDir() {
if !file.Mode().IsRegular() {
ae.Logger.Printf("skipping /etc/apparmor.d/%s since not a regular file", file.Name())
continue
}

Expand Down

0 comments on commit c1903f4

Please sign in to comment.