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

Allow event filtering based on tracing policy #1867

Merged
merged 3 commits into from
Jan 16, 2024

Conversation

ioandr
Copy link
Contributor

@ioandr ioandr commented Dec 11, 2023

This PR extends the list of filters by implementing the policy name filter. This allows Tetragon to filter events based on the name of a tracing policy.

It also improves Tetragon's docs (see #1965) and extends test suites as needed.

Closes #1855

tetra: Add event filter based on tracing policy name

Copy link

netlify bot commented Dec 11, 2023

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit fee4776
🔍 Latest deploy log https://app.netlify.com/sites/tetragon/deploys/65a5771630912d0008d50f0e
😎 Deploy Preview https://deploy-preview-1867--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.

@ioandr ioandr force-pushed the feature-i-filter-policies branch 2 times, most recently from 8ad79e5 to b14a096 Compare December 20, 2023 01:14
@ioandr ioandr marked this pull request as ready for review December 20, 2023 01:15
@ioandr ioandr requested review from a team, mtardy and willfindlay as code owners December 20, 2023 01:15
@kkourt kkourt self-requested a review December 20, 2023 10:26
@kkourt kkourt added release-note/misc This PR makes changes that have no direct user impact. release-note/minor This PR introduces a minor user-visible change and removed release-note/misc This PR makes changes that have no direct user impact. labels Dec 20, 2023
@kkourt
Copy link
Contributor

kkourt commented Dec 20, 2023

Thanks! started the tests, and added a release note!

Copy link
Member

@mtardy mtardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey!! Thanks a lot for those patches, I think they all make sense and I would like to merge them!

This is a bit of a nit but the commits are not really related, would it be possible to split this PR into two PRs? Maybe this one for the filtering based on the tracing policy name, and another one for the docs? If this is too annoying tell me and we'll figure something else.

Also if you can rebase since we fixed something in the CI in the meantime. Sorry for the delay, it was the Christmas period! 🎄

api/v1/tetragon/events.proto Outdated Show resolved Hide resolved
docs/content/en/docs/getting-started/install-k8s.md Outdated Show resolved Hide resolved
@willfindlay
Copy link
Contributor

I'm also good with merging this once @mtardy's comments have been addressed.

@jrfastab
Copy link
Contributor

jrfastab commented Jan 8, 2024

+1 appears useful please address feedback and we can get this merged! :)

@ioandr
Copy link
Contributor Author

ioandr commented Jan 10, 2024

Hey!! Thanks a lot for those patches, I think they all make sense and I would like to merge them!

That's good to hear, thanks!

This is a bit of a nit but the commits are not really related, would it be possible to split this PR into two PRs? Maybe this one for the filtering based on the tracing policy name, and another one for the docs? If this is too annoying tell me and we'll figure something else.

Sure, I can split changes into 2 PRs.

Also if you can rebase since we fixed something in the CI in the meantime.

Definitely, will do.

Copy link
Contributor

@kkourt kkourt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Everything looks good to me.

I'd prefer if the last patch was split into multiple patches, such as

  • documentation fixes (typos)
  • core code changes
  • tetra CLI

But I don't think we should block the PR on this.

Could you please address the comments from everyone and have the documentation change also work in bash?

Other than that, good to go from my side!

docs/content/en/docs/getting-started/install-k8s.md Outdated Show resolved Hide resolved
@ioandr ioandr force-pushed the feature-i-filter-policies branch from b14a096 to 6d05c15 Compare January 12, 2024 00:38
@ioandr
Copy link
Contributor Author

ioandr commented Jan 12, 2024

Update:

  1. I moved doc-related changes to a new PR - see docs: fix typos, fix k8s install guide for zsh and update Cilium SW demo #1965
  2. I broke down remaining changes introduced by the original PR into 3 commits as discussed above
  3. I rebased over latest main and force-pushed to the branch of the original PR
  4. I did not have the time to re-test functionality, I can do that in the following days (if needed)

Copy link
Contributor

@kkourt kkourt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks! LGTM

I did not have the time to re-test functionality, I can do that in the following days (if needed)

Is there testing that is not covered by the unit tests?
As far as I can see, there were no changes in the code (other than the rebasing) and you have unit tests so, at least from my side, it's good to merge.

@ioandr
Copy link
Contributor Author

ioandr commented Jan 12, 2024

Is there testing that is not covered by the unit tests? As far as I can see, there were no changes in the code (other than the rebasing) and you have unit tests so, at least from my side, it's good to merge.

Indeed, just mentioned this for completeness. I'm good to proceed.

@ioandr
Copy link
Contributor Author

ioandr commented Jan 12, 2024

@mtardy now that your comments have been addressed maybe approve this?

Copy link
Member

@mtardy mtardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, and thanks for adding tests, let's merge that :)

cmd/tetra/getevents/getevents.go Show resolved Hide resolved
@mtardy mtardy added the area/userspace Related to userspace Tetragon logic label Jan 15, 2024
@mtardy
Copy link
Member

mtardy commented Jan 15, 2024

I can't merge because of this @willfindlay, could you review it?

# Request a review from William when codegen is edited
/cmd/protoc-gen-go-tetragon/ @willfindlay

In the meantime @ioandr if you can ever rebase this on main (I'm sorry I wanted to merge this now), I fixed the CI issue that made vmtests fail early.

Signed-off-by: Ioannis Androulidakis <[email protected]>
Extend the list of filters with a new one to support filtering events
based on the name of a tracing policy.

Closes cilium#1855

Signed-off-by: Ioannis Androulidakis <[email protected]>
@ioandr ioandr force-pushed the feature-i-filter-policies branch from 6d05c15 to fee4776 Compare January 15, 2024 18:19
@mtardy
Copy link
Member

mtardy commented Jan 16, 2024

Thanks for the rebase, everything is green, now just waiting on William's ack.

@willfindlay willfindlay merged commit 5361282 into cilium:main Jan 16, 2024
37 checks passed
@willfindlay
Copy link
Contributor

Merged, thanks

justin0u0 added a commit to justin0u0/tetragon that referenced this pull request Oct 25, 2024
In cilium#1867, the `--policy-names` flag was added to filter events
based on the tracing policy. However, the filter was only appled
to `kprobe` events.

This patch extends the filter to support all events types:
`tracepoint`, `uprobe` and `lsm`.

Signed-off-by: Justin Chen <[email protected]>
justin0u0 added a commit to justin0u0/tetragon that referenced this pull request Oct 25, 2024
In cilium#1867, the `--policy-names` flag was added to filter events
based on the tracing policy. However, the filter was only appled
to `kprobe` events.

This patch extends the filter to support all events types:
`tracepoint`, `uprobe` and `lsm`.

Signed-off-by: Justin Chen <[email protected]>
justin0u0 added a commit to justin0u0/tetragon that referenced this pull request Oct 25, 2024
In cilium#1867, the `--policy-names` flag was added to filter events
based on the tracing policy. However, the filter was only appled
to `kprobe` events.

This patch extends the filter to support all events types:
`kprobe`, `tracepoint`, `uprobe` and `lsm`.

Signed-off-by: Justin Chen <[email protected]>
justin0u0 added a commit to justin0u0/tetragon that referenced this pull request Oct 25, 2024
In cilium#1867, the `--policy-names` flag was added to filter events
based on the tracing policy. However, the filter was only appled
to `kprobe` events.

This patch extends the filter to support all events types:
`kprobe`, `tracepoint`, `uprobe` and `lsm`.

Signed-off-by: Justin Chen <[email protected]>
kkourt pushed a commit that referenced this pull request Oct 28, 2024
In #1867, the `--policy-names` flag was added to filter events
based on the tracing policy. However, the filter was only appled
to `kprobe` events.

This patch extends the filter to support all events types:
`kprobe`, `tracepoint`, `uprobe` and `lsm`.

Signed-off-by: Justin Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/userspace Related to userspace Tetragon logic release-note/minor This PR introduces a minor user-visible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allow event filtering based on tracing policy
5 participants