Skip to content

Commit

Permalink
Merge pull request #599 from Ankurk99/dev
Browse files Browse the repository at this point in the history
check if resource exist - to filter relative paths
  • Loading branch information
achrefbensaad committed Nov 22, 2022
2 parents 5fab626 + 307f3c3 commit 4d0f1a2
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 4d0f1a2

Please sign in to comment.