Commit Graph

13 Commits

Author SHA1 Message Date
Mark Stemm
5f13a9be08 Add equality operators for indexed_vector/falco_{list,macro,rule}
Add an equality operator for indexed_vector.

As indexed_vectors commonly hold falco lists/macros/rules, also add
equality operators for those structs. For condition/sinsp_filter
shared_ptrs, the operator checks that the shared_ptrs point to the
same underlying memory.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-10-10 09:20:17 +02:00
Poiana
50b98b30e5 chore(falco): apply code formatting
Signed-off-by: Poiana <poiana.bot@gmail.com>
2024-09-30 13:25:31 +02:00
Luca Guerra
ddc736057f cleanup(falco): apply review suggestion about extra_output_field_t
Signed-off-by: Luca Guerra <luca@guerra.sh>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-09 15:31:24 +02:00
Luca Guerra
d210ed2e4f new(app): add append_output configuration option with fields and format
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-09 15:31:24 +02:00
Jason Dellaluce
4cffcedba1 refactor: remove refs to gen_event class family
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-02-06 10:25:53 +01:00
Roberto Scolaro
ce87f2a014 refactor(userspace): remove libs relative imports
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2024-01-31 11:51:37 +01:00
Mark Stemm
eed5b906a8 Provide the entire compile output to ruleset vs individual add()s
In order to support external rules loaders that may extend the falco
rules format with new top level objects, move away from providing
individual filter objects to the filter_ruleset via calls to add().

Instead, pass the entire compile output returned by the compiler to
the ruleset using a new method add_compile_output(). Custom users can
then cast back the compile output to the appropriate derived class for
use in the ruleset.

Move the declaration of the compile output to a standalone class so it
can be used by rulesets without including the entire rules loader
header files, and add a new factory method new_compile_output() to the
compiler so it can create a derived class if necessary.

This change is
backwards-compatible with existing rulesets, as the default
implementation of add_compile_output() simply iterates over rules and
calls add() for each rule.

This change also speeds up rule loading. Previously, each rule
condition was compiled twice:

1. First, in the compiler, to see if it was valid.
2. Second, in the falco engine before providing each rule to the
ruleset.

Add the compiled filter to the falco_rule object instead of throwing
it away in the compiler.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-01-30 20:24:33 +01:00
Jason Dellaluce
8f411f3d3b refactor(userspace/engine): modularize rules files compilation
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-09-28 12:39:20 +02:00
Leonardo Grasso
fe50ac22ee update: add SPDX license identifier
See https://github.com/falcosecurity/evolution/issues/318

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-09-21 13:21:47 +02:00
Jason Dellaluce
5781c53ddc fix(userspace): add explicit constructors and initializations
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-03 13:04:15 +02:00
Jason Dellaluce
0abd7eaa28 refactor(userspace/engine): refactor engine interface and internals
This updates the engine to comply and work properly with the newly-introduced
interface design.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-05-25 09:16:45 +02:00
Jason Dellaluce
3af8d1c0d2 refactor(userspace/engine): adapt existing ruleset implementation to new filter_ruleset interface
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-05-25 09:16:45 +02:00
Jason Dellaluce
9e93b7cd52 new(userspace/engine): add falco_rule struct to represent rule definitions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-11 12:22:18 +02:00