<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Falco – Developer Guide</title><link>https://v0-43--falcosecurity.netlify.app/docs/developer-guide/</link><description>Recent content in Developer Guide on Falco</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://v0-43--falcosecurity.netlify.app/docs/developer-guide/feed.xml" rel="self" type="application/rss+xml"/><item><title>Docs: Build Falco from source</title><link>https://v0-43--falcosecurity.netlify.app/docs/developer-guide/source/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/docs/developer-guide/source/</guid><description>
&lt;p&gt;Welcome to the guide on how to build Falco yourself! You are very brave! Since you are already
doing all this, chances that you are willing to contribute are high! Please read our &lt;a href="https://github.com/falcosecurity/.github/blob/master/CONTRIBUTING.md"&gt;contributing guide&lt;/a&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install the dependencies&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="card card-sm td-max-width-on-larger-screens"&gt;
&lt;div class="card-body"&gt;
&lt;ul class="nav nav-tabs" id="dependencies" role="tablist"&gt;&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link active" href="#dependencies-0" role="tab" aria-controls="dependencies-0" aria-selected="true"&gt;CentOS / RHEL&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#dependencies-1" role="tab" aria-controls="dependencies-1"&gt;Debian/ Ubuntu&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#dependencies-2" role="tab" aria-controls="dependencies-2"&gt;Arch Linux&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#dependencies-3" role="tab" aria-controls="dependencies-3"&gt;Alpine&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#dependencies-4" role="tab" aria-controls="dependencies-4"&gt;openSUSE&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;div class="tab-content" id="dependencies"&gt;&lt;div id="dependencies-0" class="tab-pane show active" role="tabpanel" aria-labelledby="dependencies-0"&gt;
&lt;p&gt;&lt;p&gt;CentOS 8 Stream / RHEL 8&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;dnf install git gcc gcc-c++ make cmake elfutils-libelf-devel perl-IPC-Cmd
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div id="dependencies-1" class="tab-pane" role="tabpanel" aria-labelledby="dependencies-1"&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;apt update &lt;span style="color:#666"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt install git cmake clang build-essential linux-tools-common linux-tools-generic libelf-dev bpftool
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div id="dependencies-2" class="tab-pane" role="tabpanel" aria-labelledby="dependencies-2"&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;pacman -S git cmake make gcc wget
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;pacman -S zlib jq yaml-cpp openssl curl c-ares protobuf grpc libyaml bpf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You'll also need kernel headers for building and making binaries properly.&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;pacman -S linux-headers
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can use &lt;code&gt;uname -r&lt;/code&gt; to determine the kernel version and select the appropriate header.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="dependencies-3" class="tab-pane" role="tabpanel" aria-labelledby="dependencies-3"&gt;
&lt;p&gt;&lt;p&gt;Since Alpine ships with &lt;code&gt;musl&lt;/code&gt; instead of &lt;code&gt;glibc&lt;/code&gt;, to build on Alpine, we need to pass the &lt;code&gt;-DMUSL_OPTIMIZED_BUILD=On&lt;/code&gt; CMake option.&lt;/p&gt;
&lt;p&gt;If that option is used along with the &lt;code&gt;-DUSE_BUNDLED_DEPS=On&lt;/code&gt; option, then the final build will be 100% statically-linked and portable across different Linux distributions.&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;apk add g++ gcc cmake make git bash perl linux-headers autoconf automake m4 libtool elfutils-dev libelf-static binutils bpftool clang
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div id="dependencies-4" class="tab-pane" role="tabpanel" aria-labelledby="dependencies-4"&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;zypper -n install git gcc12 gcc12-c++ cmake make libelf-devel gawk
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ol start="2"&gt;
&lt;li&gt;Build Falco&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="card card-sm td-max-width-on-larger-screens"&gt;
&lt;div class="card-body"&gt;
&lt;ul class="nav nav-tabs" id="build" role="tablist"&gt;&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link active" href="#build-0" role="tab" aria-controls="build-0" aria-selected="true"&gt;CentOS / RHEL&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#build-1" role="tab" aria-controls="build-1"&gt;Debian/ Ubuntu&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#build-2" role="tab" aria-controls="build-2"&gt;Arch Linux&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#build-3" role="tab" aria-controls="build-3"&gt;Alpine&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#build-4" role="tab" aria-controls="build-4"&gt;openSUSE&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;div class="tab-content" id="build"&gt;&lt;div id="build-0" class="tab-pane show active" role="tabpanel" aria-labelledby="build-0"&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;git clone https://github.com/falcosecurity/falco.git
&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; falco
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir -p build
&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; build
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cmake -DUSE_BUNDLED_DEPS&lt;span style="color:#666"&gt;=&lt;/span&gt;ON ..
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make falco
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;More details &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/developer-guide/source/#build-falco"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="build-1" class="tab-pane" role="tabpanel" aria-labelledby="build-1"&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;git clone https://github.com/falcosecurity/falco.git
&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; falco
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir -p build
&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; build
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cmake -DUSE_BUNDLED_DEPS&lt;span style="color:#666"&gt;=&lt;/span&gt;On ..
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make falco
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;More details &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/developer-guide/source/#build-falco"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="build-2" class="tab-pane" role="tabpanel" aria-labelledby="build-2"&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;git clone https://github.com/falcosecurity/falco.git
&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; falco
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir -p build
&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; build
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cmake ..
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make falco
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;More details &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/developer-guide/source/#build-falco"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="build-3" class="tab-pane" role="tabpanel" aria-labelledby="build-3"&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;git clone https://github.com/falcosecurity/falco.git
&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; falco
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir -p build
&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; build
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cmake -DUSE_BUNDLED_DEPS&lt;span style="color:#666"&gt;=&lt;/span&gt;On -DMUSL_OPTIMIZED_BUILD&lt;span style="color:#666"&gt;=&lt;/span&gt;On ..
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make falco
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div id="build-4" class="tab-pane" role="tabpanel" aria-labelledby="build-4"&gt;
&lt;p&gt;&lt;p&gt;First, make sure that &lt;code&gt;gcc&lt;/code&gt; and &lt;code&gt;g++&lt;/code&gt; are version 9 or above. If you have multiple versions installed you can &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/developer-guide/source/#specify-c-and-cxx-compilers"&gt;set the preferred one&lt;/a&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;git clone https://github.com/falcosecurity/falco.git
&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; falco
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir -p build
&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; build
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cmake -DUSE_BUNDLED_DEPS&lt;span style="color:#666"&gt;=&lt;/span&gt;ON ..
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make falco
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;More details &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/developer-guide/source/#build-falco"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ol start="3"&gt;
&lt;li&gt;Build kernel module driver&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="card card-sm td-max-width-on-larger-screens"&gt;
&lt;div class="card-body"&gt;
&lt;ul class="nav nav-tabs" id="kernelmodule" role="tablist"&gt;&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link active" href="#kernelmodule-0" role="tab" aria-controls="kernelmodule-0" aria-selected="true"&gt;CentOS / RHEL&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#kernelmodule-1" role="tab" aria-controls="kernelmodule-1"&gt;Debian/ Ubuntu&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#kernelmodule-2" role="tab" aria-controls="kernelmodule-2"&gt;Arch Linux&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#kernelmodule-3" role="tab" aria-controls="kernelmodule-3"&gt;Alpine&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#kernelmodule-4" role="tab" aria-controls="kernelmodule-4"&gt;openSUSE&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;div class="tab-content" id="kernelmodule"&gt;&lt;div id="kernelmodule-0" class="tab-pane show active" role="tabpanel" aria-labelledby="kernelmodule-0"&gt;
&lt;p&gt;&lt;p&gt;In the build directory:&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;yum -y install kernel-devel-&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;make driver
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;More details &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/developer-guide/source/#build-falco"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="kernelmodule-1" class="tab-pane" role="tabpanel" aria-labelledby="kernelmodule-1"&gt;
&lt;p&gt;&lt;p&gt;Kernel headers are required to build the driver.&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;apt install linux-headers-&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;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the build directory:&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;make driver
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div id="kernelmodule-2" class="tab-pane" role="tabpanel" aria-labelledby="kernelmodule-2"&gt;
&lt;p&gt;&lt;p&gt;In the build directory:&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;pacman -S --needed linux-headers
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make driver
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;More details &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/developer-guide/source/#build-falco"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="kernelmodule-3" class="tab-pane" role="tabpanel" aria-labelledby="kernelmodule-3"&gt;
&lt;p&gt;&lt;p&gt;NO STEP&lt;/p&gt;
&lt;/div&gt;
&lt;div id="kernelmodule-4" class="tab-pane" role="tabpanel" aria-labelledby="kernelmodule-4"&gt;
&lt;p&gt;&lt;p&gt;In the build directory:&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;zypper -n install kernel-default-devel
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make driver
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ol start="4"&gt;
&lt;li&gt;Build eBPF driver (deprecated)&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="card card-sm td-max-width-on-larger-screens"&gt;
&lt;div class="card-body"&gt;
&lt;ul class="nav nav-tabs" id="ebpfdriver" role="tablist"&gt;&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link active" href="#ebpfdriver-0" role="tab" aria-controls="ebpfdriver-0" aria-selected="true"&gt;CentOS / RHEL&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#ebpfdriver-1" role="tab" aria-controls="ebpfdriver-1"&gt;Debian/ Ubuntu&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#ebpfdriver-2" role="tab" aria-controls="ebpfdriver-2"&gt;Arch Linux&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#ebpfdriver-3" role="tab" aria-controls="ebpfdriver-3"&gt;Alpine&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav-item"&gt;&lt;a data-toggle="tab" class="nav-link" href="#ebpfdriver-4" role="tab" aria-controls="ebpfdriver-4"&gt;openSUSE&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;div class="tab-content" id="ebpfdriver"&gt;&lt;div id="ebpfdriver-0" class="tab-pane show active" role="tabpanel" aria-labelledby="ebpfdriver-0"&gt;
&lt;p&gt;&lt;p&gt;If you do not want to use the kernel module driver you can, alternatively, build the eBPF driver as follows.&lt;/p&gt;
&lt;p&gt;In the build directory:&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;dnf install clang llvm
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cmake -DBUILD_BPF&lt;span style="color:#666"&gt;=&lt;/span&gt;ON ..
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make bpf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div id="ebpfdriver-1" class="tab-pane" role="tabpanel" aria-labelledby="ebpfdriver-1"&gt;
&lt;p&gt;&lt;p&gt;If you do not want to use the kernel module driver you can, alternatively, build the eBPF driver as follows.&lt;/p&gt;
&lt;p&gt;In the build directory:&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;apt install llvm clang
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cmake -DBUILD_BPF&lt;span style="color:#666"&gt;=&lt;/span&gt;ON ..
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make bpf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div id="ebpfdriver-2" class="tab-pane" role="tabpanel" aria-labelledby="ebpfdriver-2"&gt;
&lt;p&gt;&lt;p&gt;If you do not want to use the kernel module driver you can, alternatively, build the eBPF driver as follows.&lt;/p&gt;
&lt;p&gt;In the build directory:&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;pacman -S llvm clang
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cmake -DBUILD_BPF&lt;span style="color:#666"&gt;=&lt;/span&gt;ON ..
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make bpf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div id="ebpfdriver-3" class="tab-pane" role="tabpanel" aria-labelledby="ebpfdriver-3"&gt;
&lt;p&gt;&lt;p&gt;NO STEP&lt;/p&gt;
&lt;/div&gt;
&lt;div id="ebpfdriver-4" class="tab-pane" role="tabpanel" aria-labelledby="ebpfdriver-4"&gt;
&lt;p&gt;&lt;p&gt;If you do not want to use the kernel module driver you can, alternatively, build the eBPF driver as follows.&lt;/p&gt;
&lt;p&gt;In the build directory:&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;zypper -n install clang llvm
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cmake -DBUILD_BPF&lt;span style="color:#666"&gt;=&lt;/span&gt;ON ..
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make bpf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id="dependencies"&gt;Dependencies&lt;/h2&gt;
&lt;p&gt;By default Falco build bundles &lt;strong&gt;most of&lt;/strong&gt; its runtime dependencies &lt;strong&gt;dynamically&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;You can notice this observing that the option &lt;code&gt;USE_BUNDLED_DEPS&lt;/code&gt; is &lt;code&gt;OFF&lt;/code&gt; by default. Which means that, whether applicable, Falco build will try to link against libraries already existing into your machine.&lt;/p&gt;
&lt;p&gt;Changing such option to &lt;code&gt;ON&lt;/code&gt; causes Falco build to bundle all the dependencies statically.&lt;/p&gt;
&lt;h2 id="build-falco"&gt;Build Falco&lt;/h2&gt;
&lt;p&gt;To build Falco, you will need to create a &lt;code&gt;build&lt;/code&gt; directory.
It's common to have the &lt;code&gt;build&lt;/code&gt; directory in the Falco working copy itself, however it can be
anywhere in your filesystem.&lt;/p&gt;
&lt;p&gt;There are &lt;strong&gt;three main steps to compile&lt;/strong&gt; Falco.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create the build directory and enter in it&lt;/li&gt;
&lt;li&gt;Use cmake in the build directory to create the build files for Falco. &lt;code&gt;..&lt;/code&gt; was used because the source directory
is a parent of the current directory, you can also use the absolute path for the Falco source code instead&lt;/li&gt;
&lt;li&gt;Build using make&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id="build-all"&gt;Build all&lt;/h4&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;mkdir build
&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; build
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cmake ..
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can also build only specific targets:&lt;/p&gt;
&lt;h4 id="build-falco-only"&gt;Build Falco only&lt;/h4&gt;
&lt;p&gt;Do the build folder and cmake setup, then:&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;make falco
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="build-the-falco-engine-only"&gt;Build the Falco engine only&lt;/h4&gt;
&lt;p&gt;Do the build folder and cmake setup, then:&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;make falco_engine
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="build-libscap-only"&gt;Build libscap only&lt;/h4&gt;
&lt;p&gt;Do the build folder and cmake setup, then:&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;make scap
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="build-libsinsp-only"&gt;Build libsinsp only&lt;/h4&gt;
&lt;p&gt;Do the build folder and cmake setup, then:&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;make sinsp
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="build-the-ebpf-probe-kernel-driver-only"&gt;Build the eBPF probe / kernel driver only&lt;/h4&gt;
&lt;p&gt;Do the build folder and cmake setup, then:&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;make driver
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="build-results"&gt;Build results&lt;/h4&gt;
&lt;p&gt;Once Falco is built, the three interesting things that you will find in your &lt;code&gt;build&lt;/code&gt; folder are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;userspace/falco/falco&lt;/code&gt;: the actual Falco binary&lt;/li&gt;
&lt;li&gt;&lt;code&gt;driver/src/falco.ko&lt;/code&gt;: the Falco kernel driver&lt;/li&gt;
&lt;li&gt;&lt;code&gt;driver/bpf/falco.o&lt;/code&gt;: if you built Falco with &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/developer-guide/source/#enable-ebpf-support"&gt;eBPF support&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you'd like to build a debug version, run cmake as &lt;code&gt;cmake -DCMAKE_BUILD_TYPE=Debug ..&lt;/code&gt; instead, see the &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/developer-guide/source/#cmake-options"&gt;CMake Options&lt;/a&gt; section for further customizations.&lt;/p&gt;
&lt;h3 id="cmake-options"&gt;CMake Options&lt;/h3&gt;
&lt;p&gt;When doing the &lt;code&gt;cmake&lt;/code&gt; command, we can pass additional parameters to change the behavior of the build files.&lt;/p&gt;
&lt;p&gt;Here'are some examples, always assuming your &lt;code&gt;build&lt;/code&gt; folder is inside the Falco working copy.&lt;/p&gt;
&lt;h4 id="generate-verbose-makefiles"&gt;Generate verbose makefiles&lt;/h4&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;-DCMAKE_VERBOSE_MAKEFILE&lt;span style="color:#666"&gt;=&lt;/span&gt;On
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="specify-c-and-cxx-compilers"&gt;Specify C and CXX compilers&lt;/h4&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;-DCMAKE_C_COMPILER=$(which gcc) -DCMAKE_CXX_COMPILER=$(which g++)
&lt;/code&gt;&lt;/pre&gt;&lt;h4 id="enforce-bundled-dependencies"&gt;Enforce bundled dependencies&lt;/h4&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;-DUSE_BUNDLED_DEPS=True
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Read more about Falco dependencies &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/developer-guide/source/#dependencies"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id="treat-warnings-as-errors"&gt;Treat warnings as errors&lt;/h4&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;-DBUILD_WARNINGS_AS_ERRORS=True
&lt;/code&gt;&lt;/pre&gt;&lt;h4 id="specify-the-build-type"&gt;Specify the build type&lt;/h4&gt;
&lt;p&gt;Debug build type&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;-DCMAKE_BUILD_TYPE=Debug
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Release build type&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;-DCMAKE_BUILD_TYPE=Release
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Notice this variable is case-insensitive and it defaults to release.&lt;/p&gt;
&lt;h4 id="specify-the-falco-version"&gt;Specify the Falco version&lt;/h4&gt;
&lt;p&gt;Optionally the user can specify the version he wants Falco to have. Eg.,&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt; -DFALCO_VERSION=0.43.0-dirty
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When not explicitly specifying it the build system will compute the &lt;code&gt;FALCO_VERSION&lt;/code&gt; value from the git history.&lt;/p&gt;
&lt;p&gt;In case the current git revision has a git tag, the Falco version will be equal to it (without the leading &amp;quot;v&amp;quot; character). Otherwise the Falco version will be in the form &lt;code&gt;0.&amp;lt;commit hash&amp;gt;[.dirty]&lt;/code&gt;.&lt;/p&gt;
&lt;h4 id="enable-ebpf-support"&gt;Enable eBPF support&lt;/h4&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;-DBUILD_BPF=True
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When enabling this you will be able to make the &lt;code&gt;bpf&lt;/code&gt; target after:&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;make bpf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="load-latest-falco-kernel-module"&gt;Load latest falco kernel module&lt;/h2&gt;
&lt;p&gt;If you have a binary version of Falco installed, an older Falco kernel module may already be loaded. To ensure you are using the latest version, you should unload any existing Falco kernel module and load the locally built version.&lt;/p&gt;
&lt;p&gt;Unload any existing kernel module via:&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;rmmod falco
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To load the locally built version, assuming you are in the &lt;code&gt;build&lt;/code&gt; dir, 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;insmod driver/falco.ko
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="run-falco"&gt;Run falco&lt;/h2&gt;
&lt;p&gt;Once Falco is built and the kernel module is loaded, assuming you are in the &lt;code&gt;build&lt;/code&gt; dir, you can run falco as:&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 ./userspace/falco/falco -c ../falco.yaml -r ../rules/falco_rules.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;By default, falco logs events to standard error.&lt;/p&gt;</description></item><item><title>Docs: Plugins Developer Guide</title><link>https://v0-43--falcosecurity.netlify.app/docs/developer-guide/plugins/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/docs/developer-guide/plugins/</guid><description>
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;This page is a guide for developers who want to write their own Falco/Falco libs plugins, providing some general best practices for authoring plugins.&lt;/p&gt;
&lt;p&gt;If you're not interested in writing your own plugin, or modifying one of the existing plugins, you can skip this page.&lt;/p&gt;
&lt;p&gt;Although plugins can be written in many languages, the Plugins API uses C functions, so you should be comfortable with C language concepts to understand the API.&lt;/p&gt;
&lt;p&gt;Before reading this page, read the main &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/plugins/"&gt;plugins&lt;/a&gt; page for an overview of what plugins are and how they are used by Falco/Falco libs.&lt;/p&gt;
&lt;h2 id="high-level-overview"&gt;High Level Overview&lt;/h2&gt;
&lt;p&gt;Here is a high level overview of how the plugin framework uses API functions to interact with plugins:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Initialization&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Checking API Compatibility&lt;/strong&gt; — The framework calls &lt;code&gt;plugin_get_required_api_version&lt;/code&gt; to verify that the plugin is compatible with the framework&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Collecting Plugin Info&lt;/strong&gt; — The framework calls &lt;code&gt;plugin_get_xxx&lt;/code&gt; functions to obtain information about the plugin&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Checking Capabilities&lt;/strong&gt; — The framework checks which capabilities a plugin implements by verifying that the required functions are exported
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Getting Supported Event source&lt;/strong&gt; — If the plugin has the event sourcing capability, the framework calls &lt;code&gt;plugin_get_id&lt;/code&gt; and &lt;code&gt;plugin_get_event_source&lt;/code&gt; to obtain the plugin ID and its event source&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Getting Supported Extractable Fields&lt;/strong&gt; — If the plugin has the field extraction capability, the framework calls &lt;code&gt;plugin_get_fields&lt;/code&gt; to obtain the list of fields supported by the plugin&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Initializing the Plugin&lt;/strong&gt; — The framework calls &lt;code&gt;plugin_init&lt;/code&gt; to initialize a plugin, which returns an opaque &lt;code&gt;ss_plugin_t&lt;/code&gt; handle. This handle is passed as an argument to later functions&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Opening Streams of Events (&lt;em&gt;event sourcing capability only&lt;/em&gt;)&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Opening a Stream&lt;/strong&gt; — The framework calls &lt;code&gt;plugin_open&lt;/code&gt; the open a stream of events, which returns an opaque &lt;code&gt;ss_instance_t&lt;/code&gt; handle. This handle is passed as an argument to later functions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Collecting Events&lt;/strong&gt; — The framework calls &lt;code&gt;plugin_next_batch&lt;/code&gt; to obtain events from the plugin&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Closeing the Stream&lt;/strong&gt; — The framework calls &lt;code&gt;plugin_close&lt;/code&gt; to close a stream of events. The &lt;code&gt;ss_instance_t&lt;/code&gt; handle is considered invalid and will not be used again&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Extracting Fields from Events (&lt;em&gt;field extraction capability only&lt;/em&gt;)&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Extracting Values&lt;/strong&gt; — The framework calls &lt;code&gt;plugin_extract_fields&lt;/code&gt; to obtain values for fields for a given event&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deinitialization&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Destroying the Plugin&lt;/strong&gt; — The framework calls &lt;code&gt;plugin_destroy&lt;/code&gt; to destroy a plugin. The &lt;code&gt;ss_plugin_t&lt;/code&gt; handle is considered invalid and will not be used again.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="general-plugin-development-considerations"&gt;General Plugin Development Considerations&lt;/h2&gt;
&lt;h3 id="plugin-sdks"&gt;Plugin SDKs&lt;/h3&gt;
&lt;p&gt;In order to abstract the complexity related with the low-level details of plugin development, the Falcosecurity organization provides a maintains SDKs to make the life of developers easier. Using an SDK is not mandatory but highly encouraged, and should be the way to go for almost all use cases.&lt;/p&gt;
&lt;p&gt;So far, only the &lt;a href="https://github.com/falcosecurity/plugin-sdk-go"&gt;SDK for the Go language&lt;/a&gt; is production-ready. Please check the &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/reference/plugins/go-sdk-walkthrough/"&gt;Go SDK walkthrough section&lt;/a&gt; for in-depth details.&lt;/p&gt;
&lt;h3 id="api-versioning"&gt;API Versioning&lt;/h3&gt;
&lt;p&gt;The plugins API is versioned with a &lt;a href="https://semver.org/"&gt;semver&lt;/a&gt;-style version string. The plugins framework checks the plugin's required api version by calling the &lt;code&gt;plugin_get_required_api_version&lt;/code&gt; API function. In order for the framework to load the plugin, the major number of the plugin framework must match the major number in the version returned by &lt;code&gt;plugin_get_required_api_version&lt;/code&gt;. Otherwise, the plugin is incompatible and will not be loaded.&lt;/p&gt;
&lt;h3 id="required-vs-optional-functions"&gt;Required vs Optional Functions&lt;/h3&gt;
&lt;p&gt;Some API functions are required, while others are optional. If a function is optional, the plugin can choose to not define the function at all. The framework will note that the function is not defined and will use default behavior. For optional functions, the default behavior is described below.&lt;/p&gt;
&lt;h3 id="memory-returned-across-the-api-is-owned-by-the-plugin"&gt;Memory Returned Across the API is Owned By the Plugin&lt;/h3&gt;
&lt;p&gt;Every API function that returns or populates a string or struct pointer must point to memory allocated by the plugin and must remain valid for use by the plugin framework. When using the SDKs, this is generally handled automatically. Keep it in mind if using the plugin API functions directly, however.&lt;/p&gt;
&lt;h3 id="what-configuration-internal-state-goes-where"&gt;What Configuration/Internal State Goes Where?&lt;/h3&gt;
&lt;p&gt;When the framework calls &lt;code&gt;plugin_open&lt;/code&gt;, it provides a configuration string which is used to configure the plugin. When the framework calls &lt;code&gt;plugin_open&lt;/code&gt;, it provides a parameters string which is used to source a stream of events. The format of both text blocks is defined by the plugin and is passed directly through by the plugin framework.&lt;/p&gt;
&lt;p&gt;Within a plugin, it must maintain state in two objects: a &lt;code&gt;ss_plugin_t&lt;/code&gt; for plugin state, and a &lt;code&gt;ss_instance_t&lt;/code&gt; for plugin instance state.&lt;/p&gt;
&lt;p&gt;For new plugin authors, it may be confusing to determine which state goes in each object and what information should be provided in the configuration string vs the parameters string. Ultimately, that's up to the plugin author, but here are some guidelines to follow:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;ss_plugin_t&lt;/code&gt; struct should contain &lt;em&gt;configuration&lt;/em&gt; that instructs the plugin how to behave. Generally, this is sourced from the configuration string.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;ss_instance_t&lt;/code&gt; struct should contain &lt;em&gt;parameters&lt;/em&gt; that instruct the plugin on how to source a stream of events. Generally, this is sourced from the parameters string.&lt;/li&gt;
&lt;li&gt;Instance state (e.g. the &lt;code&gt;ss_instance_t&lt;/code&gt; struct) should include things like file handles, connection objects, current buffer positions, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For example, if a plugin fetches URLs, whether or not to allow self-signed certificates would belong in configuration, and the actual URLs to fetch would belong in parameters.&lt;/p&gt;
&lt;h3 id="what-goes-in-an-event"&gt;What Goes In An Event?&lt;/h3&gt;
&lt;p&gt;Similarly, it may be confusing to distinguish between state for a plugin (e.g. &lt;code&gt;ss_plugin_t&lt;/code&gt;/&lt;code&gt;ss_instance_t&lt;/code&gt;) as compared to the actual data that ends up in an event. This is especially important when thinking about fields and what they represent. A good rule of thumb to follow is that fields should &lt;em&gt;only&lt;/em&gt; extract data from events, and not internal state. For example, this behavior is encouraged by &lt;em&gt;not&lt;/em&gt; providing a &lt;code&gt;ss_instance_t&lt;/code&gt; handle as an argument to &lt;code&gt;plugin_extract_fields&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For example, assume some plugin returned a sample of a metric in events, and the internal state also held the maximum value seen so far. It would be a good practice to have a field &lt;code&gt;plugin.sample&lt;/code&gt; that returned the value in a given event. It would &lt;em&gt;not&lt;/em&gt; be a good practice to have a field &lt;code&gt;plugin.max_sample&lt;/code&gt; that returned the maximum value seen, because that information is held in the internal state and not in events. If events &lt;em&gt;also&lt;/em&gt; saved the current max sample so far, then it would be fine to have a field &lt;code&gt;plugin.max_sample&lt;/code&gt;, as that can be retrieved directly from a single event.&lt;/p&gt;
&lt;p&gt;A question to ask when deciding what to put in an event is &amp;quot;if this were written to a &lt;code&gt;.scap&lt;/code&gt; capture file and replayed, would this plugin return the same values for fields as it did when the events were first generated?&amp;quot;.&lt;/p&gt;
&lt;p&gt;Alternatively, the plugin can leverage access to &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/reference/plugins/plugin-api-reference/#state-tables-api"&gt;state tables&lt;/a&gt; for extracting pieces of information not contained in an event. In such a case, the best practice is for the plugin to implement the &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/reference/plugins/plugin-api-reference/#event-parsing-capability-api"&gt;event parsing capability&lt;/a&gt; and update its internal state when parsing the events of a given data stream. The functional internal state must not be updated when extracting fields unless for cache updates oriented to performance optimizations. Then, at the extraction, the plugin can read information from the event's payload and the state it has access to, either owned by itself or from another component registered in the framework.&lt;/p&gt;
&lt;p&gt;However, the fundamental question when handling the plugin's state updates is always whether that state must be reproducible or not in case the event stream is replayed through a capture file. Given that in most cases that is a requirement, the plugin must consider also implementing the &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/reference/plugins/plugin-api-reference/#async-events-capability-api"&gt;async events capability&lt;/a&gt; for being able to inject an async synthetic event in a live data stream, to record that and make it available for file capture. The plugin needs to be capable of parsing those async events in its event parsing functions to potentially replay them and reproduce the corresponding state changes.&lt;/p&gt;
&lt;h3 id="plugin-authoring-lifecycle"&gt;Plugin Authoring Lifecycle&lt;/h3&gt;
&lt;p&gt;Here are some considerations to keep in mind when releasing the initial version of a new plugin and when releasing updated versions of the plugin.&lt;/p&gt;
&lt;h4 id="initial-version"&gt;Initial Version&lt;/h4&gt;
&lt;p&gt;For plugins with event sourcing capability, make sure the event source is distinct, or if the same as existing plugins, that the saved payload is identical. In most cases, each plugin should define a new event source.&lt;/p&gt;
&lt;p&gt;For plugins with field extraction capability, if the plugin exports a set of compatible sources, make sure you have tested it with each compatible plugin with event sourcing capability to ensure that your plugin can read event payloads without errors/crashing. If the plugin does &lt;em&gt;not&lt;/em&gt; export a set of compatible sources (meaning that it potentially handles every kind of event), your plugin must be very resilient. It will potentially be handed arbitrary binary data from other plugins.&lt;/p&gt;
&lt;p&gt;Register this plugin by submitting a PR to &lt;a href="https://github.com/falcosecurity/plugins"&gt;falcosecurity/plugins&lt;/a&gt; to update the &lt;a href="https://github.com/falcosecurity/plugins/blob/master/registry.yaml"&gt;plugin registry&lt;/a&gt;. This will give an official Plugin ID that can be safely used in capture files, etc., without overlapping with other plugins. It also lets others know that a new plugin is available!&lt;/p&gt;
&lt;h4 id="updates"&gt;Updates&lt;/h4&gt;
&lt;p&gt;Every new release of a plugin should update the plugin's version number. Following semver conventions, the patch number should always be updated, the minor number should be updated when new fields are added, and the major number should be updated whenever any field is modified/removed or the semantics of a given field changes.&lt;/p&gt;
&lt;p&gt;With every release, you should check for an updated Plugin API Version and if needed, update the plugin to conform to the new API. Remember that a plugin and framework are considered be compatible if their major versions are the same.&lt;/p&gt;
&lt;p&gt;With each new release, make sure the contact information provided by the plugin is up-to-date.&lt;/p&gt;</description></item><item><title>Docs: gRPC API</title><link>https://v0-43--falcosecurity.netlify.app/docs/developer-guide/grpc/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/docs/developer-guide/grpc/</guid><description>
&lt;div class="card card-sm pageinfo pageinfo-warning my-4"&gt;
&lt;div class="card-body"&gt;
&lt;div class="card-text"&gt;
&lt;p&gt;The gRPC Output as well as the embedded gRPC server have been deprecated in Falco &lt;code&gt;0.43.0&lt;/code&gt; and will be removed in a
future release. Until removal and since Falco &lt;code&gt;0.43.0&lt;/code&gt;, using any of them will result in a warning informing the user
about the deprecation. Users are encouraged to leverage another output and/or Falcosidekick, as the usage will result
in an error after the removal.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Starting from version &lt;a href="https://github.com/falcosecurity/falco/releases/tag/0.18.0"&gt;0.18.0&lt;/a&gt;, Falco has its own &lt;a class='glossary-tooltip' title='gRPC is a modern open source, high-performance Remote Procedure Call (RPC) framework.' data-toggle='tooltip' data-placement='top' href='https://v0-43--falcosecurity.netlify.app/docs/grpc/' target='_blank' aria-label='gRPC'&gt;gRPC&lt;/a&gt; server which provides a set of gRPC APIs.&lt;/p&gt;
&lt;p&gt;The current APIs are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://v0-43--falcosecurity.netlify.app/docs/developer-guide/grpc/outputs/"&gt;schema definition&lt;/a&gt;: get or subscribe to Falco output events.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://v0-43--falcosecurity.netlify.app/docs/developer-guide/grpc/version/"&gt;schema definition&lt;/a&gt;: retrieve the Falco version.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In order to interact with these APIs, the The Falco Project provides a &lt;a href="https://v0-43--falcosecurity.netlify.app/docs/developer-guide/grpc/client-go/"&gt;Golang SDK&lt;/a&gt;.&lt;/p&gt;</description></item></channel></rss>