diff --git a/pkg/ruleengine/v1/helpers.go b/pkg/ruleengine/v1/helpers.go index 9cd5c84f..70baa642 100644 --- a/pkg/ruleengine/v1/helpers.go +++ b/pkg/ruleengine/v1/helpers.go @@ -33,7 +33,9 @@ var ( func getExecPathFromEvent(event *tracerexectype.Event) string { if len(event.Args) > 0 { - return event.Args[0] + if event.Args[0] != "" { + return event.Args[0] + } } return event.Comm } diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index b81d6e3b..7dded0a6 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -441,7 +441,9 @@ func GetHostFilePathFromEvent(event K8sEvent, containerPid uint32) (string, erro // Get the path of the executable from the given event. func GetExecPathFromEvent(event *tracerexectype.Event) string { if len(event.Args) > 0 { - return event.Args[0] + if event.Args[0] != "" { + return event.Args[0] + } } return event.Comm }