Skip to content

Commit 024c972

Browse files
ekoopspoiana
authored andcommitted
chore!: drop legacy eBPF probe build support
Falco 0.43.0 deprecated legacy eBPF probe, and the support will be removed soon in the next libs release. Drop support for building it. BREAKING CHANGE: drop support for building the legacy eBPF probe Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
1 parent e4d7f81 commit 024c972

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+80
-388
lines changed

Example_configs.md

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ kernelrelease: 4.19.91-26.al7.x86_64
77
target: alinux
88
output:
99
module: /tmp/falco_alinux_4.19.91-26.al7.x86_64.ko
10-
probe: /tmp/falco_alinux_4.19.91-26.al7.x86_64.o
1110
driverversion: master
1211
```
1312
@@ -18,7 +17,6 @@ kernelrelease: 5.10.84-10.4.al8.x86_64
1817
target: alinux
1918
output:
2019
module: /tmp/falco_alinux_4.19.91-26.al7.x86_64.ko
21-
probe: /tmp/falco_alinux_4.19.91-26.al7.x86_64.o
2220
driverversion: master
2321
```
2422
@@ -29,7 +27,6 @@ kernelrelease: 5.14.0-162.12.1.el9_1.x86_64
2927
target: almalinux
3028
output:
3129
module: /tmp/falco_almalinux_5.14.0-162.12.1.el9_1.x86_64.ko
32-
probe: /tmp/falco_almalinux_5.14.0-162.12.1.el9_1.x86_64.o
3330
driverversion: master
3431
```
3532
@@ -50,7 +47,6 @@ kernelrelease: 4.14.171-136.231.amzn2.x86_64
5047
target: amazonlinux2
5148
output:
5249
module: /tmp/falco_amazonlinux2_4.14.171-136.231.amzn2.x86_64.ko
53-
probe: /tmp/falco_amazonlinux2_4.14.171-136.231.amzn2.x86_64.o
5450
driverversion: master
5551
```
5652
@@ -61,13 +57,12 @@ kernelrelease: 5.10.96-90.460.amzn2022.x86_64
6157
target: amazonlinux2022
6258
output:
6359
module: /tmp/falco_amazonlinux2022_5.10.96-90.460.amzn2022.x86_64.ko
64-
probe: /tmp/falco_amazonlinux2022_5.10.96-90.460.amzn2022.x86_64.o
6560
driverversion: master
6661
```
6762
6863
## archlinux
6964
70-
Example configuration file to build both the Kernel module and eBPF probe for Archlinux.
65+
Example configuration file to build both the Kernel module for Archlinux.
7166
Note: archlinux target uses the [Arch Linux Archive](https://wiki.archlinux.org/title/Arch_Linux_Archive) to fetch
7267
all ever supported kernel releases.
7368
For arm64, it uses an user-provided mirror, as no official mirror is available: http://tardis.tiny-vps.com/aarm/.
@@ -79,7 +74,6 @@ kernelrelease: 6.0.6.arch1-1
7974
target: arch
8075
output:
8176
module: /tmp/falco-arch.ko
82-
probe: /tmp/falco-arch.o
8377
driverversion: master
8478
builderimage: ${ARCH_BUILD_IMAGE_HERE}
8579
```
@@ -119,14 +113,13 @@ driverversion: master
119113
120114
## debian
121115
122-
Example configuration file to build both the Kernel module and eBPF probe for Debian.
116+
Example configuration file to build both the Kernel module for Debian.
123117
124118
```yaml
125119
kernelrelease: 4.19.0-6-amd64
126120
kernelversion: 1
127121
output:
128122
module: /tmp/falco-debian.ko
129-
probe: /tmp/falco-debian.o
130123
target: debian
131124
driverversion: master
132125
```
@@ -144,7 +137,7 @@ driverversion: master
144137
145138
## flatcar
146139
147-
Example configuration file to build both the Kernel module and eBPF probe for Flatcar.
140+
Example configuration file to build both the Kernel module for Flatcar.
148141
The Flatcar release version needs to be provided in the `kernelrelease` field instead of the kernel version;
149142
moreover, kernelconfigdata must be provided.
150143

@@ -153,21 +146,19 @@ kernelrelease: 3185.0.0
153146
target: flatcar
154147
output:
155148
module: /tmp/falco-flatcar-3185.0.0.ko
156-
probe: /tmp/falco-flatcar-3185.0.0.o
157149
driverversion: master
158150
kernelconfigdata: Q09ORklHX0ZBTk9USUZZPXkKQ09ORklHX0t...
159151
```
160152

161153
## minikube
162-
Example configuration file to build both the Kernel module and eBPF probe for Minikube.
154+
Example configuration file to build both the Kernel module for Minikube.
163155
```yaml
164156
kernelversion: 1_1.26.0
165157
kernelrelease: 5.10.57
166158
target: minikube
167159
architecture: amd64
168160
output:
169161
module: /tmp/falco_minikube_5.10.57_1_1.26.0.ko
170-
probe: /tmp/falco_minikube_5.10.57_1_1.26.0.o
171162
kernelconfigdata: Q09ORklHX0ZBTk9USUZZPXkKQ09ORklHX0t...
172163
```
173164

@@ -221,7 +212,6 @@ kernelrelease: 4.18.0-372.9.1.el8.x86_64
221212
target: redhat
222213
output:
223214
module: /tmp/falco-redhat8.ko
224-
probe: /tmp/falco-redhat8.o
225215
driverversion: master
226216
builderimage: redhat/ubi8:rhel8_driverkit
227217
```
@@ -254,7 +244,6 @@ kernelrelease: 5.14.0-70.13.1.el9_0.x86_64
254244
target: redhat
255245
output:
256246
module: /tmp/falco-redhat9.ko
257-
probe: /tmp/falco-redhat9.o
258247
driverversion: master
259248
builderimage: docker.io/redhat/ubi9:rhel9_driverkit
260249
```
@@ -300,50 +289,46 @@ kernelrelease: 5.14.0-162.18.1.el9_1.x86_64
300289
target: rocky
301290
output:
302291
module: /tmp/falco_almalinux_5.14.0-162.18.1.el9_1.x86_64.ko
303-
probe: /tmp/falco_almalinux_5.14.0-162.18.1.el9_1.x86_64.o
304292
driverversion: master
305293
```
306294
307295
## ubuntu
308-
Example configuration file to build both the Kernel module and eBPF probe for Ubuntu (works with any flavor!).
296+
Example configuration file to build both the Kernel module for Ubuntu (works with any flavor!).
309297
310298
```yaml
311299
kernelrelease: 5.0.0-1021-aws-5.0
312300
kernelversion: 24~18.04.1
313301
target: ubuntu
314302
output:
315303
module: /tmp/falco-ubuntu-generic.ko
316-
probe: /tmp/falco-ubuntu-generic.o
317304
driverversion: master
318305
```
319306
320307
## ubuntu-aws
321308
322-
Example configuration file to build both the Kernel module and eBPF probe for Ubuntu AWS.
309+
Example configuration file to build both the Kernel module for Ubuntu AWS.
323310
324311
```yaml
325312
kernelrelease: 4.15.0-1057-aws
326313
kernelversion: 59
327314
target: ubuntu-aws
328315
output:
329316
module: /tmp/falco-ubuntu-aws.ko
330-
probe: /tmp/falco-ubuntu-aws.o
331317
driverversion: master
332318
```
333319
334320
> **NOTE:** ubuntu-aws exists to retain backward compatibility only,
335321
> and should not be used in new configs.
336322
337323
## ubuntu-generic
338-
Example configuration file to build both the Kernel module and eBPF probe for Ubuntu generic.
324+
Example configuration file to build both the Kernel module for Ubuntu generic.
339325
340326
```yaml
341327
kernelrelease: 4.15.0-72-generic
342328
kernelversion: 81
343329
target: ubuntu-generic
344330
output:
345331
module: /tmp/falco-ubuntu-generic.ko
346-
probe: /tmp/falco-ubuntu-generic.o
347332
driverversion: master
348333
```
349334
@@ -362,7 +347,6 @@ kernelversion: 1
362347
target: vanilla
363348
output:
364349
module: /tmp/falco-vanilla.ko
365-
probe: /tmp/falco-vanilla.o
366350
driverversion: 0de226085cc4603c45ebb6883ca4cacae0bd25b2
367351
```
368352

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Go Report Card](https://goreportcard.com/badge/github.com/falcosecurity/driverkit?style=for-the-badge)](https://goreportcard.com/report/github.com/falcosecurity/driverkit)
88
[![Docker pulls](https://img.shields.io/docker/pulls/falcosecurity/driverkit?style=for-the-badge)](https://hub.docker.com/r/falcosecurity/driverkit)
99

10-
A command line tool that can be used to build the [Falco](https://github.com/falcosecurity/falco) kernel module and eBPF probe.
10+
A command line tool that can be used to build the [Falco](https://github.com/falcosecurity/falco) kernel module.
1111

1212
## Glossary
1313

@@ -85,7 +85,6 @@ kernelversion: 59
8585
target: ubuntu-aws
8686
output:
8787
module: /tmp/falco-ubuntu-aws.ko
88-
probe: /tmp/falco-ubuntu-aws.o
8988
driverversion: master
9089
```
9190

cmd/cli_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ var tests = []testCase{
130130
"ubuntu-aws",
131131
"--output-module",
132132
"/tmp/falco-ubuntu-aws.ko",
133-
"--output-probe",
134133
"/tmp/falco-ubuntu-aws.o",
135134
"--loglevel",
136135
"debug",
@@ -144,7 +143,6 @@ var tests = []testCase{
144143
env: map[string]string{
145144
"DRIVERKIT_KERNELVERSION": "59",
146145
"DRIVERKIT_OUTPUT_MODULE": "/tmp/falco-ubuntu-aws.ko",
147-
"DRIVERKIT_OUTPUT_PROBE": "/tmp/falco-ubuntu-aws.o",
148146
},
149147
args: []string{
150148
"docker",

cmd/docker.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package cmd
1616

1717
import (
1818
"bytes"
19+
1920
"github.com/falcosecurity/driverkit/pkg/driverbuilder"
2021
"github.com/falcosecurity/driverkit/pkg/driverbuilder/builder"
2122
"github.com/spf13/cobra"
@@ -26,7 +27,7 @@ import (
2627
func NewDockerCmd(configOpts *ConfigOptions, rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command {
2728
dockerCmd := &cobra.Command{
2829
Use: "docker",
29-
Short: "Build Falco kernel modules and eBPF probes against a docker daemon.",
30+
Short: "Build Falco kernel modules against a docker daemon.",
3031
RunE: func(c *cobra.Command, args []string) error {
3132
configOpts.Printer.Logger.Info("starting build",
3233
configOpts.Printer.Logger.Args("processor", c.Name()))

cmd/kubernetes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
func NewKubernetesCmd(configOpts *ConfigOptions, rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command {
3232
kubernetesCmd := &cobra.Command{
3333
Use: "kubernetes",
34-
Short: "Build Falco kernel modules and eBPF probes against a Kubernetes cluster.",
34+
Short: "Build Falco kernel modules against a Kubernetes cluster.",
3535
Aliases: []string{"k8s"},
3636
}
3737

cmd/kubernetes_in_cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
func NewKubernetesInClusterCmd(configOpts *ConfigOptions, rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command {
3030
kubernetesInClusterCmd := &cobra.Command{
3131
Use: "kubernetes-in-cluster",
32-
Short: "Build Falco kernel modules and eBPF probes against a Kubernetes cluster inside a Kubernetes cluster.",
32+
Short: "Build Falco kernel modules against a Kubernetes cluster inside a Kubernetes cluster.",
3333
Aliases: []string{"k8s-ic"},
3434
}
3535

cmd/local.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func NewLocalCmd(configOpts *ConfigOptions, rootOpts *RootOptions, rootFlags *pf
2020
opts := localCmdOptions{}
2121
localCmd := &cobra.Command{
2222
Use: "local",
23-
Short: "Build Falco kernel modules and eBPF probes in local env with local kernel sources and gcc/clang.",
23+
Short: "Build Falco kernel modules in local env with local kernel sources and gcc/clang.",
2424
RunE: func(c *cobra.Command, args []string) error {
2525
configOpts.Printer.Logger.Info("starting build",
2626
configOpts.Printer.Logger.Args("processor", c.Name()))

cmd/root.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ func persistentValidateFunc(rootCommand *RootCmd, configOpts *ConfigOptions, roo
4949
}
5050
nested := map[string]string{ // handle nested options in config file
5151
"output-module": "output.module",
52-
"output-probe": "output.probe",
5352
}
5453
rootCommand.c.Flags().VisitAll(func(f *pflag.Flag) {
5554
if name := f.Name; !skip[name] {
@@ -109,7 +108,7 @@ type RootCmd struct {
109108
func NewRootCmd(configOpts *ConfigOptions, rootOpts *RootOptions) *RootCmd {
110109
rootCmd := &cobra.Command{
111110
Use: "driverkit",
112-
Short: "A command line tool to build Falco kernel modules and eBPF probes.",
111+
Short: "A command line tool to build Falco kernel modules.",
113112
ValidArgs: validProcessors,
114113
ArgAliases: aliasProcessors,
115114
Args: cobra.OnlyValidArgs,

cmd/root_options.go

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,27 @@ package cmd
1616

1717
import (
1818
"errors"
19-
"github.com/falcosecurity/falcoctl/pkg/output"
20-
"github.com/spf13/pflag"
2119
"os"
2220
"runtime"
2321
"strings"
2422

23+
"github.com/falcosecurity/falcoctl/pkg/output"
24+
"github.com/spf13/pflag"
25+
2526
"github.com/creasty/defaults"
2627
"github.com/falcosecurity/driverkit/pkg/driverbuilder/builder"
2728
"github.com/falcosecurity/driverkit/pkg/kernelrelease"
2829
"github.com/falcosecurity/driverkit/validate"
2930
"github.com/go-playground/validator/v10"
3031
)
3132

32-
// OutputOptions wraps the two drivers that driverkit builds.
33+
// OutputOptions wraps the driver that driverkit builds.
3334
type OutputOptions struct {
34-
Module string `validate:"required_without=Probe,filepath,omitempty,endswith=.ko" name:"output module path"`
35-
Probe string `validate:"required_without=Module,filepath,omitempty,endswith=.o" name:"output probe path"`
35+
Module string `validate:"required,filepath,omitempty,endswith=.ko" name:"output module path"`
3636
}
3737

3838
func (oo *OutputOptions) HasOutputs() bool {
39-
return oo.Module != "" || oo.Probe != ""
39+
return oo.Module != ""
4040
}
4141

4242
type RepoOptions struct {
@@ -90,25 +90,24 @@ func (ro *RootOptions) Validate() []error {
9090
errors.As(err, &errs)
9191
errArr := []error{}
9292
for _, e := range errs {
93-
// Translate each error one at a time
93+
// Translate each error one at a time.
9494
errArr = append(errArr, errors.New(e.Translate(validate.T)))
9595
}
9696
return errArr
9797
}
9898

99-
// check that the kernel versions supports at least one of probe and module
99+
// check that the kernel versions supports the module.
100100
kr := kernelrelease.FromString(ro.KernelRelease)
101101
kr.Architecture = kernelrelease.Architecture(ro.Architecture)
102-
if !kr.SupportsModule() && !kr.SupportsProbe() {
103-
return []error{errors.New("both module and probe are not supported by given options")}
102+
if !kr.SupportsModule() {
103+
return []error{errors.New("module is not supported by given options")}
104104
}
105105

106106
return nil
107107
}
108108

109109
func (ro *RootOptions) AddFlags(flags *pflag.FlagSet, targets []string) {
110110
flags.StringVar(&ro.Output.Module, "output-module", ro.Output.Module, "filepath where to save the resulting kernel module")
111-
flags.StringVar(&ro.Output.Probe, "output-probe", ro.Output.Probe, "filepath where to save the resulting eBPF probe")
112111
flags.StringVar(&ro.Architecture, "architecture", runtime.GOARCH, "target architecture for the built driver, one of "+kernelrelease.SupportedArchs.String())
113112
flags.StringVar(&ro.DriverVersion, "driverversion", ro.DriverVersion, "driver version as a git commit hash or as a git tag")
114113
flags.StringVar(&ro.KernelVersion, "kernelversion", ro.KernelVersion, "kernel version to build the module for, it's the numeric value after the hash when you execute 'uname -v'")
@@ -117,7 +116,7 @@ func (ro *RootOptions) AddFlags(flags *pflag.FlagSet, targets []string) {
117116
flags.StringVar(&ro.KernelConfigData, "kernelconfigdata", ro.KernelConfigData, "base64 encoded kernel config data: in some systems it can be found under the /boot directory, in other it is gzip compressed under /proc")
118117
flags.StringVar(&ro.ModuleDeviceName, "moduledevicename", ro.ModuleDeviceName, "kernel module device name (the default is falco, so the device will be under /dev/falco*)")
119118
flags.StringVar(&ro.ModuleDriverName, "moduledrivername", ro.ModuleDriverName, "kernel module driver name, i.e. the name you see when you check installed modules via lsmod")
120-
flags.StringVar(&ro.BuilderImage, "builderimage", ro.BuilderImage, "docker image to be used to build the kernel module and eBPF probe. If not provided, an automatically selected image will be used.")
119+
flags.StringVar(&ro.BuilderImage, "builderimage", ro.BuilderImage, "docker image to be used to build the kernel module. If not provided, an automatically selected image will be used.")
121120
flags.StringSliceVar(&ro.BuilderRepos, "builderrepo", ro.BuilderRepos, "list of docker repositories or yaml file (absolute path) containing builder images index with the format 'images: [ { target:<target>, name:<image-name>, arch: <arch>, tag: <imagetag>, gcc_versions: [ <gcc-tag> ] },...]', in descending priority order. Used to search for builder images. eg: --builderrepo myorg/driverkit-builder --builderrepo falcosecurity/driverkit-builder --builderrepo '/path/to/my/index.yaml'.")
122121
flags.StringVar(&ro.GCCVersion, "gccversion", ro.GCCVersion, "enforce a specific gcc version for the build")
123122

@@ -139,7 +138,6 @@ func (ro *RootOptions) Log(printer *output.Printer) {
139138
printer.Logger.Debug("running with options",
140139
printer.Logger.Args(
141140
"output-module", ro.Output.Module,
142-
"output-probe", ro.Output.Probe,
143141
"driverversion", ro.DriverVersion,
144142
"kernelrelease", ro.KernelRelease,
145143
"kernelversion", ro.KernelVersion,
@@ -165,7 +163,6 @@ func (ro *RootOptions) ToBuild(printer *output.Printer) *builder.Build {
165163
Architecture: ro.Architecture,
166164
KernelConfigData: kernelConfigData,
167165
ModuleFilePath: ro.Output.Module,
168-
ProbeFilePath: ro.Output.Probe,
169166
ModuleDriverName: ro.ModuleDriverName,
170167
ModuleDeviceName: ro.ModuleDeviceName,
171168
GCCVersion: ro.GCCVersion,
@@ -209,11 +206,6 @@ func (ro *RootOptions) ToBuild(printer *output.Printer) *builder.Build {
209206
printer.Logger.Warn("skipping build attempt of module for unsupported kernel release",
210207
printer.Logger.Args("kernelrelease", kr.String()))
211208
}
212-
if len(build.ProbeFilePath) > 0 && !kr.SupportsProbe() {
213-
build.ProbeFilePath = ""
214-
printer.Logger.Warn("skipping build attempt of probe for unsupported kernel release",
215-
printer.Logger.Args("kernelrelease", kr.String()))
216-
}
217209
return build
218210
}
219211

cmd/testdata/configs/1.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ kernelversion: 59
33
target: ubuntu-aws
44
output:
55
module: /tmp/falco-ubuntu-aws.ko
6-
probe: /tmp/falco-ubuntu-aws.o
76
driverversion: master

0 commit comments

Comments
 (0)