Skip to content

Commit

Permalink
fix(filter): remove unneeded workaround (#3352)
Browse files Browse the repository at this point in the history
Since 4.19 support was dropped (non CORE) there is no need for this
workaround to exist anymore.
  • Loading branch information
rafaeldtinoco authored Aug 1, 2023
1 parent da0db0d commit ba91923
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions pkg/cmd/flags/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ package flags
import (
"strings"

"github.com/aquasecurity/libbpfgo/helpers"

"github.com/aquasecurity/tracee/pkg/events"
"github.com/aquasecurity/tracee/pkg/logger"
)

func filterHelp() string {
Expand Down Expand Up @@ -113,31 +110,6 @@ func prepareEventsToTrace(eventFilter eventFilter, eventsNameToID map[string]eve
}
}

// Exclude network events from the default set if kernel v4.19.
// Issue: https://github.com/aquasecurity/tracee/issues/1602
// TODO: workaround until we have the feature probing mechanism
if osInfo, err := helpers.GetOSInfo(); err == nil {
kernel51ComparedToRunningKernel, err := osInfo.CompareOSBaseKernelRelease("5.1.0")
if err != nil {
logger.Errorw("Failed to compare kernel version", "error", err)
} else {
if kernel51ComparedToRunningKernel == helpers.KernelVersionNewer {
id_like := osInfo.GetOSReleaseFieldValue(helpers.OS_ID_LIKE)
if !strings.Contains(id_like, "rhel") {
// disable network events for v4.19 kernels other than RHEL based ones
logger.Debugw("Kernel <= v5.1, disabling network events from default set")
for _, id := range setsToEvents["default"] {
if id >= events.NetPacketIPv4 && id <= events.MaxUserNetID {
isExcluded[id] = true
}
}
}
}
}
} else {
logger.Errorw("Failed to get OS info", "error", err)
}

// mark excluded events (isExcluded) by their id
for _, name := range excludeEvents {
if strings.HasSuffix(name, "*") { // handle event prefixes with wildcards
Expand Down

0 comments on commit ba91923

Please sign in to comment.