-
Notifications
You must be signed in to change notification settings - Fork 909
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
update(cmake,scripts): bumped falcoctl to v0.8.0-rc1 and set modern eBPF as default driver + enable automatic driver selection logic #3154
Changes from all commits
4179870
d7da320
4017492
eba5e23
28bc3ad
23ef2ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -322,7 +322,7 @@ rules_file: | |
# buffers (higher `cpus_for_each_buffer`) can lower the memory footprint. | ||
# | ||
engine: | ||
kind: kmod | ||
kind: modern_ebpf | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
kmod: | ||
buf_size_preset: 4 | ||
drop_failed_exit: false | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,8 @@ | |
# limitations under the License. | ||
# | ||
|
||
chosen_driver= | ||
# By default, we use the automatic selection for drivers | ||
chosen_driver="auto" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New default is automatic selection. |
||
chosen_unit= | ||
CHOICE= | ||
|
||
|
@@ -38,43 +39,56 @@ systemctl --system disable 'falcoctl-artifact-follow.service' || true | |
systemctl --system unmask falcoctl-artifact-follow.service || true | ||
|
||
if [ "$1" = "configure" ]; then | ||
# "auto" case is not managed here since it is already the default, so no CHOICE=2 | ||
case $FALCO_DRIVER_CHOICE in | ||
none) | ||
CHOICE=1 | ||
;; | ||
kmod) | ||
CHOICE=2 | ||
CHOICE=3 | ||
;; | ||
ebpf) | ||
CHOICE=3 | ||
CHOICE=4 | ||
;; | ||
modern_ebpf) | ||
CHOICE=4 | ||
CHOICE=5 | ||
;; | ||
esac | ||
if [ -z $CHOICE ] && [ -x /usr/bin/dialog ] && [ "${FALCO_FRONTEND}" != "noninteractive" ]; then | ||
# If dialog is installed, create a dialog to let users choose the correct driver for them | ||
CHOICE=$(dialog --clear --title "Falco drivers" --menu "Choose your preferred driver:" 12 55 4 \ | ||
1 "Manual configuration (no unit is started)" \ | ||
2 "Kmod" \ | ||
3 "eBPF" \ | ||
4 "Modern eBPF" \ | ||
2 "Automatic selection" \ | ||
3 "Kmod" \ | ||
4 "eBPF" \ | ||
5 "Modern eBPF" \ | ||
2>&1 >/dev/tty) | ||
fi | ||
fi | ||
# "auto" case is not managed here since it is already the default, so no CHOICE=2 | ||
case $CHOICE in | ||
2) | ||
chosen_driver="kmod" | ||
chosen_unit="kmod" | ||
1) | ||
chosen_driver="" | ||
;; | ||
3) | ||
chosen_driver="ebpf" | ||
chosen_unit="bpf" | ||
chosen_driver="kmod" | ||
;; | ||
4) | ||
chosen_driver="ebpf" | ||
;; | ||
5) | ||
chosen_driver="modern_ebpf" | ||
chosen_unit="modern-bpf" | ||
;; | ||
esac | ||
if [ -n "$CHOICE" ]; then | ||
if [ -n "$chosen_driver" ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just need to check whether any driver was actually chosen (ie: if neither |
||
echo "[POST-INSTALL] Configure falcoctl driver type:" | ||
falcoctl driver config --type $chosen_driver | ||
if [ "$chosen_driver" = "auto" ]; then | ||
# Configure falcoctl to enable all drivers | ||
falcoctl driver config --type "modern_ebpf" --type "ebpf" --type "kmod" | ||
# Load the actually automatic chosen driver | ||
chosen_driver=$(falcoctl driver printenv | grep DRIVER= | cut -d'"' -f2) | ||
Comment on lines
+84
to
+88
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For automatic driver selection, configure falcoctl with all drivers; then use |
||
else | ||
falcoctl driver config --type "$chosen_driver" | ||
fi | ||
CHOICE= | ||
case $FALCOCTL_ENABLED in | ||
no) | ||
|
@@ -108,10 +122,15 @@ case "$chosen_driver" in | |
# Only compile for kmod, in this way we use dkms | ||
echo "[POST-INSTALL] Call 'falcoctl driver install for kmod:" | ||
falcoctl driver install --download=false | ||
chosen_unit="kmod" | ||
;; | ||
"ebpf") | ||
echo "[POST-INSTALL] Call 'falcoctl driver install for ebpf':" | ||
falcoctl driver install | ||
chosen_unit="bpf" | ||
;; | ||
"modern_ebpf") | ||
chosen_unit="modern-bpf" | ||
;; | ||
esac | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
driver: | ||
type: "kmod" | ||
type: [@FALCOCTL_DRIVER_TYPES@] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The list of allowed types is dynamically set, eg: if modern bpf is not built, it won't be present. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
name: "@DRIVER_NAME@" | ||
repos: | ||
- "@DRIVERS_REPO@" | ||
|
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.
Like for rpm/deb, automatic selection is the default.
In this case, there is no need to explicitly call
since that is already the default falcoctl config shipped within Falco (see https://github.com/falcosecurity/falco/pull/3154/files#diff-8cef78de718faa0811f718db1971271a3a7172a72b015e10bc59dc8077c5d4e2).
For dep and rpm, we always call it to eventually reset the falcoctl configuration upon package upgrade.