chore(docker): support new automatic driver selection in docker images entrypoints.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
This commit is contained in:
Federico Di Pierro 2024-04-12 15:12:28 +02:00 committed by poiana
parent bb939959a7
commit cb414f1254
3 changed files with 20 additions and 8 deletions

View File

@ -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)"
echo " modern_ebpf modern eBPF CORE probe"
echo " ebpf eBPF probe"
echo " kmod kernel module"
echo ""
echo "Options:"
echo " --help show this help message"
@ -63,7 +65,9 @@ while test $# -gt 0; do
print_usage
exit 1
else
/usr/bin/falcoctl driver config --type $1
if [ "$1" != "auto" ]; then
/usr/bin/falcoctl driver config --type $1
fi
has_driver="true"
fi
;;

View File

@ -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:latest [driver] [options]"
echo ""
echo "Available drivers:"
echo " kmod kernel module (default)"
echo " auto leverage automatic driver selection logic (default)"
echo " modern_ebpf modern eBPF CORE probe"
echo " ebpf eBPF probe"
echo " kmod kernel module"
echo ""
echo "Options:"
echo " --help show this help message"
@ -61,13 +63,15 @@ extra_args=
while test $# -gt 0; do
case "$1" in
kmod|ebpf)
auto|kmod|ebpf|modern_ebpf)
if [ -n "$has_driver" ]; then
>&2 echo "Only one driver per invocation"
print_usage
exit 1
else
/usr/bin/falcoctl driver config --type $1
if [ "$1" != "auto" ]; then
/usr/bin/falcoctl driver config --type $1
fi
has_driver="true"
fi
;;

View File

@ -23,9 +23,11 @@ print_usage() {
echo "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 -e 'FALCO_DRIVER_LOADER_OPTIONS=[driver] [options]' falcosecurity/falco:latest"
echo ""
echo "Available FALCO_DRIVER_LOADER_OPTIONS drivers:"
echo " kmod kernel module (default)"
echo "Available drivers:"
echo " auto leverage automatic driver selection logic (default)"
echo " modern_ebpf modern eBPF CORE probe"
echo " ebpf eBPF probe"
echo " kmod kernel module"
echo ""
echo "FALCO_DRIVER_LOADER_OPTIONS options:"
echo " --help show this help message"
@ -71,7 +73,9 @@ if [[ -z "${SKIP_DRIVER_LOADER}" ]]; then
print_usage
exit 1
else
/usr/bin/falcoctl driver config --type $opt
if [ "$opt" != "auto" ]; then
/usr/bin/falcoctl driver config --type $opt
fi
has_driver="true"
fi
;;