-
Notifications
You must be signed in to change notification settings - Fork 362
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
tetragon: extract struct dentry member using CO:RE #2574
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi! I'm encountering the following error when attempting to build these changes, and am not quite sure why... 🤔 Following the same procedures as
Using the following Tracing Policy: apiVersion: cilium.io/v1alpha1
kind: TracingPolicy
metadata:
name: "follow-symlink"
spec:
kprobes:
- call: "security_inode_follow_link"
syscall: false
args:
- index: 0
type: "dentry"
returnArg:
index: 0
type: "int"
selectors:
- matchArgs:
- index: 0
operator: "Equal"
values:
- "/tmp/softlink" It appears the procedure has changed at least slightly since i've tried following the same procedure as |
I forgot to run Either way, above errors are fixed =) |
It was renamed from
Thanks! I plan to review this tomorrow. Could you also fix the static check failures? Running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, from a quick look this LGTM overall.
Can you please squash the fixes into the relevant original commits? (git rebase --interactive
using the squash
and fixup
actions should help).
It would also be great if a test was added for this newly-introduced functionality. Happy to provide some pointers and help out in doing so.
@@ -7,4 +7,4 @@ package v1alpha1 | |||
// Used to determine if CRD needs to be updated in cluster | |||
// | |||
// Developers: Bump patch for each change in the CRD schema. | |||
const CustomResourceDefinitionSchemaVersion = "1.2.0" | |||
const CustomResourceDefinitionSchemaVersion = "1.3.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the same minor number and just change the patch version since this follows the Tetragon version. So in this case, this should be 1.2.1
.
56d6858
to
2b47d1c
Compare
Thanks for the review @kkourt! I've responded to your comments and fixed the formatting issues, but I'm having trouble getting the test to work. Running the test program on my system, I see the relevant event being produced in {
"process_kprobe": {
"process": {
"exec_id": "bGF0ZXJhbHVzOjI0ODQ0MzUwNjU1MzM4OjMyNjQ2MQ==",
"pid": 326461,
"uid": 1000,
"cwd": "/home/dave/src/github.com/dwindsor/tetragon/contrib/tester-progs",
"binary": "/home/dave/src/github.com/dwindsor/tetragon/contrib/tester-progs/symlink-tester",
"flags": "execve clone",
"start_time": "2024-06-27T21:39:16.896790982Z",
"auid": 1000,
"parent_exec_id": "bGF0ZXJhbHVzOjU2NTkyMTAwMDAwMDA6ODUyNjE=",
"refcnt": 1,
"tid": 326461
},
"parent": {
"exec_id": "bGF0ZXJhbHVzOjU2NTkyMTAwMDAwMDA6ODUyNjE=",
"pid": 85261,
"uid": 1000,
"cwd": "/tmp",
"binary": "/usr/bin/bash",
"flags": "procFS auid",
"start_time": "2024-06-27T16:19:31.756135483Z",
"auid": 1000,
"parent_exec_id": "bGF0ZXJhbHVzOjU2NTkyMDAwMDAwMDA6ODUyNjA=",
"tid": 85261
},
"function_name": "security_inode_follow_link",
"args": [
{
"dentry_arg": {
"name": "/tmp/id"
}
}
],
"action": "KPROBE_ACTION_POST",
"policy_name": "path-traversal-block",
"return_action": "KPROBE_ACTION_POST"
},
"node_name": "lateralus",
"time": "2024-06-27T21:39:16.897100809Z"
} |
Hi,
Thanks. I think the issue might be that you are killing the test program before it has a chance to do the operation. I've tried the test locally, and this seems to work for me: diff --git a/pkg/sensors/tracing/kprobe_test.go b/pkg/sensors/tracing/kprobe_test.go
index db8a53f0b..55fcbbaa6 100644
--- a/pkg/sensors/tracing/kprobe_test.go
+++ b/pkg/sensors/tracing/kprobe_test.go
@@ -6049,7 +6049,6 @@ func TestDentryExtractPath(t *testing.T) {
ops := func() {
err = command.Start()
assert.NoError(t, err)
- defer command.Process.Kill()
}
events := perfring.RunTestEvents(t, ctx, ops)
Could you also rebase to latest |
could you please split the change into separate logical parts? like at least bpf bits. tests, schema changes.. anything that makes sense to split, thnx |
6c24409
to
b450367
Compare
Signed-off-by: David Windsor <dawindso@cisco.com>
438b3b5
to
ad33396
Compare
Signed-off-by: David Windsor <dawindso@cisco.com>
Signed-off-by: David Windsor <dawindso@cisco.com>
Signed-off-by: David Windsor <dawindso@cisco.com>
Thanks, can you also rebase? There seem to be conflicts. The conflicts seem to be in the auto-generated files, so it should be easy to resolve. |
Thanks! I've tried running make crds, but it shows no differences to push |
Have you tried running |
Moving this to draft since there are many conflicts. |
Thanks for contributing! Please ensure your pull request adheres to the following guidelines:
Fixes: #2573