pre-compile Tracee's ebpf probe for different kernels #574
Replies: 5 comments 16 replies
-
re the Build system issue, we probably don't need a real kernel (VM) in order to build the probe, we could cross-compile it using just the appropriate headers, as suggested by Amir Jerbi. Needs to be validated but sounds promising |
Beta Was this translation helpful? Give feedback.
-
Yea if we could have a releases page for tracee-ebpf (or a tracee container) built for various kernel versions that'd be great. I don't feel that we should distribute the tracee go binary separately from the bpf object. When we ship the complete binary we can also embed the bpf object using the go 1.16 embed package (#434) to further simplify things. Taking it a step further we can compile statically to make it even easier. |
Beta Was this translation helpful? Give feedback.
-
We have a POC of cross-compiling using the target version kernel headers. One thing we need to consider is which kernel headers to use.
option 2 is easier to implement because it's one code flow, but it potentially is risky, because we don't know how each distro is configured (K configs). @yanivagman what do you think? |
Beta Was this translation helpful? Give feedback.
-
@afdesk has been working on this. I think that soon we could open issues/PRs. |
Beta Was this translation helpful? Give feedback.
-
We need to better understand what is the kernel version component, meaning what's the granularity we need to build for. |
Beta Was this translation helpful? Give feedback.
-
Today we expect people to compile the bpf probe on their hosts, either manually using
make bpf
or automatically by letting Tracee do it at start time.We should be able to pre-compile the probe for different kernel versions, and have Tracee use that.
I'm creating this discussion to discuss some aspect of this feature before we create issues:
Issue 1 - tracee-ebpf's probe discovery
Today Tracee-ebpf's start sequence is somewhat like:
TRACEE_BPF_FILE
--install-path
--install-path
(according to--build-policy
)We should add a new step to TRY downloading the probe.
--install-path
As with other cases we have experienced, this is a good opportunity to unify the UX:
--bpf build:{never,always,ifneeded}
default: ifneeded (in place of the existing--build-policy
flag)--bpf dir:/path/to/dir
default: /tmp/tracee (in place of the existing (--install-path
flag)--bpf file:/path/to/bpf.o
(precedes over existingTRACEE_BPF_FILE
env var)--bpf remote:{never,always,ifneeded}
--bpf remote-url:https://url
default: TBD (see Issue 2)future enhancement (out of scope)
Mentioning here we should use go-getter in the future which will solve most of those challenges.
Issue 2 - Build system
We should create an automated build system that compiles the eBPF probe for the different supported kernel version.
Since we can't cross-compile this needs to be actually spinning up custom VMs, therefore I think managed GitHub Actions is not an option. Perhaps self-hosted GitHub actions could be an option.Issue 3 - Probes registry
Our instinct would be to use GitHub releases, however I don't think it's the best option in this case:
I think we should create our own minimalistic solution based on some cloud storage, and simple proxy.
Beta Was this translation helpful? Give feedback.
All reactions