<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Falco – Mentorship</title><link>https://v0-43--falcosecurity.netlify.app/tags/mentorship/</link><description>Recent content in Mentorship on Falco</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Wed, 24 Jul 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://v0-43--falcosecurity.netlify.app/tags/mentorship/feed.xml" rel="self" type="application/rss+xml"/><item><title>Blog: Halfway Through GSoC 2024: My Progress and Plans with Falco</title><link>https://v0-43--falcosecurity.netlify.app/blog/gsoc-2024-midterm/</link><pubDate>Wed, 24 Jul 2024 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/blog/gsoc-2024-midterm/</guid><description>
&lt;p&gt;Hello Falco community, I'm &lt;a href="https://github.com/GLVSKiriti"&gt;Kiriti&lt;/a&gt;, a current GSoC mentee under Falco Security. I have been working diligently to improve the testing and benchmarking capabilities of Falco’s event-generator project. Now that we've reached the midterm of GSoC, I'm eager to share the journey so far. In this blog, I'll delve into the details of my contributions, particularly focusing on two key PRs that have been merged, and outline my plans for the remainder of the program.&lt;/p&gt;
&lt;h3 id="my-project-enhancing-falco-s-event-generator"&gt;My Project: Enhancing Falco's Event-Generator&lt;/h3&gt;
&lt;p&gt;The event-generator is a vital utility within the Falco ecosystem, designed to test Falco's detection capabilities. My Google Summer of Code project focuses on upgrading the event-generator to enhance its testing and benchmarking capabilities, reliability, and consistency. Additionally, I am developing new Continuous Integration (CI) pipelines based on the upgraded event-generator. The ultimate goal is to evolve the event-generator into the standard tool for systematically assessing the correctness and performance of Falco’s threat detection capabilities during every release and development cycle.&lt;/p&gt;
&lt;h3 id="my-journey-so-far"&gt;My Journey So Far:&lt;/h3&gt;
&lt;p&gt;Before being selected for GSoC, I contributed to the event-generator repository. I am grateful to &lt;a href="https://github.com/leogr"&gt;Leonardo Grasso&lt;/a&gt; and &lt;a href="https://github.com/FedeDP"&gt;Federico Di Pierro&lt;/a&gt;, who played a vital role in getting my PRs merged during the pre-GSoC contribution phase. These contributions helped me understand the event-generator codebase. I am also thankful to my mentors, &lt;a href="https://github.com/jasondellaluce"&gt;Jason Dellaluce&lt;/a&gt; and &lt;a href="https://github.com/alacuku"&gt;Aldo Lacuku&lt;/a&gt;, for selecting me as a GSoC mentee. I will share my complete story of getting selected to GSoC in future.&lt;/p&gt;
&lt;p&gt;After my selection, Jason, Aldo, and I collectively designed a plan to enhance the event-generator. The community bonding period was crucial in designing and understanding the implementation plan. You can view our idea &lt;a href="https://hackmd.io/@aldolck/r1o9yU170"&gt;here&lt;/a&gt;, which we will implement during this GSoC period.&lt;/p&gt;
&lt;p&gt;Once the coding period began, we managed to merge two key PRs before the midterm. These PRs partially added support for testing Falco rules using declarative YAML files in the event-generator. We also added support for a container runner, which spawns a new container and runs the specified steps inside it. This is particularly useful for testing Falco rules that trigger when certain events are executed inside a container.&lt;/p&gt;
&lt;h3 id="detailed-look-at-the-merged-prs"&gt;Detailed Look at the Merged PRs:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;h4 id="pr1-add-support-for-declarative-yaml-file-testing"&gt;PR1: &lt;a href="https://github.com/falcosecurity/event-generator/pull/211"&gt;Add support for declarative yaml file testing&lt;/a&gt;&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;what's new added in this PR?:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Added a new sub command for run command called declarative:&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;event-generator run declarative [yaml-file-path]&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;
&lt;p&gt;Implemented a helper function that parses the YAML file and returns the content in a specified format. The function signature is as follows:&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-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;func&lt;/span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#00a000"&gt;parseYamlFile&lt;/span&gt;(filepath&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;string&lt;/span&gt;)&lt;span style="color:#bbb"&gt; &lt;/span&gt;(declarative.Tests,&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;error&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;Each yaml file structure should be in the following format&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-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;type&lt;/span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;SyscallStep&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;struct&lt;/span&gt;&lt;span style="color:#bbb"&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:#bbb"&gt; &lt;/span&gt;Syscall&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;string&lt;/span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;`yaml:&amp;#34;syscall&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;Args&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;map&lt;/span&gt;[&lt;span style="color:#0b0;font-weight:bold"&gt;string&lt;/span&gt;]&lt;span style="color:#0b0;font-weight:bold"&gt;string&lt;/span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;`yaml:&amp;#34;args&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:#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:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;type&lt;/span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;Test&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;struct&lt;/span&gt;&lt;span style="color:#bbb"&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:#bbb"&gt; &lt;/span&gt;Rule&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;string&lt;/span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;`yaml:&amp;#34;rule&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;Runner&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;string&lt;/span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;`yaml:&amp;#34;runner&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;Before&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;string&lt;/span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;`yaml:&amp;#34;before&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;Steps&lt;span style="color:#bbb"&gt; &lt;/span&gt;[]SyscallStep&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;`yaml:&amp;#34;steps&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;After&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;string&lt;/span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;`yaml:&amp;#34;after&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:#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:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;type&lt;/span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;Tests&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;struct&lt;/span&gt;&lt;span style="color:#bbb"&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:#bbb"&gt; &lt;/span&gt;Tests&lt;span style="color:#bbb"&gt; &lt;/span&gt;[]Test&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;`yaml:&amp;#34;tests&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:#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;
&lt;p&gt;Implemented a host runner
A host runner is represented with the following interface&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-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;type&lt;/span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;Runner&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;interface&lt;/span&gt;&lt;span style="color:#bbb"&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:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#00a000"&gt;Setup&lt;/span&gt;(beforeScript&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;string&lt;/span&gt;)&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;error&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:#00a000"&gt;ExecuteStep&lt;/span&gt;(step&lt;span style="color:#bbb"&gt; &lt;/span&gt;SyscallStep)&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;error&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:#00a000"&gt;Cleanup&lt;/span&gt;(afterScript&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;string&lt;/span&gt;)&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;error&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:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The Setup method runs a shell script (&lt;code&gt;beforeScript&lt;/code&gt;) before executing the specified steps using the &lt;code&gt;ExecuteStep&lt;/code&gt; method. The &lt;code&gt;Cleanup&lt;/code&gt; method runs a shell script (&lt;code&gt;afterScript&lt;/code&gt;) after executing the steps.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;ExecuteStep&lt;/code&gt; method makes some syscalls specified in the YAML file using helper functions. For example, when a write syscall is used in the YAML file steps, it runs the following write syscall helper function:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Added helper for making a write syscall:
The function signature is as follows&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-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;func&lt;/span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#00a000"&gt;WriteSyscall&lt;/span&gt;(filePath&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;string&lt;/span&gt;,&lt;span style="color:#bbb"&gt; &lt;/span&gt;content&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;string&lt;/span&gt;)&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;error&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;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h4 id="pr2-add-container-runner-support"&gt;PR2: &lt;a href="https://github.com/falcosecurity/event-generator/pull/216"&gt;Add container runner support&lt;/a&gt;&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;To implement a container runner, we needed the ability to spawn a container and execute the events inside it. We achieved this using the Docker GO SDK.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The container runner interface is similar to the host runner, with two new parameters: &lt;code&gt;ContainerId&lt;/code&gt; and &lt;code&gt;Image&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &lt;code&gt;Setup&lt;/code&gt; method spawns a container with the given image name, saves the &lt;code&gt;ContainerId&lt;/code&gt;, and also executes the &lt;code&gt;beforeScript&lt;/code&gt;. The &lt;code&gt;Cleanup&lt;/code&gt; method removes the container after executing the steps.&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-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;type&lt;/span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;Runner&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;interface&lt;/span&gt;&lt;span style="color:#bbb"&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:#bbb"&gt; &lt;/span&gt;ContainerId&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;string&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;Image&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;string&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:#00a000"&gt;Setup&lt;/span&gt;(beforeScript&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;string&lt;/span&gt;)&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;error&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:#00a000"&gt;ExecuteStep&lt;/span&gt;(step&lt;span style="color:#bbb"&gt; &lt;/span&gt;SyscallStep)&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;error&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:#00a000"&gt;Cleanup&lt;/span&gt;(afterScript&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;string&lt;/span&gt;)&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#0b0;font-weight:bold"&gt;error&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:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="future-work"&gt;Future Work:&lt;/h3&gt;
&lt;p&gt;The upcoming tasks we are going to handle are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Implement &lt;code&gt;ExecuteStep&lt;/code&gt; method in container runner&lt;/li&gt;
&lt;li&gt;Add support/ helper functions to make various syscalls&lt;/li&gt;
&lt;li&gt;Improve benchmarking capabilities of the event-generator&lt;/li&gt;
&lt;li&gt;Integrate the event-generator in falco ci pipeline&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="conclusion"&gt;Conclusion:&lt;/h3&gt;
&lt;p&gt;Participating in GSoC with Falco Security has been an incredible journey so far. Enhancing the event-generator has provided me with invaluable insights into cloud-native runtime security and the complexities of Falco’s detection capabilities. The support and guidance from my mentors, Jason and Aldo, through our weekly 1:1 calls, have been crucial in overcoming challenges and driving the project forward.&lt;/p&gt;
&lt;p&gt;As I look ahead, I am excited about the upcoming tasks and the potential impact our improvements will have on the Falco ecosystem. I eagerly anticipate continuing this journey and sharing more updates on our progress. Thank you for following along!&lt;/p&gt;</description></item><item><title>Blog: GSoC Week 2 updates</title><link>https://v0-43--falcosecurity.netlify.app/blog/gsoc-2023-2nd-week/</link><pubDate>Tue, 11 Jul 2023 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/blog/gsoc-2023-2nd-week/</guid><description>
&lt;p&gt;Alright, it's week 2 and I've got some updates. This week I learnt the different nuances and difficulties that comes while trying to compile a project for a new
target. In my case it was WebAssemebly.&lt;/p&gt;
&lt;p&gt;Parts of Falco, which will be used for the web application is completely written in C and C++. So, we'll be using the &lt;a href="https://emscripten.org/"&gt;emscripten&lt;/a&gt; toolchain to compile the C/C++ code into wasm.&lt;/p&gt;
&lt;h1 id="compiling-falco-to-wasm"&gt;Compiling Falco to Wasm 😱&lt;/h1&gt;
&lt;p&gt;So, Falco's core logic is inside the &lt;a href="https://github.com/falcosecurity/libs"&gt;libs&lt;/a&gt; repository.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://camo.githubusercontent.com/562853badc6f94d276aba70e6ad7cd33ac523b5eac8a8e5c2a5aa2265680c831/68747470733a2f2f66616c636f2e6f72672f696d672f66616c636f2d6469616772616d2d626c6f672d636f6e747269627574696f6e2e706e67" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;p&gt;We need to filter out libraries that won't be used and can't be compiled to wasm i.e kubernetes, grpc etc. There were a lot of modifications done, most of which are pre-processor checks for emscripten. Emscripten provies tools like &lt;code&gt;emcmake&lt;/code&gt; and &lt;code&gt;emmake&lt;/code&gt; to work with projects that are integrated using &lt;code&gt;cmake&lt;/code&gt; build system. After that we wrote a github workflow that can sucessfully compile libs to wasm. It looks something 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-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;build-libs-emscripten&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;build-libs-emscripten &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;runs-on&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;ubuntu-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;steps&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;Install deps &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;run&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; sudo apt update
&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; sudo apt install -y --no-install-recommends ca-certificates cmake build-essential clang-14 llvm-14 git pkg-config autoconf automake libtool libelf-dev libcap-dev linux-headers-$(uname -r) emscripten&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:#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;Checkout Libs &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;uses&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;actions/checkout@v3&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;with&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;fetch-depth&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;0&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:#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;Git safe directory&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;run&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; git config --global --add safe.directory $GITHUB_WORKSPACE&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:#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;Build and test &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;run&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; mkdir -p build
&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; cd build &amp;amp;&amp;amp; emcmake cmake -DUSE_BUNDLED_DEPS=True ../
&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; KERNELDIR=/lib/modules/$(ls /lib/modules)/build emmake make run-unit-tests -j4&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;You can find more information about the PR &lt;a href="https://github.com/falcosecurity/libs/pull/1156"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h1 id="testing-the-shiny-new-wasm-build"&gt;Testing the shiny new Wasm build 😎&lt;/h1&gt;
&lt;p&gt;During the final steps of compilation, the c++ exceutable will be converted to a &lt;code&gt;.js&lt;/code&gt; file with a &lt;code&gt;.wasm&lt;/code&gt; file linked to it. I loaded the wasm module with the help of a fancy react hook provied by my mentor, &lt;a href="https://github.com/jasondellaluce"&gt;Jason&lt;/a&gt; and to my suprise! it worked without any additional configurations.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;a target="_blank" href="images/sinsp-example-output.png"&gt;
&lt;img style="border: 2px solid #00b4c8"
alt="sinsp example output"
src="images/sinsp-example-output.png"&gt;
&lt;/img&gt;
&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;The above image contains the &lt;code&gt;help&lt;/code&gt; funtion of a &lt;code&gt;CLI&lt;/code&gt; interface. This is a simple &lt;code&gt;std::cout&amp;lt;&amp;lt;&lt;/code&gt; statement that logs the entire string into the console.&lt;/p&gt;
&lt;h1 id="conclusions"&gt;Conclusions&lt;/h1&gt;
&lt;p&gt;Overall, This week was super productive and informative for me. For the next week, I'm looking into adding &lt;code&gt;parsers&lt;/code&gt; for the syscalls that I added previous week. Also we'll be supporting &lt;code&gt;wasm&lt;/code&gt; build for Falco's main repository, which looks very exciting!&lt;/p&gt;</description></item><item><title>Blog: GSoC Week 1 Reflections</title><link>https://v0-43--falcosecurity.netlify.app/blog/gsoc-2023-1st-week/</link><pubDate>Tue, 27 Jun 2023 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/blog/gsoc-2023-1st-week/</guid><description>
&lt;p&gt;Hello Folks!, my name is &lt;a href="https://github.com/Rohith-Raju"&gt;Rohith&lt;/a&gt;, and I am thrilled to share my experiences and reflections on the first week of the Google Summer of Code (GSoC) period.&lt;/p&gt;
&lt;p&gt;This is an exhilarating time for participants like myself as we embark on our coding journey and dive into the world of open source development.&lt;/p&gt;
&lt;p&gt;A huge thank you! to all the community members accepting me as one of them ❤️.&lt;/p&gt;
&lt;h1 id="my-project-falco-playground"&gt;My Project: Falco Playground&lt;/h1&gt;
&lt;p&gt;Falco is a security tool that comes with a rule language for its runtime security engine. However, there is currently no official
and user-friendly integrated development environment (IDE) for writing and testing Falco rules. To address this gap, we propose a
project that aims to add WebAssembly as a supported compilation target for Falco.&lt;/p&gt;
&lt;p&gt;By using the Emscripten toolchain, we plan to create a web-based single-page application that serves as a development
environment for security rules. This means you can write and test Falco rules right inside your browser without the need for any
backend infrastructure. The end result will be similar to the Go Playground, where you can experiment with code in a seamless and
accessible manner.&lt;/p&gt;
&lt;p&gt;The project offers an exciting opportunity to explore various technologies within the cloud-native landscape. It involves working
with low-level system code in close proximity to the Linux kernel, WebAssembly world, and engaging in frontend development for
web application. By combining these different aspects, we aim to provide a convenient and comprehensive solution for developing Falco rules with ease.&lt;/p&gt;
&lt;h1 id="new-beginnings"&gt;New beginnings 🚀&lt;/h1&gt;
&lt;p&gt;By contributing to the project prior to the GSoC period, I had the opportunity to understand the project's ecosystem, gain insights into its development processes, and establish myself as a valuable member of the community. It provided me with a deeper understanding of the project's goals and challenges, enabling me to better align my proposed solutions and goals for the GSoC period.&lt;/p&gt;
&lt;p&gt;During this pre-GSoC contribution phase, &lt;a href="https://github.com/jasondellaluce"&gt;Jason Dellaluce&lt;/a&gt;, my mentor, played a crucial role in guiding and supporting me. Jason provided valuable feedback on my early contributions, helped me navigate the project's codebase, and encouraged me to explore new areas for improvement. My ongoing collaboration with Jason played a crucial role in my development as a contributor, paving the way for a fruitful journey through GSoC.&lt;/p&gt;
&lt;p&gt;As Week 1 of the official GSoC period began, my pre-GSoC contributions served as a foundation for diving deeper into the project. The knowledge and familiarity I gained before allowed me to hit the ground running and make meaningful progress from the very beginning. It also reinforced the strong mentor-mentee relationship with Jason, as we had already established a rapport and had a shared understanding of the project's context.&lt;/p&gt;
&lt;p&gt;Here is a summary of pull requests (PRs) I have submitted:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/falcosecurity/testing/pull/8"&gt;PR #1: Test For command falco -i (ignore default events)&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Description: The &lt;a href="https://github.com/falcosecurity/testing"&gt;falcosecurity/testing&lt;/a&gt; repository contains regression a test suite for Falco and other tools in its ecosystem. I contributed by adding a new test case for Falco's help output when used with thie &lt;code&gt;-i&lt;/code&gt; flag. I contributed to two other flags.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/falcosecurity/plugin-sdk-go/pull/73"&gt;PR #2: Semver check for RequiredAPIVersion values&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Description: This pr checks if user's RequiredAPIVersion follows semver system and checks if is compatible with internally-supported API version&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/falcosecurity/libs/pull/1127"&gt;PR #3: Feat: Support for memfd_create syscall&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Desciption: Whenever the kernel is updated and released, a new syscall or updated version of syscall may be added. This can
create new vulnerabilities that can allow malicious activity from Falco to go undetected. Therefore, we need to update Falco's
internal syscall table to address vulnerabilities. This PR adds support for the &lt;code&gt;memfd_create&lt;/code&gt; syscall&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/falcosecurity/libs/pull/1145"&gt;PR #4: Feat: Support for pidfd_getfd syscall&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Description: Same as above, this PR adds support to the &lt;code&gt;pidfd_getfd&lt;/code&gt; syscall&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="conclusions"&gt;Conclusions&lt;/h1&gt;
&lt;p&gt;In conclusion, my early contributions to the project before the GSoC period commenced provided me with a head start, enabling me to make a more significant impact right from the start. The guidance and support from Jason, combined with my pre-GSoC involvement, allowed me to seamlessly transition into the official GSoC period and continue building upon my previous contributions.&lt;/p&gt;
&lt;p&gt;Please stay tuned for updates and feel free to reach out to me via the CNCF Falco community channels. Your guidance, feedback, and support are invaluable.&lt;/p&gt;
&lt;p&gt;Thank you all for your warm welcome, and here’s to an exciting and fruitful GSoC.&lt;/p&gt;</description></item></channel></rss>