Skip to content
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

update(userspace/engine): modularize rule compiler, fix and enrich rule descriptions #2817

Merged
merged 9 commits into from Sep 28, 2023

Conversation

jasondellaluce
Copy link
Contributor

@jasondellaluce jasondellaluce commented Sep 19, 2023

What type of PR is this?

/kind bug

/kind cleanup

/kind feature

Any specific area of the project related to this PR?

/area engine

What this PR does / why we need it:

This is focused on the rules description feature of the -l and -L options, in the specific case of the JSON output. The goal is to be more consistent and print more information, which can be used by our automation and for debugging purposes (some of these have been asked for a while). High-level changes:

  • The rule loader compiler has been modularized even more. It will be fairly easier to write unit tests on it now.
  • For each rule, macro, or list, now also print the plugins they used among the ones currently loaded
  • For each list, now also prints the final "compiled" list of items (after resolving all list refs)
  • For each macro, now also prints the final "compiled" condition (after resolving all list and macro refs)
  • For each macro, now also prints the final "compiled" condition and output (after resolving all list, macro, and exceptions refs, and also the output substitutions such as the one of container.info)
  • Details of each YAML elements now take in consideration all the referenced elements (lists, macros) instead of just the given described element. Doing otherwise makes no sense for some cases, which are: matching event types, condition and output fields, and used plugins

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

update(userspace/engine): modularize rule compiler, fix and enrich rule descriptions

@github-actions
Copy link

This PR may bring feature or behavior changes in the Falco engine and may require the engine version to be bumped.

Please double check userspace/engine/falco_engine_version.h file. See versioning for FALCO_ENGINE_VERSION.

/hold

@jasondellaluce jasondellaluce changed the title update(userspace/engine) update(userspace/engine): modularize rule compiler, fix and enrich rule descriptions Sep 19, 2023
@jasondellaluce
Copy link
Contributor Author

This PR may bring feature or behavior changes in the Falco engine and may require the engine version to be bumped.

Please double check userspace/engine/falco_engine_version.h file. See versioning for FALCO_ENGINE_VERSION.

False alarm. No change visible to rulesets has been applied, just some changes in the internal machinery.

/unhold

@jasondellaluce
Copy link
Contributor Author

/milestone 0.37.0

@jasondellaluce
Copy link
Contributor Author

Supporting tests, for later: falcosecurity/testing#26

@FedeDP
Copy link
Contributor

FedeDP commented Sep 26, 2023

Can you rebase this one?

…ugins

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana poiana added the lgtm label Sep 28, 2023
@poiana
Copy link

poiana commented Sep 28, 2023

LGTM label has been added.

Git tree hash: b252817869fdc3c3f4d62c47050d2c7d306436be

Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana
Copy link

poiana commented Sep 28, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, jasondellaluce

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:
  • OWNERS [Andreagit97,FedeDP,jasondellaluce]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana merged commit d3e1a1f into master Sep 28, 2023
19 checks passed
@poiana poiana deleted the update/used-plugins-rules branch September 28, 2023 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants