Commit Graph

5118 Commits

Author SHA1 Message Date
Leonardo Grasso
3babc46d3c docs(userspace): update -o help text to mention backslash escaping
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-20 11:19:09 +02:00
Leonardo Grasso
d686b50088 docs(userspace): document backslash escaping to -o key-path parser
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-20 11:19:09 +02:00
Leonardo Grasso
941afe0b47 fix(userspace): add backslash escaping to -o key-path parser
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-20 11:19:08 +02:00
Leonardo Di Giovanna
f56e9c2656 chore(cmake): bump drivers to 10.0.0-rc2+driver
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2026-04-17 12:21:00 +02:00
Leonardo Di Giovanna
151f9cf2d3 chore(scripts): add script updating libs/drivers cmake module versions
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2026-04-17 11:54:00 +02:00
Leonardo Di Giovanna
df1b259cbb chore(cmake): bump libs/drivers to 0.24.0-rc1/10.0.0-rc1+driver
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2026-04-16 14:07:54 +02:00
Leonardo Grasso
a3d7dbeeea fix: use has_root_path() for cross-platform plugin library path check
Co-authored-by: irozzo-1A <iacopo@sysdig.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-15 17:05:50 +02:00
Leonardo Grasso
f4bb2ea498 chore: make plugin library path traversal check cross-platform
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-15 17:05:50 +02:00
Leonardo Grasso
3350c6f703 fix(config): prevent plugin library path traversal via relative paths
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-15 17:05:50 +02:00
Leonardo Grasso
cbc16a3ccf refactor(engine)!: remove unused seed_rng parameter from falco_engine constructor
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-15 16:47:49 +02:00
Leonardo Grasso
52324bd737 docs(userspace): update copyright year
Co-authored-by: Iacopo Rozzo <iacopo@sysdig.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-15 16:47:49 +02:00
Leonardo Grasso
5e6fc5784b fix(userspace): add portable compat wrappers for gmtime_r, localtime_r, strerror_r
The previous commits used gmtime_r/localtime_r (unavailable on Windows)
and assumed the GNU strerror_r variant returning char* (only on glibc).
This broke macOS, musl, WASM, and Win32 builds.

Add userspace/engine/compat.h with portable inline wrappers:
- falco_gmtime_r / falco_localtime_r: use gmtime_s/localtime_s on Win32
- falco_strerror_r: returns const char* on all platforms, detecting
  glibc via __GLIBC__ (not _GNU_SOURCE alone, since musl defines
  _GNU_SOURCE but provides the XSI variant returning int)

Also fixes a pre-existing bug in create_signal_handlers.cpp where
the GNU strerror_r return value was incorrectly compared to 0 and
the actual error string was discarded.

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-15 16:47:49 +02:00
Leonardo Grasso
127f0b2a2a fix(userspace): replace strerror() with thread-safe strerror_r()
strerror() returns a pointer to a shared static buffer, making it
unsafe when called concurrently from different threads. Replace all
call sites with strerror_r() using stack-local buffers, consistent
with the existing pattern in create_signal_handlers.cpp.

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-15 16:47:49 +02:00
Leonardo Grasso
f004258bf7 fix(userspace/engine): replace non-thread-safe random() with thread-local RNG
random() uses internal static state that is not thread-safe. Since
should_drop_evt() can be called concurrently from per-source event
processing threads, replace it with a thread_local std::mt19937
seeded by std::random_device. Remove the now-unused srandom() seed
and Windows compat defines.

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-15 16:47:49 +02:00
Leonardo Grasso
6a00de21a8 fix(userspace): replace gmtime/localtime with reentrant variants
gmtime() and localtime() return pointers to a shared static buffer,
making them unsafe in multi-threaded contexts. Replace all call sites
with gmtime_r() and localtime_r() which use caller-provided buffers.

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-15 16:47:49 +02:00
poiana
7a46ddd4ce update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: poiana <51138685+poiana@users.noreply.github.com>
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2026-04-15 16:39:50 +02:00
Leonardo Di Giovanna
7e59ac5653 ci(reusable_test_packages): produce core dumps when falco crashes
Moreover, align the suffix of each artifact produced in
`reusable_test_packages.yaml` by using a common env variable
`ARTIFACT_SUFFIX`.

Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2026-04-15 15:13:49 +02:00
irozzo-1A
65c114faf6 chore(cmake): add use TSAN option
Add USE_TSAN CMake option to build Falco with Thread Sanitizer support.

Signed-off-by: irozzo-1A <iacopo@sysdig.com>
2026-04-15 11:22:48 +02:00
dependabot[bot]
8e2af6dc35 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `77d3237` to `66d4992`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](77d3237058...66d4992453)

---
updated-dependencies:
- dependency-name: submodules/falcosecurity-rules
  dependency-version: 66d4992453061b441809a9acf156389505b3e5e7
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-15 11:21:48 +02:00
Leonardo Grasso
1f45da8634 fix(userspace/falco): respect buffered_outputs YAML config value
The buffered_outputs config option was silently overridden to true by an unconditional assignment in load_config.cpp. The -U CLI flag now only overrides the config when explicitly passed.

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-14 16:13:46 +02:00
dependabot[bot]
5f3cc45bc1 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `e63b765` to `77d3237`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](e63b765e23...77d3237058)

---
updated-dependencies:
- dependency-name: submodules/falcosecurity-rules
  dependency-version: 77d3237058d8ed37ef4e3f9127993fabb633d91b
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-13 14:13:50 +02:00
Leonardo Grasso
274c5d42b3 build: drop WIN32 exclusion from http_output, webserver, and metrics gates
Rely solely on MINIMAL_BUILD and EMSCRIPTEN as semantic guards instead of explicit platform checks. MSVC builds are unaffected since  CompilerFlags.cmake forces MINIMAL_BUILD=ON, keeping these features  disabled. Non-MSVC Windows toolchains (MinGW, clang) can now build with http_output if curl and OpenSSL are available.

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-13 09:48:49 +02:00
Leonardo Grasso
45f7cee02a build: enable http_output, webserver, and metrics on macOS
The HTTP output, health webserver, and Prometheus metrics were excluded from macOS builds as collateral damage when a Linux-only CMake gate was  introduced to handle gRPC/protobuf dependencies (86e76924). Now that  gRPC has been dropped (43aaffc4), the original reason no longer applies.

Widen CMake gates and C++ preprocessor guards from Linux-only to  all non-Windows/non-Emscripten platforms. Also remove the dead c-ares dependency, which was only needed by gRPC.

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-13 09:48:49 +02:00
Leonardo Grasso
6c2023302a docs(CHANGELOG.md): 0.43.1
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-04-09 16:50:25 +02:00
Leonardo Di Giovanna
1d73b2f0a9 ci: restore minimum set of required permissions
Commit #8171176 reduced workflow permissions and only allowed read
accesses to repo content. However, some workflows require write
permissions for token-id and attestations: these requirements resulted
in both master and release CIs being broken in the last month.

While still applying least privilege principle, this patch restores
the minimum set of required ones.

Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2026-04-01 11:28:39 +02:00
Leonardo Di Giovanna
8207e20e46 feat(userspace/falco): add support for kernel iterator metrics
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2026-04-01 09:42:39 +02:00
irozzo-1A
07d627a8e6 docs: add work partitioning section
Signed-off-by: irozzo-1A <iacopo@sysdig.com>
2026-03-18 11:44:39 +01:00
irozzo-1A
4f22143c6e docs: high-level Falco multi-threaded architecture
Signed-off-by: irozzo-1A <iacopo@sysdig.com>
2026-03-18 11:44:39 +01:00
irozzo-1A
9f767e409e docs: multi-thread falco high-level design proposal
Signed-off-by: irozzo-1A <iacopo@sysdig.com>
2026-03-18 11:44:39 +01:00
Paolo Polidori
e0c810c9d2 fix(engine): address PR review comments
- Move output_format.h from userspace/falco/ to userspace/engine/ to
  fix reverse dependency (engine layer was including from app layer);
  update all include paths accordingly
- Add SPDX-License-Identifier to output_format.h
- Remove leftover m_first_event_in_category field from MarkdownFormatter
  (was set in begin_category() but never read)
- Emit deprecation warning to stderr when --markdown is used

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Paolo Polidori <paolo.polidori@sysdig.com>
2026-03-17 14:16:34 +01:00
Paolo Polidori
8c6ab2387f fix(engine) license date
Signed-off-by: Paolo Polidori <polyp91@gmail.com>

Signed-off-by: Paolo Polidori <paolo.polidori@sysdig.com>
2026-03-17 14:16:34 +01:00
Paolo Polidori
e1f16c0464 feat: add JSON as output format for --list/--list_events
- Added support of the JSON format
- Refactored field and events formatting using the strategy pattern

Signed-off-by: Paolo Polidori <paolo.polidori@sysdig.com>
2026-03-17 14:16:34 +01:00
Leonardo Grasso
bb404863b4 chore(unit_tests): test validation for unknown-key in rules
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-03-17 12:03:34 +01:00
Leonardo Grasso
7994460666 new(userspace/engine): validation for unknown-key in rules
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-03-17 12:03:34 +01:00
Leonardo Grasso
9aed480082 fix(userspace/engine): JSON Schema fixes
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-03-17 12:03:34 +01:00
Roberto Scolaro
61be9ec4dd fix(cmake): configure falco.yaml from current src dir
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2026-03-16 10:55:29 +01:00
Adnan Ali
6d20070f27 fix(metrics): Prevent race condition crash during metrics collection on shutdown
This fixes a segmentation fault that occurs when /metrics endpoint is accessed during Falco shutdown. The crash happens as the webserver continues serving /metrics requests after outputs and inspectors have been destroyed.

Changes:

- Create cleanup_outputs action to handle outputs destruction
- Create print_stats action for stats printing
- Reorder teardown steps to stop webserver before destorying outputs
- Move outputs.reset() from process_events to cleanup_outputs()

This eliminates the race condition by ensuring the webserver stops accepting requests before any subsystems are destroyed. The synchronisation behaviour of output.reset() block till queue flushed is preserved.

Signed-off-by: Adnan Ali <adduali1310@hotmail.com>
2026-03-16 10:46:29 +01:00
Leonardo Grasso
59dae06e13 update(engine): bump engine version to 0.60.0
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-03-12 17:12:07 +01:00
Leonardo Grasso
426fe3dabc fix(cmake): move cxxopts include before falcosecurity-libs
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-03-12 17:12:07 +01:00
poiana
cf0d2eb15a update(cmake): update libs and driver to latest master.
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2026-03-12 17:12:07 +01:00
irozzo-1A
8989870d26 fix(userspace/falco): fix watchdog race condition on timeout exchange
The watchdog thread and stop() consume the timeout pointer with
m_timeout.exchange(nullptr, ...). That exchange was using
memory_order_release. The load part of the RMW needs acquire
semantics so it synchronizes-with the release store in
set_timeout()/cancel_timeout(); otherwise the consumer can see
the pointer value without seeing the writes that initialized
the timeout_data and payload (data race).
Use memory_order_acq_rel on the consumer exchanges so the load
synchronizes-with the producer and the pointed-to memory is
visible before use.

Signed-off-by: irozzo-1A <iacopo@sysdig.com>
2026-03-12 13:21:07 +01:00
dependabot[bot]
526dc9afef chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `21afd80` to `e63b765`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](21afd80cec...e63b765e23)

---
updated-dependencies:
- dependency-name: submodules/falcosecurity-rules
  dependency-version: e63b765e23f7f9beacad2d36952658874570243f
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-12 12:32:06 +01:00
Gagan H R
8171176e31 ci: add top-level permissions to workflow files
Add `permissions: contents: read` at the workflow level for
bump-libs.yaml, format.yaml, master.yaml, and release.yaml to follow
the principle of least privilege. Job-level permissions that require
elevated access will override this as expected.

Signed-off-by: Gagan H R <hrgagan4@gmail.com>
2026-03-11 18:05:08 +01:00
irozzo-1A
6fdb686b7a chore(falco): fix warning in webserver.h
/workspaces/falco/userspace/falco/app/../webserver.h:36:2: warning: explicitly defaulted move constructor is implicitly deleted [-Wdefaulted-function-deleted]
   36 |         falco_webserver(falco_webserver&&) = default;
      |         ^
/workspaces/falco/userspace/falco/app/../webserver.h:49:20: note: move constructor of 'falco_webserver' is implicitly deleted because field 'm_failed' has a deleted move constructor
   49 |         std::atomic<bool> m_failed;
      |                           ^
/usr/bin/../lib/gcc/aarch64-linux-gnu/13/../../../../include/c++/13/atomic:72:5: note: 'atomic' has been explicitly marked deleted here
   72 |     atomic(const atomic&) = delete;
      |     ^
/workspaces/falco/userspace/falco/app/../webserver.h:36:39: note: replace 'default' with 'delete'
   36 |         falco_webserver(falco_webserver&&) = default;
      |                                              ^~~~~~~
      |                                              delete
/workspaces/falco/userspace/falco/app/../webserver.h:37:19: warning: explicitly defaulted move assignment operator is implicitly deleted [-Wdefaulted-function-deleted]
   37 |         falco_webserver& operator=(falco_webserver&&) = default;
      |                          ^
/workspaces/falco/userspace/falco/app/../webserver.h:49:20: note: move assignment operator of 'falco_webserver' is implicitly deleted because field 'm_failed' has a deleted move assignment operator
   49 |         std::atomic<bool> m_failed;
      |                           ^
/usr/bin/../lib/gcc/aarch64-linux-gnu/13/../../../../include/c++/13/atomic:73:13: note: 'operator=' has been explicitly marked deleted here
   73 |     atomic& operator=(const atomic&) = delete;
      |             ^
/workspaces/falco/userspace/falco/app/../webserver.h:37:50: note: replace 'default' with 'delete'
   37 |         falco_webserver& operator=(falco_webserver&&) = default;
      |                                                         ^~~~~~~
      |                                                         delete

Signed-off-by: irozzo-1A <iacopo@sysdig.com>
2026-03-11 12:33:06 +01:00
irozzo-1A
7554de160a fix(engine): add unknown filter match in err_is_unknown_type_or_field
After PR https://github.com/falcosecurity/libs/pull/2776 a new error
message has been introduced for unknown types.

Signed-off-by: irozzo-1A <iacopo@sysdig.com>
2026-03-11 12:05:07 +01:00
irozzo-1A
31e92b88bc fix(cmake): protect from redefine cxxopts target
Signed-off-by: irozzo-1A <iacopo@sysdig.com>
2026-03-11 12:05:07 +01:00
irozzo-1A
17ebbecec9 feat(userspace/engine): update libs ref and adapt to transformer AST changes
- Bump default falcosecurity/libs to latest main (8f6b914) with
  transformer_list_expr and field_transformer_expr (values) support
- Add visit(transformer_list_expr*) to filter_details_resolver and
  filter_macro_resolver visitors
- Fix field_transformer_expr handling to use e->values instead of e->value

Signed-off-by: irozzo-1A <iacopo@sysdig.com>
2026-03-11 12:05:07 +01:00
Maxime Grenu
e816587a8d docs: fix anchor trailing hyphen for emoji heading
The heading "Add DCO signed-off to your commits 🔏" generates a GitHub
anchor with a trailing hyphen due to the emoji. Fix both link references
to use the correct anchor.

Signed-off-by: Maxime Grenu <maxime.grenu@gmail.com>
2026-03-02 18:26:05 +01:00
Maxime Grenu
12b8bf8522 docs: fix Contributing.md outdated references
- Replace incorrect `/libs` path reference with 'the root directory
  of the project'; this file is for the falco repo, not falcosecurity/libs.
- Fix the DCO section: replace `libs` repository mention with `falco`
  so it accurately refers to this repository.
- Fix broken markdown hyperlink: `[dedicated section]((#anchor))` had
  double opening parentheses causing the link to render incorrectly;
  corrected to `[dedicated section](#anchor)`.

Signed-off-by: Maxime Grenu <maxime.grenu@gmail.com>
2026-03-02 18:26:05 +01:00
dependabot[bot]
a43e1ac7f3 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `6f43d74` to `21afd80`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](6f43d7492d...21afd80cec)

---
updated-dependencies:
- dependency-name: submodules/falcosecurity-rules
  dependency-version: 21afd80cec7a92f6a87a61fb1a172aa969e2daea
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-27 13:34:43 +01:00