-
Notifications
You must be signed in to change notification settings - Fork 905
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
new: ship falcoctl bundled with Falco #2345
Conversation
cmake/modules/falcoctl.cmake
Outdated
|
||
string(TOLOWER ${CMAKE_HOST_SYSTEM_NAME} FALCOCTL_SYSTEM_NAME) | ||
|
||
set(FALCOCTL_VERSION "0.2.0-rc1") |
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.
RC version for now. To be bumped before release.
cmake/modules/falcoctl.cmake
Outdated
BUILD_COMMAND "" | ||
INSTALL_COMMAND "") | ||
|
||
install(PROGRAMS "${PROJECT_BINARY_DIR}/falcoctl-prefix/src/falcoctl/falcoctl" DESTINATION "${FALCO_BIN_DIR}" COMPONENT "${FALCO_COMPONENT_NAME}") |
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.
Install it under the FALCO_COMPONENT_NAME
, just like we do for falco-driver-loader
.
scripts/debian/postinst.in
Outdated
@@ -17,19 +17,19 @@ | |||
# | |||
|
|||
chosen_driver= | |||
enable_falcoctl=0 |
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.
Disabled by default.
scripts/debian/postinst.in
Outdated
|
||
if [ "$1" = "configure" ]; then | ||
if [ -x /usr/bin/dialog ]; then | ||
# If dialog is installed, create a dialog to let users choose the correct driver for them | ||
CHOICE=$(dialog --clear --backtitle "Choose your preferred driver" --title "Falco drivers" --menu "Choose one of the following options:" 15 40 5 \ | ||
CHOICE=$(dialog --clear --title "Falco drivers" --menu "Choose your preferred driver:" 12 40 5 \ |
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.
Small tweaks.
/milestone 0.34.0 |
CI timed out :/ |
@LucaGuerra @loresuso @alacuku Minor refinements might be needed on systemd service permissions; moreover, i am not getting who is supposed to ship:
|
scripts/systemd/falcoctl.service
Outdated
ProtectKernelTunables=true | ||
RestrictRealtime=true | ||
#RestrictAddressFamilies=~AF_PACKET | ||
#StandardOutput=null |
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.
Do we really need StandardOutput=null
for all other services?
/cc @leogr
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.
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.
Ok thank you!
@FedeDP |
Ok, i will add support for it :) |
Support added in latest commit; basically:
|
scripts/debian/postinst.in
Outdated
@@ -17,19 +17,19 @@ | |||
# | |||
|
|||
chosen_driver= | |||
enable_falcoctl=1 |
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.
Enabled by default.
scripts/debian/postinst.in
Outdated
clear | ||
esac | ||
|
||
CHOICE=$(dialog --clear --title "Falcoctl" --menu "Do you want to follow automatic ruleset updates?" 10 40 2 \ |
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.
Choice is always requested for falcoctl, even when no driver was chosen.
scripts/debian/prerm.in
Outdated
systemctl --system stop 'falco-bpf.service' || true | ||
systemctl --system stop 'falco-modern-bpf.service' || true | ||
systemctl --system stop 'falco-plugin.service' || true | ||
systemctl --system stop 'falco.target' || true |
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.
Since all units are PartOf
falco.target, and falcoctl service is bound to it, we can just stop falco.target
.
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.
Fantastic work! LGTM so far!
/hold |
be97f3a
to
80ef2e2
Compare
Signed-off-by: Federico Di Pierro <nierro92@gmail.com> Co-authored-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
b97db9a
to
ad449df
Compare
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
903ff0b
to
7c4f1de
Compare
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FedeDP, jasondellaluce, 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:
Approvers can indicate their approval by writing |
/unhold |
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area build
What this PR does / why we need it:
This PR bundles falcoctl inside Falco; moreover, it adds a new systemd service for falcoctl that will be used during DEB/RPM installation; moreover, the user will be asked (through a dialog) to enable the automatic feed; by default (when dialog is missing or we are in a non interactive mode), falcoctl is not enabled.
Finally, if no driver is chosen at package installation time, falcoctl dialog won't be shown.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: