Skip to content

Commit

Permalink
check if resource exist - to filter relative paths
Browse files Browse the repository at this point in the history
Signed-off-by: Ankur Kothiwal <ankur.kothiwal@accuknox.com>
  • Loading branch information
Ankurk99 committed Nov 22, 2022
1 parent 5fab626 commit 307f3c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugin/kubearmor.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ func StartKubeArmorRelay(StopChan chan struct{}, cfg types.ConfigKubeArmorRelay)
continue
}

if res.Operation != "Network" && !strings.HasPrefix(res.Resource, "/") {
if len(res.Resource) != 0 && res.Operation != "Network" && !strings.HasPrefix(res.Resource, "/") {
log.Warn().Msgf("Relative path found: %v", res)
continue
}
Expand Down Expand Up @@ -490,7 +490,7 @@ func StartKubeArmorRelay(StopChan chan struct{}, cfg types.ConfigKubeArmorRelay)
continue
}

if res.Operation != "Network" && !strings.HasPrefix(res.Resource, "/") {
if len(res.Resource) != 0 && res.Operation != "Network" && !strings.HasPrefix(res.Resource, "/") {
log.Warn().Msgf("Relative path found: %v", res)
continue
}
Expand Down

0 comments on commit 307f3c3

Please sign in to comment.