Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/sensors: fix binprm matchArgs test #2624

Closed
wants to merge 2 commits into from

Conversation

mtardy
Copy link
Member

@mtardy mtardy commented Jul 2, 2024

Based on #2623 work. Given this comment #2623 (comment).
cc @anfedotoff @dwindsor.

Running the test with the first commit only should fail as expected:

go test -exec sudo ./pkg/sensors/tracing --run TestLinuxBinprmExtractPath

With @anfedotoff patch, the test should now be green.

mtardy and others added 2 commits July 2, 2024 19:44
The test was broken in two ways:
- First it was using the "In" operator with MatchArgs, which does not
  exist. "Equal" should be used. It can be confusing because
  MatchBinaries uses "In". It bypasses validation since it provided the
  Go object without using the YAML unmarshalling.
- Secondly, it was only checking that the event existed without checking
  that the filtering actually happened. We can check the "lack" of event
  in addition to the presence of it thanks to the way this test is
  written, using the perfring.RunTestEvents.

This test should have detected the issue fixed by the following patch.

Signed-off-by: Mahe Tardy <[email protected]>
@mtardy mtardy added the release-note/bug This PR fixes an issue in a previous release of Tetragon. label Jul 2, 2024
@mtardy mtardy requested a review from a team as a code owner July 2, 2024 17:47
@mtardy mtardy requested review from tixxdz, dwindsor and kevsecurity and removed request for tixxdz July 2, 2024 17:47
Copy link

netlify bot commented Jul 2, 2024

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit d36c6bb
🔍 Latest deploy log https://app.netlify.com/sites/tetragon/deploys/66843d42b88ceb00082096f3
😎 Deploy Preview https://deploy-preview-2624--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kkourt
Copy link
Contributor

kkourt commented Jul 3, 2024

Seems to fail in 4.19:

❌ pkg.sensors.tracing.TestLinuxBinprmExtractPath (total:1 failed:1 skipped:0)
2.469554425s 14m5.677840959s

Maybe we need to skip the test if !HasProgramLargeSize()?

func HasProgramLargeSize() bool {

@anfedotoff
Copy link
Contributor

Seems to fail in 4.19:

❌ pkg.sensors.tracing.TestLinuxBinprmExtractPath (total:1 failed:1 skipped:0)
2.469554425s 14m5.677840959s

Maybe we need to skip the test if !HasProgramLargeSize()?

func HasProgramLargeSize() bool {

I skipped it already in my #2623. We can merge any of these PRs I think)).

@kevsecurity
Copy link
Contributor

I guess we don't need this one now.

@kevsecurity kevsecurity closed this Jul 3, 2024
@mtardy mtardy deleted the pr/mtardy/fix-linuxbprm-filter branch July 3, 2024 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/bug This PR fixes an issue in a previous release of Tetragon.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants