-
Notifications
You must be signed in to change notification settings - Fork 165
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
[WIP] new(libscap): POC optimized syscalls #788
Conversation
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
…l_table Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: incertum The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
this seems an interesting idea, the real question could be is |
On top of my head the initial scap filesystem scan at agent startup also needs to be a bit more configurable, most notably if you only care about spawned processes, no need to populate fd tables. For the rest of the critical syscalls there will be the distinction: (1) Some dependent syscalls are responsible to add and remove items to the state engine vs (2) update information ensuring correct current view. (1) being most critical to get right, but (2) is critical too. Thread table cleanup is through tp In summary, let's go 1:1 through every syscall and audit sinsp in order to derive a roadmap re what changes would be needed in addition to adjusting the syscall selection mechanisms. The potential impact of these optimizations in terms of savings in compute overhead -> very very large sums of money plus new opportunities of using Falco for more tailored environments with varying monitoring scopes. |
While I like this idea, any syscall dependency list we come up with will be fragile and subject to becoming out of date fairly quickly. The syscall dependency list will likely be different depending on compile options (e.g. whether the libs were built using |
💯 absolutely @dwindsor, thanks for calling this out! To your point, how to automatically create a syscall dependency tree ... let me think more what options there could be besides manual expert knowledge input. How would you feel if we extended this POC to sinsp-example soon, start the sinsp audit and then iron out details based on outcomes? |
@incertum thanks a lot for driving the initiative on this topic. I support this and I'm looking forward to accomplishing the end goal, but IMO this is not the right path from few perspectives:
Let me know what you think. Of course, my assumptions imply that changes will mostly/entirely happen in libsinsp and that a polishing phase must happen in the state management code first. I think that should be the first step to look forward to. |
Thanks @jasondellaluce overall this is all excellent feedback and enough food for thought to try tackling a POC#2 that truly is efficient (you only pay for what you get and need) and more easily maintainable. However, I think we won't get away without some sort of knowledge base, at least in part, but everything can live in I'll leave this PR open until then, in case more folks want to offer additional thoughts. Expectation is to then attach RIP POC#1 and close it. |
Closing in favor of POC (take 2) #826. |
What type of PR is this?
/kind cleanup
/kind design
/kind feature
Any specific area of the project related to this PR?
/area libscap
Does this PR require a change in the driver versions?
What this PR does / why we need it:
POC: Optimize syscalls of interest selection based on Falco's rules. For each syscall encode all syscall dependencies to allow for no ambiguity or negative impacts on sinsp state engine build-up or life-cycle management.
Disclaimer: This is a very early draft. Edited the syscall table with string replacement and only explored few initial use cases through additional manual edits. If this or a similar approach were accepted, it would require careful review of the sinsp state engine. Open to other suggestions to accomplish the same end goal and no feelings hurt should this be completely off.
Pros:
Cons:
Examples:
Solely newly spawned processes are monitored -> no need to update threads in state engine as no other syscalls a process can make are monitored.
On the other hand, below scenarios include all syscalls that change a thread's params like uid, pgid, or dir and for the syscalls that create an fd, close is included to destroy fds.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: