-
Notifications
You must be signed in to change notification settings - Fork 381
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: Allow persistent enforcement during tetragon restart #2600
Conversation
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
56ff75f
to
4b7113c
Compare
0a3a057
to
055fa35
Compare
0a61e66
to
99a61e7
Compare
99a61e7
to
5d76690
Compare
5d76690
to
7cae9a6
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.
LGTM, thanks!
Just a quick question: Is link.Pin
also supported in the other types of programs that Tetragon supports (i.e. LSM, Tracing, Uprobes, RawTracepoints)? If yes, I believe that it is a good idea to update those as well. In that case, we also need to have a feature detection function using the same type of program instead of kprobes?
cmd/tetragon/main.go
Outdated
return old, nil | ||
} | ||
|
||
func deleteOlBpfDir(path string) { |
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.
Typo: deleteOlBpfDir -> deleteOldBpfDir
cmd/tetragon/main.go
Outdated
return | ||
} | ||
if err := os.RemoveAll(path); err != nil { | ||
log.Errorf("Failed to remove old bpf isntance '%s': %s\n", path, err) |
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.
Typo: isntance
yes, those should be supported as wee, I'll do follow up with that support, thanks |
Update ebpf version to latest upstream to get link Pin/Unpin changes. Signed-off-by: Jiri Olsa <[email protected]>
.. to detect link pinning functionality. Signed-off-by: Jiri Olsa <[email protected]>
Adding --bpf-dir option to alter to 'map dir' for tetragon, the default stays '/sys/fs/bpf/tetragon'. Signed-off-by: Jiri Olsa <[email protected]>
Adding support to pin link through linkPin function. At the moment we limit the link pinning with new PinLink bool in program.Program object, which will be used/set in future to control link pin for program. Adding test for pin link path setup. Signed-off-by: Jiri Olsa <[email protected]>
Adding support to pin tracepoint links. Signed-off-by: Jiri Olsa <[email protected]>
Adding support to pin kprobe links for both normal and override programs. Signed-off-by: Jiri Olsa <[email protected]>
Adding support to pin kprobe multi links. Signed-off-by: Jiri Olsa <[email protected]>
Adding support to pin fmodret links. Signed-off-by: Jiri Olsa <[email protected]>
Adding --keep-sensors-on-exit option to global control the pinning of maps/programs/links. By default tetragon creates and destroyes pin files for maps and programs. With --keep-sensors-on-exit option tetragon : - also create pins for links - does not unpin any pns on exit So this option will effectively keep configured policy still running even when tetragon process is gone. Signed-off-by: Jiri Olsa <[email protected]>
Adding support to detect and remove previous bpf instance of /sysfs/bpf/tetragon directory. On start tetragon now: - detect existing '/sysfs/bpf/tetragon' (or any other configured path) - rename it to '/sysfs/bpf/tetragon_old' - loads configured policy - deletes '/sysfs/bpf/tetragon_old' directory Signed-off-by: Jiri Olsa <[email protected]>
Adding tests for persistent enforcement - kill and override. Signed-off-by: Jiri Olsa <[email protected]>
7cae9a6
to
3683daf
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.
LGTM, thanks!
needs cilium/ebpf#1496 (merged, waiting for cilium/ebpf release)
Adding support to configure tetragon to keep existing policy in place - create pins for all maps/programs/links and do not remove them when tetragon exits.
This allows the policy to be in place when tetragon process is gone.
At the moment the configuration is by global flag. I have changes for configuring this through the spec 'options' flag, but first I need first to find a good way how to configure base sensor with same option. I think it's better to have this in place now, the option flag can come later.