-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[New Feature]: User flag for base_syscalls.repair
as extension to base_syscalls
config overriding default sinsp state enforcement
#2433
Comments
Describing current approach of falcosecurity/libs#826 Regardless of the input filter system calls a fair approach seems to activate all system calls that are explicitly used to build the core sinsp state engine, that is, the process or thread cache table. Code review of parsers surfaced that all below system calls can add or alter the table plus these are typically more low volume system calls comparatively.
Now the conditioning by input filter syscalls starts:
Lastly, it is worth mentioning that Falco also hooks into the scheduler process exit and the associated |
In aboves approach falcosecurity/libs#826 what else are we missing? Below is a list of the static set of system calls that are associated with the We could all collectively review the parser? Would appreciate help from the community. Thanks a bunch in advance!
|
Hey @incertum -- awesome work and excited to see the progress! There's some new terminology being used here that I'm not exactly caught up with. From reading the related links in the description,
Can I get a bit of clarification regarding:
|
Absolutely, trying my best to help clarify and please feel free to ask more follow up questions. This is exactly the type of feedback we need to improve this feature! Thanks a bunch! Re the wording open to change
It allows the end user to tell Falco to also activate system calls that are not defined in any Falco rule. The end result will be all system calls from each Falco rules plus the ones passed over
adaptive base syscalls option would be opt-in, the current default is adding a hard-coded static set of system calls to the system calls from each Falco rule. So no matter how you change Falco rules, this static set will always be activated in the kernel.
Please let me try a fresh explanation in a follow up comment for all these. |
What does Falco <= 0.34.x do? Falco <= 0.34.x does not offer much configurability wrt to system calls. The work Falco does in the kernel is either a static set of hard-coded system calls or all system calls (old -A flag behavior) regardless of Falco rules. What is new in Falco >= 0.35? Falco now gives end users control over how much work Falco does in the kernel. This can directly influence CPU utilization and possible kernel side event drops on servers with a lot of activity. In summary, you can control Falco's resource utilization in ways you could not do before. With Falco >= 0.35 there are several options and the end user can choose the option that best fits the use case at hand. Option 1: The default option -> use if you do not need Option 2 or Option 3
Option 2: base_syscalls user config (set) -> use with caution
Option 3: adaptive_base_syscalls user config (bool) -> use if you want Falco to be more resourceful and smarter in an automated manner aka the Falco "only takes what you can eat" option (what this ticket is about)
What is Falco's state engine: Falco creates a struct in memory to cache all processes so that you can for example look up parent processes. Internally Falco calls this the thread table and there are more details to it. Some system calls can modify the information of a process in that struct, e.g. setuid. Then there are other cases more related to file descriptors. For instance, network system calls like connect do not know about ips on their own, the place to retrieve ip tuples is the socket system calls. Furthermore, the process table in memory also keeps track of fds, so you would want to monitor the close system call as well so that the state engine knows to remove the fd from memory ... Scenarios:
|
Regarding a name suggestions for Maybe |
Plus we would need to convey that this is a boolean option that reasons automatically and as mentioned above follows the principle of "only take what you can eat", which also aligns with https://github.com/cncf/tag-env-sustainability (tag environmental sustainability). So it could be regarded as the best of Option 1 and Option 2 sort of ... also still thinking about a name that conveys all this better. Will post again once I have ideas. Since I mention tag-env-sustainability, perhaps it would be of interest to tag up with them on the tough challenges we also face with the single thread issues and the security monitoring degradation implications Ali pointed out? But if so let's quickly pivot to a new issue for that. |
I think this would be very cool! I love their initiative and I think our case would be a good candidate for tagging up with them. @incertum, would you like to drive this? |
My proposal would be to call the flag base_syscalls:
repair: true
custom_set: [...] |
I like this a lot, because it also adds the option to actually fix up the Under the hood in @happy-dude what are your thoughts? |
I'm a fan of this suggestion! Makes the configuration cleaner/clearer. By doing this, I think it also affords itself to less misconfiguration by users using the single setting (as opposed to the original 2 config options/variables). |
adaptive_base_syscalls
as extension to base_syscalls
config overriding default sinsp state enforcementbase_syscalls.repair
as extension to base_syscalls
config overriding default sinsp state enforcement
See falcosecurity/falco#2433 (comment) Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com> Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
See falcosecurity/falco#2433 (comment) Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com> Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
See falcosecurity/falco#2433 (comment) Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com> Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
See falcosecurity/falco#2433 (comment) Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com> Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
See falcosecurity#2433 Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com> Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
See falcosecurity#2433 Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com> Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
See #2433 Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com> Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
See falcosecurity/falco#2433 (comment) Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com> Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
v1 of this feature has been finalized. |
Context / Bigger Picture
Thanks to @happy-dude feedback realized to perhaps first set the stage, please consider reading #2433 (comment) before continuing reading below as we are diving right into the technical details of what we currently call "Option 3".
Motivation
At the time of writing Falco's default libsinsp state enforcement activates a static set of system calls [see additional note 1] that are associated with the
EF_MODIFIES_STATE
flag in the libs event_table. The entirety of these system calls are activated regardless of the system calls used in Falco rules.Compute overhead budgets typically are not unlimited plus Falco's rules event evaluation runs single threaded and eventually drops events kernel side once one entire CPU is consumed. Therefore, the default libsinsp state enforcement can have severe production degradation impacts, especially for configurations that do not activate most system calls and/or when running Falco on very active servers w/ 96 CPUs (see falcosecurity/libs#855).
We introduced
base_syscalls
(see #2373) (scheduled for 0.35 release, see d6421d4) which provides the end user with a config option to pass their own set of syscalls that will be activated in addition to the system calls from each Falco rule. The recommendations given for this new option are based on the concept ofadaptive_base_syscalls
introduced here falcosecurity/libs#826.The question of what the system calls are that are truly needed for Falco's state engine given the rules sets remains open. Plus ideally there would also be such an automated
adaptive_base_syscalls
in addition tobase_syscalls
so that end users do not have to keep a manual set of base syscalls correct and can rely on automatic resourceful syscalls activation that ensures that both (1) data is correct and (2) state engine remains healthy.The intended outcome of this issue is to derive a clear understanding of what the system call dependencies of libsinsp are given x input filter system calls.
Notes:
The text was updated successfully, but these errors were encountered: