Skip to content

Commit

Permalink
chore(docker): support new automatic driver selection in docker image…
Browse files Browse the repository at this point in the history
…s entrypoints.

Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed Apr 12, 2024
1 parent eba5e23 commit 28bc3ad
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
8 changes: 6 additions & 2 deletions docker/driver-loader-legacy/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
;;
Expand Down
10 changes: 7 additions & 3 deletions docker/driver-loader/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
;;
Expand Down
10 changes: 7 additions & 3 deletions docker/falco/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
;;
Expand Down

0 comments on commit 28bc3ad

Please sign in to comment.