<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Falco – EBPF</title><link>https://v0-43--falcosecurity.netlify.app/tags/ebpf/</link><description>Recent content in EBPF on Falco</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Mon, 22 Jul 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://v0-43--falcosecurity.netlify.app/tags/ebpf/feed.xml" rel="self" type="application/rss+xml"/><item><title>Blog: Deploy Falco on a Talos cluster</title><link>https://v0-43--falcosecurity.netlify.app/blog/deploy-falco-talos-cluster/</link><pubDate>Mon, 22 Jul 2024 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/blog/deploy-falco-talos-cluster/</guid><description>
&lt;p&gt;&lt;a href="https://www.talos.dev/"&gt;&lt;code&gt;Talos Linux&lt;/code&gt;&lt;/a&gt; is an OS designed for Kubernetes, with in mind to be secure, immutable and minimal. It offers a solution for having secure nodes for your Kubernetes cluster. Running Falco on them requires some configurations we'll see in this blog post. The good news is everything is available to collect the syscalls with &lt;code&gt;eBPF&lt;/code&gt; and also the audit logs from the &lt;code&gt;Kubernetes&lt;/code&gt; control plane.&lt;/p&gt;
&lt;div class="alert alert-primary" role="alert"&gt;
In this tutorial we'll use a local &lt;code&gt;Talos&lt;/code&gt; cluster created with Docker containers for convenience, adapt the configurations to your own context.
&lt;/div&gt;
&lt;h2 id="requirements"&gt;Requirements&lt;/h2&gt;
&lt;p&gt;For this tutorial, you'll need several tools installed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.docker.com/engine/install/"&gt;Docker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://helm.sh/docs/intro/install/"&gt;Helm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.talos.dev/v1.7/introduction/getting-started/"&gt;talosctl&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kubernetes.io/docs/tasks/tools/#kubectl"&gt;kubectl&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="set-up-the-talos-cluster"&gt;Set up the Talos cluster&lt;/h2&gt;
&lt;p&gt;We'll start with a 2 workers cluster:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;talosctl cluster create --workers &lt;span style="color:#666"&gt;2&lt;/span&gt; --wait-timeout 5m
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After a few minutes, your containers and so your cluster should be up and running. You can check the status with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;talosctl cluster show --nodes 10.5.0.2,10.5.0.3,10.5.0.4
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;PROVISIONER docker
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NAME talos-default
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NETWORK NAME talos-default
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NETWORK CIDR 10.5.0.0/24
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NETWORK GATEWAY
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NETWORK MTU &lt;span style="color:#666"&gt;1500&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NODES:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NAME TYPE IP CPU RAM DISK
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;talos-default-controlplane-1 controlplane 10.5.0.2 - - -
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;talos-default-worker-1 worker 10.5.0.3 - - -
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;talos-default-worker-2 worker 10.5.0.4 - - -
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="get-the-kubeconfig"&gt;Get the kubeconfig&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;talosctl&lt;/code&gt; CLI allows to easily set up your &lt;code&gt;kubeconfig&lt;/code&gt; file for managing the apps in your fresh new cluster:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;talosctl kubeconfig -n 10.5.0.2 -f
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Check you have access to the cluster:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubectl cluster-info
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Kubernetes control plane is running at https://10.5.0.2:6443
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;CoreDNS is running at https://10.5.0.2:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;To further debug and diagnose cluster problems, use &lt;span style="color:#b44"&gt;&amp;#39;kubectl cluster-info dump&amp;#39;&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="patch-the-cluster"&gt;Patch the cluster&lt;/h2&gt;
&lt;p&gt;When you deploy &lt;code&gt;Falco&lt;/code&gt; with &lt;code&gt;Helm&lt;/code&gt; in a &lt;code&gt;Kubernetes&lt;/code&gt; cluster, an &lt;code&gt;initContainer&lt;/code&gt; is bootstrapped to inject the &lt;code&gt;eBPF&lt;/code&gt; probe into the kernel of each node. This behavior requires some privileges but &lt;code&gt;Talos&lt;/code&gt;, designed to be secured, doesn't allow that by default. It's possible anyway by patching the nodes.&lt;/p&gt;
&lt;p&gt;Create this &lt;code&gt;patch.yaml&lt;/code&gt; file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cluster:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; apiServer:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; admissionControl:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - name: PodSecurity
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; configuration:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; exemptions:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; namespaces:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - falco
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="alert alert-primary" role="alert"&gt;
As you can see, we allow the pods in the namespace &lt;code&gt;falco&lt;/code&gt; to use &lt;code&gt;PodSecurity&lt;/code&gt; settings.
&lt;/div&gt;
&lt;p&gt;And now patch the cluster:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;talosctl patch machineconfig --patch @patch.yaml --nodes 10.5.0.2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;patched MachineConfigs.config.talos.dev/v1alpha1 at the node 10.5.0.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Applied configuration without a reboot
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="install-falco"&gt;Install Falco&lt;/h2&gt;
&lt;p&gt;We'll use &lt;a href="https://helm.sh"&gt;Helm&lt;/a&gt; to deploy &lt;code&gt;Falco&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install the Helm registry for the &lt;code&gt;Falco&lt;/code&gt; chart:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;helm repo add falcosecurity https://falcosecurity.github.io/charts
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;helm repo update
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;Create the &lt;code&gt;values.yaml&lt;/code&gt; file:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cat &amp;lt;&amp;lt; EOF &amp;gt; values.yaml&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;driver&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;kind&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;modern_ebpf&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;tty&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;true&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;falcosidekick&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;enabled&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;true&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;replicaCount&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;1&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;webui&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;enabled&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;true&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;replicaCount&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;1&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;redis&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;storageEnabled&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;false&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;service&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;type&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;NodePort&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;port&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;2802&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;targetPort&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;2802&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;nodePort&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;30128&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;falcoctl&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;artifact&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;install&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;enabled&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;true&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;follow&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;enabled&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;true&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;config&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;artifact&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;install&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;refs&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;[falco-rules:latest, falco-incubating-rules:latest, k8saudit-rules:latest]&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;follow&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;refs&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;[falco-rules:latest, falco-incubating-rules:latest, k8saudit-rules:latest]&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;services&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- &lt;span style="color:#008000;font-weight:bold"&gt;name&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;k8saudit-webhook&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;type&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;ClusterIP&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;ports&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- &lt;span style="color:#008000;font-weight:bold"&gt;port&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;9765&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;targetPort&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;9765&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;protocol&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;TCP&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;name&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;http&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;falco&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;rules_files&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- /etc/falco/falco_rules.yaml&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- /etc/falco/falco-incubating_rules.yaml&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- /etc/falco/k8s_audit_rules.yaml&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- /etc/falco/rules.d&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;plugins&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- &lt;span style="color:#008000;font-weight:bold"&gt;name&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;k8saudit&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;library_path&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;libk8saudit.so&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;init_config&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;open_params&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;&amp;#34;http://:9765/k8s-audit&amp;#34;&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- &lt;span style="color:#008000;font-weight:bold"&gt;name&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;json&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;library_path&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;libjson.so&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;init_config&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;load_plugins&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;[k8saudit, json]&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;EOF&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;Deploy &lt;code&gt;Falco&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;helm upgrade -i falco falcosecurity/falco -n falco --create-namespace -f values.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Follow the deployment:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubectl get pods -w -n falco
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Before moving on, let's take time to explain why some of these values.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;driver&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;kind&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;modern_ebpf&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;tty&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;true&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;We use the &lt;code&gt;modern_epbf&lt;/code&gt; probe to collec the syscall events.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tty: true&lt;/code&gt; allows to get the alerts in the stdout immediatly, without any buffering.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;falcosidekick&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;enabled&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;true&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;replicaCount&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;1&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;webui&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;enabled&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;true&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;replicaCount&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;1&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;redis&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;storageEnabled&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;false&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;service&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;type&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;NodePort&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;port&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;2802&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;targetPort&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;2802&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;nodePort&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;30128&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;We install &lt;a href="https://github.com/falcosecurity/falcosidekick"&gt;&lt;code&gt;Falcosidekick&lt;/code&gt;&lt;/a&gt; and its &lt;a href="https://github.com/falcosecurity/falcosidekick"&gt;&lt;code&gt;UI&lt;/code&gt;&lt;/a&gt;. All settings for the forwarding of the events between &lt;code&gt;Falco&lt;/code&gt; and &lt;code&gt;Falcosidekick&lt;/code&gt; are managed by the &lt;code&gt;Helm&lt;/code&gt; chart.&lt;/li&gt;
&lt;li&gt;As it's local cluster, we set the &lt;code&gt;replicaCounts&lt;/code&gt; to 1, it loses the HA but save resources.&lt;/li&gt;
&lt;li&gt;The UI will be exposed directly by the nodes on the port &lt;code&gt;30128&lt;/code&gt;, very convenient for a local cluster, &lt;strong&gt;prefer an ingress or just a port-forward for production&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;falcoctl&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;artifact&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;install&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;enabled&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;true&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;follow&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;enabled&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;true&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;config&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;artifact&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;install&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;refs&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;[falco-rules:latest, falco-incubating-rules:latest, k8saudit-rules:latest]&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;follow&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;refs&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;[falco-rules:latest, falco-incubating-rules:latest, k8saudit-rules:latest]&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/falcosecurity/falcoctl"&gt;&lt;code&gt;falcoctl&lt;/code&gt;&lt;/a&gt; controls which plugins and rules to install and follow.&lt;/li&gt;
&lt;li&gt;We install the stable and incubating rules for &lt;code&gt;Falco&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;We install and follow the rules for the Kubernetes audit logs, the relevant plugins &lt;a href="https://github.com/falcosecurity/plugins/tree/main/plugins/k8saudit"&gt;&lt;code&gt;k8saudit&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://github.com/falcosecurity/plugins/tree/main/plugins/k8saudit"&gt;&lt;code&gt;json&lt;/code&gt;&lt;/a&gt; will be automatically installed by &lt;code&gt;falcoctl&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;services&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- &lt;span style="color:#008000;font-weight:bold"&gt;name&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;k8saudit-webhook&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;type&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;ClusterIP&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;ports&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- &lt;span style="color:#008000;font-weight:bold"&gt;port&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;9765&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;targetPort&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;9765&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;protocol&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;TCP&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;name&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;http&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;k8saudit&lt;/code&gt; plugin requires to create a &lt;code&gt;Service&lt;/code&gt; listen the incoming events from the control plane.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;falco&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;rules_files&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- /etc/falco/falco_rules.yaml&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- /etc/falco/falco-incubating_rules.yaml&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- /etc/falco/k8s_audit_rules.yaml&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- /etc/falco/rules.d&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;plugins&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- &lt;span style="color:#008000;font-weight:bold"&gt;name&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;k8saudit&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;library_path&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;libk8saudit.so&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;init_config&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;open_params&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;&amp;#34;http://:9765/k8s-audit&amp;#34;&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- &lt;span style="color:#008000;font-weight:bold"&gt;name&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;json&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;library_path&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;libjson.so&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;init_config&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;load_plugins&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;[k8saudit, json]&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;We load the rules for the &lt;code&gt;syscalls&lt;/code&gt; and for the &lt;code&gt;audit logs&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;We load the plugins and their config. The &lt;code&gt;k8saudit&lt;/code&gt; plugin will listen on the same port than configured in the &lt;code&gt;services&lt;/code&gt; section.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="forward-the-audit-logs-to-falco"&gt;Forward the audit logs to Falco&lt;/h2&gt;
&lt;p&gt;In a classic context, the control plane is configured to send its audit logs to an endpoint, like the &lt;code&gt;k8saudit&lt;/code&gt; plugin. With &lt;code&gt;Talos&lt;/code&gt;, it's not yet possible to configure this endpoint, but fortunately for us, these audit logs are written as files in the &lt;code&gt;/var/log/audit/kube/&lt;/code&gt; folder of the master nodes.&lt;/p&gt;
&lt;p&gt;We'll use &lt;a href="https://fluentbit.io/"&gt;&lt;code&gt;Fluent Bit&lt;/code&gt;&lt;/a&gt; to parse these files and forward them to the &lt;code&gt;k8saudit&lt;/code&gt; plugin.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install the Helm registry for the &lt;code&gt;Fluent Bit&lt;/code&gt; chart:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;helm repo add fluent https://fluent.github.io/helm-charts
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;helm repo update
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;Create the &lt;code&gt;values.yaml&lt;/code&gt; file:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cat &lt;span style="color:#b44"&gt;&amp;lt;&amp;lt; EOF &amp;gt; values.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;podAnnotations:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; fluentbit.io/exclude: &amp;#39;true&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;daemonSetVolumes:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; - name: varlog
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; hostPath:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; path: /var/log
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;daemonSetVolumeMounts:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; - name: varlog
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; mountPath: /var/log
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;tolerations:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; - operator: Exists
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; effect: NoSchedule
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;nodeSelector:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; node-role.kubernetes.io/control-plane: &amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;config:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; service: |
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; [SERVICE]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Flush 5
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Daemon Off
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Log_Level warn
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; HTTP_Server On
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; HTTP_Listen 0.0.0.0
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; HTTP_Port 2020
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Health_Check On
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Parsers_File /fluent-bit/etc/parsers.conf
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Parsers_File /fluent-bit/etc/conf/custom_parsers.conf
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; inputs: |
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; [INPUT]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Name tail
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Alias audit
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Path /var/log/audit/kube/*.log
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Parser audit
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Tag audit.*
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Ignore_older true
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; customParsers: |
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; [PARSER]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Name audit
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Format json
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Time_Key requestReceivedTimestamp
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Time_Format %Y-%m-%dT%H:%M:%S.%L%z
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; outputs: |
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; [OUTPUT]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Name http
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Alias http
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Match *
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Host falco-k8saudit-webhook.falco.svc.cluster.local
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Port 9765
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; URI /k8s-audit
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; Format json
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;EOF&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;Deploy &lt;code&gt;Fluent Bit&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;helm upgrade -i fluent-bit fluent/fluent-bit -n kube-system -f values.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="alert alert-warning" role="alert"&gt;
To be allowed to mount the folder with the logs, we install &lt;code&gt;Fluent Bit&lt;/code&gt; in the namespace &lt;code&gt;kube-system&lt;/code&gt;.
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Follow the deployment:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubectl get pods -n kube-system -w -l app.kubernetes.io/name&lt;span style="color:#666"&gt;=&lt;/span&gt;fluent-bit
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some explanations of the &lt;code&gt;values.yaml&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;daemonSetVolumes&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- &lt;span style="color:#008000;font-weight:bold"&gt;name&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;varlog&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;hostPath&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;path&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;/var/log&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;daemonSetVolumeMounts&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- &lt;span style="color:#008000;font-weight:bold"&gt;name&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;varlog&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;mountPath&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;/var/log&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The host folder with the logs is mounted inside the &lt;code&gt;Fluent Bit&lt;/code&gt; pod.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;tolerations&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- &lt;span style="color:#008000;font-weight:bold"&gt;operator&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;Exists&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;effect&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;NoSchedule&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;nodeSelector&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;node-role.kubernetes.io/control-plane&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;These settings are there to deploy &lt;code&gt;Fluent Bit&lt;/code&gt; on the master nodes only.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;config&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;inputs&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;|&lt;span style="color:#b44;font-style:italic"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44;font-style:italic"&gt; [INPUT]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44;font-style:italic"&gt; Name tail
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44;font-style:italic"&gt; Alias audit
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44;font-style:italic"&gt; Path /var/log/audit/kube/*.log
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44;font-style:italic"&gt; Parser audit
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44;font-style:italic"&gt; Tag audit.*
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44;font-style:italic"&gt; Ignore_older true&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;Fluent Bit&lt;/code&gt; will parse the files &lt;code&gt;*.logs&lt;/code&gt; from the folder &lt;code&gt;/var/log/audit/kube/&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;config&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;outputs&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;|&lt;span style="color:#b44;font-style:italic"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44;font-style:italic"&gt; [OUTPUT]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44;font-style:italic"&gt; Name http
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44;font-style:italic"&gt; Alias http
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44;font-style:italic"&gt; Match *
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44;font-style:italic"&gt; Host falco-k8saudit-webhook.falco.svc.cluster.local
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44;font-style:italic"&gt; Port 9765
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44;font-style:italic"&gt; URI /k8s-audit
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44;font-style:italic"&gt; Format json&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The logs are forwarded to the endpoint &lt;code&gt;falco-k8saudit-webhook.falco.svc.cluster.local:9765/k8s-audit&lt;/code&gt;, which is listened by the &lt;code&gt;k8saudit&lt;/code&gt; plugin.&lt;/p&gt;
&lt;h2 id="visalize-the-alerts"&gt;Visalize the alerts&lt;/h2&gt;
&lt;p&gt;Everything should be set up and running from now. You can access to the &lt;code&gt;Falcosidekick-UI&lt;/code&gt; by the URL &lt;a href="http://10.5.0.2:30128"&gt;http://10.5.0.2:30128&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The default credentials are &lt;code&gt;admin&lt;/code&gt;/&lt;code&gt;admin&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="images/ui.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Talos Linux&lt;/code&gt; is a more and more famous solution for creating resilient and secure &lt;code&gt;Kubernetes&lt;/code&gt; clusters, but the trust doesn't exclude control. Mixing &lt;code&gt;Talos&lt;/code&gt; and &lt;code&gt;Falco&lt;/code&gt; makes you gain a step upper in term of security for your applications.
Thanks to our modern &lt;code&gt;eBPF&lt;/code&gt; probe and our &lt;code&gt;k8saudit&lt;/code&gt; plugin, you can see how easy and quick it is to install &lt;code&gt;Falco&lt;/code&gt; in &lt;code&gt;Talos&lt;/code&gt; and start to observe what's happening.&lt;/p&gt;
&lt;p&gt;Thanks to &lt;a href="https://twitter.com/TheBidouilleur"&gt;Quentin Joly&lt;/a&gt; for his &lt;a href="https://a-cup-of.coffee/blog/talos/"&gt;blog post about &lt;code&gt;Talos&lt;/code&gt;&lt;/a&gt; which helped me a lot to write this one.&lt;/p&gt;
&lt;hr&gt;
&lt;ul&gt;
&lt;li&gt;Get started in &lt;a href="http://falco.org/"&gt;Falco.org&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Check out the &lt;a href="https://github.com/falcosecurity/falcosidekick"&gt;Falcosidekick project on GitHub&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Check out the &lt;a href="https://github.com/falcosecurity/falcosidekick-ui"&gt;Falcosidekick UI project on GitHub&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Get involved in the &lt;a href="https://falco.org/community/"&gt;Falco community&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Meet the maintainers on the &lt;a href="https://kubernetes.slack.com/?redir=%2Farchives%2FCMWH3EH32"&gt;Falco Slack&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Follow &lt;a href="https://twitter.com/falco_org"&gt;@falco_org on Twitter&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Blog: Tracing System Calls Using eBPF - Part 2</title><link>https://v0-43--falcosecurity.netlify.app/blog/tracing-system-calls-using-ebpf-part-2/</link><pubDate>Fri, 06 Oct 2023 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/blog/tracing-system-calls-using-ebpf-part-2/</guid><description>
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In &lt;a href="https://falco.org/blog/tracing-syscalls-using-ebpf-part-1/"&gt;Tracing System Calls Using eBPF Part 1&lt;/a&gt;, we lay the groundwork, introducing you to the fundamentals of &lt;code&gt;eBPF&lt;/code&gt; and its predecessor, &lt;code&gt;BPF (Berkeley Packet Filter)&lt;/code&gt;. We delve into the evolution of this technology, its safety, performance, and observability advantages over traditional kernel modules, and its pivotal role in securing modern cloud native environments. We guide you through the intricate process of working with eBPF programs, from compilation to execution, highlighting its power in tracing system calls.&lt;/p&gt;
&lt;p&gt;In the second installment, &lt;code&gt;Tracing System Calls Using eBPF Part 2&lt;/code&gt;, we elevate our understanding of eBPF's capabilities. We unravel the world of &lt;code&gt;Uprobes&lt;/code&gt; and &lt;code&gt;Uretprobes&lt;/code&gt;, demonstrating how these features empower developers to instrument and monitor user-space applications seamlessly. We then venture into &lt;code&gt;Kprobes&lt;/code&gt; and &lt;code&gt;Kretprobes&lt;/code&gt;, unlocking the potential to dynamically trace and debug kernel functions, offering insights into system behavior and performance analysis.&lt;/p&gt;
&lt;h2 id="uprobes"&gt;Uprobes&lt;/h2&gt;
&lt;p&gt;Uprobes, short for user probes, are a feature in the Linux kernel that enables developers to instrument and monitor user-space applications without modifying their code directly. They allow for the insertion of breakpoints at specific points of interest within an application, facilitating the collection of data, tracing of function calls, debugging, and performance analysis.&lt;/p&gt;
&lt;h2 id="uretprobes"&gt;Uretprobes&lt;/h2&gt;
&lt;p&gt;Uretprobes, short for User Return Probes, are a feature in the Linux kernel that allows developers to trace and monitor the return paths of functions in user-space applications. While uprobes are used to instrument and intercept the entry points of functions, URETprobes specifically focus on the exit points or return paths. They enable developers to set up probes that are triggered when a specific function returns to its caller.&lt;/p&gt;
&lt;p&gt;Here is an eBPF program that uses user probes to trace the printf function present in &lt;code&gt;glibc (the standard GNU C Library)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf2-01.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="An eBPF program that uses user probes to trace the printf function present in `glibc (the standard GNU C Library)`"
src="images/ebpf2-01.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;In accordance with the instructions outlined in our &lt;a href="https://falco.org/blog/tracing-syscalls-using-ebpf-part-1/"&gt;Tracing System Calls Using eBPF Part 1&lt;/a&gt; blog, we can create a loader to effectively load this eBPF program and read the logs from the file &lt;code&gt;/sys/kernel/tracing/trace_pipe&lt;/code&gt; .&lt;/p&gt;
&lt;h2 id="kprobes"&gt;Kprobes&lt;/h2&gt;
&lt;p&gt;Kprobes, short for Kernel Probes, are a feature in the Linux kernel that allow dynamic tracing and debugging of kernel functions. They are particularly useful for tasks like performance analysis, bug diagnosis, and system monitoring. They provide a non-intrusive way to gather runtime information from the kernel without requiring modifications to the kernel code itself. Additionally, they can be used to trace specific function calls, track parameters and return values, and gather statistical data on function execution&lt;/p&gt;
&lt;h2 id="kretprobes"&gt;Kretprobes&lt;/h2&gt;
&lt;p&gt;Kretprobes, short for Kernel Return Probes, are a feature in the Linux kernel that complements Kprobes by allowing dynamic tracing and debugging of kernel function return points. While Kprobes focus on probing the entry points of kernel functions, kretprobes specifically target the return points of these functions.Similar to Kprobes, kretprobes work by inserting a probe handler function that gets executed when a specific kernel function is about to return. This allows developers and system administrators to gather information, modify return values, or perform additional actions at the point of function return.&lt;/p&gt;
&lt;p&gt;Here is an eBPF program that uses kernel probes to trace a kernel function named &lt;code&gt;prepare_kernel_cred&lt;/code&gt;. This function is used to create a new &lt;code&gt;struct cred object&lt;/code&gt; that represents the credentials or privileges associated with a kernel task. It is commonly used in &lt;code&gt;privilege escalation exploits&lt;/code&gt; for gaining root access. By tracing this function, we can identify all processes that invoke it, providing valuable insight for analyzing potential malicious activity.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf2-02.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="An eBPF program that uses kernel probes to trace a kernel function"
src="images/ebpf2-02.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;SEC(“kprobe/prepare_kernel_cred”)&lt;/code&gt; indicates that an eBPF program is associated with the kprobe event for the &lt;code&gt;&amp;quot;prepare_kernel_cred&amp;quot;&lt;/code&gt; kernel function. This event allows dynamic tracing and debugging by intercepting the entry point of the function.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;struct pt_regs&lt;/code&gt; is a data structure that provides access to the register state of the program when it is executed. It contains information about the &lt;code&gt;CPU registers&lt;/code&gt; at the time of the eBPF program invocation. It is defined as :&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf2-03.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Consolidated rule"
src="images/ebpf2-03.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;To facilitate the loading of the aforementioned eBPF program, we’ll use the following program.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf2-04.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Loader for the above program"
src="images/ebpf2-04.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Here is a Makefile for compiling the eBPF program and the loader&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf2-05.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="A Makefile for compiling the eBPF program and the loader"
src="images/ebpf2-05.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In this two-part exploration of &lt;strong&gt;Tracing System Calls Using eBPF&lt;/strong&gt;, we've embarked on a fascinating journey through the inner workings of this powerful technology. &lt;code&gt;Part 1&lt;/code&gt; laid the foundation by introducing us to the fundamentals of eBPF and its predecessor, BPF, shedding light on their evolution and significance in modern cloud native environments. We uncovered how eBPF's safety, performance, and observability advantages empower us to trace system calls with unmatched efficiency.&lt;/p&gt;
&lt;p&gt;In &lt;code&gt;Part 2&lt;/code&gt;, we took our understanding to new heights. We delved into the world of &lt;code&gt;Uprobes&lt;/code&gt; and &lt;code&gt;Uretprobes&lt;/code&gt;, showcasing how they enable seamless instrumentation and monitoring of user-space applications. We then ventured into &lt;code&gt;Kprobes&lt;/code&gt; and &lt;code&gt;Kretprobes&lt;/code&gt;, unlocking the ability to dynamically trace and debug kernel functions. Armed with these advanced techniques, we gained valuable insights into system behavior, performance analysis, and even the detection of potential malicious activity.&lt;/p&gt;
&lt;p&gt;As we conclude this journey into the heart of eBPF, we stand equipped with a powerful set of tools and knowledge. Whether you're a seasoned sysadmin, a curious developer, or a vigilant security enthusiast, the capabilities of eBPF open new doors to real-time monitoring and analysis.&lt;/p&gt;
&lt;p&gt;Stay tuned for further insights and practical guidance in the world of eBPF, where innovation meets security, and the future of system monitoring becomes a reality.&lt;/p&gt;</description></item><item><title>Blog: Introducing a framework for regression testing against Linux kernels</title><link>https://v0-43--falcosecurity.netlify.app/blog/falco-kernel-testing/</link><pubDate>Thu, 21 Sep 2023 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/blog/falco-kernel-testing/</guid><description>
&lt;p&gt;There are a few foundational technologies that empower the Cloud Native ecosystem. Containers is one. And one of the basis for containerization is the Linux Kernel itself. With Falco, we are developing a runtime security tool that hooks directly in the kernel to collect information about the system and notifies about malicious behavior.&lt;br&gt;
We have found the need to validate our drivers against various versions of the Linux kernel, to properly ensure that with each iteration of our drivers, supported kernels remained unaffected.&lt;br&gt;
To elaborate, we lacked a means to guarantee that a new driver release could:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Successfully compile on multiple kernel versions.&lt;/li&gt;
&lt;li&gt;Pass the eBPF verifier when executed on various kernel versions.&lt;/li&gt;
&lt;li&gt;Operate as expected, such as retrieving kernel events, across multiple kernel versions.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To address this issue, we started a major intervention. Initially, a &lt;a href="https://github.com/falcosecurity/libs/blob/master/proposals/20230530-driver-kernel-testing-framework.md"&gt;proposal&lt;/a&gt; was discussed and incorporated into the libs repository.&lt;/p&gt;
&lt;p&gt;Since this was a pretty novel area, there were no pre-existing tools available to tackle it. Consequently, we embarked on the development of a completely new framework.&lt;br&gt;
Allow us to introduce you to the &lt;code&gt;kernel testing framework&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id="components-of-a-kernel-testing-framework"&gt;Components of a kernel testing framework&lt;/h3&gt;
&lt;p&gt;Considering the inherent characteristics of the challenge, we need to set up a complete virtual machine for each distinct kernel version.&lt;br&gt;
These tests should be executed automatically each time new code is integrated into our drivers, serving as a means to promptly identify any issue or flaw in the tested kernel versions.&lt;br&gt;
With these objectives in mind, our approach should fulfill the following requirements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Rapid and cost-effective VM creation: the process of creating these virtual machines should be efficient and budget-friendly.&lt;/li&gt;
&lt;li&gt;Effortless distribution of VM images: we should ensure easy sharing and deployment of the virtual machine images.&lt;/li&gt;
&lt;li&gt;Parallel execution of tests on multiple VMs: tests should run concurrently on each virtual machine to expedite the process.&lt;/li&gt;
&lt;li&gt;Reproducibility in local environments for debugging purposes: developers should be able to replicate the test environment locally to investigate and troubleshoot issues.&lt;/li&gt;
&lt;li&gt;Straightforward and user-friendly presentation of the test results: they should be presented in a simple and intuitive manner to immediately spot failures.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="ignite-a-firecracker-microvm"&gt;Ignite a Firecracker microVM&lt;/h4&gt;
&lt;p&gt;&lt;a href="https://https://github.com/weaveworks/ignite"&gt;Weave Ignite&lt;/a&gt; is used to provision the &lt;a href="https://github.com/firecracker-microvm/firecracker"&gt;firecracker&lt;/a&gt; microVMs. Weave Ignite is an open source tool designed for lightweight and fast virtual machine management. It enables users to effortlessly create and manage virtual machines (VMs) for various purposes, such as development, testing, and experimentation.
One of the main reasons why we chose to use this tool was its capability to create firecracker microVMs from kernels and rootfs packed as OCI images.
Currently, we are using a patched version located at &lt;a href="https://github.com/therealbobo/ignite"&gt;a forked repository&lt;/a&gt;. These patches were essential to enable the booting of kernels that necessitated the use of an initrd (initial ramdisk).&lt;/p&gt;
&lt;h4 id="kernel-rootfs-oci-images"&gt;Kernel &amp;amp; Rootfs OCI images&lt;/h4&gt;
&lt;p&gt;Virtual machines consist of two essential layers: the kernel and the rootfs. These layers are packaged and distributed as OCI (Open Container Initiative) images. The kernel image encompasses the kernel that the virtual machine relies on, in contrast the rootfs image serves as the fundamental building block of a virtual machine, offering the essential filesystem necessary for booting the VM. Typically, these rootfs images incorporate a Linux distribution.
For more info on how we build them please check the available &lt;a href="https://github.com/falcosecurity/kernel-testing/tree/main/images"&gt;images documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id="ansible-playbooks"&gt;Ansible Playbooks&lt;/h4&gt;
&lt;p&gt;Automation is accomplished through the utilization of &lt;a href="https://docs.ansible.com/ansible/latest/index.html"&gt;Ansible&lt;/a&gt;. A collection of &lt;a href="https://github.com/falcosecurity/kernel-testing/tree/main/ansible-playbooks"&gt;playbooks&lt;/a&gt; is responsible for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Orchestrating the provisioning of microVMs.&lt;/li&gt;
&lt;li&gt;Configuring the machines.&lt;/li&gt;
&lt;li&gt;Retrieving the code to be tested.&lt;/li&gt;
&lt;li&gt;Eliminating the microVMs once the testing process is completed.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="presenting-test-results"&gt;Presenting test results&lt;/h4&gt;
&lt;p&gt;We wanted the test data to be publicly and easily accessible by anyone, thus we had to find a way to represent the test output.&lt;br&gt;
Since there are 3 possible ways of instrumenting the kernel, that are using a kernel module or one of the available eBPF probes, the playbooks perform up to 3 tests. Taking into account that the modern eBPF probe is built in the Falco libraries, only 2 drivers need to be compiled.
We have 3 possible results for each of them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;success, when the test goes fine&lt;/li&gt;
&lt;li&gt;error, when the test fails&lt;/li&gt;
&lt;li&gt;skipped, when the test is not runnable for the kernel (for example, skipping modern eBPF tests where it is unsupported)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The natural way of dealing with all of this was to develop a &lt;a href="https://github.com/falcosecurity/kernel-testing/tree/main/matrix_gen"&gt;small tool&lt;/a&gt; that, given as input the output root folder, would generate a markdown matrix with the results.&lt;/p&gt;
&lt;p&gt;While scrutinizing the first version of the markdown matrix, we understood that it would have been even better if errors were also attached to the markdown, allowing for a more streamlined visualization of the results.&lt;br&gt;
This is the format we settled with; it can be found &lt;a href="https://falcosecurity.github.io/libs/matrix_X64/"&gt;at libs github pages&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/matrix.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;h3 id="how-we-use-it"&gt;How we use it&lt;/h3&gt;
&lt;p&gt;We implemented a new Github action workflow in the libs repository that triggers on pushes to master, using an x86_64 and an aarch64 nodes with virtualization capabilities provided by the CNCF.&lt;br&gt;
The &lt;a href="https://github.com/falcosecurity/libs/blob/master/.github/workflows/kernel_tests.yaml"&gt;workflow&lt;/a&gt; itself is very simple since it runs the testing framework on self-hosted nodes just like you would run it locally:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-yaml=" data-lang="yaml="&gt;jobs:
test-kernels:
strategy:
fail-fast: false
matrix:
architecture: [X64, ARM64] # We use a matrix to run our job on both supported arch
# Since github actions do not support arm64 runners and they do not offer virtualization capabilities, we need to use self hosted nodes.
runs-on: [ &amp;#34;self-hosted&amp;#34;, &amp;#34;linux&amp;#34;, &amp;#34;${{matrix.architecture}}&amp;#34; ]
steps:
# We clone the kernel-testing repo, generate vars.yaml (ie: input options for the kernel-testing run)
# and run needed ansible playbooks one by one, directly on each node.
- name: Checkout
uses: actions/checkout@v3
with:
repository: falcosecurity/kernel-testing
ref: v0.2.3
- name: Generate vars yaml
working-directory: ./ansible-playbooks
run: |
LIBS_V=${{ github.event.inputs.libsversion }}
LIBS_VERSION=${LIBS_V:-${{ github.ref_name }}}
cat &amp;gt; vars.yml &amp;lt;&amp;lt;EOF
run_id: &amp;#34;id-${{ github.run_id }}&amp;#34;
output_dir: &amp;#34;~/ansible_output_${{ github.run_id }}&amp;#34;
repos:
libs: {name: &amp;#34;falcosecurity-libs&amp;#34;, repo: &amp;#34;https://github.com/falcosecurity/libs.git&amp;#34;, version: &amp;#34;$LIBS_VERSION&amp;#34;}
EOF
- name: Bootstrap VMs
working-directory: ./ansible-playbooks
run: |
ansible-playbook bootstrap.yml --extra-vars &amp;#34;@vars.yml&amp;#34;
- name: Common setup
working-directory: ./ansible-playbooks
run: |
ansible-playbook common.yml --extra-vars &amp;#34;@vars.yml&amp;#34;
- name: Prepare github repos
working-directory: ./ansible-playbooks
run: |
ansible-playbook git-repos.yml --extra-vars &amp;#34;@vars.yml&amp;#34;
- name: Run scap-open tests
working-directory: ./ansible-playbooks
run: |
ansible-playbook scap-open.yml --extra-vars &amp;#34;@vars.yml&amp;#34; || :
# Once test finished, we collect its output folder and upload it to the github workflow space
- name: Tar output files
run: |
tar -cvf ansible_output.tar ~/ansible_output_${{ github.run_id }}
- uses: actions/upload-artifact@v3
with:
name: ansible_output_${{matrix.architecture}}
path: ansible_output.tar
# We then build the matrix and upload them too
- name: Build matrix_gen
working-directory: ./matrix_gen
env:
GOPATH: /root/go
GOCACHE: /root/.cache/go-build
run: |
go build .
- name: Generate new matrix
working-directory: ./matrix_gen
run: |
./matrix_gen --root-folder ~/ansible_output_${{ github.run_id }} --output-file matrix_${{matrix.architecture}}.md
- uses: actions/upload-artifact@v3
with:
name: matrix_${{matrix.architecture}}
path: ./matrix_gen/matrix_${{matrix.architecture}}.md
# Always run the cleanup playbook to avoid leaving garbage on the nodes
- name: Cleanup
if: always()
working-directory: ./ansible-playbooks
run: |
ansible-playbook clean-up.yml --extra-vars &amp;#34;@vars.yml&amp;#34; || :
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In the &lt;code&gt;Generate new matrix&lt;/code&gt; step, the kernel matrix gets generated and then uploaded.&lt;br&gt;
Once this workflow runs successfully for both architectures, another &lt;a href="https://github.com/falcosecurity/libs/blob/master/.github/workflows/pages.yml"&gt;workflow&lt;/a&gt; gets triggered,&lt;br&gt;
that is responsible for generating and pushing updated Github pages.&lt;br&gt;
The end result can be seen at &lt;a href="https://falcosecurity.github.io/libs/matrix/"&gt;https://falcosecurity.github.io/libs/matrix/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Moreover, the kernel-testing workflow gets also triggered on each driver's tag; then a &lt;a href="https://github.com/falcosecurity/libs/blob/master/.github/workflows/release-body.yml"&gt;supplementary workflow&lt;/a&gt; takes care of attaching matrixes to the release body;&lt;br&gt;
here is an example: &lt;a href="https://github.com/falcosecurity/libs/releases/tag/6.0.0%2Bdriver"&gt;https://github.com/falcosecurity/libs/releases/tag/6.0.0%2Bdriver&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Pretty nice, uh?&lt;/p&gt;
&lt;h3 id="what-s-next-for-the-framework"&gt;What's next for the framework&lt;/h3&gt;
&lt;p&gt;There are quite a few gaps that still need to be addressed by our framework. First of all, the images being used by Ignite to spawn FireCracker VMs are still under a development Docker repository and need to be moved under Falcosecurity.&lt;br&gt;
Moreover, we need to implement a CI to automatically build and push those images.&lt;/p&gt;
&lt;p&gt;As previously said, the kernel tests are currently running &lt;a href="https://github.com/falcosecurity/libs/tree/master/userspace/libscap/examples/01-open"&gt;&lt;code&gt;scap-open&lt;/code&gt;&lt;/a&gt; binary to check whether any event gets received. It is a small libscap C example that loads a driver and waits for events, nothing more.&lt;br&gt;
It would be great to run &lt;a href="https://github.com/falcosecurity/libs/tree/master/test/drivers"&gt;drivers tests&lt;/a&gt; instead, to fully test the expected behavior of the drivers.&lt;/p&gt;
&lt;p&gt;Finally, an utopian idea: imagine if we were able to run &lt;a href="https://github.com/falcosecurity/kernel-crawler"&gt;&lt;code&gt;kernel-crawler&lt;/code&gt;&lt;/a&gt; to fetch kernel images, and then &lt;strong&gt;automatically&lt;/strong&gt; build new kernel testing matrix entries for newly discovered images.&lt;br&gt;
This would mean that our kernel testing matrix coverage increases steadily week after week, giving users even more guarantees about the stability of the Falco drivers!&lt;/p&gt;
&lt;p&gt;Here is the libs tracking issue: &lt;a href="https://github.com/falcosecurity/libs/issues/1224"&gt;https://github.com/falcosecurity/libs/issues/1224&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We would love to hear back from you! If you try out the framework and find any issues, please file them at &lt;a href="https://github.com/falcosecurity/kernel-testing/issues"&gt;https://github.com/falcosecurity/kernel-testing/issues&lt;/a&gt;. If you want to help us to improve, please join our Slack, and feel free to open a Pull Request!&lt;/p&gt;</description></item><item><title>Blog: Tracing System Calls Using eBPF - Part 1</title><link>https://v0-43--falcosecurity.netlify.app/blog/tracing-syscalls-using-ebpf-part-1/</link><pubDate>Mon, 11 Sep 2023 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/blog/tracing-syscalls-using-ebpf-part-1/</guid><description>
&lt;h2 id="introduction"&gt;Introduction:&lt;/h2&gt;
&lt;p&gt;In this article, we will delve into the details of eBPF (extended Berkeley Packet Filter) and explore its significance in tracing system calls. This particular blog will be in two parts; in the first blog, we will discuss eBPF, and in the subsequent section, we will delve into probes. eBPF is a powerful technology that allows for the dynamic and efficient tracing of events within the kernel space of an operating system. You have probably heard of the acronyms BPF and eBPF being used interchangeably. That's why we will aim to address both BPF and eBPF before discussing how and why Falco uses this technology.&lt;/p&gt;
&lt;h2 id="bpf-berkeley-packet-filter"&gt;BPF (Berkeley Packet Filter)&lt;/h2&gt;
&lt;p&gt;BPF is a technology used for network packet filtering and analysis. It is a powerful tool for implementing network security features, such as firewalls and intrusion detection systems. It can also be used to examine network traffic in real-time, detect suspicious patterns, and take appropriate actions to protect the network.&lt;/p&gt;
&lt;h2 id="ebpf-extended-berkeley-packet-filter"&gt;eBPF (Extended Berkeley Packet Filter)&lt;/h2&gt;
&lt;p&gt;The Extended Berkeley Filter (eBPF) is an evolution of the original BPF technology. It extends the capabilities of BPF by providing a more powerful and flexible way to perform dynamic tracing, network analysis, and performance monitoring. It allows developers to write and load programs into the kernel which can be attached to various hooks and events in the system. These programs can provide real-time insights and control over system activities.&lt;/p&gt;
&lt;h2 id="working-on-an-ebpf-program"&gt;Working on an eBPF program&lt;/h2&gt;
&lt;p&gt;The process of compiling and running an eBPF program involves several steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The eBPF program is converted into bytecode by using a compiler, ready to be loaded by a loader program.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The eBPF verifier checks the program for safety, correctness and adherence to specific rules and constraints. First of all, it performs a depth-first search on all possible execution paths to ensure that the program always proceeds to completion. Next, it performs a static analysis on the bytecode and ensures that the program doesn't violate memory access rules, and doesn't cause instability.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Once the eBPF program passes the verification process, it can be loaded into the kernel. The loader ensures that the program is securely loaded and attached to the desired hooks or targets in the system.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;At runtime, the eBPF bytecode is further optimised through JIT (Just-in-time) compilation. This step converts the eBPF bytecode into machine code that can be executed by the CPU.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="kernel-modules"&gt;Kernel Modules&lt;/h2&gt;
&lt;p&gt;Apart from eBPF, the other approach we previously discussed for process tracing in Linux is the use of kernel modules. Kernel modules allow developers to write custom code that can be loaded into the kernel to extend its functionality.&lt;/p&gt;
&lt;p&gt;By leveraging kernel modules, it is possible to hook into various points of the kernel's process management code and capture detailed information about process execution. This includes events such as process creation, termination, and context switches.&lt;/p&gt;
&lt;p&gt;By accessing the kernel's internal data structures and functions, the module can gather valuable insights such as process IDs, parent-child relationships, execution time, system calls, and more.&lt;/p&gt;
&lt;h2 id="so-why-does-falco-use-ebpf"&gt;So why does Falco use eBPF?&lt;/h2&gt;
&lt;p&gt;The integration of eBPF brings significant advantages to projects like Falco, empowering them to securely and efficiently monitor and analyze system calls in real-time. You might be wondering why eBPF is necessary when Falco already has real-time detection capabilities through its kprobe (kernel probe) that handles syscall events.&lt;/p&gt;
&lt;p&gt;One compelling reason for incorporating eBPF support is to enable Falco to seamlessly operate in modern cloud native environments, where the traditional kernel probe may encounter limitations or face restrictions imposed by the control plane nodes.&lt;/p&gt;
&lt;p&gt;By embracing eBPF, Falco ensures the continuity of its real-time detection capabilities in a secure manner, allowing for the prompt and accurate identification of security incidents, regardless of the underlying environment.&lt;/p&gt;
&lt;p&gt;Later in the article, we will delve into the various considerations surrounding the adoption of an eBPF probe for Falco, providing valuable insights for determining when it becomes advantageous to leverage this functionality.&lt;/p&gt;
&lt;h2 id="ebpf-programs-vs-kernel-modules"&gt;eBPF programs vs kernel modules&lt;/h2&gt;
&lt;h3 id="safety-and-isolation"&gt;Safety and Isolation&lt;/h3&gt;
&lt;p&gt;eBPF programs are subjected to a thorough verification process before they are loaded into the kernel. This step provides an extra layer of protection and helps prevent security vulnerabilities. In contrast, kernel modules have direct access to the kernel code, which can pose a threat to the system if not implemented correctly.&lt;/p&gt;
&lt;h3 id="performance"&gt;Performance&lt;/h3&gt;
&lt;p&gt;eBPF programs are JIT compiled into machine code, which significantly improves the performance. JIT compilation optimizes the program for the specific CPU architecture, enabling efficient execution. Despite all these efforts, an eBPF instrumentation will always cause a greater overhead in the system than a kernel module one, the reason is that in the kernel module instrumentation there are no calls to the BPF subsystem.&lt;/p&gt;
&lt;h3 id="observability-and-debugging"&gt;Observability and Debugging&lt;/h3&gt;
&lt;p&gt;eBPF provides powerful tracing and observability capabilities. eBPF programs can be attached to various events, such as network packets, system calls, or kernel functions, allowing detailed visibility into the system behaviour. This makes eBPF a valuable tool for debugging, performance analysis, and security monitoring. Kernel modules typically require more invasive and complex mechanisms for achieving similar observability.&lt;/p&gt;
&lt;h2 id="attaching-ebpf-programs-to-hooks-and-events"&gt;Attaching eBPF programs to hooks and events&lt;/h2&gt;
&lt;p&gt;There are various instrumentation points defined in the Linux kernel. An instrumentation is a specific point in a computer program where additional code, known as instrumentation code, is inserted to gather information about the program's execution. Instrumentation code can be injected at runtime using JIT compilation. Kernel probes, tracepoints, user-space probes, kretprobes are examples of instrumentation points.&lt;/p&gt;
&lt;p&gt;Here is an eBPF program that runs when the execve system call is made.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-01.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="An eBPF program that runs when the execve system call is made"
src="images/ebpf-01.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;In the eBPF programming context, the &lt;code&gt;macro SEC()&lt;/code&gt; from the &lt;code&gt;bpf/bpf_helper.h&lt;/code&gt; header file plays a crucial role. It allows the programmer to specify the section in which a function or variable will be placed within the &lt;code&gt;eBPF object file&lt;/code&gt;. This becomes essential when loading eBPF programs into the kernel using mechanisms like the &lt;code&gt;bpf() system call&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;By organizing functions and variables into named sections, the eBPF loader can efficiently locate and load the required code and data. Specifically, when dealing with tracepoint events, the &lt;code&gt;SEC&lt;/code&gt; format follows the pattern &lt;code&gt;SEC(&amp;quot;tp/&amp;lt;category&amp;gt;/&amp;lt;name&amp;gt;&amp;quot;)&lt;/code&gt;, where &lt;code&gt;&amp;lt;category&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;name&amp;gt;&lt;/code&gt; represent the respective tracepoint category and event name.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;tp/syscalls/sys_enter_execve&lt;/code&gt; refers to a tracepoint that records when a process spawns the execve system call.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A list of all the available tracepoints is present in the &lt;code&gt;/sys/kernel/debug/tracing/available_events&lt;/code&gt; file. The format for each line in the file is &lt;code&gt;&amp;lt;category&amp;gt;:&amp;lt;name&amp;gt;&lt;/code&gt;. For example, syscalls:sys_enter_execve.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Before compiling the program, we need to do some basic configuration:&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-02.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Basic configurations."
src="images/ebpf-02.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Let's compile the program.
The following command can be used to do this task:&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-03.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Command to compile the program."
src="images/ebpf-03.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Now, we need to write a loader program that loads and attaches this program. This loader program is used to load and attach an eBPF program to the Linux kernel. It opens and loads the eBPF object file, checks for errors during the process, finds a specific eBPF program within the loaded object, and attaches it to the kernel. Once attached, the eBPF program will be executed when certain events occur. The program enters an infinite loop at the end, indicating that it will continue running until it is manually terminated.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-04.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Loader program for eBPF."
src="images/ebpf-04.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Let's compile and run this program&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-05.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Command to compile loader program for eBPF."
src="images/ebpf-05.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;To get the logs generated by the function &lt;code&gt;bpf_printk&lt;/code&gt;, we can read the file:
&lt;code&gt;/sys/kernel/tracing/trace_pipe&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-06.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Reading '/sys/kernel/tracing/trace_pipe' file."
src="images/ebpf-06.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-res-01.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Messages we got after reading the 'trace_pipe' file."
src="images/ebpf-res-01.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Manually reading messages from the tracepipe doesn't seem to be an efficient approach. It would be advantageous to establish a mechanism for the eBPF program to send messages to the loader program. One viable solution is to utilize ring buffers. Let’s review more details about ring buffers.&lt;/p&gt;
&lt;h2 id="ring-buffers"&gt;Ring buffers&lt;/h2&gt;
&lt;p&gt;eBPF ring buffer, also known as &lt;code&gt;bpf_ringbuf&lt;/code&gt;, is a mechanism provided by the Linux kernel for efficient communication between eBPF programs and user-space programs.&lt;/p&gt;
&lt;p&gt;It allows the exchange of data and events between eBPF programs running in the kernel and user-space applications. It is a &lt;code&gt;MPSC (Multi Producer Single Consumer)&lt;/code&gt; queue and can be safely shared across multiple CPUs simultaneously.&lt;/p&gt;
&lt;p&gt;The eBPF ring buffer, being shared across all CPUs, offers a unified and efficient solution for managing memory utilisation, mitigating issues of overuse or under-allocation that commonly occur with perfbuf.&lt;/p&gt;
&lt;p&gt;Let's have a look at a few functions that we'll be using to write an eBPF program that sends data to userspace.&lt;/p&gt;
&lt;h3 id="bpf-ringbuf-reserve"&gt;bpf_ringbuf_reserve&lt;/h3&gt;
&lt;p&gt;This function is used to reserve &lt;code&gt;size&lt;/code&gt; bytes of space in a BPF ring buffer.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-08.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Function which is used to reserve `size` bytes of space in a BPF ring buffer."
src="images/ebpf-08.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;h3 id="bpf-probe-read-user-str"&gt;bpf_probe_read_user_str&lt;/h3&gt;
&lt;p&gt;This function is used to read a null terminated string from user-space memory into the destination &lt;code&gt;dst&lt;/code&gt;. The dst parameter is a pointer to the destination buffer in the kernel space. &lt;code&gt;unsafe_ptr&lt;/code&gt; is a pointer to the source string in the user-space.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-09.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Function which is used to read a null terminated string from user-space memory into the destination `dst`."
src="images/ebpf-09.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;h3 id="bpf-ringbuf-submit"&gt;bpf_ringbuf_submit&lt;/h3&gt;
&lt;p&gt;This function is used to submit data that had previously been reserved in a &lt;code&gt;ringbuf&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-10.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Function ehich is used to submit data that had previously been reserved in a ringbuf."
src="images/ebpf-10.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;h3 id="bpf-object-find-map-fd-by-name"&gt;bpf_object__find_map_fd_by_name&lt;/h3&gt;
&lt;p&gt;This function is used to find the file descriptor of a named map.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-11.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Function which is used to find the file descriptor of a named map."
src="images/ebpf-11.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;h3 id="bpf-program-attach-tracepoint"&gt;bpf_program__attach_tracepoint&lt;/h3&gt;
&lt;p&gt;This function is used to attach an eBPF program to a kernel tracepoint.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-12.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Function which is used to attach an eBPF program to a kernel tracepoint."
src="images/ebpf-12.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;h3 id="ring-buffer-new"&gt;ring_buffer__new&lt;/h3&gt;
&lt;p&gt;This function is used for creating and opening a new ringbuf manager.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-13.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Function which is used for creating and opening a new ringbuf manager."
src="images/ebpf-13.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;h3 id="ring-buf-consume"&gt;ring_buf__consume&lt;/h3&gt;
&lt;p&gt;Used to remove or consume data from a &lt;code&gt;ring buffer&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-14.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Program used to remove or consume data from a ring buffer."
src="images/ebpf-14.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2 id="btf-bpf-type-format"&gt;BTF (BPF Type Format)&lt;/h2&gt;
&lt;p&gt;It provides a way to describe the types of data structures used by eBPF programs, allowing for improved type safety, debugging, and introspection.&lt;/p&gt;
&lt;p&gt;Now, let's write a program that sends data to userspace using ringbuf.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-15.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Program that sends data to userspace using ringbuf"
src="images/ebpf-15.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Having created the program, we can write a loader to load this eBPF program.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-16.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="A loader to load this eBPF program."
src="images/ebpf-16.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;The infinite loop is necessary to ensure that the program continuously checks for new events in the ring buffer. Without the loop, the program would only consume events that were already in the buffer at the time of the initial &lt;code&gt;ring_buffer__consume()&lt;/code&gt; call. By looping and calling &lt;code&gt;ring_buffer__consume()&lt;/code&gt; repeatedly, the program can retrieve events as soon as they become available and process them in real-time. The &lt;code&gt;sleep(1)&lt;/code&gt; call within the loop serves to reduce the CPU usage of the program by introducing a one-second delay between each call to &lt;code&gt;ring_buffer__consume()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-17.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Commands to compile and run the above program."
src="images/ebpf-17.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/ebpf-res-02.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="Results after compiling and executing the above program."
src="images/ebpf-res-02.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Great, we were able to recover the process name as well as the PID!&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In conclusion, this article has provided a comprehensive overview of eBPF (extended Berkeley Packet Filter) and its significance in tracing system calls. We have explored the evolution from BPF to eBPF, discussed why Falco uses this technology, and delved into the process of working with eBPF programs and ring buffers for efficient data communication between the kernel and user-space applications.&lt;/p&gt;
&lt;p&gt;As we journeyed through the capabilities of eBPF in this first part, we uncovered its benefits in terms of safety, performance, and observability when compared to traditional kernel modules. eBPF empowers us to securely and efficiently monitor and analyze system calls in real-time, making it a valuable tool in modern cloud native environments.&lt;/p&gt;
&lt;p&gt;In the upcoming second part of this blog series, we will further expand our exploration by delving into the realm of probes and additional advanced topics. We will dive deeper into how eBPF probes can be leveraged for enhanced system tracing, performance analysis, and security monitoring. Stay tuned for more insights and practical guidance on harnessing the power of eBPF.&lt;/p&gt;
&lt;p&gt;Keep an eye out for Part 2, where we'll continue our journey into the world of eBPF and system call tracing.&lt;/p&gt;</description></item><item><title>Blog: Modern eBPF probe is ready to shine</title><link>https://v0-43--falcosecurity.netlify.app/blog/falco-modern-bpf-0-35-0/</link><pubDate>Wed, 14 Jun 2023 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/blog/falco-modern-bpf-0-35-0/</guid><description>
&lt;p&gt;Introducing the brand-new eBPF probe: a game-changing addition to Falco's toolkit. Curious to learn more? Dive into our &lt;a href="https://falco.org/blog/falco-modern-bpf/"&gt;first blog post&lt;/a&gt; where we spill the beans on its exciting features, what you need to get started, and real-world use cases.&lt;/p&gt;
&lt;p&gt;Initially a Falco 0.34.0 experimental feature, we've put in months of hard work to refine it for production use. The wait is finally over! Falco 0.35.0 now ships with the modern probe as an official driver, alongside the trusted Kernel module and current eBPF probe. Falco is now more prepared than ever to scale with your infrastructure.&lt;/p&gt;
&lt;h2 id="supported-syscalls"&gt;Supported Syscalls&lt;/h2&gt;
&lt;p&gt;In our driver history, we've supported syscalls in two possible ways:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Fully instrumented 🟢&lt;/li&gt;
&lt;li&gt;Generically instrumented 🟡&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Fully instrumented&lt;/strong&gt; means that Falco notifies when a syscall is invoked in the system and enables the user to examine its parameters. You can find the list of available parameters for each syscall on &lt;a href="https://falco.org/docs/reference/rules/supported-events/"&gt;https://falco.org/docs/reference/rules/supported-events/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Generically instrumented&lt;/strong&gt; means that Falco notifies when a syscall is invoked in the system, but nothing more.&lt;/p&gt;
&lt;p&gt;Excitingly, in the latest Falco 0.35.0 version, the modern probe extends its support to reach syscall parity with the other drivers. &lt;a href="https://falcosecurity.github.io/libs/report/"&gt;This report&lt;/a&gt; outlines the current instrumentation state.&lt;/p&gt;
&lt;h2 id="advanced-support-checks"&gt;Advanced support checks&lt;/h2&gt;
&lt;p&gt;Before Falco 0.35.0, the modern probe was restricted to running exclusively on machines with kernel versions &amp;gt;= 5.8. This limitation posed challenges for certain users, prompting us to implement a more intelligent support detection mechanism. Leveraging the capabilities of the &lt;code&gt;libbpf&lt;/code&gt; library, we can now search for specific features within the target system, precisely addressing our needs.&lt;/p&gt;
&lt;p&gt;To elaborate further, we currently search for two crucial features that are essential for running the modern probe:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;BPF Ring Buffer&lt;/li&gt;
&lt;li&gt;BTF Tracing Programs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://v0-43--falcosecurity.netlify.app/blog/falco-modern-bpf-0-35-0/images/falco-modern-bpf-01.png" alt="Required features to run the modern eBPF probe" loading="lazy" /&gt;
&lt;/p&gt;
&lt;p&gt;For a more in-depth understanding of these two concepts, we invite you to explore the &lt;a href="https://falco.org/blog/falco-modern-bpf/#what-s-new"&gt;previous blog&lt;/a&gt; discussing the modern eBPF driver.&lt;/p&gt;
&lt;p&gt;Now, let's delve into the potential errors that you may encounter if any of these features are missing.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If the BPF ring buffer is not available, Falco will present you with an error message similar to:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-plain" data-lang="plain"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ring buffer map type is not supported
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If BTF tracing programs are absent, the error message you can expect to encounter would be along the lines of:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-plain" data-lang="plain"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tracing program type is not supported
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="buffers-allocation"&gt;Buffers allocation&lt;/h2&gt;
&lt;p&gt;Every Falco driver utilizes shared buffers to facilitate the transmission of security events between the kernel and the userspace. To be more specific, there is an individual buffer allocated for each online CPU, ensuring efficient handling of events.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://v0-43--falcosecurity.netlify.app/blog/falco-modern-bpf-0-35-0/images/falco-modern-bpf-02.png" alt="Buffers allocation using the current eBPF probe" loading="lazy" /&gt;
&lt;/p&gt;
&lt;p&gt;We have always followed this particular approach for utilizing shared buffers, and recently we introduced a new feature that allows you to modify the size of these buffers using a custom Falco configuration option called &lt;code&gt;syscall_buf_size_preset&lt;/code&gt;. By default, each buffer is set to 8 MB, but you have the flexibility to adjust it anywhere between 1 MB and 512 MB.&lt;/p&gt;
&lt;p&gt;Increasing the buffer size can be beneficial when you encounter syscall drops. A larger buffer size can help mitigate syscall drops in systems with high production loads. However, it's important to note that very large buffers may also impact the overall system performance, potentially slowing down the machine.&lt;/p&gt;
&lt;p&gt;Conversely, reducing the buffer size can help enhance system speed, but it may also result in an increased number of syscall drops. It's crucial to exercise caution when experimenting with this configuration option, taking into consideration the trade-off between performance and syscall drops ⚠️&lt;/p&gt;
&lt;p&gt;While the ability to adjust buffer sizes is a cool feature, it is available to all drivers. So, what sets the modern probe apart? Well, with this new driver, you have the added capability to manipulate the number of buffers. This means that the traditional rule of having one buffer per CPU is no longer a strict requirement. Unlike the old drivers, where the only possible configuration was one buffer per CPU, the modern probe introduces flexibility in this aspect, opening up new possibilities and alternative scenarios.&lt;/p&gt;
&lt;p&gt;As an illustration, one such scenario is the allocation of a ring buffer for every 3 CPUs.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://v0-43--falcosecurity.netlify.app/blog/falco-modern-bpf-0-35-0/images/falco-modern-bpf-03.png" alt="Buffers allocation using the modern eBPF probe" loading="lazy" /&gt;
&lt;/p&gt;
&lt;div class="card card-sm pageinfo pageinfo-info my-4"&gt;
&lt;div class="card-body"&gt;
&lt;div class="card-text"&gt;
&lt;blockquote&gt;
&lt;p&gt;Observe that the second buffer can still be used by another CPU.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To adjust the number of buffers, you can use the Falco configuration option called &lt;code&gt;modern_bpf.cpus_for_each_syscall_buffer&lt;/code&gt;. Unlike other drivers that have a 1:1 mapping between buffers and CPUs, the modern probe has a default value of one buffer for every two CPUs. This distinction arises because the BPF ring buffer requires more memory compared to other drivers, necessitating a reduction in the number of buffers.&lt;/p&gt;
&lt;p&gt;However, feel free to experiment and find the configuration that best suits your system. Just remember the following guideline: having more buffers can reduce the likelihood of drops but will increase the overall memory footprint. On the other hand, reducing the number of buffers can help decrease memory consumption but may lead to an increased risk of drops.&lt;/p&gt;
&lt;h2 id="least-privileged-mode"&gt;Least privileged mode&lt;/h2&gt;
&lt;p&gt;Similar to the current probe, the modern probe can operate in &lt;em&gt;least privileged&lt;/em&gt; mode. However, to ensure proper functionality, Falco always mandates a minimum of two capabilities: &lt;code&gt;CAP_SYS_RESOURCE&lt;/code&gt; and &lt;code&gt;CAP_SYS_PTRACE&lt;/code&gt;. Additional required capabilities vary depending on your specific kernel version, like the &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt; capability for older kernels, which can be replaced by the &lt;code&gt;CAP_PERFMON&lt;/code&gt; and &lt;code&gt;CAP_BPF&lt;/code&gt; ones when running on a kernel newer than 5.8.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://v0-43--falcosecurity.netlify.app/blog/falco-modern-bpf-0-35-0/images/falco-modern-bpf-04.png" alt="Newer kernels allow more granularity when using Linux capabilities" loading="lazy" /&gt;
&lt;/p&gt;
&lt;p&gt;Here's an example command to run Falco in &lt;em&gt;least privileged&lt;/em&gt; mode using the modern probe:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;docker run --rm -i -t &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --cap-drop all &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --cap-add sys_admin &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --cap-add sys_resource &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --cap-add sys_ptrace &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /var/run/docker.sock:/host/var/run/docker.sock &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /proc:/host/proc:ro &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; falcosecurity/falco-no-driver:latest falco --modern-bpf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="card card-sm pageinfo pageinfo-info my-4"&gt;
&lt;div class="card-body"&gt;
&lt;div class="card-text"&gt;
&lt;p&gt;Observe we cannot use &lt;code&gt;CAP_BPF&lt;/code&gt; and &lt;code&gt;CAP_PERFMON&lt;/code&gt; here since &lt;a href="https://github.com/moby/moby/pull/41563"&gt;docker doesn't support&lt;/a&gt; them yet.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id="try-it-out"&gt;Try it out&lt;/h2&gt;
&lt;p&gt;The modern eBPF probe is compatible with all the installation methods available for other drivers.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://v0-43--falcosecurity.netlify.app/docs/getting-started/installation/#installation-with-dialog"&gt;Falco packages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://v0-43--falcosecurity.netlify.app/docs/getting-started/running/#falco-binary"&gt;Falco binary&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://v0-43--falcosecurity.netlify.app/docs/getting-started/running/#modern-ebpf"&gt;Docker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/falcosecurity/charts/blob/master/falco/README.md#daemonset"&gt;Helm chart&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also, you can test it live in this interactive environment that we have prepared for you.&lt;/p&gt;
&lt;p&gt;Click on it to start playing with it 🎮&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="https://play.instruqt.com/embed/sysdig/tracks/falco-modern-ebpf?token=em_Kwn3AXuYeONY6e0v&amp;icp_embed_source=blog-falco-modern-bpf-0-35-0&amp;icp_owner=oss"&gt;&lt;img src="images/falco-modern-bpf-lab.png"&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Blog: Getting started with modern BPF probe in Falco</title><link>https://v0-43--falcosecurity.netlify.app/blog/falco-modern-bpf/</link><pubDate>Wed, 30 Nov 2022 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/blog/falco-modern-bpf/</guid><description>
&lt;p&gt;The new BPF probe has landed among us 👽 and it brings to the table new shiny features. The BPF world grows continuously and every new kernel release introduces some unbelievable novelties!&lt;/p&gt;
&lt;p&gt;To take advantage of these we have created a completely new architecture, new BPF programs and maps. The main goal is to improve performance, maintainability, and user experience, shipping a unique, powerful, self-contained Falco executable. (... Oops, I said too much but don't burn the steps, first things first.)&lt;/p&gt;
&lt;h2 id="what-s-new"&gt;What's new 🗞️&lt;/h2&gt;
&lt;p&gt;We wouldn't be able to cover all the details here so we will just go through the most outstanding features. If you are interested in technical aspects you can always take a look at the &lt;a href="https://github.com/falcosecurity/libs/blob/master/proposals/20220329-modern-bpf-probe.md"&gt;proposal&lt;/a&gt; merged upstream some months ago with its corresponding &lt;a href="https://github.com/falcosecurity/libs/pull/268"&gt;discussion&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="co-re-paradigm"&gt;CO-RE paradigm&lt;/h3&gt;
&lt;p&gt;Portability is one of the biggest issues we have with the current BPF driver. Our infrastructure tries to compile a BPF probe for every supported kernel since version &lt;code&gt;4.14&lt;/code&gt;! As you can imagine, this is not a simple task, and it causes some pain to both, users and maintainers. For this reason, the Falco maintainers have been working hard to adopt the so-called &lt;strong&gt;&lt;a href="https://nakryiko.com/posts/bpf-portability-and-co-re/"&gt;CO-RE&lt;/a&gt;&lt;/strong&gt; paradigm.&lt;/p&gt;
&lt;p&gt;CO-RE stands for &lt;em&gt;&amp;quot;Compile-once-run-everywhere&amp;quot;&lt;/em&gt;, so as you may imagine, this paradigm allows compiling the BPF probe just once for all kernels!&lt;/p&gt;
&lt;p&gt;You understood well: No more missing drivers, and no more painful local builds requiring the much-loved &lt;strong&gt;KERNEL HEADERS&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id="bpf-ring-buffer-map"&gt;BPF Ring Buffer map&lt;/h3&gt;
&lt;p&gt;Today, whenever a BPF program needs to send data to userspace, it first copies it into a BPF map, and then it pushes its content to a shared buffer located between userspace and kernel: The so-called &lt;strong&gt;&lt;code&gt;perf-buffer&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This solution works great, but it has two major shortcomings that prove to be inconvenient in practice: Inefficient APIs and extra data copying.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;&lt;code&gt;ring buffer&lt;/code&gt;&lt;/strong&gt; can be considered an evolution of the &lt;strong&gt;&lt;code&gt;perf buffer&lt;/code&gt;&lt;/strong&gt;. We still use a shared buffer but with some advantages.&lt;/p&gt;
&lt;p&gt;First, the APIs to interact with are more efficient. Second, and more importantly, we now have the possibility of writing data directly into this shared buffer, without having to write it twice!&lt;/p&gt;
&lt;p&gt;This is a game changer in scenarios where high throughput is required, like running Falco, since it could save many cycles during the collection phase.&lt;/p&gt;
&lt;h3 id="btf-enabled-program"&gt;BTF-enabled program&lt;/h3&gt;
&lt;p&gt;Kernel engineers recently introduced a sort of debugging information for BPF programs/maps. This is called &lt;a href="https://docs.kernel.org/bpf/btf.html"&gt;BTF&lt;/a&gt; and stands for &amp;quot;BPF Type Format&amp;quot;. This feature shook the foundations of the BPF world because it finally offers the possibility to write code without BPF helpers like the famous &lt;code&gt;bpf_probe_read()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This will not only increase the readability of the BPF code but will also reduce the bytecode dimension, allowing the crafting of smaller and more efficient programs!&lt;/p&gt;
&lt;h3 id="bpf-global-variables"&gt;BPF global variables&lt;/h3&gt;
&lt;p&gt;The addition of global variables points in the same direction as BTF: Simplify the code experience, increase the readability and reduce the performance overhead due to BPF helpers.&lt;/p&gt;
&lt;p&gt;While BTF allows to deference kernel pointer without the use of the &lt;code&gt;bpf_probe_read()&lt;/code&gt; helper, global variables allow to access BPF maps without the use of helpers like &lt;code&gt;bpf_map_lookup_elem()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You can find further technical information about these 2 new features in the &lt;a href="https://github.com/falcosecurity/libs/blob/master/proposals/20220329-modern-bpf-probe.md#new-bpf-tracing-programs-kernel-version-55"&gt;probe proposal&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="bpf-skeleton"&gt;BPF skeleton&lt;/h3&gt;
&lt;p&gt;Do you remember when we talked about Falco being a self-contained binary?&lt;/p&gt;
&lt;p&gt;Well the BPF skeleton concept allows us to achieve the dream:
&lt;strong&gt;Ship Falco as a unique, self-contained executable!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Under the hood, the probe is compiled once into Falco when the package is built. Hence, when you deploy Falco on different machines it will automatically inject the code without any extra effort on your side. Hard to believe? Try it &lt;a href="https://v0-43--falcosecurity.netlify.app/blog/falco-modern-bpf/#modern-bpf-in-action"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="multi-arch-support"&gt;Multi-arch support&lt;/h3&gt;
&lt;p&gt;The modern BPF probe also supports multiple architectures by design. The actual targets are &lt;code&gt;x86_64&lt;/code&gt;, &lt;code&gt;arm64&lt;/code&gt;, and &lt;code&gt;s390x&lt;/code&gt;, but new ones can be added at any time.&lt;/p&gt;
&lt;p&gt;If you have a project that needs BPF instrumentation for one of these architectures you could simply link the Falco libraries (&lt;code&gt;libsinsp&lt;/code&gt;, &lt;code&gt;libscap&lt;/code&gt;) to obtain a working solution out of the box. We would to thank &lt;a href="https://github.com/hbrueckner"&gt;Hendrik Brueckner&lt;/a&gt; for the huge help he gives in reviewing and implementing the multi-arch support!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;At this moment, we ship Falco for &lt;code&gt;x86_64&lt;/code&gt; and &lt;code&gt;arm64&lt;/code&gt; architectures only, due to their popularity in the community.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="requirements"&gt;Requirements ⛓️&lt;/h2&gt;
&lt;p&gt;To use the modern BPF probe, there are 2 main requirements:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A kernel that implements all the aforementioned features&lt;/strong&gt;. Linux kernel version &lt;code&gt;5.8&lt;/code&gt; is the first kernel that supports &lt;strong&gt;all of them&lt;/strong&gt;, and for this reason, we consider it the minimum required one.&lt;/p&gt;
&lt;p&gt;Nevertheless, these features could also be backported into older kernels, so it wouldn't be completely fair to define the &lt;code&gt;5.8&lt;/code&gt; as the first supported version. This is just a strict assumption that we put in place since we still miss the logic to detect all the necessary features of your kernel.&lt;/p&gt;
&lt;p&gt;Until that day arrives, if your kernel is older than &lt;code&gt;5.8&lt;/code&gt;, you might find the following error when trying to start the modern probe:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-txt" data-lang="txt"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Error: Actual kernel version is: &amp;#39;5.4.0&amp;#39; while the minimum required is: &amp;#39;5.8.0&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A kernel that exposes BTF types&lt;/strong&gt;. This shouldn't be a big issue since we already require a kernel version newer than &lt;code&gt;5.8&lt;/code&gt; and most &lt;a href="https://github.com/libbpf/libbpf#bpf-co-re-compile-once--run-everywhere"&gt;recent Linux distributions&lt;/a&gt; come with kernel BTF capabilities.&lt;/p&gt;
&lt;p&gt;If you want to be sure you can easily check their presence by typing:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ls /sys/kernel/btf/vmlinux
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If your kernel supports them you should see:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/sys/kernel/btf/vmlinux
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now, if your machine satisfies these 2 requirements, you are ready to have fun with the modern probe! 🚀&lt;/p&gt;
&lt;h2 id="modern-bpf-in-action"&gt;Modern BPF in action 🏎️&lt;/h2&gt;
&lt;p&gt;Falco provides you with pre-release packages to try the modern BPF probe, but the full release will take place in Falco 0.34.&lt;/p&gt;
&lt;p&gt;If you happen find some bugs or misbehaviors, please be kind with us and &lt;a href="https://github.com/falcosecurity/falco/issues"&gt;open an issue on Falco&lt;/a&gt; 🙏&lt;/p&gt;
&lt;p&gt;Having said that, you have 3 main ways to try Falco with the modern probe.&lt;/p&gt;
&lt;h3 id="1-pre-built-deb-rpm-packages"&gt;1. Pre-built &lt;code&gt;deb&lt;/code&gt;, &lt;code&gt;rpm&lt;/code&gt; packages&lt;/h3&gt;
&lt;p&gt;You can find &lt;a href="https://app.circleci.com/pipelines/github/falcosecurity/falco/3453/workflows/c8573555-0ecb-44de-af84-1f2a4121d772/jobs/29647/artifacts"&gt;here&lt;/a&gt; the &lt;code&gt;x86_64&lt;/code&gt; packages and &lt;a href="https://app.circleci.com/pipelines/github/falcosecurity/falco/3453/workflows/c8573555-0ecb-44de-af84-1f2a4121d772/jobs/29646/artifacts"&gt;here&lt;/a&gt; the &lt;code&gt;arm64&lt;/code&gt; ones.&lt;/p&gt;
&lt;p&gt;Taking as an example the &lt;code&gt;deb&lt;/code&gt; package, you have simply to download it and type the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo dpkg -i &amp;lt;your_deb_package.deb&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now there are 2 possibilities:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If you have the &lt;code&gt;dialog&lt;/code&gt; binary installed on your system you should see a dialog window like this (the dialog is a new feature that will be regularly shipped in Falco 0.34 for all the drivers!):&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="https://v0-43--falcosecurity.netlify.app/blog/falco-modern-bpf/images/falco-modern-bpf-02.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;p&gt;You have simply to choose the &lt;em&gt;&amp;quot;Modern eBPF&amp;quot;&lt;/em&gt; option.&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;If you don't have &lt;code&gt;dialog&lt;/code&gt; installed, you must start the service manually:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo systemctl start falco-modern-bpf.service
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Typing &lt;code&gt;sudo systemctl status falco-modern-bpf.service&lt;/code&gt; should either way show you a similar output to:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-txt" data-lang="txt"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Nov 15 14:50:46 ip-172-31-13-74 systemd[1]: Started Falco: Container Native Runtime Security with modern ebpf.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Nov 15 14:50:46 ip-172-31-13-74 falco[1587330]: Falco version: 0.32.1-291+5d1b0c5 (x86_64)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Nov 15 14:50:46 ip-172-31-13-74 falco[1587330]: Falco initialized with configuration file: /etc/falco/falco.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Nov 15 14:50:46 ip-172-31-13-74 falco[1587330]: Loading rules from file /etc/falco/falco_rules.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Nov 15 14:50:46 ip-172-31-13-74 falco[1587330]: Loading rules from file /etc/falco/falco_rules.local.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Nov 15 14:50:46 ip-172-31-13-74 falco[1587330]: The chosen syscall buffer dimension is: 8388608 bytes (8 MBs)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Nov 15 14:50:46 ip-172-31-13-74 falco[1587330]: Starting health webserver with threadiness 8, listening on port 8765
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Nov 15 14:50:46 ip-172-31-13-74 falco[1587330]: Enabled event sources: syscall
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Nov 15 14:50:46 ip-172-31-13-74 falco[1587330]: Opening capture with modern BPF probe
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="2-tar-archive"&gt;2. Tar archive&lt;/h3&gt;
&lt;p&gt;You can download &lt;a href="https://output.circle-artifacts.com/output/job/eb00e055-c99b-4846-b203-8262ebe666f1/artifacts/0/packages/falco-0.32.1-293&amp;#43;76726d7-x86_64.tar.gz"&gt;here&lt;/a&gt; the &lt;code&gt;x86_64&lt;/code&gt; tar.gz and &lt;a href="https://output.circle-artifacts.com/output/job/457abf8a-f060-4cc1-961d-e2d2ac10eebb/artifacts/0/packages/falco-0.32.1-293&amp;#43;76726d7-aarch64.tar.gz"&gt;here&lt;/a&gt; the &lt;code&gt;arm64&lt;/code&gt; one.&lt;/p&gt;
&lt;p&gt;Here the procedure is very simple, you can extract the contents of the archive and execute the Falco binary:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tar -xvf &amp;lt;targz_package.tar.gz&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a2f"&gt;cd&lt;/span&gt; &amp;lt;untar_folder&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo ./usr/bin/falco --modern-bpf -c ./etc/falco/falco.yaml -r ./etc/falco/falco_rules.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Please note&lt;/strong&gt;: The command line option required to run Falco with the modern BPF probe is &lt;code&gt;--modern-bpf&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id="3-docker-image"&gt;3. Docker image&lt;/h3&gt;
&lt;p&gt;In an environment where you can start containers, you can simply use the docker images from DockerHub:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#080;font-style:italic"&gt;# x86_64&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;docker pull andreater/falco-modern-x86:latest
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;docker run --rm -i -t &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --privileged &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /var/run/docker.sock:/host/var/run/docker.sock &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /proc:/host/proc:ro &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; andreater/falco-modern-x86:latest
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#080;font-style:italic"&gt;# arm64&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;docker pull andreater/falco-modern-arm64:latest
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;docker run --rm -i -t &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --privileged &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /var/run/docker.sock:/host/var/run/docker.sock &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /proc:/host/proc:ro &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; andreater/falco-modern-arm64:latest
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Please note&lt;/strong&gt;: The helm chart is not available yet since this is a pre-release but it will be shipped as expected with Falco &lt;code&gt;0.34&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="current-syscall-support"&gt;Current syscall support ⏲️&lt;/h2&gt;
&lt;p&gt;The modern BPF probe doesn't yet support all the syscalls supported by the current probe. It only supports the &lt;em&gt;&amp;quot;simple consumer set&amp;quot;&lt;/em&gt;, which means that we support all the syscalls necessary to run Falco without &lt;code&gt;-A&lt;/code&gt; option, also known as the &lt;em&gt;default Falco mode&lt;/em&gt;. At the moment, adding the &lt;code&gt;-A&lt;/code&gt; flag wouldn't have any further effect.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/falcosecurity/libs/issues/513"&gt;Here&lt;/a&gt; you can find the complete list of syscalls currently supported by the modern probe.&lt;/p&gt;
&lt;p&gt;The good news is that we are actively working to include all the syscalls supported by the &lt;a href="https://falcosecurity.github.io/libs/report/"&gt;current probe&lt;/a&gt; 💥&lt;/p&gt;
&lt;h2 id="next-steps"&gt;Next steps 🔮&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Release Falco 0.34 with the modern probe as an experimental feature.&lt;/li&gt;
&lt;li&gt;Reach the full support of syscall.&lt;/li&gt;
&lt;li&gt;Introduce new points of instrumentation like LSM hooks to collect security events.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="falco-and-modern-bpf-at-ebpf-summit"&gt;Falco and modern BPF at eBPF summit 🐝&lt;/h2&gt;
&lt;p&gt;If you want to know more about how the modern BPF probe works under the hood take a look at the eBPF summit presentation.&lt;/p&gt;
&lt;div style="position: relative; padding-bottom: 45%; height: 0; overflow: hidden;"&gt;
&lt;iframe src="https://www.youtube.com/embed/BxoKztfHnYY" style="position: absolute; top: 0; left: 0; width: 80%; height: 100%; border:0;" allowfullscreen title="Falco&amp;#39;s Discovery of the Modern eBPF World - Andrea Terzolo &amp;amp; Jason Dellaluce"&gt;&lt;/iframe&gt;
&lt;/div&gt;</description></item><item><title>Blog: Falco Driverkit with Docker on Debian</title><link>https://v0-43--falcosecurity.netlify.app/blog/falco-driverkit-debian-docker/</link><pubDate>Mon, 05 Sep 2022 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/blog/falco-driverkit-debian-docker/</guid><description>
&lt;p&gt;We use different technologies on a daily basis. Tools like Vagrant, Terraform, Ansible, and many more allow us to create and destroy digital resources in a matter of minutes, if not seconds. However, if you keep changing your running environment, you might also need to calibrate your workloads to these new changes. This is especially true when you deploy applications tightly dependent on the operating system.&lt;/p&gt;
&lt;p&gt;In other words, every time you deploy an application like Falco there's a chance that you need to compile a new module or eBPF probe to get along with the current underlying kernel. This is the first of a series of posts where you will learn some interesting techniques related to how Falco generates the much needed driver and how you can make it available for your deployments.&lt;/p&gt;
&lt;h2 id="falco-on-docker"&gt;Falco on Docker&lt;/h2&gt;
&lt;p&gt;There are many ways to run Falco: as a service, as a local container, as a Pod in Kubernetes, etc. Either way, if what we want to do is use Falco to detect threats based on syscalls, we will need a driver that has been compiled for the specific kernel running on the machine, be it a physical machine, a virtual one, or a Kubernetes node in the cloud.&lt;/p&gt;
&lt;h3 id="launching-falco-as-a-container"&gt;Launching Falco as a container&lt;/h3&gt;
&lt;p&gt;The Falco image embeds a script, &lt;code&gt;/usr/bin/falco-driver-loader&lt;/code&gt;, that will automatically try to find and download a kernel module or an eBPF probe. If that wasn't possible, it might try to compile it inside the container itself. We will learn a bit more about this process and how to control it.&lt;/p&gt;
&lt;p&gt;Here is the output of a fresh instance of &lt;code&gt;falco&lt;/code&gt; running on our local docker service:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker run -it --privileged &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --name falco-driver-test &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /dev:/host/dev &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /etc:/host/etc:ro &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /proc:/host/proc:ro &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /var/run/docker.sock:/host/var/run/docker.sock &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; docker.io/falcosecurity/falco:0.32.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Unable to find image &lt;span style="color:#b44"&gt;&amp;#39;falcosecurity/falco:0.32.2&amp;#39;&lt;/span&gt; locally
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;0.32.2: Pulling from falcosecurity/falco
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;7e6a53d1988f: Pull &lt;span style="color:#a2f"&gt;complete&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;... output omitted
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;f3102eb3e85f: Pull &lt;span style="color:#a2f"&gt;complete&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Digest: sha256:5ceb23e5baae9c86fc0b160fed397facd2074ca398b770878adbb9c6d049d8a8
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Status: Downloaded newer image &lt;span style="color:#a2f;font-weight:bold"&gt;for&lt;/span&gt; falcosecurity/falco:0.32.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Setting up /usr/src links from host
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Running falco-driver-loader &lt;span style="color:#a2f;font-weight:bold"&gt;for&lt;/span&gt;: falco &lt;span style="color:#b8860b"&gt;version&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;0.32.2, driver &lt;span style="color:#b8860b"&gt;version&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;2.0.0+driver
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Running falco-driver-loader with: &lt;span style="color:#b8860b"&gt;driver&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;module, &lt;span style="color:#b8860b"&gt;compile&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;yes, &lt;span style="color:#b8860b"&gt;download&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#b8860b"&gt;yes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#666"&gt;================&lt;/span&gt; Cleaning &lt;span style="color:#b8860b"&gt;phase&lt;/span&gt; &lt;span style="color:#666"&gt;================&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* 1. Check &lt;span style="color:#a2f;font-weight:bold"&gt;if&lt;/span&gt; kernel module &lt;span style="color:#b44"&gt;&amp;#39;falco&amp;#39;&lt;/span&gt; is still loaded:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;- OK! There is no &lt;span style="color:#b44"&gt;&amp;#39;falco&amp;#39;&lt;/span&gt; module loaded.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* 2. Check all versions of kernel module &lt;span style="color:#b44"&gt;&amp;#39;falco&amp;#39;&lt;/span&gt; in dkms:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;- There are some versions of &lt;span style="color:#b44"&gt;&amp;#39;falco&amp;#39;&lt;/span&gt; module in dkms.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* 3. Removing all the following versions from dkms:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2.0.0+driver
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;- Removing 2.0.0+driver...
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Deleting module version: 2.0.0+driver
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;completely from the DKMS tree.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Done.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;- OK! Removing &lt;span style="color:#b44"&gt;&amp;#39;2.0.0+driver&amp;#39;&lt;/span&gt; succeeded.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#666"&gt;[&lt;/span&gt;SUCCESS&lt;span style="color:#666"&gt;]&lt;/span&gt; Cleaning phase correctly terminated.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#666"&gt;================&lt;/span&gt; Cleaning &lt;span style="color:#b8860b"&gt;phase&lt;/span&gt; &lt;span style="color:#666"&gt;================&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Looking &lt;span style="color:#a2f;font-weight:bold"&gt;for&lt;/span&gt; a falco module locally &lt;span style="color:#666"&gt;(&lt;/span&gt;kernel 5.10.0-14-cloud-amd64&lt;span style="color:#666"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Trying to download a prebuilt falco module from https://download.falco.org/driver/2.0.0%2Bdriver/x86_64/falco_debian_5.10.0-14-cloud-amd64_1.ko
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;curl: &lt;span style="color:#666"&gt;(&lt;/span&gt;22&lt;span style="color:#666"&gt;)&lt;/span&gt; The requested URL returned error: &lt;span style="color:#666"&gt;404&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Unable to find a prebuilt falco module
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Trying to dkms install falco module with GCC /usr/bin/gcc
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;DIRECTIVE: &lt;span style="color:#b8860b"&gt;MAKE&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#b44"&gt;&amp;#34;&amp;#39;/tmp/falco-dkms-make&amp;#39;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Creating symlink /var/lib/dkms/falco/2.0.0+driver/source -&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; /usr/src/falco-2.0.0+driver
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;DKMS: add completed.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Running dkms build failed, couldn&lt;span style="color:#b44"&gt;&amp;#39;t find /var/lib/dkms/falco/2.0.0+driver/build/make.log (with GCC /usr/bin/gcc)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;* Trying to dkms install falco module with GCC /usr/bin/gcc-8
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;DIRECTIVE: MAKE=&amp;#34;&amp;#39;&lt;/span&gt;/tmp/falco-dkms-make&lt;span style="color:#b44"&gt;&amp;#39;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;* Running dkms build failed, couldn&amp;#39;&lt;/span&gt;t find /var/lib/dkms/falco/2.0.0+driver/build/make.log &lt;span style="color:#666"&gt;(&lt;/span&gt;with GCC /usr/bin/gcc-8&lt;span style="color:#666"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Trying to dkms install falco module with GCC /usr/bin/gcc-6
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;DIRECTIVE: &lt;span style="color:#b8860b"&gt;MAKE&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#b44"&gt;&amp;#34;&amp;#39;/tmp/falco-dkms-make&amp;#39;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Running dkms build failed, couldn&lt;span style="color:#b44"&gt;&amp;#39;t find /var/lib/dkms/falco/2.0.0+driver/build/make.log (with GCC /usr/bin/gcc-6)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;* Trying to dkms install falco module with GCC /usr/bin/gcc-5
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;DIRECTIVE: MAKE=&amp;#34;&amp;#39;&lt;/span&gt;/tmp/falco-dkms-make&lt;span style="color:#b44"&gt;&amp;#39;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;* Running dkms build failed, couldn&amp;#39;&lt;/span&gt;t find /var/lib/dkms/falco/2.0.0+driver/build/make.log &lt;span style="color:#666"&gt;(&lt;/span&gt;with GCC /usr/bin/gcc-5&lt;span style="color:#666"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Trying to load a system falco module, &lt;span style="color:#a2f;font-weight:bold"&gt;if&lt;/span&gt; present
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Consider compiling your own falco driver and loading it or getting in touch with the Falco community
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:00:02+0000: Falco version 0.32.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:00:02+0000: Falco initialized with configuration file /etc/falco/falco.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:00:02+0000: Loading rules from file /etc/falco/falco_rules.yaml:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:00:02+0000: Loading rules from file /etc/falco/falco_rules.local.yaml:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:00:02+0000: Starting internal webserver, listening on port &lt;span style="color:#666"&gt;8765&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:00:02+0000: Unable to load the driver.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:00:02+0000: Runtime error: error opening device /host/dev/falco0. Make sure you have root credentials and that the falco module is loaded.. Exiting.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There are some important reads from this output:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The driver version this image tries to load is the &lt;strong&gt;&lt;code&gt;2.0.0+driver&lt;/code&gt;&lt;/strong&gt;. This information will be really useful when we need to compile and share the driver with the &lt;em&gt;falco container&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;By default, the container will look for a kernel module. It is possible to switch to an &lt;em&gt;eBPF probe&lt;/em&gt; by using an environment variable, as you'll see later in this post.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;falco-driver-loader&lt;/code&gt; script always removes the driver from memory and tries to load a current one. This is done for security reasons and the way to avoid that is not running this script when creating the container. More on this later, too.&lt;/li&gt;
&lt;li&gt;After looking in the system for a previously installed driver, the script tries to download it from the URL &lt;code&gt;https://download.falco.org&lt;/code&gt;. Unfortunately, it doesn't seem to be able to find it and falls back to the local compilation method.&lt;/li&gt;
&lt;li&gt;When the script tries to compile the driver inside the container, it doesn't succeed because we haven't fulfilled one important prerequisite: installing the kernel headers on the host machine. In this post, we won't address that method but you can always refer to the documentation.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="using-falco-driverkit"&gt;Using Falco Driverkit&lt;/h3&gt;
&lt;p&gt;As mentioned, there are different ways to obtain a valid kernel: downloading it from &lt;code&gt;https://download.falco.org&lt;/code&gt;, compiling it via the &lt;code&gt;falco-driver-loader&lt;/code&gt; script, or the method we'll explain here: using &lt;code&gt;driverkit&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We don't intend this post to be an exhaustive guide to &lt;code&gt;driverkit&lt;/code&gt;. That's also why we've chosen a relatively easy and tested target operating system: Debian.&lt;/p&gt;
&lt;p&gt;First of all, we need the &lt;code&gt;driverkit&lt;/code&gt; tool which we'll compile ourselves. We can download the source code from &lt;code&gt;https://github.com/falcosecurity/driverkit&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When compiling a tool, we like using a temporary container. In this case, we'll start our container using the &lt;code&gt;docker.io/golang:1.19&lt;/code&gt; image and a &lt;code&gt;sleep&lt;/code&gt; process until we're done. The &lt;code&gt;./driverkit&lt;/code&gt; directory will help us to extract the binary to the host filesystem. Feel free to use any other method you prefer, like &lt;code&gt;docker cp&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#080;font-style:italic"&gt;# This directory will contain the driverkit binary&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#080;font-style:italic"&gt;# once it is compiled inside the container&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ mkdir ./driverkit
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#080;font-style:italic"&gt;# Container with Go tools&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker run --rm -d --name golang-compiler &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v &lt;span style="color:#b8860b"&gt;$PWD&lt;/span&gt;/driverkit:/export &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; golang:1.19 sleep infinity
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Check that the container has been successfully created and still runs:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker ps
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;1ff943cbf7f9 golang:1.19 &lt;span style="color:#b44"&gt;&amp;#34;sleep infinity&amp;#34;&lt;/span&gt; &lt;span style="color:#666"&gt;4&lt;/span&gt; seconds ago Up &lt;span style="color:#666"&gt;3&lt;/span&gt; seconds golang-compiler
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next, create a shell with a terminal in the container:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker &lt;span style="color:#a2f"&gt;exec&lt;/span&gt; -it golang-compiler /bin/bash
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Remember, you are in the container context now. Whatever you do here will be lost unless you copy it to the &lt;code&gt;/export&lt;/code&gt; directory. We will clone the &lt;code&gt;driverkit&lt;/code&gt; code and compile it using the following commands:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git clone https://github.com/falcosecurity/driverkit
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a2f"&gt;cd&lt;/span&gt; driverkit &lt;span style="color:#666"&gt;&amp;amp;&amp;amp;&lt;/span&gt; make
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cp _output/bin/driverkit /export/driverkit
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a2f"&gt;exit&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once we are done with the Golang container, we can stop it and it'll be automatically removed thanks to the &lt;code&gt;--rm&lt;/code&gt; parameter that we used to start it.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;docker stop golang-compiler -t0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="creating-a-configuration-file-for-the-driver-request"&gt;Creating a configuration file for the driver request&lt;/h4&gt;
&lt;p&gt;Time to create a configuration file. Do you remember the driver version: &lt;code&gt;2.0.0+driver&lt;/code&gt;? We will use that and additional information to create the configuration file.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#080;font-style:italic"&gt;# We&amp;#39;ve included some VARIABLES that will help you understand&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#080;font-style:italic"&gt;# where the different values come from and what they represent&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a2f"&gt;export&lt;/span&gt; &lt;span style="color:#b8860b"&gt;DRIVER_VERSION&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;2.0.0+driver
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a2f"&gt;export&lt;/span&gt; &lt;span style="color:#b8860b"&gt;DRIVER_TARGET&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;debian
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a2f"&gt;export&lt;/span&gt; &lt;span style="color:#b8860b"&gt;DRIVER_ARCH&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;$(&lt;/span&gt;arch&lt;span style="color:#a2f;font-weight:bold"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a2f"&gt;export&lt;/span&gt; &lt;span style="color:#b8860b"&gt;KERNEL_VERSION&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;$(&lt;/span&gt;uname -v| cut -f1 -d&lt;span style="color:#b44"&gt;&amp;#39; &amp;#39;&lt;/span&gt; | tr -d &lt;span style="color:#b62;font-weight:bold"&gt;\#&lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a2f"&gt;export&lt;/span&gt; &lt;span style="color:#b8860b"&gt;KERNEL_RELEASE&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;$(&lt;/span&gt;uname -r&lt;span style="color:#a2f;font-weight:bold"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a2f"&gt;export&lt;/span&gt; &lt;span style="color:#b8860b"&gt;DRIVER_NAME&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;falco
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a2f"&gt;export&lt;/span&gt; &lt;span style="color:#b8860b"&gt;PROBE_FILE&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;DRIVER_NAME&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt;_&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;DRIVER_TARGET&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt;_&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;KERNEL_RELEASE&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt;_&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;KERNEL_VERSION&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt;.o
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a2f"&gt;export&lt;/span&gt; &lt;span style="color:#b8860b"&gt;MODULE_FILE&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;DRIVER_NAME&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt;_&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;DRIVER_TARGET&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt;_&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;KERNEL_RELEASE&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt;_&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;KERNEL_VERSION&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt;.ko
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir -p drivers/&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;DRIVER_VERSION&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt;/&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;DRIVER_ARCH&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#080;font-style:italic"&gt;# Creating the actual file that we will pass to driverkit&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cat &amp;gt; debian.yaml &lt;span style="color:#b44"&gt;&amp;lt;&amp;lt; EOF
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;target: ${DRIVER_TARGET}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;driverversion: ${DRIVER_VERSION}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;kernelrelease: ${KERNEL_RELEASE}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;kernelversion: ${KERNEL_VERSION}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;output:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; module: ./drivers/${DRIVER_VERSION}/x86_64/${MODULE_FILE}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt; probe: ./drivers/${DRIVER_VERSION}/x86_64/${PROBE_FILE}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b44"&gt;EOF&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The resulting file should look like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ cat debian.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;target: debian
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;driverversion: 2.0.0+driver
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kernelrelease: 5.10.0-14-cloud-amd64
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kernelversion: &lt;span style="color:#666"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;output:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; module: ./drivers/2.0.0+driver/x86_64/falco_debian_5.10.0-14-cloud-amd64_1.ko
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; probe: ./drivers/2.0.0+driver/x86_64/falco_debian_5.10.0-14-cloud-amd64_1.o
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;p&gt;In case you want to use a version previous to Falco 0.32.2 you might need to remove the &lt;code&gt;x86_64/&lt;/code&gt; string from the probe path. This is due to the expected path inside the &lt;code&gt;falco-driver-loader&lt;/code&gt; script. These paths will be offered via an HTTP server at a later stage, so make sure they match in both steps.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This same file is the one we will pass to &lt;code&gt;driverkit&lt;/code&gt;. If the driver is compiled satisfactorily, we should see a similar output in some seconds. Be patient.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ ./driverkit/driverkit docker -c debian.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO using config file &lt;span style="color:#b8860b"&gt;file&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;debian.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO driver building, it will take a few seconds &lt;span style="color:#b8860b"&gt;processor&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;docker
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO kernel module available &lt;span style="color:#b8860b"&gt;path&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;./drivers/2.0.0+driver/x86_64/falco_debian_5.10.0-14-cloud-amd64_1.ko
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO eBPF probe available &lt;span style="color:#b8860b"&gt;path&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;./drivers/2.0.0+driver/x86_64/falco_debian_5.10.0-14-cloud-amd64_1.o
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Make sure you use either the .yml or .yaml suffix. Otherwise, you'll get an error like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ ./driverkit/driverkit docker -c debian.unknown-ext
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Error: exiting &lt;span style="color:#a2f;font-weight:bold"&gt;for&lt;/span&gt; validation errors
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Usage:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; driverkit docker &lt;span style="color:#666"&gt;[&lt;/span&gt;flags&lt;span style="color:#666"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Flags:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;... output omitted
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;FATA error executing driverkit &lt;span style="color:#b8860b"&gt;error&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#b44"&gt;&amp;#34;exiting for validation errors&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Alternatively, we could have used a bunch of parameters in the command line, like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#080;font-style:italic"&gt;# Don&amp;#39;t forget to \, to let the command continue after each line&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ ./driverkit/driverkit docker &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --architecture amd64 &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --target &lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;DRIVER_TARGET&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt; &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --driverversion &lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;DRIVER_VERSION&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt; &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --kernelversion &lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;KERNEL_VERSION&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt; &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --kernelrelease &lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;KERNEL_RELEASE&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt; &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --output-probe ./drivers/&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;DRIVER_VERSION&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt;/x86_64/&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;PROBE_FILE&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt; &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --output-module ./drivers/&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;DRIVER_VERSION&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt;/x86_64/&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;MODULE_FILE&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO driver building, it will take a few seconds &lt;span style="color:#b8860b"&gt;processor&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;docker
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO kernel module available &lt;span style="color:#b8860b"&gt;path&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;./drivers/2.0.0+driver/x86_64/falco_debian_5.10.0-14-cloud-amd64_1.ko
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO eBPF probe available &lt;span style="color:#b8860b"&gt;path&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;./drivers/2.0.0+driver/x86_64/falco_debian_5.10.0-14-cloud-amd64_1.o
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Either way, if &lt;code&gt;driverkit&lt;/code&gt; manages to compile the drivers, you can continue with the next step. Otherwise, you might need to adjust some of the parameters in the configuration or even customize your builder image, but we will explain that in a different post where we will deep dive into &lt;code&gt;driverkit&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id="launching-falco-with-the-new-driver"&gt;Launching Falco with the new driver&lt;/h3&gt;
&lt;p&gt;There are different ways to load the driver when running Falco. We'll show you two of them: loading them manually and leaving this action to the script embedded in the container image.&lt;/p&gt;
&lt;h4 id="loading-the-driver-manually"&gt;Loading the driver manually&lt;/h4&gt;
&lt;p&gt;A kernel module only needs to be loaded once. So, if we load it manually before starting the container, Falco doesn't need to do it again.&lt;/p&gt;
&lt;p&gt;There are two ways of achieving that, and both require avoiding the execution of the &lt;code&gt;falco-driver-loader&lt;/code&gt; script:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Setting the SKIP_DRIVER_LOADER environment variable to any value when creating the container. By doing so, the container entrypoint will skip the existing &lt;code&gt;falco-driver-loader&lt;/code&gt; script.&lt;/li&gt;
&lt;li&gt;Using the image &lt;code&gt;docker.io/falco/falco-no-driver&lt;/code&gt;, which doesn't contain that script.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;First, try to load the driver on the host. Look for the &lt;code&gt;.ko&lt;/code&gt; file in the directory structure we created and load it using &lt;code&gt;insmod&lt;/code&gt;, for instance. If the compilation was successful and the kernel version chosen was the right one, you shouldn't see any message once the module is loaded. Don't forget to do it with the user &lt;em&gt;root&lt;/em&gt; (i.e., via &lt;code&gt;sudo&lt;/code&gt;).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ find &lt;span style="color:#b8860b"&gt;$HOME&lt;/span&gt;/drivers -type f
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;drivers/2.0.0+driver/x86_64/falco_debian_5.10.0-14-cloud-amd64_1.o
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;drivers/2.0.0+driver/x86_64/falco_debian_5.10.0-14-cloud-amd64_1.ko
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ sudo insmod drivers/2.0.0+driver/x86_64/falco_debian_5.10.0-14-cloud-amd64_1.ko
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ lsmod | grep -i falco
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;falco &lt;span style="color:#666"&gt;741376&lt;/span&gt; &lt;span style="color:#666"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This first method of starting the &lt;code&gt;falco&lt;/code&gt; container will use the &lt;code&gt;docker.io/falco/falco:0.32.2&lt;/code&gt; image, passing the &lt;code&gt;SKIP_DRIVER_LOADER&lt;/code&gt; variable. We've set it to one but the script doesn't check its value.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Observe that we're removing any existing container with that name before starting ours, but the container image remains.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker rm -f falco-driver-test &lt;span style="color:#080;font-style:italic"&gt;# Ignore any failure here&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;falco-driver-test
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker run -it --privileged &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --name falco-driver-test &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -e &lt;span style="color:#b8860b"&gt;SKIP_DRIVER_LOADER&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#666"&gt;1&lt;/span&gt; &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /dev:/host/dev &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /proc:/host/proc:ro &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /var/run/docker.sock:/host/var/run/docker.sock &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; docker.io/falcosecurity/falco:0.32.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:07:30+0000: Falco version 0.32.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:07:30+0000: Falco initialized with configuration file /etc/falco/falco.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:07:30+0000: Loading rules from file /etc/falco/falco_rules.yaml:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:07:30+0000: Loading rules from file /etc/falco/falco_rules.local.yaml:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:07:30+0000: Starting internal webserver, listening on port &lt;span style="color:#666"&gt;8765&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The second method uses the &lt;code&gt;docker.io/falco/falco-no-driver&lt;/code&gt; image, so, as you can expect, it won't try to reload the driver this time.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This time, Docker will pull the image since we hadn't used it yet.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker rm -f falco-driver-test &lt;span style="color:#080;font-style:italic"&gt;# Ignore any failure here&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;falco-driver-test
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker run -i -t --privileged &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /var/run/docker.sock:/host/var/run/docker.sock &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /dev:/host/dev &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /proc:/host/proc:ro &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --name falco-driver-test &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; docker.io/falcosecurity/falco-no-driver:0.32.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Unable to find image &lt;span style="color:#b44"&gt;&amp;#39;falcosecurity/falco-no-driver:0.32.2&amp;#39;&lt;/span&gt; locally
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;0.32.2: Pulling from falcosecurity/falco-no-driver
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;1efc276f4ff9: Pull &lt;span style="color:#a2f"&gt;complete&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;e34e1870ff2c: Pull &lt;span style="color:#a2f"&gt;complete&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Digest: sha256:14e6d3da56fe607ff9b0bfe91ec812ab4f4b030cea3ed88a2d31ac9b31f97fb4
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Status: Downloaded newer image &lt;span style="color:#a2f;font-weight:bold"&gt;for&lt;/span&gt; falcosecurity/falco-no-driver:0.32.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:12:40+0000: Falco version 0.32.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:12:40+0000: Falco initialized with configuration file /etc/falco/falco.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:12:40+0000: Loading rules from file /etc/falco/falco_rules.yaml:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:12:40+0000: Loading rules from file /etc/falco/falco_rules.local.yaml:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:12:40+0000: Starting internal webserver, listening on port &lt;span style="color:#666"&gt;8765&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="sharing-the-probe-and-driver-with-the-falco-container"&gt;Sharing the probe and driver with the Falco container&lt;/h4&gt;
&lt;p&gt;This method is a bit more complicated than the previous one but will also give us the flexibility of deploying &lt;code&gt;falco&lt;/code&gt; at scale.&lt;/p&gt;
&lt;p&gt;The idea is simple though. After starting your favorite webserver and publishing the &lt;code&gt;./drivers&lt;/code&gt; directory that we created before, we'll tell the &lt;code&gt;falco&lt;/code&gt; container to use it as a repository and download the driver from there.&lt;/p&gt;
&lt;p&gt;To keep things clean, we've used the &lt;code&gt;docker.io/python:latest&lt;/code&gt; container image, which includes the Python module &lt;code&gt;http.server&lt;/code&gt;. If you have Python already installed on your system, you can use it directly. Just remember to define a port accessible to the &lt;code&gt;falco&lt;/code&gt; container and pass the right IP address.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker run -d &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --name falco-drivers-web &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v &lt;span style="color:#b8860b"&gt;$PWD&lt;/span&gt;/drivers:/data:ro &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; docker.io/python:latest &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; bash -c &lt;span style="color:#b44"&gt;&amp;#34;cd /data &amp;amp;&amp;amp; python -m http.server&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Unable to find image &lt;span style="color:#b44"&gt;&amp;#39;python:latest&amp;#39;&lt;/span&gt; locally
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;latest: Pulling from library/python
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;1671565cc8df: Pull &lt;span style="color:#a2f"&gt;complete&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;... output omitted
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;4334b2fe8293: Pull &lt;span style="color:#a2f"&gt;complete&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Digest: sha256:745efdfb7e4aac9a8422bd8c62d8bc35a693e8979a240d29677cb03e6aa91052
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Status: Downloaded newer image &lt;span style="color:#a2f;font-weight:bold"&gt;for&lt;/span&gt; python:latest
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;f94cb601f85c312d62aab3e116619558239bada9f5d05e971fe26c0206828b6b
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Our python web server is now available and offers the drivers to any local container that might need them. Retrieve the IP address of this container for later use:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker inspect falco-drivers-web --format &lt;span style="color:#b44"&gt;&amp;#39;{{ .NetworkSettings.IPAddress }}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;172.17.0.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#080;font-style:italic"&gt;# Assign it to a variable for later use&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ &lt;span style="color:#a2f"&gt;export&lt;/span&gt; &lt;span style="color:#b8860b"&gt;DRIVERS_REPO&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;$(&lt;/span&gt;docker inspect falco-drivers-web &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --format &lt;span style="color:#b44"&gt;&amp;#39;{{ .NetworkSettings.IPAddress }}&amp;#39;&lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;)&lt;/span&gt;:8000
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ &lt;span style="color:#a2f"&gt;echo&lt;/span&gt; &lt;span style="color:#b8860b"&gt;$DRIVERS_REPO&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;172.17.0.2:8000
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It's always a good practice to test that the drivers are in the right place and accessible through the webserver.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#080;font-style:italic"&gt;# This is the checksum of the local files&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ find ./drivers -type f -name &lt;span style="color:#b44"&gt;&amp;#34;*o&amp;#34;&lt;/span&gt; -exec cksum &lt;span style="color:#666"&gt;{}&lt;/span&gt; &lt;span style="color:#b62;font-weight:bold"&gt;\;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#666"&gt;3873827283&lt;/span&gt; &lt;span style="color:#666"&gt;843080&lt;/span&gt; ./drivers/2.0.0+driver/x86_64/falco_debian_5.10.0-14-cloud-amd64.ko
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#666"&gt;914371530&lt;/span&gt; &lt;span style="color:#666"&gt;4980536&lt;/span&gt; ./drivers/2.0.0+driver/x86_64/falco_debian_5.10.0-14-cloud-amd64.o
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#080;font-style:italic"&gt;# This is the checksum of the files retrieved through HTTP&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ find ./drivers -type f -name &lt;span style="color:#b44"&gt;&amp;#34;*o&amp;#34;&lt;/span&gt; | &lt;span style="color:#a2f;font-weight:bold"&gt;while&lt;/span&gt; &lt;span style="color:#a2f"&gt;read&lt;/span&gt; FILE
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a2f;font-weight:bold"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#b8860b"&gt;URL&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;$(&lt;/span&gt;&lt;span style="color:#a2f"&gt;echo&lt;/span&gt; &lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;FILE&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt; | sed -e &lt;span style="color:#b44"&gt;&amp;#39;s,./drivers,&amp;#39;&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;DRIVERS_REPO&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt;&lt;span style="color:#b44"&gt;&amp;#39;,&amp;#39;&lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a2f"&gt;echo&lt;/span&gt; &lt;span style="color:#b44"&gt;&amp;#34;&lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;$(&lt;/span&gt;curl -s http://&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;URL&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt; | cksum&lt;span style="color:#a2f;font-weight:bold"&gt;)&lt;/span&gt;&lt;span style="color:#b44"&gt; http://&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;URL&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt;&lt;span style="color:#b44"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a2f;font-weight:bold"&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#666"&gt;3873827283&lt;/span&gt; &lt;span style="color:#666"&gt;843080&lt;/span&gt; localhost:8000/2.0.0+driver/x86_64/falco_debian_5.10.0-14-cloud-amd64.ko
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#666"&gt;914371530&lt;/span&gt; &lt;span style="color:#666"&gt;4980536&lt;/span&gt; localhost:8000/2.0.0+driver/x86_64/falco_debian_5.10.0-14-cloud-amd64.o
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As you can see, they are accessible and identical.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;These values will be different depending on the version of the kernel and the Falco drivers.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id="loading-the-kernel-module"&gt;Loading the kernel module&lt;/h4&gt;
&lt;p&gt;Let's start with the kernel module. In this case, the only variable we need to pass is the &lt;code&gt;DRIVERS_REPO&lt;/code&gt; one, which has been carefully prepared in the previous step.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker rm -f falco-driver-test
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;falco-driver-test
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker run -it --privileged &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --name falco-driver-test &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /dev:/host/dev &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /etc:/host/etc:ro &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /proc:/host/proc:ro &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /var/run/docker.sock:/host/var/run/docker.sock &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -e &lt;span style="color:#b8860b"&gt;DRIVERS_REPO&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;DRIVERS_REPO&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt; &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; docker.io/falcosecurity/falco:0.32.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Setting up /usr/src links from host
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Running falco-driver-loader &lt;span style="color:#a2f;font-weight:bold"&gt;for&lt;/span&gt;: falco &lt;span style="color:#b8860b"&gt;version&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;0.32.2, driver &lt;span style="color:#b8860b"&gt;version&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;2.0.0+driver
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Running falco-driver-loader with: &lt;span style="color:#b8860b"&gt;driver&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;module, &lt;span style="color:#b8860b"&gt;compile&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;yes, &lt;span style="color:#b8860b"&gt;download&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#b8860b"&gt;yes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#666"&gt;================&lt;/span&gt; Cleaning &lt;span style="color:#b8860b"&gt;phase&lt;/span&gt; &lt;span style="color:#666"&gt;================&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* 1. Check &lt;span style="color:#a2f;font-weight:bold"&gt;if&lt;/span&gt; kernel module &lt;span style="color:#b44"&gt;&amp;#39;falco&amp;#39;&lt;/span&gt; is still loaded:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;- OK! There is no &lt;span style="color:#b44"&gt;&amp;#39;falco&amp;#39;&lt;/span&gt; module loaded.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* 2. Check all versions of kernel module &lt;span style="color:#b44"&gt;&amp;#39;falco&amp;#39;&lt;/span&gt; in dkms:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;- There are some versions of &lt;span style="color:#b44"&gt;&amp;#39;falco&amp;#39;&lt;/span&gt; module in dkms.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* 3. Removing all the following versions from dkms:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2.0.0+driver
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;- Removing 2.0.0+driver...
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Deleting module version: 2.0.0+driver
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;completely from the DKMS tree.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Done.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;- OK! Removing &lt;span style="color:#b44"&gt;&amp;#39;2.0.0+driver&amp;#39;&lt;/span&gt; succeeded.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#666"&gt;[&lt;/span&gt;SUCCESS&lt;span style="color:#666"&gt;]&lt;/span&gt; Cleaning phase correctly terminated.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#666"&gt;================&lt;/span&gt; Cleaning &lt;span style="color:#b8860b"&gt;phase&lt;/span&gt; &lt;span style="color:#666"&gt;================&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Looking &lt;span style="color:#a2f;font-weight:bold"&gt;for&lt;/span&gt; a falco module locally &lt;span style="color:#666"&gt;(&lt;/span&gt;kernel 5.10.0-14-cloud-amd64&lt;span style="color:#666"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Trying to download a prebuilt falco module from 172.17.0.2:8000/2.0.0%2Bdriver/x86_64/falco_debian_5.10.0-14-cloud-amd64_1.ko
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Download succeeded
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Success: falco module found and inserted
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:36:29+0000: Falco version 0.32.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:36:29+0000: Falco initialized with configuration file /etc/falco/falco.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:36:29+0000: Loading rules from file /etc/falco/falco_rules.yaml:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:36:29+0000: Loading rules from file /etc/falco/falco_rules.local.yaml:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:36:29+0000: Starting internal webserver, listening on port &lt;span style="color:#666"&gt;8765&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It's a similar output as before, but this time we can see:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;* Trying to download a prebuilt falco module from 172.17.0.2:8000/2.0.0%2Bdriver/x86_64/falco_debian_5.10.0-14-cloud-amd64_1.ko
* Download succeeded
* Success: falco module found and inserted
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The module has been successfully loaded and Falco can start properly.&lt;/p&gt;
&lt;h4 id="loading-the-ebpf-probe"&gt;Loading the eBPF Probe&lt;/h4&gt;
&lt;p&gt;For this, we will make use of another variable, &lt;code&gt;FALCO_BPF_PROBE&lt;/code&gt;. Like it happened with the &lt;code&gt;SKIP_DRIVER_LOADER&lt;/code&gt; variable, its value is not as relevant as the fact that the variable had been defined. We also need to keep the &lt;code&gt;DRIVERS_REPO&lt;/code&gt; variable, since the &lt;code&gt;falco-driver-loader&lt;/code&gt; script will look for the probe in that URL.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker rm -f falco-driver-test
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;falco-driver-test
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker run -it --privileged &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --name falco-driver-test &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /dev:/host/dev &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /etc:/host/etc:ro &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /proc:/host/proc:ro &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /var/run/docker.sock:/host/var/run/docker.sock &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -e &lt;span style="color:#b8860b"&gt;DRIVERS_REPO&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;DRIVERS_REPO&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt; &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -e &lt;span style="color:#b8860b"&gt;FALCO_BPF_PROBE&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#b44"&gt;&amp;#34;&amp;#34;&lt;/span&gt; &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; docker.io/falcosecurity/falco:0.32.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Setting up /usr/src links from host
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Running falco-driver-loader &lt;span style="color:#a2f;font-weight:bold"&gt;for&lt;/span&gt;: falco &lt;span style="color:#b8860b"&gt;version&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;0.32.2, driver &lt;span style="color:#b8860b"&gt;version&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;2.0.0+driver
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Running falco-driver-loader with: &lt;span style="color:#b8860b"&gt;driver&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;bpf, &lt;span style="color:#b8860b"&gt;compile&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;yes, &lt;span style="color:#b8860b"&gt;download&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;yes
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Mounting debugfs
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Trying to download a prebuilt eBPF probe from 172.17.0.2:8000/2.0.0%2Bdriver/x86_64/falco_debian_5.10.0-14-cloud-amd64_1.o
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Skipping compilation, eBPF probe is already present in /root/.falco/falco_debian_5.10.0-14-cloud-amd64_1.o
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* eBPF probe located in /root/.falco/falco_debian_5.10.0-14-cloud-amd64_1.o
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Success: eBPF probe symlinked to /root/.falco/falco-bpf.o
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:58:10+0000: Falco version 0.32.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:58:10+0000: Falco initialized with configuration file /etc/falco/falco.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:58:10+0000: Loading rules from file /etc/falco/falco_rules.yaml:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:58:10+0000: Loading rules from file /etc/falco/falco_rules.local.yaml:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2022-08-31T12:58:10+0000: Starting internal webserver, listening on port &lt;span style="color:#666"&gt;8765&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This time the output is easier to read: The driver is set to bpf, the URL of the HTTP container points to our local webserver, and it also shows where it downloads the probe before starting Falco.&lt;/p&gt;
&lt;h3 id="debugging"&gt;Debugging&lt;/h3&gt;
&lt;p&gt;As a final tip, if you want to start a container based on the regular &lt;code&gt;falco&lt;/code&gt; image to test the &lt;code&gt;falco-driver-loader&lt;/code&gt; script, we recommend starting the container with the &lt;code&gt;--entrypoint /bin/bash&lt;/code&gt; parameter. This will keep the &lt;code&gt;/docker-entrypoint.sh&lt;/code&gt; script from being executed (that one triggers &lt;code&gt;/usr/bin/falco-driver-loader&lt;/code&gt;) and you'll have a much more comfortable environment to work with.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker run -it --privileged &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --name falco-driver-test &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /dev:/host/dev &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /etc:/host/etc:ro &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /proc:/host/proc:ro &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -v /var/run/docker.sock:/host/var/run/docker.sock &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -e &lt;span style="color:#b8860b"&gt;DRIVERS_REPO&lt;/span&gt;&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;${&lt;/span&gt;&lt;span style="color:#b8860b"&gt;DRIVERS_REPO&lt;/span&gt;&lt;span style="color:#b68;font-weight:bold"&gt;}&lt;/span&gt; &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --entrypoint /bin/bash &lt;span style="color:#b62;font-weight:bold"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; docker.io/falcosecurity/falco:0.32.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@e0c391e0cee1:/#
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="conclusion"&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Falco requires tapping into the kernel to be able to retrieve useful information from it. For that, it has two methods: loading a kernel module in the traditional way, or using an eBPF probe. Both of them instrumentalize the kernel and provide the functionality to retrieve the relevant data.&lt;/p&gt;
&lt;p&gt;Due to the infinite number of combinations of Linux kernels and distributions, it is extremely difficult to offer all possible kernels as downloadable assets. Besides, in some environments, it'll be a requirement to compile the driver of such a critical component. Learning how to use Falco Driverkit will help you to easily deploy Falco in more environments.&lt;/p&gt;</description></item></channel></rss>