-
Notifications
You must be signed in to change notification settings - Fork 905
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: add possibility to retrieve details about rules with filter_details_visitor #2544
new: add possibility to retrieve details about rules with filter_details_visitor #2544
Conversation
62bfedf
to
0004597
Compare
0004597
to
2527699
Compare
This is super cool and highly requested! Thank you @loresuso ! |
3b1ff62
to
e713ae0
Compare
Links to #2372 and potentially fixes it, if we just add the information about the |
Last two commits address the following:
This will allow to check for instance (check https://github.com/falcosecurity/rules/blob/main/RELEASE.md for further details):
Currently working on adding |
c803516
to
b9c8ac1
Compare
9b2d14d
to
eabd030
Compare
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.
Left some minor comments, LGTM!
@@ -126,13 +126,13 @@ falco::app::run_result falco::app::actions::load_rules_files(falco::app::state& | |||
|
|||
if (s.options.describe_all_rules) |
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.
I would initialize both describe_all_rules
and describe_rule
variables here
options::options()
: event_buffer_format(sinsp_evt::PF_NORMAL),
gvisor_config(""),
list_fields(false),
list_plugins(false),
list_syscall_events(false),
markdown(false),
modern_bpf(false)
{
}
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.
They should already have their default I guess in options.cpp
ed9b102
to
b886a00
Compare
b886a00
to
e58a4a8
Compare
/milestone 0.35.0 |
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.
Looks good Lore:
- Left you a simple comment on that thing about exceptions and list of operators
- Left you suggestions to cover corner cases in the macro/list visitor search
- Once all's done, we'll need to rebase on top of update!: bump libs version, and support latest plugin features, add --nodriver option #2552, that should bump the libs and hopefully fix the broken tests
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
…etails when requested Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
5178406
to
d97d862
Compare
Just rebased and everything's green, I think we are there now! |
… getting details of all rules Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
…ption Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
… details Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
- avoiding inspector to be allocated for each rule - use two boolean values for expecting macros and lists - move items of lists alongside name, under info - use snake case for json output, like we do for e.g alerts - correctly retrieve evt names - consider two levels of lists for exception operators Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
d97d862
to
f662353
Compare
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.
/approve
Thanks! This is great!
LGTM label has been added. Git tree hash: 76ba42e28e821ab6c89ef3774628d821c834d360
|
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Andreagit97, jasondellaluce, loresuso The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area engine
What this PR does / why we need it:
This PR introduces a specialized visitor that can be used to construct a normalized form of a rule, containing all the macros, lists, operators, and fields it uses in JSON format. The functionality is embedded in the
-l
/-L
flags and can be triggered when the output is set to JSON.This functionality can be used later in CI tools for rules to e.g understand how to automatically handle and increase rules version.
Example:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: