Open alexeysofin opened 6 months ago
Thanks for taking the time to open this issue. So you can see the process information and its parent in your event (if you get the event that contains the parent, or retrieve the information externally, you can rebuild an ancestor tree).
The process ancestry is a feature that is not available on the OSS version of Tetragon. May I ask where you saw mentions of this feature?
Hello.
Are there any plans to add process ancestry feature to tetragon in any foreseeable future? It really is very useful.
I've implemented my own version of it plus additional ancestor_binary_regex filter recently and so far it seems to be working fine. Not sure if my approach for it was optimal though, since i just basically added an optional loop to pkg/grpc/exec/exec.go. Not sure if i should create a PR as well, since it is a feature of the enterprise version.
@mtardy
May I ask where you saw mentions of this feature?
Nowhere, but this is just obvious that in a more or less loaded cluster health checks will be 99% of events, happening thousands per second, and in addition there are go structures for ancestors, which are always empty.
So we ended up with a custom solution as well, but without forking tetragon as per @t0x01, but as a secondary process that tracks process trees and is injected into the data delivery pipeline.
Hello, @mtardy.
Just trying to make sure. Since this feature is available only in the Isovalent enterprise version of Tetragon, is it prohibited to add it to the open-source version or anyone can essentially propose required changes via a PR anyway? It is a very usefull feature to have for both observability and filtering purposes. As i mentioned earlier, i've implemented my own version of it recently and it seems to be working well enough. At least as far as i can tell.
What i've changed:
enable-process-ancestors
from the config file. Turn option enable-process-ancestors
off by default.enable-process-ancestors
is set, try to include ancestors (up to PID 1/PID 2) of the process beyond the immediate parent in process_exec
, process_exit
, process_uprobe
, process_kprobe
, process_lsm
, process_tracepoint
events in a respective protobuf message for the given process.enable-process-ancestors
is set and there was an error when trying to include process' ancestors in the protobuf message, add the event to eventcache for reprocessing.enable-process-ancestors
is set and Ancestors
is nil, try to include process' ancestors again.All changes can be found here. I'm not quite certain, where and how it can be improved as of now. Please let me know if these changes are allowed to be added to the open-source version of Tetragon, and if so is it required to add or change anything else before creating a PR. Thank you.
Please submit a PR the list looks good and I'll review it wen the PR exists, didn't look at the link yet I'm currently at Linux Plumbers Conference but can look when I get back in a few days. Whatever different folks have forked on or added on top of Tetragon doesn't impact what we should do in Tetragon. Assuming the code looks good and no one has technical arguments against it I say we can push it. Thanks!
What happened?
Tetragon version
Kind version
deployed using default helm.
if I start a pod with image
debian:bookworm-slim
, exec into the pod and run this bash script../script.sh
I am not getting any ancestors in the log
is there something I'm doing wrong? This seems critical for more or less high-loaded clusters where container's health-checks can quickly overwhelm the log systems. In addition to that I think healthchecks can not filter out by ancestors either but at least we can do that by an intermediate filter system if the ancestors were there.
Tetragon Version
CLI version: v1.0.2
Kernel Version
Linux *** 6.5.0-28-generic #29~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 4 14:39:20 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Kubernetes Version
Server Version: v1.29.2
Bugtool
No response
Relevant log output
No response
Anything else?
No response