-
Notifications
You must be signed in to change notification settings - Fork 72
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(anomalydetection): Initial Scope - CountMinSketch Powered Probabilistic Counting and Filtering #419
base: main
Are you sure you want to change the base?
Conversation
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 |
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
c72e9de
to
f5bb677
Compare
auto& req = in.get_extract_request(); | ||
uint64_t count_min_sketch_estimate = 0; | ||
// todo fix settings to allow arg index in field | ||
auto index = req.get_arg_index(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasondellaluce may I ask for some guidance re how to make the arg indices available? The idea is to support notations like anomaly.count_min_sketch[2]
etc. It should be possible, just not sure how. Thanks in advance!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In std::vector<falcosecurity::field_info> anomalydetection::get_fields()
you are defining the list of available fields. In each, when doing {...}
you're invoking their constructor and defining them one by one. The 5th (and optional) argument of that constructor is the field arg, which is a substruct you can define to represent what the argument for that field looks like: https://github.com/falcosecurity/plugin-sdk-cpp/blob/efa5564221cea590eaf727a7a26e655515848c2b/include/falcosecurity/types.h#L149
Example:
...
{
ft::FTYPE_UINT64,
"anomaly.count_min_sketch",
"Count Min Sketch Estimate",
"Count Min Sketch Estimate according to the specified behavior profile for a predefined set of {syscalls} events. Access different behavior profiles/sketches using indices. For instance, anomaly.count_min_sketch[0] retrieves the first behavior profile defined in the plugins' `init_config`.",
{ // field arg
false, // key
true, // index
false, // required (don't know, maybe it is -- you know better)
}
},
...
After this declaration, the framework (libs) will handle all the syntax parsing for you and will provide you the user-defined argument, which you can access through req.get_arg_index()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I see it's a sub struct 🙃 works like a charm now!
f5bb677
to
bde5bcd
Compare
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
bde5bcd
to
fdd5401
Compare
What type of PR is this?
/kind design
/kind feature
Any specific area of the project related to this PR?
/area plugins
What this PR does / why we need it:
Introduce a new
anomalydetection
plugin, as outlined in the Proposal.Which issue(s) this PR fixes:
falcosecurity/falco#3117
Fixes #
Special notes for your reviewer: