<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Falco – Event Sources</title><link>https://v0-44--falcosecurity.netlify.app/docs/concepts/event-sources/</link><description>Recent content in Event Sources on Falco</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://v0-44--falcosecurity.netlify.app/docs/concepts/event-sources/feed.xml" rel="self" type="application/rss+xml"/><item><title>Docs: Kernel Events</title><link>https://v0-44--falcosecurity.netlify.app/docs/concepts/event-sources/kernel/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-44--falcosecurity.netlify.app/docs/concepts/event-sources/kernel/</guid><description>
&lt;p&gt;Falco uses different instrumentations to analyze the system workload and pass security events to &lt;a class='glossary-tooltip' title='The memory space where all user actions and applications are executed.' data-toggle='tooltip' data-placement='top' href='https://v0-44--falcosecurity.netlify.app/docs/reference/glossary/?all=true#term-user-space' target='_blank' aria-label='userspace'&gt;userspace&lt;/a&gt;. We usually refer to these instrumentations as &lt;a class='glossary-tooltip' title='The global term for the software that sends events from the kernel.' data-toggle='tooltip' data-placement='top' href='https://v0-44--falcosecurity.netlify.app/docs/concepts/event-sources/kernel/' target='_blank' aria-label='drivers'&gt;drivers&lt;/a&gt; since a driver runs in &lt;a class='glossary-tooltip' title='The memory space where the Kernel executes and provides its services.' data-toggle='tooltip' data-placement='top' href='https://v0-44--falcosecurity.netlify.app/docs/reference/glossary/?all=true#term-kernel-space' target='_blank' aria-label='kernelspace'&gt;kernelspace&lt;/a&gt;. The driver provides the &lt;strong&gt;syscall event source&lt;/strong&gt; since the monitored events are strictly related to the &lt;a class='glossary-tooltip' title='Syscalls stands for system calls, a way to request a service from the running kernel.' data-toggle='tooltip' data-placement='top' href='https://man7.org/linux/man-pages/man2/syscalls.2.html' target='_blank' aria-label='syscall'&gt;syscall&lt;/a&gt; context.&lt;/p&gt;
&lt;p&gt;There are several supported drivers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Modern eBPF probe &lt;em&gt;(default)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Kernel module&lt;/li&gt;
&lt;/ul&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Kernel module&lt;/th&gt;
&lt;th&gt;Modern eBPF probe&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;x86_64&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&amp;gt;= 3.10&lt;/td&gt;
&lt;td&gt;&lt;a href="https://v0-44--falcosecurity.netlify.app/docs/concepts/event-sources/kernel/#requirements"&gt;Minimal set of features&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;aarch64&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&amp;gt;= 3.10&lt;/td&gt;
&lt;td&gt;&lt;a href="https://v0-44--falcosecurity.netlify.app/docs/concepts/event-sources/kernel/#requirements"&gt;Minimal set of features&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="kernel-module"&gt;Kernel module&lt;/h2&gt;
&lt;p&gt;By default, the &lt;a class='glossary-tooltip' title='Used to describe the .ko object that would be loaded into the kernel as a potentially risky kernel module.' data-toggle='tooltip' data-placement='top' href='https://linux-kernel-labs.github.io/refs/heads/master/labs/kernel_modules.html' target='_blank' aria-label='kernel module'&gt;kernel module&lt;/a&gt; will be installed when installing the Falco &lt;a href="https://v0-44--falcosecurity.netlify.app/docs/getting-started/installation"&gt;debian/rpm&lt;/a&gt; package, when running the &lt;code&gt;falcoctl driver&lt;/code&gt; tool shipped within the &lt;a href="https://v0-44--falcosecurity.netlify.app/docs/getting-started/installation#linux-binary"&gt;binary package&lt;/a&gt;, or when running the &lt;code&gt;falcosecurity/falco-driver-loader&lt;/code&gt; docker image (that just wraps the aforementioned tool).&lt;/p&gt;
&lt;p&gt;To install the kernel module, please refer to the &lt;a href="https://v0-44--falcosecurity.netlify.app/docs/getting-started/installation/#install-driver"&gt;installation&lt;/a&gt; page.&lt;/p&gt;
&lt;h3 id="least-privileged-mode"&gt;Least privileged mode&lt;/h3&gt;
&lt;p&gt;The kernel module requires full privileges and cannot run with Linux capabilities&lt;/p&gt;
&lt;h2 id="modern-ebpf-probe"&gt;Modern eBPF probe&lt;/h2&gt;
&lt;p&gt;The &lt;a class='glossary-tooltip' title='More robust eBPF probe which brings the CO-RE paradigm, better performances and maintainability.' data-toggle='tooltip' data-placement='top' href='https://v0-44--falcosecurity.netlify.app/docs/concepts/event-sources/kernel/#modern-ebpf-probe' target='_blank' aria-label='modern eBPF probe'&gt;modern eBPF probe&lt;/a&gt; is an alternative driver for Falco. The main advantage it brings to the table is that it is embedded into Falco, which means that you don't have to download or build anything, if your kernel is recent enough Falco will automatically inject it!&lt;/p&gt;
&lt;h3 id="what-s-new"&gt;What's new&lt;/h3&gt;
&lt;p&gt;The new probe is highly customizable, you are not obliged to use one buffer &lt;a href="https://github.com/falcosecurity/falco/blob/660da98e4c37f4d4f79ec4bebf4379d9b90b0892/falco.yaml#L292"&gt;for each CPU&lt;/a&gt; you can also use just one huge buffer for all your CPUs! And obviously, also the &lt;a href="https://github.com/falcosecurity/falco/blob/660da98e4c37f4d4f79ec4bebf4379d9b90b0892/falco.yaml#L226"&gt;buffer size&lt;/a&gt; is customizable! All this is possible thanks to new outstanding features like &lt;a href="https://nakryiko.com/posts/bpf-portability-and-co-re/"&gt;the CO-RE paradigm&lt;/a&gt;, &lt;a href="https://nakryiko.com/posts/bpf-ringbuf/"&gt;the BPF ring buffer&lt;/a&gt; and many others, if you are curious you can read more about them in this &lt;a href="https://v0-44--falcosecurity.netlify.app/blog/falco-modern-bpf/#what-s-new"&gt;blog post&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="requirements"&gt;Requirements&lt;/h3&gt;
&lt;p&gt;The modern eBPF probe doesn't require a specific kernel version. Usually, all versions &lt;code&gt;&amp;gt;=5.8&lt;/code&gt; are enough but there are cases in which the required features could also be backported into older kernels, so it wouldn't be completely fair to define &lt;code&gt;5.8&lt;/code&gt; as the first supported version. The 2 main required features are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.kernel.org/doc/html/next/bpf/ringbuf.html"&gt;BPF ring buffer&lt;/a&gt; support.&lt;/li&gt;
&lt;li&gt;A kernel that exposes &lt;a href="https://docs.kernel.org/bpf/btf.html"&gt;BTF&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Falco can automatically detect if these features are available on the running machine and can notify you if something is missing. As an alternative, you could always use &lt;code&gt;bpftool&lt;/code&gt;, you just need to type 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;sudo bpftool feature probe kernel | grep -q &lt;span style="color:#b44"&gt;&amp;#34;map_type ringbuf is available&amp;#34;&lt;/span&gt; &lt;span style="color:#666"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style="color:#a2f"&gt;echo&lt;/span&gt; &lt;span style="color:#b44"&gt;&amp;#34;true&amp;#34;&lt;/span&gt; &lt;span style="color:#666"&gt;||&lt;/span&gt; &lt;span style="color:#a2f"&gt;echo&lt;/span&gt; &lt;span style="color:#b44"&gt;&amp;#34;false&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo bpftool feature probe kernel | grep -q &lt;span style="color:#b44"&gt;&amp;#34;program_type tracing is available&amp;#34;&lt;/span&gt; &lt;span style="color:#666"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style="color:#a2f"&gt;echo&lt;/span&gt; &lt;span style="color:#b44"&gt;&amp;#34;true&amp;#34;&lt;/span&gt; &lt;span style="color:#666"&gt;||&lt;/span&gt; &lt;span style="color:#a2f"&gt;echo&lt;/span&gt; &lt;span style="color:#b44"&gt;&amp;#34;false&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="how-to-run-it"&gt;How to run it&lt;/h3&gt;
&lt;p&gt;Modern eBPF probe is bundled into the userspace binary and works out of the box, regardless of the kernel release, thanks to the eBPF feature called 'Compile Once Run Everywhere' (CO-RE). To enable it in Falco, just set the &lt;code&gt;engine.kind&lt;/code&gt; configuration key to &lt;code&gt;modern_ebpf&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;It is supported in all the installation methods of other drivers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://v0-44--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-44--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-44--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/tree/master/charts/falco#daemonset"&gt;Helm chart&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="useful-resources"&gt;Useful resources&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://v0-44--falcosecurity.netlify.app/blog/falco-modern-bpf/"&gt;Modern BPF blog post&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/falcosecurity/libs/blob/master/proposals/20220329-modern-bpf-probe.md"&gt;Modern BPF proposal&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youtu.be/BxoKztfHnYY"&gt;eBPF day presentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="least-privileged-mode-1"&gt;Least privileged mode&lt;/h3&gt;
&lt;p&gt;The minimal set of capabilities required by Falco to run the modern eBPF probe is the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;CAP_SYS_BPF&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CAP_SYS_PERFMON&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CAP_SYS_RESOURCE&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CAP_SYS_PTRACE&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let's see them in detail:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CAP_SYS_RESOURCE&lt;/strong&gt;: Falco needs this capability to be able to call the &lt;code&gt;setrlimit&lt;/code&gt; syscall. The &lt;code&gt;setrlimit&lt;/code&gt; syscall is used together with the &lt;code&gt;RLIMIT_MEMLOCK&lt;/code&gt; flag to change the amount of memory that can be &lt;em&gt;mlocked&lt;/em&gt; into RAM. The default value for this memory limit is very low, so even a very simple eBPF program would fail. The workaround is to increase the default value to something acceptable so eBPF maps can be correctly &lt;em&gt;mlocked&lt;/em&gt; in memory.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CAP_SYS_PTRACE&lt;/strong&gt;: Falco needs this capability because it accesses paths like &lt;code&gt;/proc/&amp;lt;pid&amp;gt;/environ&lt;/code&gt;. From the userspace standpoint, the permission to do so is mapped to the &lt;code&gt;CAP_SYS_PTRACE&lt;/code&gt; capability. For the curious reader, see &lt;a href="https://elixir.bootlin.com/linux/latest/source/fs/proc/base.c#L937"&gt;environ_open&lt;/a&gt; implementation in the kernel.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CAP_SYS_ADMIN&lt;/strong&gt;: Falco needs this capability to load eBPF programs and maps, and to interact with the system using the &lt;code&gt;bpf&lt;/code&gt; syscall.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This set of capabilities should work most of the time but under some conditions, it is possible to replace the &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt; with two more granular capabilities: &lt;code&gt;CAP_SYS_BPF&lt;/code&gt; and &lt;code&gt;CAP_SYS_PERFMON&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The only condition needed is a kernel version that supports these capabilities. The Linux Kernel version &lt;code&gt;5.8&lt;/code&gt; is the first one that officially supports them but they could have been backported on older versions on some distributions.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Please note&lt;/strong&gt;: we will try to do our best to keep this as the minimum required set but due to &lt;a href="https://lore.kernel.org/bpf/CAGQdkDvYU_e=_NX&amp;#43;6DRkL_-TeH3p&amp;#43;QtsdZwHkmH0w3Fuzw0C4w@mail.gmail.com/T/#u"&gt;some issues with CO-RE relocations&lt;/a&gt; it is possible that this changes in the future.&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>Docs: Plugin Events</title><link>https://v0-44--falcosecurity.netlify.app/docs/concepts/event-sources/plugins/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-44--falcosecurity.netlify.app/docs/concepts/event-sources/plugins/</guid><description>
&lt;p&gt;Since the introduction of the &lt;a href="https://v0-44--falcosecurity.netlify.app/docs/plugins"&gt;Plugin System&lt;/a&gt;, additional event sources can serve as input for Falco. Those event sources are provided by plugins implementing the &lt;a href="https://v0-44--falcosecurity.netlify.app/docs/reference/plugins/plugin-api-reference/#event-sourcing-capability-api"&gt;event sourcing capability&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Examples of event source defined by officially-supported plugins are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://v0-44--falcosecurity.netlify.app/docs/concepts/event-sources/plugins/kubernetes-audit/"&gt;Kubernetes Audit Events&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://v0-44--falcosecurity.netlify.app/docs/concepts/event-sources/plugins/cloudtrail/"&gt;AWS CloudTrail&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://v0-44--falcosecurity.netlify.app/docs/concepts/event-sources/plugins/okta/"&gt;Okta&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In addition to these plugins hosted by the Falcosecurity organization, others have written third-party &lt;a href="https://github.com/falcosecurity/plugins#readme"&gt;plugins&lt;/a&gt; that support additional event sources. Please refer to the &lt;a href="https://github.com/falcosecurity/plugins/blob/master/registry.yaml"&gt;official Plugin Registry&lt;/a&gt; for the most up-to-date information regarding the Falco plugins acknowledged by the community.&lt;/p&gt;
&lt;p&gt;At the implementation level, the plugin system sends events to Falco using the same protocol that is used for syscalls, but the encoding and decoding of the payload is performed by the plugin itself according to its own data format representation. Every plugin exposes the necessary functionality to seamlessly integrate its events with Falco.&lt;/p&gt;</description></item></channel></rss>