Commit Graph

597 Commits

Author SHA1 Message Date
Federico Di Pierro
ea9e86d9e0 update(userspace): bump engine version and checksum.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-06-30 14:25:18 +02:00
Federico Di Pierro
4418bf2101 update(userspace/engine): bump engine version and checksum.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-06-09 12:19:53 +02:00
Federico Di Pierro
7a349a3e87 update(userspace/engine): bump engine version and checksum.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-06-03 11:12:11 +02:00
Federico Di Pierro
b0ef64b449 update(userspace/engine): bump engine version and checksum.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-05-12 12:01:22 +02:00
Luca Guerra
28e7050f0f cleanup(engine): remove unreachable function engine::read_file
Signed-off-by: Luca Guerra <luca@guerra.sh>
2025-05-12 10:58:22 +02:00
Federico Di Pierro
a41e3df45d update(userspace/engine): bump engine checksum and version.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-05-06 15:03:44 +02:00
Federico Di Pierro
6e4b7663ca cleanup(userspace/engine,userspace/falco): drop replace_container_info flag.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-05-06 10:06:43 +02:00
Federico Di Pierro
11f6fc5d14 cleanup(userspace/engine): deprecated %container.info.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-05-06 10:06:43 +02:00
Federico Di Pierro
08a00609a1 new(userspace,unit_tests): port merge-strategy to be a yaml map.
Merge-strategy for included config files must now be
specified as yaml map of the form:
- path: foo
  strategy: bar

If `strategy` is omitted, or the old `string-only` form is used,
`append` strategy is enforced.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-04-29 16:17:06 +02:00
Federico Di Pierro
630167d9ad new(userspace,unit_tests)!: add a way to specify merge-strategy for config_files.
By default we now use the `append` merge-strategy:
* existing sequence keys will be appended
* existing scalar keys will be overridden
* non-existing keys will be added

We also have an `override` merge-strategy:
* existing keys will be overridden
* non-existing keys will be added

Finally, there is an `add-only` merge-strategy:
* existing keys will be ignored
* non-existing keys will be added

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-04-29 16:17:06 +02:00
Federico Di Pierro
80d52963d6 fix(userspace): fixed engine openssl dep.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-04-29 13:50:04 +02:00
Federico Di Pierro
52127d4c8a update(userspace/engine): bump engine checksum and version.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-04-29 09:48:03 +02:00
Leonardo Grasso
6e717daa95 update(userspace/engine): relax validation for values in exceptions
Defining `exceptions` with empty `values` is a legitimate use case since the values can be added to another rules file. Even when values are not populated elsewhere, Falco can work without issues; that's the reason why the `values` field is not required. With this change, we avoid emitting useless validation warnings in situations where exceptions are just defined but not actually used because values are not being provided.

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2025-04-10 18:37:07 +02:00
Luca Guerra
f70b28bfb4 new(falco): add json_include_output_fields_property option
Signed-off-by: Luca Guerra <luca@guerra.sh>
2025-04-08 16:22:51 +02:00
Federico Di Pierro
cfc221549a chore(userspace/engine): update engine checksum and version minor.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-26 13:08:26 +01:00
Federico Di Pierro
9f1bc7d518 fix(userspace/engine): expand %container.info extra format to empty string.
Also, remove `container_id container_name` fields from `-pc` output.
These fields are now automatically appended since the `container` plugin
marks them as suggested.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-26 13:08:26 +01:00
Federico Di Pierro
aa312096d0 chore(userspace/engine): bump engine version and checksum.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-01-15 14:49:50 +01:00
Federico Aponte
ec2c2e801e chore: avoid deprecated funcs to calculate sha256
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2025-01-13 13:22:39 +01:00
Luca Guerra
d7792acdf3 update(falco): update libs to latest master
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-12-19 10:31:48 +01:00
Mark Stemm
4a73ef8824 When overriding rules, ensure that the sources match
In places where a second rule definition might replace, append to, or
replace items from a base rule, ensure that the source of the second
rule definiton matches the first.

This already existed for defines, but for other changes. There was a
bug where a second definition might exist for a different source, but
the additional rule was used anyway.

This now returns the same error for these other changes e.g. "Rule has
been re-defined..." as define.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-10-24 08:45:12 +02:00
Mark Stemm
a44b311333 Add a source to rule_update_info
It's possible that someone might want to override a property for a
non-syscall rule source. To assist in this, decode any source property
for rules with append/override and save it in the rule_update_info
object. For the source property only, the value for source can be
empty e.g. 'source: ' or an empty string e.g. 'source: ""'. Both of
those are considered valid but result in an empty source.

A later change will ensure that the sources match up when
appending/redefining/overriding/enabling.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-10-24 08:45:12 +02:00
Federico Di Pierro
e4cbffc35b update(userpsace/engine): update engine checksum and version.
See https://github.com/falcosecurity/libs/pull/2047.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-10-21 16:01:59 +02:00
Mark Stemm
e99b11e793 Make enable()/disable() virtual so they can be overridden
Subclasses might want to also see when rules are enabled/disabled.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-10-16 12:01:37 +02:00
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
Mark Stemm
093d9234a5 Add a compile_output::clone() method that can be overridden
Add a clone() method that can be overridden by subclasses. This allows
copying compile state when needed in a way that preserves
polymorphism.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-10-10 09:20:17 +02:00
Federico Di Pierro
c55adf38b4 chore(userspace/engine): fix build warning.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-10-09 16:26:14 +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
Federico Di Pierro
fa701dd52f fix(userspace/engine): improve rule json schema to account for source and required_plugin_versions.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-17 17:34:51 +02:00
Luca Guerra
037d7f9b36 cleanup(falco): use a header file for rule json schema
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-16 09:59:46 +02:00
Luca Guerra
5c959d0b1b update(falco): use std::include for readability
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-13 15:58:36 +02:00
Luca Guerra
7005983409 update(engine): modify append_output format
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-13 15:58:36 +02:00
Melissa Kilby
9669a4a0bb update(falco_metrics): rearrange evts and drops prometheus metrics
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-09-12 15:26:33 +02:00
Luca Guerra
bc7394b8c3 new(falco): add json_include_message_property option
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-11 17:52:32 +02:00
Federico Di Pierro
0f26e3c9ed chore(userspace): adjusted rule_loader::result::as_verbose_string following errors and warnings output layout.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-11 13:20:31 +02:00
Federico Di Pierro
468037151a chore(userspace,unit_tests): properly report all schema validation warnings from yaml_helper::validate_node().
`-V` option will print all warnings, while normal run will only print foremost warning.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-11 13:20:31 +02:00
Federico Di Pierro
2f89a2c140 chore(userspace): added schema validation info to rule_loader::result as_json and as_string outputs.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-11 13:20:31 +02:00
Federico Di Pierro
1f9bea5a0b update(userspace/engine): fixed priorities in rules schema.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2024-09-11 13:20:31 +02:00
Federico Di Pierro
118e82ae01 cleanup(userspace): drop unused includes from yaml_helper.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-11 13:20:31 +02:00
Federico Di Pierro
a392e1ed2d chore(userspace): minified rule schema json.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-11 13:20:31 +02:00
Federico Di Pierro
5bd2d5a63e cleanup(userspace,unit_tests): moved rule schema under engine.
Also, moved yaml_helper under engine/ folder.
Ported rule json schema validation in the engine.

Also, updated rule_loader tests to check for validation.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-11 13:20:31 +02:00
Federico Di Pierro
d14825faf0 update(userspace/engine): bump engine version and checksum.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-11 13:15: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
Melissa Kilby
1caece2cf9 update(metrics): use new libs addr_to_string methods for host_ifinfo_json
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-08-27 10:18:26 +02:00
Melissa Kilby
23b412ea3c new(metrics): add host_ifinfo metric
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-08-27 10:18:26 +02:00
Federico Di Pierro
4a4ed1e118 update(userspace/engine): bump engine version and checksum.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-06-26 10:32:44 +02:00
Mark Stemm
a3bf8b472b If rule compilation fails, return immediately
There's no need to populate rulesets with the output if compilation
failed.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-06-25 18:27:39 +02:00
Mark Stemm
adeca79d1c Modify evttype_index_ruleset to derive from indexable_ruleset
Modify evttype_index_ruleset to derive from indexable_ruleset instead
of having its own implementation of segregating filters by ruleset
id/event type.

An evttype_index_wrapper contains a falco rule and filter, and
implements the methods required by the template. run_wrappers()
evaluate the filter as before, without the segregation by ruleset
id/event type.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-06-20 11:23:12 +02:00
Mark Stemm
bbcfa61d82 Add an indexable ruleset that can split filters by ruleset/evttype
Now that custom rules loading implementations (and related, custom
rulesets) can be swapped into falco in a customizable way, there is
some functionality in evttype_index_ruleset that could be used by
other rulesets, specifically the part that segregates filters by
ruleset and enables/disables filters based on name substring + tags.

To allow for this, create a new template indexable_ruleset<class
filter_wrapper> which derives from filter_ruleset and segregates the
filter_wrappers by ruleset. It also optionally segregates
filter_wrappers by event type.

The filter_wrapper class is an object that can return a name, tags,
and sc/event codes.

The main interfaces for classes that derive from indexable_ruleset are:

- add_wrapper(), which provides a filter_wrapper to the
  indexable_ruleset. This is generally called from
  add()/add_compile_output(), which must be implemented by the derived class.
- run_wrappers(), which must be implemented by the derived class and
  is called for event processing.

Most of the methods required by filter_ruleset are implemented by
indexable_ruleset and do not need to be implemented by the derived
class.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-06-20 11:23:12 +02:00
Federico Di Pierro
0e754aec14 chore(userspace): bump engine version and checksum.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-06-13 13:40:48 +02:00