Skip to content
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

Merged
merged 6 commits into from
Apr 15, 2024

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Apr 4, 2024

What type of PR is this?

/kind release

Any specific area of the project related to this PR?

/area build

What this PR does / why we need it:
This PR bumps falcoctl to v0.8.0-rc1.
Moreover, it:

  • Sets modern ebpf as default driver
  • Enables automatic driver selection logic as default behavior for deb,rpm and driver loader docker images

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

TODO:

  • update rpm/deb installation scripts
  • update docker images entrypoints

Does this PR introduce a user-facing change?:

new(scripts,docker)!: enable automatic driver selection logic in packages and docker images. Modern eBPF is now also the default driver and the highest priority one in the new driver selection logic.

@@ -1,5 +1,8 @@
driver:
type: "kmod"
type:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leverage new falcoctl feature to automatically select the best driver for us.

@FedeDP FedeDP changed the title update(cmake,scripts): bumped falcoctl to v0.8.0-rc1. wip: update(cmake,scripts): bumped falcoctl to v0.8.0-rc1. Apr 4, 2024
…n cmake configuration.

Signed-off-by: Federico Di Pierro <[email protected]>
@@ -1,5 +1,5 @@
driver:
type: "kmod"
type: [@FALCOCTL_DRIVER_TYPES@]
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@poiana poiana added size/L and removed size/S labels Apr 9, 2024
…eal with new automatic driver selection as default behavior.

Signed-off-by: Federico Di Pierro <[email protected]>
Andreagit97
Andreagit97 previously approved these changes Apr 9, 2024
Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana poiana added the lgtm label Apr 9, 2024
@Andreagit97 Andreagit97 added this to the 0.38.0 milestone Apr 9, 2024
@FedeDP
Copy link
Contributor Author

FedeDP commented Apr 9, 2024

This is still wip :D

;;
esac
if [ -n "$CHOICE" ]; then
if [ -n "$chosen_driver" ]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 FALCO_DRIVER_CHOICE=none was passd nor Manual configuration was set).

@@ -17,7 +17,8 @@
# limitations under the License.
#

chosen_driver=
# By default, we use the automatic selection for drivers
chosen_driver="auto"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New default is automatic selection.

Comment on lines +83 to +87
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)
Copy link
Contributor Author

@FedeDP FedeDP Apr 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For automatic driver selection, configure falcoctl with all drivers; then use printenv to load the runtime selected driver; it is needed to know which systemd unit must be enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has same changes as the deb one.

@@ -24,8 +24,10 @@ print_usage() {
echo " docker run -i -t --privileged -v /root/.falco:/root/.falco -v /proc:/host/proc:ro -v /boot:/host/boot:ro -v /lib/modules:/host/lib/modules:ro -v /usr:/host/usr:ro -v /etc:/host/etc:ro falcosecurity/falco-driver-loader-legacy:latest [driver] [options]"
echo ""
echo "Available drivers:"
echo " kmod kernel module (default)"
echo " auto leverage automatic driver selection logic (default)"
Copy link
Contributor Author

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

/usr/bin/falcoctl driver config --type modern_ebpf --type ebpf --type kmod

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.

Copy link
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM!

@@ -322,7 +322,7 @@ rules_file:
# buffers (higher `cpus_for_each_buffer`) can lower the memory footprint.
#
engine:
kind: kmod
kind: modern_ebpf
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -1,5 +1,5 @@
driver:
type: "kmod"
type: [@FALCOCTL_DRIVER_TYPES@]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: Federico Di Pierro <[email protected]>
@FedeDP FedeDP changed the title wip: update(cmake,scripts): bumped falcoctl to v0.8.0-rc1. update(cmake,scripts): bumped falcoctl to v0.8.0-rc1. Apr 12, 2024
@FedeDP
Copy link
Contributor Author

FedeDP commented Apr 12, 2024

Refs #3165

Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana
Copy link
Contributor

poiana commented Apr 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, leogr

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:
  • OWNERS [Andreagit97,FedeDP,leogr]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana merged commit 7cc57a9 into master Apr 15, 2024
33 checks passed
@poiana poiana deleted the bump/falcoctl branch April 15, 2024 13:13
@FedeDP FedeDP changed the title update(cmake,scripts): bumped falcoctl to v0.8.0-rc1. update(cmake,scripts): bumped falcoctl to v0.8.0-rc1 and set modern eBPF as default driver + enable automatic driver selection logic Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants