-
Notifications
You must be signed in to change notification settings - Fork 360
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
Lists #1283
Lists #1283
Conversation
0c1442d
to
f02e127
Compare
8b43955
to
c70db4c
Compare
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.
Cool! Had a quick look and left a comment.
73f454a
to
cc2350f
Compare
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
c77a730
to
1b22606
Compare
fe7630a
to
1ff1241
Compare
Curve out addKprobe which adds single kprobe, so we can pass specific name to it following changes and support symbols lists. The number of in/out arguments for addKprobe function is too big so I added in and out structs to carry it. There's no functional change intended, just preparation for following changes. Signed-off-by: Jiri Olsa <[email protected]>
Adding support to define lists in the schema, like: spec: lists: - name: "syscalls" type: "syscalls" values: - "sys_dup" - "sys_dup2" They will be used in generic kprobes. The type can be: syscalls generated_syscalls generated_ftrace The implementation is in following patches. Signed-off-by: Jiri Olsa <[email protected]>
Result of 'make generate && make codegen'. Signed-off-by: Jiri Olsa <[email protected]>
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.
LGTM! Thanks!
Adding support to validate lists for generic kprobes. The specific type validation checks comes with type implementations in following changes. Signed-off-by: Jiri Olsa <[email protected]>
Adding support for syscall lists, like: spec: lists: - name: "syscalls" type: "syscalls" values: - "sys_dup" - "sys_dup2" kprobes: - call: "list:syscalls" The prevalidation adds the arch specific syscall prefix. Signed-off-by: Jiri Olsa <[email protected]>
Adding support to generated syscall list, like: spec: lists: - name: "all-syscalls" type: "generated-syscalls" kprobes: - call: "list:all-syscalls" selectors: - matchBinaries: - operator: "In" values: - "/usr/bin/kill" that hooks to all syscalls and trace them for kill binary. Signed-off-by: Jiri Olsa <[email protected]>
Adding support for generated ftrace list in tracing policy. The list is based on ftrace available_filter_functions file and filtered out for regex pattern specified in pattern value, like: spec: lists: - name: "ksys" type: "generated_ftrace" pattern: "^ksys_*" kprobes: - call: "list:ksys" selectors: - matchBinaries: - operator: "In" values: - "/usr/bin/kill" Signed-off-by: Jiri Olsa <[email protected]>
Adding support to use list in generic kprobe specs. It's now possible to specify list in 'call' value, like: kprobes: - call: "list:ksys" That makes all previous changelog examples working. Signed-off-by: Jiri Olsa <[email protected]>
Adding new all-syscalls-list sub command that allows to generate tracing policy with all available syscalls, like: # ./tetra tracingpolicy generate all-syscalls-list apiVersion: cilium.io/v1alpha1 kind: TracingPolicy metadata: name: "syscalls" spec: lists: - name: "syscalls" type: "syscalls" values: - "sys_shutdown" - "sys_kexec_file_load" - "sys_io_uring_enter" - "sys_pkey_alloc" - "sys_clone3" - "sys_munlock" - "sys_lookup_dcookie" - "sys_eventfd2" - "sys_finit_module" - "sys_pwrite64" - "sys_semget" ... - "sys_mkdirat" - "sys_sync_file_range" - "sys_preadv" - "sys_syncfs" - "sys_link" - "sys_timer_delete" - "sys_unlinkat" kprobes: - call: "list:syscalls" syscall: true Signed-off-by: Jiri Olsa <[email protected]>
Adding new avail-list sub command that allows to generate tracing policy with generated functions list. The list is based on ftrace available_filter_functions file and filtered out for regex pattern given in -r/--regex option, like: # ./tetra tracingpolicy generate avail-list -r ^ksys_ apiVersion: cilium.io/v1alpha1 kind: TracingPolicy metadata: name: "ftrace" spec: lists: - name: "ftrace" values: - "ksys_dup3" - "ksys_fadvise64_64" - "ksys_fallocate" - "ksys_fchown" - "ksys_ioperm" - "ksys_lseek" - "ksys_mmap_pgoff" - "ksys_msgctl.constprop.0" - "ksys_msgget" - "ksys_msgrcv" - "ksys_msgsnd" - "ksys_pread64" - "ksys_pwrite64" - "ksys_read" - "ksys_readahead" - "ksys_semctl.constprop.0" - "ksys_semget" - "ksys_semtimedop" - "ksys_setsid" - "ksys_shmctl.constprop.0" - "ksys_shmdt" - "ksys_shmget" - "ksys_sync" - "ksys_sync_file_range" - "ksys_sync_helper" - "ksys_unshare" - "ksys_write" kprobes: - call: "list:ftrace" Note it's possible to get all available functions generated, but it's not advisable to run such policy ;-) Signed-off-by: Jiri Olsa <[email protected]>
Adding syscall list tracing policy example. Signed-off-by: Jiri Olsa <[email protected]>
Adding syscall generated list tracing policy example. Signed-off-by: Jiri Olsa <[email protected]>
Adding ftrace generated list tracing policy example. Signed-off-by: Jiri Olsa <[email protected]>
This is awesome! 🎉 |
syscalls specified in list:
all syscalls (generated):
ftrace functions (generated) with filter:
standard functions in the list: