-
Notifications
You must be signed in to change notification settings - Fork 912
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
falco-driver-loader - break apart logic and improvements #1200
Conversation
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.
SGTM but need time to verify it a bit more.
Left one comment, thanks! 🎉
1713e86
to
7a594ba
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.
As said this looks mostly good.
The only thing I'm not really sure about is the usage of check_skip_load
to circuit-break only the load phase of the drivers (not their installation).
So, implemented in this way, what's the use case of --skip-load
? Maybe I'm missing something..
7a594ba
to
70b0d0b
Compare
My thought when I saw the proposal in the issue was... we might need this for testing purposes only. Ofc, Falco will not work if Should we remove it? |
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.
It's very hard for me to review this one.
Commit 70b0d0b contains many things that spans from formatting to adjusting old logic to new logic.
Even if looking at the PR it looks good to me it's very hard to me to spot a possible error here.
This script is fragile for many reasons:
- Does not have any tests
- Contains lots of OS specific logic
- It's used virtually by every user using Falco in a container
70b0d0b
to
5631bd8
Compare
I think The My 2 cents |
5631bd8
to
1d375ce
Compare
Update:
|
IMPORTANT I have noticed that:
might load a kernel module that does not fit the installed Falco version. Currently, it happens before trying a local prebuilt and the download strategy, but that should be the last resort. |
3ec833f
to
3439f61
Compare
Signed-off-by: Leonardo Grasso <[email protected]>
Signed-off-by: Leonardo Grasso <[email protected]>
Signed-off-by: Leonardo Grasso <[email protected]>
Signed-off-by: Leonardo Grasso <[email protected]>
3439f61
to
2792af2
Compare
Rebased on top of master to include lastest fixes. |
/milestone 0.23.0 |
LGTM label has been added. Git tree hash: 947bf6a4f4a5ca071a6c0ec2bb56c12d1edb4971
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fntlnz, leodido The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
What this PR does / why we need it:
See #1193
Which issue(s) this PR fixes:
Fixes #1193
Fixes #1125 (again)
Special notes for your reviewer:
Usage: falco-driver-loader [driver] [options] Available drivers: module kernel module (default) bpf eBPF probe Options: --help show brief help --compile try to compile the driver locally --download try to download a prebuilt driver
With no options and arguments, it preserves the previous behavior (we should test it deeply).
Notable improvements in messages:
* Message...
* Success: message...
*
represent the output of another program or an error/cc @kris-nova
/cc @leodido
/cc @fntlnz
falco-driver-loader (pre refactoring behavior)
Preflight check:
curl
, then exit 1module
Preflight check:
lsmod
, then exit 1modprobe
, then exit 1rmmod
, then exit 1else
dkms install
andinsmod
then exit 0modprobe
module, then exit 0get_target_id
)~/.falco/falco_<target_id>_<kernel_release>_<kernel_version>.ko
, then:insmod
then exit 0, else exit 1curl
module, theninsmod
then exit 0, else exit 1else
bpf
Preflight check:
get_kernel_config
)get_target_id
)~/.falco/falco_<target_id>_<kernel_release>_<kernel_version>.o
, then go to step 6.BPF_USE_LOCAL_KERNEL_SOURCES
then download kernel sourcecustomize_kernel_build
~/.falco/falco_<target_id>_<kernel_release>_<kernel_version>.o
~/.falco/falco_<target_id>_<kernel_release>_<kernel_version>.o
,curl
bpf probe (continue on error)~/.falco/falco_<target_id>_<kernel_release>_<kernel_version>.o
, then~/.falco/falco-bpf.o
then exit 0, else exit 1else
N.B.: bpf exists with 0 even though
curl
failed (see step 2.)Does this PR introduce a user-facing change?: