Compare commits

...

2623 Commits

Author SHA1 Message Date
Federico Di Pierro 539294595e update(userspace/engine): bump engine version and checksum.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-08-04 17:12:50 +02:00
Federico Di Pierro 154cde354f fix(userspace/falco): use proper API to fetch event param[0] as uint32_t.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-08-04 17:12:50 +02:00
poiana ce8a67a5f4 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-04 17:12:50 +02:00
Federico Di Pierro ec24062b71 chore(userspace/falco): print plugin version info too at plugin loading.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-08-01 18:27:30 +02:00
Federico Di Pierro 08b9e0f065 chore(ci): disable mimalloc for master builds.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-07-28 11:31:05 +02:00
Federico Di Pierro 3dce2f030d fix(cmake,userspace): fix usage and build of mimalloc.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-07-25 16:58:43 +02:00
Federico Di Pierro 687c3e147d update(cmake): bump mimalloc to 3.1.5.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-07-25 16:58:43 +02:00
Federico Di Pierro e13e384d37 new(ci): add optional input to reusable_build_packages workflow to enable jemalloc or mimalloc.
Enable mimalloc in all CIs but release CI (keep it with jemalloc for now).

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-07-25 16:58:43 +02:00
Federico Di Pierro 6a4fa5dfce new(cmake,userspace/falco): add `mimalloc` allocator library support.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-07-25 16:58:43 +02:00
dependabot[bot] cf792a0700 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `1208816` to `be38001`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](120881647a...be3800132f)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-25 10:56:44 +02:00
Leonardo Grasso 8dee7a075e docs(falco.yaml): avoid out-of-sync config options for `container` plugin
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2025-07-24 17:00:41 +02:00
Mariell Hoversholm c3fc9e0d0f fix(restart_handler): disable if there is no work
When there is no work to do, i.e. when all config watching is disabled,
there is no need to keep the restart_handler running. Disable it in this
case.

This is helpful to do on nodes where there is little to no headroom in
terms of open inotify watches (as per the inotify/max_user_instances
configuration), as can happen on nodes populated with other software
that also watch the filesystem for changes. If Falco is run on such a
node, it may fail to start due to functionality the app does not even
intend on using.

This has one change in terms of behaviour, however: the dry-run restarts
will no longer occur. As there is still never going to happen a real
restart, I understand it as unlikely for there to be a proper need for
dry-run restarts.

Signed-off-by: Mariell Hoversholm <mariell@grafana.com>
2025-07-24 12:56:39 +02:00
Federico Di Pierro 5e2925bc95 update(cmake): bumped cpp-httplib dep to v0.23.1 (latest release).
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-07-22 14:32:28 +02:00
Leonardo Di Giovanna ca291b0eaf update(userspace/engine): update falco engine version and checksum
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2025-07-22 14:30:29 +02:00
poiana 4deb2bdf31 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-22 11:40:29 +02:00
Leonardo Di Giovanna 8956279d47 build: fix `debian:buster` apt debian repo URL in driver-loader-buster
As buster reached its EOL, the official debian repo URL doesn't
host anymore buster packages info. For this reason, change the URLs
to point to the `20250630T203427Z` snapshot, which still contains
them.

Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2025-07-18 12:02:10 +02:00
poiana 0c12b44bc6 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-02 17:22:29 +02:00
Leonardo Di Giovanna 33e6e1ef61 update(CHANGELOG.md): release 0.41.3
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2025-07-02 16:29:30 +02:00
dependabot[bot] 25be186548 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `4d51b18` to `1208816`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](4d51b1813f...120881647a)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-02 12:22:28 +02:00
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 b2c76769cf fix(userspace/falco): enforce filtercheck overlap check for static fields too against plugin fields.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
2025-06-30 14:25:18 +02:00
Federico Di Pierro 07266e1247 new(userspace/falco): append static filterchecks with static fields.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-06-30 14:25:18 +02:00
Federico Di Pierro 8d8ba5ba5c new(userspace/falco): add new `static_fields` config key + update schema.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-06-30 14:25:18 +02:00
Leonardo Di Giovanna 2ed1f0ffec docs(RELEASE.md): remove some unneeded old activities
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2025-06-18 15:38:05 +02:00
Leonardo Di Giovanna f146204623 docs(RELEASE.md): fix `falcosecurity/community` repo link
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2025-06-18 15:38:05 +02:00
Leonardo Di Giovanna 56bf4933e7 docs(RELEASE.md): fix `rn2md` command documentation
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2025-06-18 15:38:05 +02:00
Leonardo Di Giovanna d4e69e8c5a docs(RELEASE.md): fix release note checking procedure documentation
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2025-06-18 15:38:05 +02:00
poiana a9386b37f2 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-17 16:22:45 +02:00
Leonardo Di Giovanna 25daddbf29 update(CHANGELOG.md): release 0.41.2
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2025-06-17 15:39:45 +02:00
Leonardo Grasso 720d3e61f2 chore(falco.yaml): clean up plugins config leftover
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2025-06-13 10:35:16 +02:00
Melissa Kilby d55be4b29f doc(OWNERS): move incertum (Melissa Kilby) to emeritus_approvers
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2025-06-13 09:48:17 +02:00
dependabot[bot] 3d38e130fc chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `b4437c4` to `4d51b18`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](b4437c492f...4d51b1813f)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-12 09:45:10 +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
poiana 43cd120030 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-09 12:19:53 +02:00
Denis Romanenko 5b1c6886e5 Fix alpine build
Signed-off-by: Denis Romanenko <denis.romanenko@flant.com>
2025-06-09 12:18:54 +02:00
Federico Di Pierro f3b4f68ecd update(docs): bump CHANGELOG.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-06-05 14:48:30 +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
FedeDP 0eb0b40c45 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-03 11:12:11 +02:00
Federico Di Pierro 9055811d79 fix(userspace/falco): when collecting metrics for stats_writer, create a `libs_metrics_collector` for each source.
In case multiple sources are enabled, each source has its own `libs_metrics_collector`
with correct flags, so that it can retrieve all metrics.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-06-02 10:42:59 +02:00
Federico Di Pierro 2346a397f7 chore(userspace/falco): fix build for non linux minimal builds.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-05-30 19:05:38 +02:00
Federico Di Pierro 24f92dfdbc fix(userspace/falco): only enable prometheus metrics once all inspectors have been opened.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-05-30 19:05:38 +02:00
Federico Di Pierro 1d51203c29 update(docs): bumped changelog for release.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-05-29 11:12:24 +02:00
Federico Di Pierro a7433e032b chore(userspace/falco): make re2 patterns statically lived.
Moreover, rename `falco_metrics::` methods to better expose
they return prometheus metrics.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Samuel Gaist <samuel.gaist@idiap.ch>
2025-05-28 09:47:16 +02:00
Federico Di Pierro bac052f5d2 cleanup(userspace/falco): only push metrics for enabled sources.
Refactor `::to_text` a bit to be more clear.
Also, we will push agent_info and machine_info only for the first
inspector that exposes them, to avoid duplicated entries in the prometheus text.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-05-28 09:47:16 +02:00
Melissa Kilby 0ffe864e42 fix(metrics/prometheus): non-duplicate evt_source retrieval
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2025-05-28 09:47:16 +02:00
Melissa Kilby 4ef697b2c6 cleanup(metrics/prometheus): add detailed logic explanation wrt inspector loop
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2025-05-28 09:47:16 +02:00
Melissa Kilby b90f3cc18e update(metrics/prometheus): place syscalls inspector (if applicable) at index 0 of loop
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2025-05-28 09:47:16 +02:00
Melissa Kilby 4c12c2b1b5 fix(metrics/prometheus): gracefully handle multiple event sources, avoid erroneous duplicate metrics
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2025-05-28 09:47:16 +02:00
Luca Guerra 8f86f20d17 chore(build): update falcoctl, rules for artifact follow
Signed-off-by: Luca Guerra <luca@guerra.sh>
2025-05-27 16:53:12 +02:00
dependabot[bot] 70b0167f76 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `cb17833` to `b4437c4`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](cb17833316...b4437c492f)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-27 08:51:10 +02:00
Federico Di Pierro 38cb34edc6 update(cmake): bumped falcoctl to 0.11.1 and rules to 4.0.0.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-05-26 18:50:06 +02:00
Luca Guerra 8a10bd52e6 update(containers): add labels
Signed-off-by: Luca Guerra <luca@guerra.sh>
2025-05-26 13:16:04 +02:00
Federico Di Pierro 8c703602c1 chore(userspace/falco): initialize `m_falco_reload_ts` to 0.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2025-05-26 13:00:05 +02:00
Melissa Kilby faee56fc1a cleanup: apply minor code pilot suggestions
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2025-05-26 13:00:05 +02:00
Melissa Kilby c4dcf9e4e8 cleanup(configs): move runtime generated configs to section w/ clear comments
Co-authored-by: Samuel Gaist <samuel.gaist@idiap.ch>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2025-05-26 13:00:05 +02:00
Melissa Kilby 309ccf65d3 cleanup(metrics): simplify logic around immediate metrics logging after start/reload
* For consistency don't make first run metrics log special
* Remove firt tick variable altogether to enable metrics logging immediately after startup/reload

Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2025-05-26 13:00:05 +02:00
Melissa Kilby 22d40e2a65 clenaup(metrics): rename new restart_ts to reload_ts to reflect hot relaod conditions
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2025-05-26 13:00:05 +02:00
Melissa Kilby c86a45e2ca update(metrics): introduce restart ts metric to statistically inspect restart/hot_reload conditions
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2025-05-26 13:00:05 +02:00
Melissa Kilby 7b8fdd8f97 update(metrics): introduce immediate initial metrics msg (output_rule or output_file) upon start/restart/hot_reload
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2025-05-26 13:00:05 +02:00
dependabot[bot] 2250c0135b chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `4ccf111` to `cb17833`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](4ccf111c36...cb17833316)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-26 10:09:25 +02:00
Leonardo Grasso 917a477ec2 update(cmake/rules): bump to falco-rules-4.0.0-rc1
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2025-05-20 19:05:29 +02:00
Federico Di Pierro 831e804473 cleanup(userspace/falco): drop unused `libs_metrics_collector` variable.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-05-20 17:34:29 +02:00
poiana 145036e923 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-19 11:06:01 +02:00
Federico Di Pierro 4074148435 fix(build): fixed container custom_target `sed` command.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-05-15 18:27:41 +02:00
dependabot[bot] 1728a5febc chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `ae6ed41` to `4ccf111`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](ae6ed41a7a...4ccf111c36)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-15 18:22:42 +02:00
Tero Kauppinen 1533734fc4 There is an issue in building the bundled c-ares on certain
distributions such as SLES. The cmake file for c-ares sets
'CARES_LIB' destination directory to '${CARES_SRC}/lib' but when the
bundled c-ares is compiled it produces a binary which is placed in
the '${CARES_SRC}/lib64' directory.

This is due to the fact that the bundled c-ares expands
${CMAKE_INSTALL_LIBDIR} to 'lib64' and not to 'lib' which is
expected by 'CARES_LIB'.

The fix is to enforce the building process of the bundled c-ares
to place the produced binary in 'lib'.

Signed-off-by: Tero Kauppinen <tero.kauppinen@est.tech>
2025-05-15 14:36:40 +02:00
dependabot[bot] f6c624a4e0 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `1d2c6b1` to `ae6ed41`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](1d2c6b1f0b...ae6ed41a7a)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-14 09:26:34 +02:00
Federico Di Pierro 50bc0037e5 Revert "chore(deps): Bump submodules/falcosecurity-rules"
This reverts commit 99b7215439.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-05-13 16:18:30 +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
poiana f4f7ccf777 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-12 12:01:22 +02:00
Luca Guerra ae28be023e cleanup(engine): update docs for rule_files and -r option
Signed-off-by: Luca Guerra <luca@guerra.sh>
2025-05-12 10:58: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
Luca Guerra 910788850a cleanup(engine): only consider .yaml/.yml rule files
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
FedeDP 06c4133b90 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-06 15:03:44 +02:00
Kunal Singh 61d9383e8f using vet github url
Signed-off-by: Kunal Singh <kunalsin9h@gmail.com>
2025-05-06 15:02:45 +02:00
Kunal Singh 60d6368c08 Added SafeDep as Adopter.
Signed-off-by: Kunal Singh <kunalsin9h@gmail.com>
2025-05-06 15:02:45 +02:00
Federico Di Pierro ff288f70b3 chore(userspace/falco): rework a bit `-p` cli option help message.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-05-06 10:06:43 +02:00
Federico Di Pierro fb292e6fbb fix(unit_tests): fixed extra format unit tests.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-05-06 10:06:43 +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 0326210f49 cleanup(userspace/falco): deprecate `-p` option.
Also, `-pc` and `-pk` won't do anything now.

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
poiana 7badc31cb1 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-05 12:02:39 +02:00
FedeDP 11c7e23569 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-30 10:05:09 +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
benierc 835ac52f4f Update userspace/falco/config_json_schema.h
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: benierc <clement.benier@iot.bzh>
2025-04-29 11:52:05 +02:00
benierc 543734af3c Apply suggestions from code review
Co-authored-by: Samuel Gaist <samuel.gaist@idiap.ch>
Signed-off-by: benierc <clement.benier@iot.bzh>
2025-04-29 11:52:05 +02:00
Clément Bénier 186614dff4 fix(userspace/falco): fix outputs_http timeout
libcurl timeout prevent to send alert through http
keep trying to send the alert

Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
2025-04-29 11:52:05 +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
poiana 04c1a11136 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-29 09:48:03 +02:00
Federico Di Pierro 68465f6f2e fix(ci): use clang-19 to build modern_ebpf skeleton.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-04-23 16:36:26 +02:00
FedeDP 18f99582da update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-15 17:06:41 +02:00
Federico Di Pierro e8a6f72bc9 chore(ci): install systemd rpm macros from centos9.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-04-14 11:28:32 +02:00
poiana db178840d6 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-14 11:28:32 +02:00
Federico Di Pierro 7c3c8eccc4 fix(ci): properly install rpm `systemd-rpm-macro` package on building packages pipeline.
Refs #3503: we need it because rpm pre/post install/remove scripts
are evaluated at rpm package building time.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-04-11 10:49:11 +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 d15cf450fc fix(build): compatibility with newer compilers
Signed-off-by: Luca Guerra <luca@guerra.sh>
2025-04-08 16:22:51 +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
poiana ca80e69baa update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-08 16:21:52 +02:00
poiana d8c6af821d update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-01 12:27:06 +02:00
Federico Di Pierro 258d13a472 fix(build): properly configure a binary_dir falco.yaml.
It automatically enables container plugin from the binary_dir located one.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-03-25 11:08:22 +01:00
poiana 6811ce6153 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-03-25 11:08:22 +01:00
Leonardo Grasso 283c645ea6 docs(README.md): cleanups and enhancements
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2025-03-19 16:49:21 +01:00
FedeDP d4c211d492 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-03-18 14:24:15 +01:00
Federico Di Pierro e300109624 update(cmake): bump libs and driver to latest libs master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-03-17 13:20:09 +01:00
Federico Di Pierro 0cc18d7617 chore(falco.yaml): improve statement clarity
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Samuel Gaist <samuel.gaist@idiap.ch>
2025-03-17 13:20:09 +01:00
Federico Di Pierro 8843a9ec2b chore(userspace/falco,falco.yaml): enable libs_logger with info severity by default.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-03-17 13:20:09 +01:00
Federico Di Pierro 7db05e5828 cleanup(falco.yaml): drop `verbosity` from container plugin init config.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-03-17 13:20:09 +01:00
dependabot[bot] 99b7215439 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `1d2c6b1` to `371e431`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](1d2c6b1f0b...371e43167e)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-12 14:52:43 +01:00
Federico Di Pierro c67fadc92b chore(cmake): honor CMAKE_BUILD_TYPE when building cares.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-03-12 11:41:41 +01:00
FedeDP 028dd4c155 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-03-12 11:41:41 +01:00
Federico Di Pierro 9c84745cde fix(cmake): use `CONTAINER_LIBRARY` variable instead of custom path.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-27 14:50:32 +01:00
FedeDP 3366f1b40e update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-27 14:50:32 +01:00
Federico Di Pierro 9cbfdda21f fix(userspace/falco): when counting `-M` timeout, make sure that time diff is > 0.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-26 22:08:28 +01:00
Federico Di Pierro 79bed43862 cleanup(ci): drop test-packages static jobs.
Container plugin cannot be dynamically loaded on musl build, therefore
some falcosecurity/testing tests are failing on it.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-26 13:08:26 +01: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 2752e0d60f chore(ci): cleanup unused fields.
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 bb13702f0f chore(userspace/falco): drop `container_engines` config key.
Also, default falco.yaml will only host container plugin configuration but won't enable the plugin.
Instead, a configuration override file will be installed only on linux non-musl deployments, enabled the plugin.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-26 13:08:26 +01:00
Federico Di Pierro fafeddaf35 chore(userspace,unit_tests): include thread.h where needed.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-26 13:08:26 +01:00
Federico Di Pierro 1fd8a85b95 fix(userspace/falco): fixed bundled deps build.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-26 13:08:26 +01:00
Federico Di Pierro a79b3b122c chore(build): install container plugin as part of Falco install target.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-26 13:08:26 +01:00
Federico Di Pierro 66cd160f1d new(cmake,userspace): port Falco to use new container plugin.
It will be shipped by default hence it is present in default config.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-26 13:08:26 +01:00
dependabot[bot] 0b8979afec chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `d8415c1` to `1d2c6b1`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](d8415c1bc1...1d2c6b1f0b)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-26 11:01:26 +01:00
Leonardo Grasso 542960df6e docs(proposals): correct typo in example
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2025-02-19 15:20:44 +01:00
Federico Di Pierro ad99ab514f fix(unit_tests): fixed unit tests after CLI options drop.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-19 14:24:43 +01:00
Federico Di Pierro 4c34457fa3 cleanup(userspace/falco): drop deprecated in 0.40.0 CLI flags.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-19 14:24:43 +01:00
Federico Di Pierro ef5b45c05a chore(unit_tests): update Configuration.configuration_config_files_cmdline test to avoid future issues.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-13 13:21:10 +01:00
Federico Di Pierro 252eb5cd40 fix(userspace/falco): init cmdline options after loading all config files.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-13 13:21:10 +01:00
Federico Di Pierro 7c8bdf0c9e fix(docker): fixed entrypoints paths with new docker context.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-13 10:04:09 +01:00
Federico Di Pierro cd81c52dde chore(docker,scripts): moved scripts/falco to config/ folder.
Updated dockerignore to point to whole config folder.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-12 18:13:06 +01:00
Federico Di Pierro a5a55fb101 chore(build): add a dockerignore file to ignore everything but docker and scripts/falco folders.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Samuel Gaist <samuel.gaist@idiap.ch>
2025-02-12 18:13:06 +01:00
Federico Di Pierro 050431425f cleanup(scripts): drop unmaintained and useless script.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-12 18:13:06 +01:00
Federico Di Pierro 3d70a2cbd0 new(docker,scripts,ci): use an override config file to enable ISO 8601 output timeformat on docker images.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-12 18:13:06 +01:00
Nguyen Marc c4081d7a6f fix(cmake): add support for 16K kernel page to jemalloc
Signed-off-by: Nguyen Marc <nguyen_marc@live.fr>
2025-02-11 15:40:59 +01:00
Leonardo Di Giovanna 9e2c22804c refactor(falco/app): apply early return pattern in actions code
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2025-02-10 18:20:53 +01:00
dependabot[bot] 31c94df10e chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `abf6637` to `d8415c1`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](abf6637e0a...d8415c1bc1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-10 18:18:54 +01:00
Leonardo Di Giovanna a8db99db5b feat(falco/app): move actions not using config before `load_config`
Move actions not requiring config to be loaded before `load_config`
action. This avoid resource waste. Notably, `print_help` is
promoted as first execution action. Moreover, set actions lists to
constant expressions.

Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2025-02-10 10:44:52 +01:00
Daniel Bodky ca0a2a34cf Add NETWAYS Web Services to ADOPTERS.md
Signed-off-by: Daniel Bodky <daniel.bodky@netways.de>
2025-02-07 13:13:39 +01:00
Federico Di Pierro 14a8ee0b08 fix(userspace/falco): fix jemalloc enabled in minimal build.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-06 13:30:36 +01:00
Federico Di Pierro 8ea272e7ed chore: add back Falco static package to the release template.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-01-29 10:01:37 +01:00
Federico Di Pierro c804f6b3a4 chore(docs): updated changelog.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-01-28 15:52:34 +01:00
Aldo Lacuku 867a465e6e update(cmake): bump falcoctl to v0.11.0
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2025-01-27 13:24:32 +01:00
Aldo Lacuku 43d3e15398 chore(falco.yaml): remove comments about cri cli arguments
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2025-01-21 12:14:59 +01:00
Federico Di Pierro aba535b76f fix(ci): fixed reusable_build/publish_docker workflows.
`upload-artifact` action since v4 does not allow to upload same artifact name multiple times.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-01-21 11:37:59 +01:00
poiana 0077a4bcb5 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-01-20 10:15:48 +01:00
zayaanshahm 77b83557ea fix(userspace/falco): use container_engines.cri.sockets in load_yaml
Signed-off-by: Zayaan Moez <zayaanmoez@outlook.com>
2025-01-17 17:07:34 +01:00
Federico Di Pierro c9e7047d1f chore(ci): enable test-drivers for arm64 too.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-01-17 10:01:32 +01:00
Federico Di Pierro ed4f330a2c chore(ci:) switch to github provided arm runners.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-01-17 10:01:32 +01:00
Federico Di Pierro b66814fdd0 chore(ci): bumped actions/upload-download-artifact.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-01-17 10:01:32 +01:00
Federico Di Pierro 437ec7633c fix(ci): fixed Falco release debug symbols names.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-01-16 16:20:27 +01:00
Federico Di Pierro 5664e8715c chore(ci): build Falco in RelWithDebInfo, and upload Falco debug symbols as github artifacts.
Then, upload these artifacts as release assets.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-01-16 16:20:27 +01:00
Leonardo Grasso 3aa3039149 chore(docker): drop unused libelf dep from container images
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2025-01-16 10:41:27 +01:00
Federico Di Pierro 7339363d1a update: update falco.yaml
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-01-16 10:33:27 +01:00
Federico Di Pierro 5977f708bd chore: update plugins_hostinfo description with a link to the chart template.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-01-16 10:33:27 +01:00
Federico Di Pierro 9f9199bd69 chore(docs): update `plugins_hostinfo` config file comment.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-01-16 10:33:27 +01:00
Shane Lawrence f23e44fcab Add TODO comment for win32.
Signed-off-by: Shane Lawrence <shane@lawrence.dev>
2025-01-16 10:05:56 +01:00
Shane Lawrence 6bf33ffd76 Add RelWithDebInfo target to produce release binary with separate debug symbols file.
Signed-off-by: Shane Lawrence <shane@lawrence.dev>
2025-01-16 10:05:56 +01:00
John Thiltges 6235e05919 update(build): relax dkms requirements to suggestions
Running in modern_ebpf mode does not require kernel build dependencies

Signed-off-by: John Thiltges <jthiltges2@unl.edu>
2025-01-16 10:04:56 +01:00
dependabot[bot] ec9954d62d chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `283a62f` to `abf6637`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](283a62f464...abf6637e0a)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-16 09:29:55 +01:00
Luca Guerra 1e455f30a6 update(ci): use 4cpu-16gb runners
Signed-off-by: Luca Guerra <luca@guerra.sh>
2025-01-16 09:27:55 +01:00
Federico Di Pierro 0bdc5909ee chore(ci): use another arm64 runner to enable back arm64 jobs.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-01-15 14:49:50 +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 Di Pierro 913e1b91ef chore(unit_tests/falco): fix test.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-01-15 14:49:50 +01:00
FedeDP d44e17bb60 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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
Federico Di Pierro 3277d6e00b chore(ci): enable jemalloc in musl build.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-12-20 13:17:54 +01:00
Shane Lawrence d88d6685f8 Fix accidental whitespace.
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Shane Lawrence <shane@lawrence.dev>
2024-12-19 18:25:50 +01:00
Shane Lawrence 06818263b6 Check if path exists before linking.
Signed-off-by: Shane Lawrence <shane@lawrence.dev>
2024-12-19 18:25:50 +01:00
Luca Guerra 02f3db9835 cleanup(build): remove libelf dependency
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-12-19 10:31:48 +01:00
Luca Guerra 1239566467 fix(falco): prevent use-after-return in webserver
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-12-19 10:31:48 +01:00
Luca Guerra 129087a08b fix(ci): consolidate sanitizers/not sanitizers jobs
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-12-19 10:31:48 +01:00
Luca Guerra 3bc27afc14 fix(ci): use ubuntu 22.04 to build wasm due to a regression (undefined _main)
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-12-19 10:31:48 +01:00
Luca Guerra f2a983298e fix(build): remove zlib requirement from cpp-httplib
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-12-19 10:31:48 +01:00
Luca Guerra 42de47a488 fix(ci): upgrade bpftool for static build
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-12-19 10:31:48 +01:00
Luca Guerra 092b54cab6 update(build): link (BSD) libelf statically by default
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-12-19 10:31:48 +01:00
Luca Guerra e652d7fc85 Revert "update(build): disable musl builds"
This reverts commit 30df5738a5.

Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-12-19 10:31:48 +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
Leonardo Grasso a975e4cbc4 docs(falco.yaml): correct `buffered_outputs` description
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2024-12-16 09:33:32 +01:00
Federico Di Pierro fa862b57e8 update(cmake): bump jemalloc asan warning message
Co-authored-by: Samuel Gaist <samuel.gaist@idiap.ch>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-12-10 15:11:03 +01:00
Federico Di Pierro ac191b746c chore(cmake): add a warning when using both jemalloc and asan.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-12-10 15:11:03 +01:00
Federico Di Pierro 72f4715688 chore(ci): drop jemalloc from ASAN builds.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-12-10 15:11:03 +01:00
Federico Di Pierro 5044f3aa7e fix(cmake): fixed jemalloc from system.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-12-10 15:11:03 +01:00
Federico Di Pierro 1c71777dbd new(cmake,userspace): expose jemalloc stats in stats writer and prometheus metircs.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-12-10 15:11:03 +01:00
Federico Di Pierro d007418fd3 new(cmake,ci): added support for using jemalloc allocator instead of glibc one.
The jemalloc allocator is enabled by default for published packages.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-12-10 15:11:03 +01:00
Federico Di Pierro f8feea63ad fix(userspace/falco): use correct filtercheck_field_info.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-12-06 13:33:46 +01:00
cpanato 257ae9a8c0 add attestation
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-12-05 17:34:41 +01:00
Federico Di Pierro 35d8618373 chore(userspace/falco): add new `suggested_output` option to `append_output` configuration.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-12-05 15:34:40 +01:00
Federico Di Pierro 70ee5f4107 chore(userspace): update config schema.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-12-05 15:34:40 +01:00
Federico Di Pierro 114757d215 new(userspace,cmake): honor new plugins exposed suggested output formats.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-12-05 15:34:40 +01:00
Federico Di Pierro 9b35c0d5e0 update(userspace/falco): use ternary operator
Co-authored-by: Samuel Gaist <samuel.gaist@idiap.ch>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-12-05 10:15:39 +01:00
Federico Di Pierro 211eea6abb new(userspace/falco): allow entirely disabling plugin hostinfo support.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-12-05 10:15:39 +01:00
FedeDP 9f29444b17 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-12-03 10:01:26 +01:00
Thomas Labarussias 242f25ae25 fix: update the url for the docs about the concurrent queue classes
Signed-off-by: Thomas Labarussias <issif+github@gadz.org>
2024-11-26 18:29:48 +01:00
Federico Di Pierro ee4c9f9d4b update(changelog): updated changelog for 0.39.2.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-11-21 18:03:22 +01:00
poiana 563291f8d8 update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-21 11:03:21 +01:00
Federico Di Pierro 4efbd44354 update(cmake): bumped falcoctl to v0.10.1.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-11-21 09:56:21 +01:00
Federico Di Pierro 0a8526dd7b fix(cmake,docker): avoid cpp-httplib requiring brotli.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-11-07 08:58:23 +01:00
Luca Guerra edf36c0724 fix(docker): add brotli to the Falco image
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-11-06 16:10:18 +01:00
Leonardo Grasso 3fa8bc9bc7 fix(docker/falco-debian): usage label
Co-authored-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2024-11-05 17:38:11 +01:00
Leonardo Grasso a212262194 docs(docker): update images description
Co-authored-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2024-11-05 17:38:11 +01:00
Leonardo Grasso cfaf260b08 update(docker): no CMD for falco-driver-loader images
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2024-11-05 17:38:11 +01:00
Federico Di Pierro f4dd0b9c07 fix(docker): fix docker-compose with correct image name for Falco.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-11-05 17:38:11 +01:00
Federico Di Pierro c44d323b4b chore(ci,docker): more fixes.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2024-11-05 17:38:11 +01:00
Federico Di Pierro 57446c38f7 chore(docker): apply some review suggestions.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2024-11-05 17:38:11 +01:00
Federico Di Pierro 77695ace72 fix(docker): fixed small issues in the new images.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-11-05 17:38:11 +01:00
Federico Di Pierro 01ab1661c0 cleanup(ci): drop `-slim` tag.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-11-05 17:38:11 +01:00
Federico Di Pierro 58930ea8c0 new(ci,docker): renamed driver-loader-legacy to driver-loader-buster.
Moreover, ported docker images CI to new images.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-11-05 17:38:11 +01:00
Federico Di Pierro 56c061f37a chore(docker): updated README.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-11-05 17:38:11 +01:00
Federico Di Pierro 1307061554 new(docker): initial work towards new docker images.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-11-05 17:38:11 +01:00
Luca Guerra e4107c05a4 update(ci): replace aarch64 actuated runners with oracle
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-11-05 10:59:09 +01:00
Federico Di Pierro 729bf9562b update(cmake): bump yaml-cpp to latest master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-11-05 09:29:09 +01:00
dependabot[bot] b50903e498 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `407e997` to `283a62f`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](407e99721f...283a62f464)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-24 10:11:12 +02:00
Mark Stemm 09a9fd4c26 Add tests for mismatched sources and append
Add additional unit tests to verify that rule loading fails when a
second rules object has a different source but the name of an existing
rules object.

Also add tests for additional rules having an empty source.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-10-24 08:45:12 +02: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 24f824dfb5 update(cmake): bump libs to latest master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-10-22 14:59:04 +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
poiana 5749517c4e update(cmake): update libs and driver to latest master.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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
Federico Di Pierro c19b637e36 fix(ci): fixed shasum computation for bump-libs CI.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-10-15 16:16:37 +02:00
Luca Guerra fb01b6d927 cleanup(falco): deprecate -b --print-base64
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-10-10 17:37:18 +02:00
Luca Guerra 4501b64b9d new(falco): add buffer_format_base64
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-10-10 17:37:18 +02:00
dependabot[bot] e04deeabe5 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `e38fb3f` to `407e997`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](e38fb3f6a7...407e99721f)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-10 10:35:17 +02:00
Luca Guerra dfa6b9b88e chore(falco): deprecated -A
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-10-10 10:26:16 +02:00
Luca Guerra 3b28450171 new(falco): add base_syscalls.all option to falco.yaml
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-10-10 10:26:16 +02:00
Federico Di Pierro b242f90510 chore(ci): use redhat advised method to check rpmsign success.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-10-10 10:17:17 +02:00
Mark Stemm 80b7de6d90 Add a test for compile_output::clone() for derived type
Add a test for checking that compile_output::clone() returns equal
values, specifically in the case of derived values.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-10-10 09:20:17 +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
Federico Di Pierro 3e24606c11 new(ci): use `zig` compiler instead of relying on centos7.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-10-09 16:26:14 +02:00
Federico Di Pierro 93e5292f2f update(changelog): updated changelog for 0.39.1.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-10-09 10:54:14 +02:00
Luca Guerra a754601cb6 update(tests): add tests for plugin init_config
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-10-08 12:06:08 +02:00
Luca Guerra 6721a6b9cf fix(engine): allow null init_config for plugin info
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-10-08 12:06:08 +02:00
Federico Di Pierro 7b2feb1f73 fix(ci): fixed bump-libs workflow syntax.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-10-07 17:49:04 +02:00
Luca Guerra c7c0246ca8 fix(engine): disable comma separated vectors in cxxopts
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-10-07 13:24:04 +02:00
Federico Di Pierro 5141bddedd new(ci): add a workflow to automatically bump libs on each monday.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-10-07 11:35:03 +02:00
Luca Guerra 478514940f update(falco): deprecated -S --snaplen option
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-10-07 11:33:03 +02:00
Luca Guerra ef79648037 new(falco): add falco_libs.snaplen option
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-10-07 11:33:03 +02:00
Federico Di Pierro f72e6a59ad fix(userspace/falco): fix event set selection for plugin with parsing capability.
In live mode we need to use the source_info inspectors instead of the offline inspector.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-10-07 09:56:02 +02:00
dependabot[bot] 257938291d chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `b6ad373` to `e38fb3f`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](b6ad373719...e38fb3f6a7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-03 10:22:43 +02:00
Federico Di Pierro 41f20fd07a cleanup(userspac/falco): drop deprecated options.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-10-02 14:49:40 +02:00
Aldo Lacuku 6997c96306 update(changelog): add changelog for falco 0.39.0
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2024-10-01 12:00:35 +02:00
Luca Guerra 17e61450db cleanup(falco): reformat options::define
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-30 17:50:32 +02:00
Luca Guerra 683df327ac fix(falco): allow disable_cri_async from both CLI and config
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-30 15:33:32 +02:00
Luca Guerra 262aa9a003 cleanup(falco): ignore lint commit
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-30 13:59:32 +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
Andrea Terzolo 11bac9dbd2 update: ignore_some_files
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-09-30 11:10:32 +02:00
Luca Guerra c235f5b576 chore(build): update libs to 0.18.1 (master branch)
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-27 12:25:21 +02:00
Leonardo Di Giovanna 3a6d1c8c5d feat(stats): add host_netinfo networking information stats family
Introduce host_netinfo stats family to hold information regarding host
networking. At the moment, it only provides ipv4 and ipv6 addresses
list for each interface available on the host. The naming schema for
the introduced stats is
falco.host_netinfo.interfaces.<ifname>.protocols.<ipv4|ipv6>.addresses.

Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2024-09-26 15:50:16 +02:00
Luca Guerra 70c10ee7e0 fix(engine): sync outputs before printing stats at shutdown
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-23 16:58:01 +02:00
Leonardo Di Giovanna d3a67c10bd cleanup(falco_metrics): remove unused falco_utils import
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2024-09-23 15:38:01 +02:00
Leonardo Di Giovanna 5ba94a36bd fix(falco_metrics): remove ifinfo_json stat/metric
Using JSON as value prevents any meaningful aggregation for the stats.
Splitting these information into multiple labels can drastically
increase the number of dimensions, as the number of interfaces and
addresses can be high in some environment. Moreover, these information
are not currently refreshed, even if they can frequently change. Given
these reasons, remove ifinfo_json from stats and metrics.

Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2024-09-23 15:38:01 +02:00
Leonardo Di Giovanna 00b35cfd81 fix(falco_metrics)!: use full name for configs and rules files
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2024-09-23 15:38:01 +02:00
Leonardo Di Giovanna d77f768692 fix(falco_metrics)!: split tags label into multiple tag_ labels
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2024-09-23 15:38:01 +02:00
Luca Guerra 50f4bc172d update(tests): add test for plugin init_config map
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-20 09:55:49 +02:00
Luca Guerra 1a4a29348f fix(falco): allow plugin init_config map in json schema
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-20 09:55:49 +02:00
Federico Di Pierro 78f56190b4 fix(userspace/falco): properly account for plugin with CAP_PARSING when computing interesting sc set.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-19 17:40:48 +02:00
Leonardo Di Giovanna d66c4ceb23 update(systemd): add falco.service alias to all systemd units
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
2024-09-18 15:44:53 +02:00
Federico Di Pierro ad13cb6014 update(cmake): bump libs to 0.18.0 and driver to 7.3.0+driver.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-18 10:28:52 +02:00
Federico Di Pierro 6f1a741c7e chore(userspace/falco): deprecate `cri` related CLI options.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-18 09:35:52 +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
Federico Di Pierro 6b634df56e update(cmake): bump libs and driver to 0.18.0-rc2.
Moreover, bumped falcoctl to v0.10.0 and rules to 3.2.0.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-16 16:04:48 +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 ed4fb33981 cleanup(falco): use header file for json schema
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-16 09:59:46 +02:00
Luca Guerra cd0d607f14 update(falco): add warning if the append condition does not appear to make sense
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-13 15:58:36 +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 a2336f186e update(falco): update json schema
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 d3c6a7478e update(falco_metrics): change prometheus rules metric naming
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-09-13 11:25:36 +02:00
Federico Di Pierro d1644079e9 chore(userspace/falco): updated configuration schema.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-12 15:26:33 +02:00
Melissa Kilby 9089262569 update(falco_metrics): add kernel_event_counters_per_cpu_enabled config
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-09-12 15:26:33 +02:00
Melissa Kilby 2ceb6ecf0f update(Falco_metrics): fix prom subsystem for some scap vs falco metrics
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-09-12 15:26:33 +02:00
Melissa Kilby 2badce1714 update(falco_metrics): adjust sha256 prometheus name, remove double falco_
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-09-12 15:26:33 +02:00
Melissa Kilby 4f35b3e4e2 update(falco_metrics): apply reviewers suggestions
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-09-12 15:26:33 +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
Andrea Terzolo 55069c8a0a chore: scaffolding for enabling code formatting
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-09-11 19:03:31 +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 c8361efea7 chore(userspace/falco): reverted file to master version.
Signed-off-by: Federico Di Pierro <nierro92@gmail.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 895e50d3a0 new(userspace): added json schema validation for rules.
Also, a new `--rule-schema` cli option was added to print the schema and leave.

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
Federico Di Pierro 7f9211d817 update(cmake): bump libs and driver to 0.18.0-rc1.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-11 13:15:31 +02:00
Federico Di Pierro a6f31058c1 fix(ci): restore master and release CI workflow permissions.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-10 12:23:28 +02:00
Aldo Lacuku 0034c3f082 update(cmake): bump falcoctl to v0.10.0-rc1
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2024-09-09 15:52:23 +02:00
Luca Guerra df072dace7 update(libsinsp/tests): add CLI options test for append output
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-09 15:31:24 +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 aeb4126ce2 fix(falco): update json schema
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-09 15:31:24 +02:00
Luca Guerra 8a19f1b135 update(tests): add message for failing configuration schema test
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-09 15:31:24 +02:00
Luca Guerra 3c95c0512d new(falco): add append_output explanation to falco.yaml
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-09 15:31:24 +02:00
Luca Guerra 63784e06ef new(falco): add json schema for append_output
Signed-off-by: Luca Guerra <luca@guerra.sh>
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
Francesco Furlan 00ff9d82ea ci(insecure-api): update semgrep docker image
Signed-off-by: Francesco Furlan <francesco.furlan@sysdig.com>
2024-09-09 15:03:24 +02:00
Federico Di Pierro f3eecb6b21 new(userspace/falco): added `--config-schema` action to print config schema.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-06 09:51:10 +02:00
Federico Di Pierro dabfe0e154 cleanup(userspace/falco): drop deprecated -t,-T,-D options.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-06 09:26:10 +02:00
Luca Guerra 36d6951e77 new(falco): add test for object cli configuration, minor test fix
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-06 09:25:11 +02:00
Luca Guerra 5b6810a51e new(falco): enable -o key={object} configuration
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-06 09:25:11 +02:00
harshitasao 24a70da976 made required changes
Signed-off-by: harshitasao <harshitasao@gmail.com>
2024-09-04 22:00:06 +02:00
harshitasao 9f180b989a fixed the token-permission and pinned-dependencies issue
Signed-off-by: harshitasao <harshitasao@gmail.com>
2024-09-04 22:00:06 +02:00
Bill Vandenberk 4053c6e1cc Apply suggestions from code review
Formatting and case, adds links

Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Bill Vandenberk <bill@vandenberk.me>
2024-08-30 10:22:41 +02:00
Bill Vandenberk 8030c03334 fix spelling
Signed-off-by: Bill Vandenberk <bill@vandenberk.me>
2024-08-30 10:22:41 +02:00
Bill Vandenberk 32550dad26 add newline to end of config file
Signed-off-by: Bill Vandenberk <bill@vandenberk.me>
2024-08-30 10:22:41 +02:00
Bill Vandenberk c587d8efc7 add missing changes
Signed-off-by: Bill Vandenberk <bill@vandenberk.me>
2024-08-30 10:22:41 +02:00
Bill Vandenberk 123d5ba244 add config file, update readme, config mount, remove command override
Signed-off-by: Bill Vandenberk <bill@vandenberk.me>
2024-08-30 10:22:41 +02:00
Bill Vandenberk 48442be91e adds docker-compose config
Signed-off-by: Bill Vandenberk <bill@vandenberk.me>
2024-08-30 10:22:41 +02:00
Melissa Kilby 8a3cb7608a chore: updat config schema w/ container_engines
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-08-27 12:13:26 +02:00
Melissa Kilby 898e060544 chore: update desc in falco.yaml
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-08-27 12:13:26 +02:00
Melissa Kilby 08d5ac92ad update(engine): move some contaienr engines debug message to init inspector
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-08-27 12:13:26 +02:00
Melissa Kilby e8afcc55cc update(engine): address reviewers comments wrt container_engines config
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-08-27 12:13:26 +02:00
Melissa Kilby f6ffa75d74 new(config): add container_engines config to falco.yaml
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-08-27 12:13:26 +02:00
Melissa Kilby f8398213ba update(metrics): always refresh ifinfo
Because libs constantly refreshes them, it's fine to re-create the JSON
each time

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-08-27 10:18:26 +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
Fede Barcelona 7a684fdf13 feat(cmake): add conditional builds for falcoctl and rules
There are systems, like Nix derivations where the build process
does not have network access in order to enforce reproducibility.
This patch allows people building Falco to optionally skip the build
of falcoctl with `-DADD_FALCOCTL_DEPENDENCY=OFF` and point to their own
self-backed, or pre-fetched rules files with
`-DFALCOSECURITY_RULES_FALCO_PATH=<some-path>` and
`-DFALCOSECURITY_RULES_LOCAL_PATH=<some-path>`.

For context, I needed to apply these patches while building the
project with Nix in https://github.com/tembleking/falco-nix but I think
that would be benefitial for the community to have also these options
open, and that would also make Falco feasible to be added to the
nixpkgs repository at https://github.com/nixos/nixpkgs

Signed-off-by: Fede Barcelona <fede_rico_94@hotmail.com>
2024-08-27 10:15:26 +02:00
dependabot[bot] 8920701385 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `baecf18` to `b6ad373`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](baecf181ea...b6ad373719)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-26 18:27:25 +02:00
Federico Di Pierro db52442b3f fix(userspace/falco): fixed windows build by enforcing NOMINMAX compile definition.
Also, minified config schema, since the big schema string leads to an MSVC compiler error.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-08-26 18:06:25 +02:00
Federico Di Pierro 3fff994b19 chore(userspace/falco): include numeric header for std::accumulate.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-08-26 18:06:25 +02:00
Federico Di Pierro 05bbe74d69 fix(unit_tests): skip Configuration.schema_validate_config test if Falco config is not present.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-08-26 18:06:25 +02:00
Federico Di Pierro d1c715e7a8 chore(unit_tests,userspace): use nlhomann json instead of jsoncpp.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-08-26 18:06:25 +02:00
Federico Di Pierro be927edfe8 new(userspace/falco,unit_tests): added new tests around schema validation feature.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-08-26 18:06:25 +02:00
Federico Di Pierro 94dc7da986 cleanup(unit_tests,userspace/falco): moved all config validation logic to be more testable.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-08-26 18:06:25 +02:00
Federico Di Pierro 6dfdfdd649 chore(unit_tests): moved config_files and env vars config tests to their own source file.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-08-26 18:06:25 +02:00
Federico Di Pierro c807727475 chore(userspace/falco): use `minProperties` where needed.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-08-26 18:06:25 +02:00
Federico Di Pierro 5c551df116 new(userspace/falco): validate loaded configuration files against config schema.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-08-26 18:06:25 +02:00
Federico Di Pierro 4e45152521 fix(cmake,userspace/falco): bumped libs to latest master.
Also, fixes some newly introduced API breaks.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-08-26 15:51:25 +02:00
Luca Guerra 1886aca8b5 update(falco): update metrics interface
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-08-26 15:51:25 +02:00
Luca Guerra d93c51c929 update(build): update libs to latest master
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-08-26 15:51:25 +02:00
Luca Guerra 784d2d27cb update(cmake): bump libs and drivers to fix compilation issue
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-08-26 15:51:25 +02:00
Jason Dellaluce 6783cc7055 fix(unit_tests): adapt tests to new engine warning formats
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-08-26 15:51:25 +02:00
Jason Dellaluce 4ae942f1c6 update(cmake): bump libs and driver to latest master
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-08-26 15:51:25 +02:00
dependabot[bot] d3191bdf15 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `342b20d` to `baecf18`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](342b20dc7d...baecf181ea)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-20 10:46:43 +02:00
Luca Guerra 6824bdb660 update(docs): update changelog for 0.38.2
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-08-19 16:34:41 +02:00
Bill Vandenberk 1755527ad7 Add Tulip Retail to adopters list
Signed-off-by: Bill Vandenberk <bill@vandenberk.me>
2024-08-08 15:00:54 +02:00
Melissa Kilby 33a0d9c6ab fix(metrics/prometheus): adopt best prometheus practices for rules counters and sha256 file metrics
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-08-05 11:39:40 +02:00
dependabot[bot] 7a9048125f chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `068f0f2` to `342b20d`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](068f0f2dc9...342b20dc7d)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-02 19:55:30 +02:00
dependabot[bot] d12b0ce290 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `28b98b6` to `068f0f2`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](28b98b6f5f...068f0f2dc9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-23 14:03:45 +02:00
Samuel Gaist 0e0428c5f7 vote: request to join maintainers
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-07-08 16:45:35 +02:00
Federico Di Pierro 1f2943da1e chore(ci): add `ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION:true` env to enforce the usage of node16.
Centos:7 does not support node20 (glibc required mismatch).

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-07-08 07:03:33 +02:00
Federico Di Pierro a9f3d98a00 chore(ci): use correct vault repo path for arm64.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-07-08 07:03:33 +02:00
Federico Di Pierro aa42e380e0 fix(ci): use vault.centos.org for centos:7 CI build.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-07-08 07:03:33 +02:00
dependabot[bot] 5283dca335 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `c0a9bf1` to `28b98b6`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](c0a9bf17d5...28b98b6f5f)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-03 11:27:18 +02:00
harshitasao c25ded8f39 made some required changes
Signed-off-by: harshitasao <harshitasao@gmail.com>
2024-07-02 11:16:12 +02:00
harshitasao a9ef7f9f97 added the openssf scorecard badge
Signed-off-by: harshitasao <harshitasao@gmail.com>
2024-07-02 11:16:12 +02:00
dependabot[bot] 62a448f805 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `ea57e78` to `c0a9bf1`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](ea57e78ea1...c0a9bf17d5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-27 14:45:50 +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
Federico Di Pierro c602be596b update(docs): update CHANGELOG for 0.38.1
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-06-26 10:32:44 +02:00
Federico Di Pierro 24eec1e92a update(cmake,userspace): bump libs and driver to latest master.
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
Gianmatteo Palmieri 3e91a27538 new(metrics): enable plugins metrics
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-06-13 16:32:48 +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
Federico Di Pierro 0e4c580c1e update(cmake): bump libs to master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-06-13 13:40:48 +02:00
Luca Guerra b8e5e2e8dd update(engine): allow using -p to pass a format to plugin events
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-06-11 09:19:39 +02:00
dependabot[bot] 1c31390c56 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `df963b6` to `ea57e78`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](df963b6bcd...ea57e78ea1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-11 09:18:40 +02:00
Luca Guerra 8a59cee355 cleanup(falco): clarify that --print variants only affect syscalls
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-06-06 09:46:22 +02:00
Gianmatteo Palmieri 1c66b640f2 Revert "fix(engine): apply output substitutions for all sources"
This reverts commit 4ef7c9553a.

Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-06-05 12:43:19 +02:00
Federico Di Pierro 35395728cc chore(ci): enable dummy tests on the testing framework.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-06-04 10:15:13 +02:00
Melissa Kilby 5777a44ca1 fix(metrics): fix sha256 metric names for prometheus
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-06-04 09:52:13 +02:00
Melissa Kilby 97207d309a fix(metrics): allow each metric output channel to be selected independently
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-06-04 09:52:13 +02:00
dependabot[bot] f43347da45 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `679a50a` to `df963b6`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](679a50aa5c...df963b6bcd)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 17:01:10 +02:00
Federico Di Pierro 6687d50fc2 chore(userspace/falco): more extra safety checks on stats collector too.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-06-03 15:56:14 +02:00
Federico Di Pierro ae71cec507 fix(userspace/falco): fixed `falco_metrics::to_text` implementation when running with plugins.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-06-03 15:56:14 +02:00
Federico Di Pierro ba85afa2ab update(cmake): bump libs and driver to master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-31 11:26:59 +02:00
dependabot[bot] 048b9e3dd0 chore(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `9e56293` to `679a50a`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](9e56293b55...679a50aa5c)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-30 16:36:56 +02:00
Luca Guerra 1ddfde61f5 update(docs): update CHANGELOG for 0.38.0
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-05-30 16:35:56 +02:00
Federico Di Pierro edd93054fd chore(proposals): fix typo.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-28 11:05:46 +02:00
Federico Di Pierro b5316c98bc update(cmake): bump falcoctl to v0.8.0.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-28 11:05:46 +02:00
Luca Guerra 6c66294e72 chore(build): bump rules to 3.1.0
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-05-27 16:29:43 +02:00
dependabot[bot] 9fd26eaa2e ---
updated-dependencies:
- dependency-name: submodules/falcosecurity-rules
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-23 09:51:23 +02:00
Jason Dellaluce cd1c5f911c refactor(userspace): move falco logger under falco engine
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-23 09:29:23 +02:00
Luca Guerra 40765ca77b chore(gha): update cosign
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-05-21 11:41:13 +02:00
dependabot[bot] 1e942129b2 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `29c41c4` to `59bf03b`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](29c41c4eed...59bf03bf74)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-21 11:37:13 +02:00
Federico Di Pierro 0bf7458f3d chore(falco.yaml): `rule` -> `rules`.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-20 16:33:11 +02:00
Federico Di Pierro d553662108 cleanup(falco.yaml): removed useless sentence.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-20 16:33:11 +02:00
Federico Di Pierro a48965a00c chore(userspace,falco.yaml,unit_tests): `configs_files` -> `config_files`.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-20 16:33:11 +02:00
Federico Di Pierro 1b22c4566a chore(falco.yaml): added config maturity to index.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-20 16:33:11 +02:00
Federico Di Pierro c03ce122e7 chore(docs): added falco.yaml section about config keys maturity.
Also, rename `Experimental` -> `Incubating` and move `prometheus_metrics_enabled` to `Incubating`.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-20 16:33:11 +02:00
Melissa Kilby 0668c54485 cleanup(metrics): use sha26_rules (plural form) as naming
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-20 10:25:10 +02:00
Melissa Kilby 27bab30017 cleanup(metrics): add original rule name as label
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-20 10:25:10 +02:00
Federico Di Pierro dfbd1810f9 update(cmake): bumped libs to 0.17.0-rc1 and falcoctl to v0.8.0-rc6.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-17 17:11:58 +02:00
Melissa Kilby b0f352e7b9 cleanup(test): add test cases for sanitize_metric_name
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-17 14:54:58 +02:00
Melissa Kilby c15a309781 clenaup: add sanitize_metric_name helper
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-17 14:54:58 +02:00
Melissa Kilby e9afe24e17 cleanup(metrics): simplify some logic
Co-authored-by: Samuel Gaist <samuel.gaist@idiap.ch>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-17 14:54:58 +02:00
Melissa Kilby aa021537d9 cleanup(metrics): improve comments
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-17 14:54:58 +02:00
Melissa Kilby 0195dba889 cleanup: add getter functions to stats_manager
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-17 14:54:58 +02:00
Melissa Kilby b7adcd251d new(metrics): add rules_counters_enabled option
Intended to replace https://github.com/falcosecurity/falco-exporter
when used with Prometheus output

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-17 14:54:58 +02:00
Jason Dellaluce 64039196ad chore(unit_tests): fix linting issue
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-17 14:38:57 +02:00
Jason Dellaluce ec9f148e0b test(engine): cover case of replaced or appended exceptions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-17 14:38:57 +02:00
Jason Dellaluce e211e97e2a fix(userspace/engine): make sure exception fields are not optional in replace mode
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-17 14:38:57 +02:00
Federico Di Pierro 1bf6a83e31 new(docker): added `zstd` dep.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-17 13:38:57 +02:00
Luca Guerra b5461e11a7 new(ci): sign .tar.gz packages
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-05-17 10:17:56 +02:00
Federico Di Pierro c8072d2640 update(cmake): bumped falcoctl to v0.8.0-rc5.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-16 14:41:54 +02:00
Melissa Kilby 6057c1553e cleanup(engine): print total number of enabled rules
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-16 10:29:53 +02:00
Melissa Kilby 77341cbd2e new(engine): add print_enabled_rules_falco_logger when log_level debug
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-16 10:29:53 +02:00
dependabot[bot] 0869abc65e build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `4f153f5` to `29c41c4`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](4f153f53ae...29c41c4eed)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-16 09:37:53 +02:00
Luca Guerra eb3ee5d2b2 update(falco): add deprecation warning messages
Signed-off-by: Luca Guerra <luca@guerra.sh>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-15 10:33:50 +02:00
Luca Guerra f9a56d9c9d update(falco): add deprecation notice for -T, -t and -D
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-05-15 10:33:50 +02:00
Luca Guerra abf82f6373 update(config): split init_from_content from init_from_file
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-05-14 12:47:46 +02:00
Luca Guerra f6ae8c8470 update(config): experimental->incubating
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-05-14 12:47:46 +02:00
Luca Guerra 02afb39a85 new(engine): add 'rules' section description to falco.yaml
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-05-14 12:47:46 +02:00
Luca Guerra 35bd348e21 new(falco): implement rule selection configuration in falco.yaml
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-05-14 12:47:46 +02:00
Melissa Kilby 60e6798f9b cleanup(metrics): use map for config and rules filenames sha256 tracking
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-14 10:08:51 +02:00
Melissa Kilby 91b58c43f1 chore: fix non linux build metrics
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-14 10:08:51 +02:00
Melissa Kilby 67a5015be7 cleanup(metrics): use filesystem lib to derive file names + build fix
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-14 10:08:51 +02:00
Melissa Kilby 34ecd39113 new(metrics): add file sha256sum metrics for loaded config and rules files
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-14 10:08:51 +02:00
Melissa Kilby 2b80cf85ac new(utils): add new helper to calculate file sha256sum
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-14 10:08:51 +02:00
Federico Di Pierro 44c275dee8 update(cmake): bumped falcoctl to v0.8.0-rc4.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-13 18:32:43 +02:00
Federico Di Pierro cf88a8cdf8 update(cmake): bump falcoctl to v0.8.0-rc3
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-13 18:32:43 +02:00
Federico Di Pierro dd9163c6f4 fix(userspace/falco): fix state inizialization.
This fixes an ugly segfault happening during hot reload.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-09 10:43:58 +02:00
Jason Dellaluce d17f2afe4f update(cmake): bump libs and driver to a8fdacdb
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-08 20:23:55 +02:00
Jason Dellaluce b2e4cddcdf fix(userspace/falco): inizialize options variables
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-08 20:23:55 +02:00
Jason Dellaluce c6e3cfd115 test(engine): cover transformers and field-to-field checks in exceptions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-08 20:23:55 +02:00
Jason Dellaluce f18ea1e8b7 update(userspace/engine): support tranformers in exception fields
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-08 20:23:55 +02:00
Jason Dellaluce fa8e780b07 update(userspace/engine): propagate compiler warnings
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-08 20:23:55 +02:00
Jason Dellaluce bc078f1f63 update(userspace/engine): support comparins with right-hand fields
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-08 20:23:55 +02:00
Jason Dellaluce ed22e94292 refactor(userspace/libsinsp): support new filter ast structure in falco engine
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-08 20:23:55 +02:00
Federico Aponte 62d1c4fc4d refactor: smart pointer usage
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-05-06 11:10:44 +02:00
dependabot[bot] 96c47e5eeb build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `ec255e6` to `4f153f5`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](ec255e68f4...4f153f53ae)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 10:33:44 +02:00
Federico Di Pierro ec0f8077e1 update(cmake): bump libs and driver to latest master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-03 12:12:02 +02:00
Andrea Terzolo 0999d45fbf bump ro rc4
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-05-03 12:12:02 +02:00
Federico Di Pierro 20c394ba34 chore(cmake): bumped libs to 0.16.0-rc2.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-03 12:12:02 +02:00
Andrea Terzolo e2c2b50b3b chore: disable TLS sanitizer
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-05-03 12:12:02 +02:00
Andrea Terzolo db1be96ad9 chore: tmp bump to libs master to test Falco CI
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-05-03 12:12:02 +02:00
Federico Di Pierro 6954a4028e chore(userspace/engine): bump version and checksum.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-03 12:12:02 +02:00
Federico Di Pierro 937637f668 update(cmake): bumped falcoctl to v0.8.0-rc2.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-03 12:12:02 +02:00
Federico Di Pierro 8b477bdc00 update(cmake): bumped libs and driver to latest RCs.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-03 12:12:02 +02:00
Samuel Gaist cbfe77d1a0 fix(falco_metrics): remove falco_ prefix for version
The textual content was fixed but not the metrics name.

Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist 66d1970952 fix(falco_metrics): make duration_sec and outputs_queue_num_drops monotonic
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist 1316b0f448 chore(configuration): add reference to Prometheus endpoint in metrics documentation
The cross reference makes it easier to pair the web server and the
metrics configuration elements.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist 82c914c11d fix(falco_metrics): make duration_sec a count and not a timestamp
The output will thus be a total which is what this metrics is.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist 2ae6103ab6 fix(falco_metrics): remove redundant falco in version metrics
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist 65331c0f20 feat(falco_metrics): add event sources
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist 1ba35c911a feat(falco_metrics): add duration_sec
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist 5ef8f1c311 feat(falco_metrics): add outputs_queue_num_drops
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist f90dbf9b77 refactor(metrics): use prometheus_metrics_enabled for configuration
As agreed upon during review, use this name to get started. If more
backends were to be added, the configuration structure will be updated.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist 5c237a07dc refactor(metrics): make to_text get the application state
As falco may update its state at any time and thus its inspectors objects,
keeping pointers to them may end up in using dangling values.

Therefore, use the state of the application when requesting metrics.

Optimizations such as caching of mostly static values will be done in
a follow up patch.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist a0c109fcff refactor(falco_metrics): put content type in documented constant
This will keep things clearer and also allow for easir update in
the future.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist 9cc44c0eb7 doc(falco_metrics): add basic documentation
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist de7a70ea54 fix(metrics): correct hostname metrics name and namespace
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist 53722a26bf fix(metrics): correct static metrics
Things to fix:
- type
- name
- unit

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist 59c290dc80 fix(metrics): correct metrics namespace
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist daf7efde67 refactor(metrics): move metrics handling to its own class
This will keep the details out of the webserver itself and make
it easier to manage metrics.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist e50d647dc9 refactor(configuration): move webserver items in own struct
This makes things easier to pass around like when starting the
web server.

This has the added benefit of simplifying further extension such as
making the metrics endpoint name configurable without adding yet another
parameter to the start function.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist 968a403cba refactor(webserver): move metrics endpoint activation under webserver
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist cd073a033a fix(webserver): use falcosecurity as metric namespace
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist 4819877b9f fix(webserver): remove extra line return
The converter already provides properly formatted text.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist 3a251beea7 fix(webserver): correct enabled check
It was checking twice for prometheus configuration rather than metrics and then prometheus.

Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Samuel Gaist 8f1b2dc909 feat(webserver): implement metrics endpoint
This endpoint currently returns only prometheus metrics.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Federico Di Pierro 61dab93eb3 chore(ci): fixed BUILD_FALCO_MODERN_BPF usages.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-24 16:49:26 +02:00
Federico Di Pierro cc09811303 chore(cmake): enable modern bpf build by default.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-24 16:49:26 +02:00
Luca Guerra d0945e5db5 cleanup(docs): fix typo in license blocks
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-04-19 16:52:58 +02:00
Federico Di Pierro bdcfbba90b chore(docker,scripts): set old eBPF probe as lowest priority driver.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-18 11:18:54 +02:00
dependabot[bot] b239246ff8 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `869c9a7` to `ec255e6`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](869c9a7f4d...ec255e68f4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-18 09:44:54 +02:00
Luca Guerra 814c510d7e update(app): close inspectors at teardown time
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-04-17 18:39:54 +02:00
Gianmatteo Palmieri eb04b1c66f fix(test): expect warning instead of error on invalid macro/list name
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-04-17 11:27:52 +02:00
Gianmatteo Palmieri dd59c48034 new(engine): raise warning instead of error on invalid macro/list name
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-04-17 11:27:52 +02:00
Federico Di Pierro e21a3a5e58 chore(userspace/falco): make it clear singular vs plural.
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-16 16:39:47 +02:00
Federico Di Pierro 92c1b24905 chore(falco.yaml): small improvements.
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-16 16:39:47 +02:00
Federico Di Pierro a2a8c6c3d4 chore(userspace/falco): deprecate old 'rules_file' config key.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-16 16:39:47 +02:00
Federico Di Pierro 80a99b672f fix(docker): default to `auto` for driver to be configured.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-16 14:44:46 +02:00
Federico Di Pierro fc7a451aed fix(docker): fixed docker entrypoints for driver loading.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-16 14:44:46 +02:00
Federico Di Pierro ac61543276 fix(docker,scripts): do not load falcoctl driver loader when installing Falco deb package in docker image.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-15 17:22:44 +02:00
Federico Di Pierro 7cc57a9fa0 docs(scripts): leave a small comment.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-15 15:13:44 +02:00
Federico Di Pierro cb414f1254 chore(docker): support new automatic driver selection in docker images entrypoints.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-15 15:13:44 +02:00
Federico Di Pierro bb939959a7 update(falco.yaml): set `modern_ebpf` as default engine kind.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-15 15:13:44 +02:00
Federico Di Pierro 2ede48ccfc chore(scripts): updated debian and rpm post installation scripts to deal with new automatic driver selection as default behavior.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-15 15:13:44 +02:00
Federico Di Pierro 53d13f8bfc chore(scripts): dynamically set falcoctl allowed driver types based on cmake configuration.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-15 15:13:44 +02:00
Federico Di Pierro 2eb519380a update(cmake,scripts): bumped falcoctl to v0.8.0-rc1.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-15 15:13:44 +02:00
Gianmatteo Palmieri c3d0579d9b fix(test): expect warning instead of error in exceptions names test
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-04-11 17:22:28 +02:00
Gianmatteo Palmieri 83910be726 new(engine): raise warning instead of error on not-unique exceptions names
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-04-11 17:22:28 +02:00
Luca Guerra 7ac5c36d5a update(ci): build both release and debug versions
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-04-10 16:10:20 +02:00
Federico Di Pierro 8b340d3903 chore(userspace/falco): watch all configs files.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 15:57:20 +02:00
Federico Di Pierro e840a4ada0 new(unit_tests,userspace/falco): support loading and merging configs files when used from cmdline option.
Also, moved core logic from yaml_helper to falco_configuration class.
Finally, updated tests.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro faabd41d9e chore(falco.yaml): add configs_files to falco yaml index.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro a8345327d4 chore(unit_tests,userspace/falco): throw an exception when included config file is not present.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro de9efcbec7 new(userspace/falco): allow `--support` to print expanded configuration file.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro 2a856f2cd3 chore(unit_tests): assert expected length of warnings.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro 74034213a2 chore(unit_test,userspace): better log management.
Also, warnings are now returned so that yaml_helper class does not need to log anything.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro aac9b550d3 new(userspace,unit_tests): return loaded config filenames in config::load_from_file.
Add a debug log with the list of loaded config files.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro df220e3c3b chore(userspace,unit_tests): support loading config files from directories.
The files inside the folder will be loaded in lexicographic order,
like we do for rules_file.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro 5e51828509 chore(build): install a config.d folder under the falco directory.
Also, include it in the config file.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro d3bf3a7560 chore(userspace/falco,unit_tests): renamed `includes` to `configs_files`.
Moreover, split single huge test into multiple smaller ones.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro 1deafee5f7 chore(userspace/falco): print a warn message if `-o includes=` is passed to cmdline.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro 45754fda9f new(userspace,unit_tests): deny main config to include itself.
Moreover, added a couple more tests.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro 8112f6210b chore(userspace,unit_tests): enable override of main config from secondary config files.
Moreover, do not trigger an exception when an included file is not present; just print a warning.
Finally, add more tests.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro 6e1f128851 chore(unit_tests): more tests.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro b3ebf9f57e new(userspace,unit_tests): introduce the possibility to split main config file into multiple config files.
The PR introduces a `includes` keyword in the config file,
that points to a list of strings (paths to other config files).

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Luca Guerra 3cbc4aa29c chore(falco): update falco libs to latest master
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-04-08 17:18:13 +02:00
dependabot[bot] 39cb0a8a67 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `88a40c8` to `869c9a7`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](88a40c8d9c...869c9a7f4d)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-05 19:02:03 +02:00
Gianmatteo Palmieri 7234bc5bee chore(engine): bump engine version
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-04-03 18:23:53 +02:00
Gianmatteo Palmieri 368463e295 new(tests): add unique exceptions names test
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-04-03 18:23:53 +02:00
Gianmatteo Palmieri 05c434ed89 new(engine): enforce unique exceptions names
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-04-03 18:23:53 +02:00
Luca Guerra 05e6e3038c chore(build): update scorecard-action to v2.3.1
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-04-02 16:53:45 +02:00
Luca Guerra b01ef55f6b new(ci): build with sanitizers in CI
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-03-29 14:08:24 +01:00
Luca Guerra f895f8fc78 fix(tests): fix uninitialized variable in test
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-03-29 14:08:24 +01:00
Luca Guerra b82c73c66c new(build): add option to build with ASAN and UBSAN
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-03-29 14:08:24 +01:00
Luca Guerra 1aae10fe84 update(engine): bump engine checksum and version
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-03-29 10:16:23 +01:00
Luca Guerra 0d40a718c8 update(build): bump libs to latest master
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-03-29 10:16:23 +01:00
Luca Guerra 13c8e37a41 cleanup(falco): consolidate falco::grpc::server in one class
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-03-28 10:16:15 +01:00
Gianmatteo Palmieri a8018a2894 new(tests): test override/append exception with no values
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-03-27 09:15:13 +01:00
Gianmatteo Palmieri 7086f35eba new(engine): add warning when appending an exception with no values
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-03-27 09:15:13 +01:00
Gianmatteo Palmieri d1707bef63 fix(engine): apply output substitutions for all sources
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-03-25 19:33:06 +01:00
dependabot[bot] 1882def2a6 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `fbf0a4e` to `88a40c8`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](fbf0a4e8ce...88a40c8d9c)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-25 19:06:06 +01:00
Luca Guerra 8421e4b122 fix(cmake): fix USE_BUNDLED_DEPS=ON and BUILD_FALCO_UNIT_TESTS=ON
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-03-25 16:47:06 +01:00
Paul Rey 12cd72a396 Remove --source-only option in driver loader docker-entrypoint.sh
The option is supported anymore in falcoctl

Signed-off-by: Paul Rey <contact@paulrey.io>
2024-03-22 13:45:53 +01:00
Paul Rey 858c82ffe0 Update driver-loader docker-entrypoint
Remove debug log
Set default option ENABLE_COMPILE and ENABLE_DOWNLOAD

Signed-off-by: Paul Rey <contact@paulrey.io>
2024-03-22 13:45:53 +01:00
Paul Rey 2f6fdfa972 Add kernelversion and kernelrelease options to falco driver loader entrypoint
Signed-off-by: Paul Rey <contact@paulrey.io>
2024-03-22 13:45:53 +01:00
dependabot[bot] 2dfac14cd1 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `44addef` to `fbf0a4e`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](44addef4f7...fbf0a4e8ce)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-15 09:41:27 +01:00
Federico Di Pierro 5fe9fc9d89 update(cmake): bumped libs and driver to 0.15.0-rc1.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-03-14 10:55:24 +01:00
Melissa Kilby 3b7b3439ec cleanup(metrics): fix build for non linux
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-03-14 10:55:24 +01:00
Melissa Kilby 7762d0cd84 chore: bump libs
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-03-14 10:55:24 +01:00
Melissa Kilby 09d813b22d feat(metrics): sync libs metrics collector refactor
Includes a handful of naming changes. A notice to
https://falco.org/docs/metrics/falco-metrics/ will be added well
in advance of Falco 0.38.0

falco.hostname -> evt.hostname to be consistent with the newer evt.hostname filtercheck
cpu_usage_perc_total_host -> host_cpu_usage_perc
memory_used_host -> host_memory_used_kb (or host_memory_used_mb)
procs_running_host -> host_procs_running
open_fds_host -> host_open_fds

memory_rss -> memory_rss_kb (or memory_rss_mb)
memory_pss -> memory_pss_kb (or memory_pss_mb)
memory_vsz -> memory_vsz_kb (or memory_vsz_mb)
container_memory_used -> container_memory_used_bytes (or container_memory_used_mb)

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-03-14 10:55:24 +01:00
Andrea Terzolo 3395e604b6 ci: use ubuntu-22.04 with codeQL job
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-03-12 16:29:17 +01:00
Andrea Terzolo 0ce2b95b89 chore: bump falco engine version
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-03-12 16:29:17 +01:00
Andrea Terzolo c5bb2b68e2 chore: bump to latest libs commit
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-03-12 16:29:17 +01:00
Federico Aponte 8dbec6c779 refactor: Use FetchContent for integrating bundled yaml-cpp lib
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-03-11 13:57:15 +01:00
Federico Aponte c32b7c1246 refactor: Use FetchContent for integrating bundled cpp-httplib
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-03-11 13:57:15 +01:00
Federico Aponte bc499e191d refactor: Use FetchContent for integrating bundled nlohman-json lib
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-03-11 13:57:15 +01:00
dependabot[bot] ea187d3b45 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `dc7970d` to `44addef`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](dc7970d175...44addef4f7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-11 09:38:14 +01:00
Gianmatteo Palmieri 517b79ee13 chore(engine): bump engine version
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-03-08 00:02:01 +01:00
Gianmatteo Palmieri 3d4be156cc new(tests): add unit test for invalid macro/list name
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-03-08 00:02:01 +01:00
Gianmatteo Palmieri 7265190e66 new(engine): don't expose details in error message
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-03-08 00:02:01 +01:00
Gianmatteo Palmieri f00926b8af new(engine): error on invalid macro/list name
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-03-08 00:02:01 +01:00
dependabot[bot] a473ae5eb8 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `f88b991` to `dc7970d`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](f88b991a7f...dc7970d175)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-07 11:39:58 +01:00
Federico Aponte 3954ff233b refactor(ci): Avoid using command make directly
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-03-07 11:37:58 +01:00
Leonardo Grasso a5297c4f29 docs(proposals/20231220-features-adoption-and-deprecation): general revision
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2024-03-06 14:34:55 +01:00
Leonardo Grasso eb35ea7dfe docs(proposals/20231220-features-adoption-and-deprecation): add Platform support area
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2024-03-06 14:34:55 +01:00
Leonardo Grasso 63ccf872fd Update proposals/20231220-features-adoption-and-deprecation.md
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2024-03-06 14:34:55 +01:00
Leonardo Grasso 3bdb98a46b Update proposals/20231220-features-adoption-and-deprecation.md
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2024-03-06 14:34:55 +01:00
Leonardo Grasso c68ef54bb2 docs(proposals/20231220-features-adoption-and-deprecation): remove feature gates, simplify policies and transition phases
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2024-03-06 14:34:55 +01:00
Leonardo Grasso 865553dbe3 docs(proposals/20231220-features-adoption-and-deprecation): only stable features deprecation require a major bump
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2024-03-06 14:34:55 +01:00
Leonardo Grasso 10a9c1d774 docs(proposal): 20231220-features-adoption-and-deprecation.md
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2024-03-06 14:34:55 +01:00
Aldo Lacuku 185075bfd8 update(scrips/falcoctl): bump falco-rules version to 3
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2024-03-06 07:35:54 +01:00
Melissa Kilby 5185f152c5 new(config): add falco_libs.thread_table_size
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-03-05 11:36:51 +01:00
Samuel Gaist 8f87b117c4 fix(userspace): correct directory iteration options
The original code was using follow_directory_symlink twice, this patch
fixes that.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-03-05 10:29:51 +01:00
dependabot[bot] 5084a62dd1 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `b499a1d` to `f88b991`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](b499a1d0d0...f88b991a7f)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 12:05:36 +01:00
Leonardo Grasso ca4db17e05 docs(README.md): Falco Graduates within the CNCF
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2024-02-29 16:41:33 +01:00
Samuel Gaist f9b17b67f8 refactor(engine): fix variable / function shadowing
Improve variable names in the code surrounding the changes.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-29 16:20:34 +01:00
Samuel Gaist 8a7361c8ab refactor(app): fix variable / function shadowing
Improve variable names in the code surrounding the changes.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-29 16:20:34 +01:00
dependabot[bot] 2589bd0c0b build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `497e011` to `b499a1d`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](497e01189e...b499a1d0d0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-28 11:16:27 +01:00
Gianmatteo Palmieri 928cb8bb8e new(tests): add unit test for exceptions condition
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-02-28 08:28:26 +01:00
Gianmatteo Palmieri ea781477d6 fix(engine): logical issue in exceptions condition
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-02-28 08:28:26 +01:00
Federico Di Pierro f6818902de fix(ci): properly enforce bundled deps off in build-dev, like it was before https://github.com/falcosecurity/falco/pull/3092.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-02-27 11:07:25 +01:00
Federico Di Pierro 5ebc7bbd7c chore(ci): bumped codeql actions.
Moveover, to avoid spending too much time (and space) on the job, build without bundled deps.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-02-26 17:55:21 +01:00
Federico Aponte f6af72fe76 cleanup: too many includes and useless defines
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-02-26 14:59:22 +01:00
Federico Aponte 4d66a50d5b fix: pessimizing move warning
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-02-26 14:59:22 +01:00
Federico Aponte 59c14f46a2 refactor: shared_ptr construction
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-02-26 14:59:22 +01:00
Federico Aponte 557929a82a refactor: use object rather than unique_ptr
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-02-26 14:59:22 +01:00
Federico Aponte 9a2b58c6f7 refactor: very minor improvement
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-02-26 14:59:22 +01:00
Gianmatteo Palmieri 1705fc2281 refactor(build): use find_package when possible
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-02-23 15:43:08 +01:00
Gianmatteo Palmieri 97806a98fb new(build): add options to use bundled yamlcpp and njson
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-02-23 15:43:08 +01:00
Gianmatteo Palmieri 736277d3d5 new(build): switch USE_BUNDLED_DEPS default value to ON
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-02-23 15:43:08 +01:00
Gianmatteo Palmieri bc804c44a0 refactor(build): set bundled deps default value
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-02-23 15:43:08 +01:00
Gianmatteo Palmieri 91e74b1b19 cleanup(build): remove bundled dep check
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-02-23 15:43:08 +01:00
Gianmatteo Palmieri 0fd3732422 new(build): add options to use system libcxxopts and libcpp-httplib
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-02-23 15:43:08 +01:00
Federico Di Pierro 60ef759c70 fix(ci): test-dev-packages-arm64 needs build-dev-packages-arm64.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-02-23 15:42:08 +01:00
Jason Dellaluce 02ad182b48 fix(cmake): solve windows compilation issues
Co-authored-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-02-23 11:39:07 +01:00
Jason Dellaluce 3b06fb2cbb fix(userspace): solve compilation issues
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-02-23 11:39:07 +01:00
Jason Dellaluce c13cf79aab update(engine): bump engine version
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-02-23 11:39:07 +01:00
Jason Dellaluce 9b4c1a0023 update(cmake): bump libs and driver to latest
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-02-23 11:39:07 +01:00
Jason Dellaluce 0ec2a6c708 refactor(userspace): reduce usage of raw pointers
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-02-23 11:39:07 +01:00
Jason Dellaluce b515f0a079 refactor(usersapace): adapt to changes libs
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-02-23 11:39:07 +01:00
Melissa Kilby 4ed11d90a4 chore: rename plugin name to more expressive anomalydetection term
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-02-22 10:20:05 +01:00
Melissa Kilby bf55a7e86e update(proposals): minor enhancements and falco community call feedback
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-02-22 10:20:05 +01:00
Melissa Kilby 2f2bd6e93e update(proposals): minor enhancements and kubeconna23 feedback
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-02-22 10:20:05 +01:00
Melissa Kilby 534afca5f5 new(proposals): introduce on host anomaly detection framework
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-02-22 10:20:05 +01:00
Federico Di Pierro 71a0d0d186 fix(cmake): properly let falcoctl cmake module create `/usr/share/falco/plugins/` folder.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-02-21 10:05:02 +01:00
Federico Aponte b4e55ee6a1 cleanup: falco_engine test fixture
Upgrade GTest to 1.14.0

Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-02-21 00:31:59 +01:00
Federico Aponte 745d18ba38 refactor: test AtomicSignalHandler.handle_once_wait_consistency
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-02-20 15:19:56 +01:00
Samuel Gaist 05e796723f fix(userspace): remove unread variable in restart_handler
When hitting that part, the restart signal is triggered and the code
leaves the loop, hence setting should_restart as false makes no sense
in this context.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-19 18:01:48 +01:00
Samuel Gaist ad585cd46b fix(actions): remove unused variable in print_support
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-19 18:01:48 +01:00
Samuel Gaist e07f056fc5 fix(tests): remove unused variables in rule loader tests
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-19 18:01:48 +01:00
Federico Di Pierro 1178a0505c cleanup(submodules): dropped testing submodule.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-02-19 17:06:48 +01:00
Federico Di Pierro fbe45125ae cleanup(ci): make use of falcosecurity/testing provided composite action.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-02-19 10:56:47 +01:00
Andrea Terzolo a44bee57d9 fix(CI): fix windows CI
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-02-16 18:30:38 +01:00
Andrea Terzolo d49b21ab22 cleanup: move ebpf default value logic
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-02-16 18:30:38 +01:00
Andrea Terzolo 76ab28ff59 tests: remove deprecated assertions
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-02-16 18:30:38 +01:00
Andrea Terzolo 99781f7936 cleanup(configuration): cleanup deprecated code
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-02-16 18:30:38 +01:00
Andrea Terzolo 9c182d23f6 cleanup(falco.yaml)!: remove deprecated configs
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-02-16 18:30:38 +01:00
Samuel Gaist 5e497a4119 fix(c++): improve const correctness
Reported by cppcheck

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-15 22:16:33 +01:00
dependabot[bot] 792bcdca18 build(deps): Bump submodules/falcosecurity-testing
Bumps [submodules/falcosecurity-testing](https://github.com/falcosecurity/testing) from `ae3950a` to `7abf76f`.
- [Commits](ae3950acf0...7abf76f2a0)

---
updated-dependencies:
- dependency-name: submodules/falcosecurity-testing
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-15 19:41:33 +01:00
Luca Guerra 5564d3da11 cleanup(app): ensure unbuffered_outputs is initialized
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-15 11:03:30 +01:00
Luca Guerra fe5c58e20e cleanup(tests): use test_falco_engine in test_enable_rule
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-15 11:03:30 +01:00
Luca Guerra baf9e77810 cleanup(tests): update configure_interesting_sets to use test_falco_engine
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-15 11:03:30 +01:00
Luca Guerra 1afacb45fb cleanup(tests): extract engine fixture
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-15 11:03:30 +01:00
Luca Guerra 12f57514ad cleanup(tests): pass a valid inspector to factory/ast/filter tests
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-15 11:03:30 +01:00
Samuel Gaist e18acc361e fix(c++): don't throw outside of the try catch block in nothrow function
Reported by cppcheck

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-15 10:19:30 +01:00
Samuel Gaist f3491d62c9 fix(c++): re-throw original exception rather than copy
Reported by cppcheck

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-15 10:19:30 +01:00
Federico Aponte 7a18795ca5 cleanup: falco_engine deps and include paths
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-02-15 10:08:30 +01:00
Federico Aponte 539dac0590 fix: Some compiler warnings
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-02-15 10:07:30 +01:00
dependabot[bot] 14650f49b6 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `0f60976` to `497e011`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](0f609769ef...497e01189e)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-14 19:38:27 +01:00
Andrea Terzolo 26add16d12 cleanup(docker)!: remove unused builder dockerfile
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-02-14 17:10:26 +01:00
Federico Di Pierro 3476555ad1 update(docs): added CHANGELOG entry for 0.37.1
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-02-13 10:37:21 +01:00
Melissa Kilby 3c2bd8d4d8 cleanup: minor adjustments to readme, add new testing section
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-02-13 10:21:22 +01:00
dependabot[bot] f268f45923 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `6ed2036` to `0f60976`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](6ed2036d83...0f609769ef)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-12 18:46:18 +01:00
Samuel Gaist 8c98ca5e8d fix(c++): add missing member initialisation to grpc server
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-12 18:45:18 +01:00
Samuel Gaist d6b0810657 fix(c++): move trivial initializations to declaration site
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-12 18:45:18 +01:00
Samuel Gaist 42f90817ad refactor: make falco_exception a std::runtime_error
The implementation provides more or less the same implementation
and thus it makes more sense to base it on std::runtime_error.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-12 18:45:18 +01:00
Samuel Gaist f6498cd8bd fix(c++): refactor member initialization in constructor initialization list
Reported by cppcheck

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>

# Conflicts:
#	userspace/engine/falco_common.h
2024-02-12 18:45:18 +01:00
Tom Müller 8bc32d248e Added http headers option for driver download in docker images
Signed-off-by: Tom Müller <60851960+toamto94@users.noreply.github.com>
2024-02-12 18:03:17 +01:00
Samuel Gaist 08f62200b1 fix(c++): add missing explicit to single argument constructors
Reported by cppcheck

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-12 16:59:17 +01:00
dependabot[bot] 48a7f3bcb4 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `1053b2d` to `6ed2036`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](1053b2d1b6...6ed2036d83)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-12 14:55:16 +01:00
Federico Di Pierro 6c29fdb1e5 update(cmake): bumped falcoctl to v0.7.2.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-02-12 11:13:16 +01:00
Jason Dellaluce 0cc1c5b44f refactor(userspace/engine): reduce allocations during rules loading
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-02-09 14:50:05 +01:00
Luca Guerra d69f329b54 fix(ci): update sync in deb and rpm scripts with acl
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-09 10:33:04 +01:00
Samuel Gaist a9e1bfef42 fix(c++): add missing overrides
Reported by cppcheck

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-09 08:24:03 +01:00
Federico Di Pierro 7879920570 chore(userspace/engine): introduce proper check to avoid future issues throwing an exception.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-02-08 15:13:59 +01:00
Federico Di Pierro 7bcbc08b52 fix(userspace/engine): always consider all rules (even the ones below min_prio) in m_rule_stats_manager.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-02-08 15:13:59 +01:00
Tom Müller 71f3c77a1a fixed typo in print usage
fixed typo in the print usage description of the docker run command

Signed-off-by: Tom Müller <60851960+toamto94@users.noreply.github.com>
2024-02-08 10:16:59 +01:00
Tom Müller 56a4e31d18 added option for insecure http driver download
added option for insecure http driver download to the falco docker entrypoint.

Signed-off-by: Tom Müller <60851960+toamto94@users.noreply.github.com>
2024-02-08 10:16:59 +01:00
Tom Müller 159e3f6ffc added insecure http driver download
added insecure http driver download to the driver-loader-legacy entrypoint.

Signed-off-by: Tom Müller <60851960+toamto94@users.noreply.github.com>
2024-02-08 10:16:59 +01:00
Tom Müller f62c38e9e8 added option for insecure http download
Added option for insecure http driver download in the docker-entrypoint.sh script. By passing --http-insecure to the container via an argument, the flag is forwarded to the falcoctl driver install command.

Signed-off-by: Tom Müller <60851960+toamto94@users.noreply.github.com>
2024-02-08 10:16:59 +01:00
Luca Guerra b091522398 new(build): prune deb-dev and rpm-dev directories
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-07 16:46:57 +01:00
RohithRaju 195116fa09 update(scripts): address review requests
Signed-off-by: RohithRaju <rohithraju488@gmail.com>
2024-02-07 14:31:57 +01:00
RohithRaju 1b9c2da601 update(CI): publish wasm package as dev-wasm
Signed-off-by: RohithRaju <rohithraju488@gmail.com>
2024-02-07 14:31:57 +01:00
Jason Dellaluce 039069d0e1 update(engine): bump engine version and checksum
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-02-06 10:25:53 +01:00
Jason Dellaluce 58f8f14a1b fix(tests): solve last few compilation issues
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-02-06 10:25:53 +01:00
Jason Dellaluce aca08ff744 update(cmake): bump libs and driver to 8df8817
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-02-06 10:25:53 +01: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
Luca Guerra 0613f11980 fix(build): install libstdc++ in the Wolfi image
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-05 14:55:49 +01:00
Luca Guerra ea67e47023 update(build): install libelf in the nodriver image
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-02 19:57:40 +01:00
Luca Guerra 7d0001269c update(build): include libelf in the distroless image
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-02 19:57:40 +01:00
Luca Guerra 30df5738a5 update(build): disable musl builds
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-02 19:57:40 +01:00
Luca Guerra e3a3271c7a update(ci): add libelf to build containers
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-02 19:57:40 +01:00
Luca Guerra b414b01aab update(ci): allow version/static checks to work even if libelf is not installed
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-02 19:57:40 +01:00
Luca Guerra 7d9cfd02e3 chore(falco): update engine checksum
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-02 19:57:40 +01:00
Luca Guerra 8309d88595 new(build): build with dynamic libelf by default
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-02 19:57:40 +01:00
Luca Guerra 871597f1fa chore(build): update libs and drivers to 9cd289c
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-02 19:57:40 +01:00
dependabot[bot] 8acbbde600 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `3cac61c` to `1053b2d`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](3cac61cfa9...1053b2d1b6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-01 10:28:37 +01:00
Roberto Scolaro 40f4ce008a chore(engine): bump engine version
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2024-01-31 11:53:35 +01:00
Roberto Scolaro 3d06b77de5 chore(engine): update falco engine checksum
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2024-01-31 11:53:35 +01:00
Roberto Scolaro fa6d380940 update: bump libs+driver to bfbc007
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2024-01-31 11:53:35 +01:00
Roberto Scolaro 9557b74501 fix: adopt new libsinsp logger
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2024-01-31 11:53:35 +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
Federico Di Pierro 41ee64e006 chore(ci): bumped rn2md to latest master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-01-31 11:39:35 +01:00
dependabot[bot] eccb5a6baa build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `3f668d0` to `3cac61c`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](3f668d0568...3cac61cfa9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-31 09:52:34 +01:00
Mark Stemm e1fb55e046 Add unit test for alternate rules loader
Add a unit test for providing an alternate rules loader that also
demonstrates how users can define sub-classes that may want to extend
the falco rules syntax.

This test creates a test rules reader/collector/compiler that supports
top-level objects "test_object". The reader reads them and saves them
in the collector. The compiler iterates over all test_objects and puts
the property values into a single set<string>.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-01-30 20:24:33 +01:00
Mark Stemm 1e0430dff9 Make compile_condition() a protected method for use in subclasses
Move the part of compile_rule_infos that actually compiled a condition
string into a sinsp_filter into a standalone method
compile_condition(). That way it can be used by classes that derive
from rule_loader::compiler() and want to compile condition strings.

This implementation also saves the compiled filter as a part of the
falco_rule object so it does not need to be compiled again wihin the
falco engine after rules loading.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-01-30 20:24:33 +01:00
Mark Stemm 88a57bfd1a Add ability for rulesets to access falco engine state
Some rulesets may need information which is held by the falco_engine
that created this ruleset. So define a set of functions in a struct
and have setters/getters for those functions in the base class.

Derived classes can use the struct's functions to obtain the falco
engine information.

The only function so far is to obtain the filter_ruleset for a given
event source.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-01-30 20:24:33 +01:00
Mark Stemm ce5a50cbb5 Add addl support for rules reader/compiler subclasses
To support subclasses that may extend the falco rules format, add
additional error/warning/item types for an extension item.

When subclasses report errors and warnings, they can use these
codes/item types in context objects and still provide an exact
line/column context.

Also make some previously static functions in rules reader protected
methods so they can be used in sub-classes.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-01-30 20:24:33 +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
Mark Stemm 2d0159ae05 Add ability to provide external rules reader/collector/compiler
In some cases, a user of the falco engine may want to extend the falco
rules format to provide additional objects to the rules file.

To support that, add a new method set_rule_loader() that allows a user
to provide classes that derive from
rule_loader::{reader,collector,compiler} and read those additional
objects from the rules file.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-01-30 20:24:33 +01:00
Federico Di Pierro f66780eb81 fix(ci): fixed release body driver version.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-01-30 13:26:32 +01:00
dependabot[bot] 67a7685c29 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `c39d31a` to `3f668d0`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](c39d31a0bc...3f668d0568)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-30 12:59:32 +01:00
Andrea Terzolo 135ce35ac2 new(docs): add changelog for 0.37.0
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-30 11:57:31 +01:00
Leonardo Grasso 2e19960522 update(cmake/modules): bump Falco rules to 3.0
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2024-01-25 17:03:15 +01:00
Melissa Kilby bb4a643385 update(config): soft deprecation of old stats
add CHANGE NOTICE wrt syscall_event_drops

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-01-25 10:33:15 +01:00
Melissa Kilby 3675587aad cleanup(configs): adjust old stats deprecation notice
Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-01-25 10:33:15 +01:00
Melissa Kilby 8a697502b9 update!(config): add deprecation notice for syscall_event_drops
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-01-25 10:33:15 +01:00
Melissa Kilby 2dc8d452ae fix(userspace/metric): minor fixes in new libsinsp state metrics handling
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-01-24 11:04:13 +01:00
Federico Aponte 8143a194d2 fix: nlohmann_json lib include path
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-01-24 09:38:13 +01:00
Jason Dellaluce acba90d97a test(engine): assess proper list escaping in engine collector
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-01-23 11:58:09 +01:00
Jason Dellaluce ccf62a3745 fix(userspace/engine): avoid storing escaped strings in engine defs
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-01-23 11:58:09 +01:00
Federico Di Pierro 10eaf31881 update(cmake): bumped falcoctl to v0.7.1.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-01-23 11:57:09 +01:00
Andrea Terzolo f4aef006fe chore: bump falco rules
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-17 16:20:55 +01:00
Andrea Terzolo e1c07568b4 chore: bump Falco to libs 0.14.1
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-17 15:12:55 +01:00
dependabot[bot] ded4bdde96 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `2ac430b` to `c39d31a`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](2ac430be13...c39d31a0bc)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-17 09:42:54 +01:00
Andrea Terzolo ae9ffe414f cleanup: rename `none` into `nodriver`
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2024-01-17 09:41:55 +01:00
Melissa Kilby d8c368b5ce update(config): graduate outputs_queue to stable
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-01-16 12:54:51 +01:00
Federico Di Pierro b718083fe7 update(cmake): bump falcoctl to v0.7.0.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-01-12 11:50:39 +01:00
dependabot[bot] 3f4ed4ca4b build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `1221b9e` to `2ac430b`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](1221b9e817...2ac430be13)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-12 00:55:38 +01:00
Andrea Terzolo a6a1a9769f cleanup: restore the name of a variable
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Co-authored-by: Luca Guerra <luca.guerra@sysdig.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo e601ec2eab chore: bump testing submodule manually to fix e2e tests
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo 64bbffe5ef fix codespell
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo 5ee05abc08 cleanup: adopt a new helper method in tests
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo c308f5c7e2 cleanup: rename some error messages
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo ee78c862ad tests: add some new tests on override replace
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo 8ebdbe3e6f cleanup: use macros for default error messages
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo 91d1511285 tests: add test on the order for macro and rules
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo 3f9ede86bb tests: add some new tests about list order
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo 5192921732 doc: typo in the exception
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo 56de6e6786 update(rule_loader): remove the warning on the required_engine_version
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo f5dea33b5e update(falco): always enable rules warnings
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo b318c165da cleanup(falco_engine): remove unused methods
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo 5ac005bd4d update(rule_loader): deprecate all non-SemVer compatible values
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo 2367d36867 cleanup(tests): use new `check_error_message` helper
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo 95e4c58e7f update(rule_loader): deprecate `enabled` usage
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo 4aebee684a update(rule_loader): deprecate `append` key and add a warning
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo 63736563a2 cleanup(rule_loader): remove useless include
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Andrea Terzolo 7cac2833b2 cleanup(rule_loader): add a common log message
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 15:37:38 +01:00
Federico Di Pierro 447a251e16 chore(ci): bumped rn2md to latest master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-01-11 09:52:38 +01:00
Federico Di Pierro b5e64c52f3 fix(ci): manually invoke falcoctl to install cloudtrail and k8saudit plugin before running tests.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-01-11 09:08:38 +01:00
Federico Di Pierro bbef26aad0 cleanup(cmake): dropped bundled plugins since falcoctl takes care of everything.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-01-11 09:08:38 +01:00
Andrea Terzolo 6bb68c0c43 chore: bump Falco to latest libs
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-11 05:32:38 +01:00
dependabot[bot] a25b5c1045 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `424b258` to `1221b9e`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](424b258789...1221b9e817)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-09 19:01:34 +01:00
Andrea Terzolo f6ab7f2501 chore: bump driver version
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-01-08 20:20:31 +01:00
Mark Stemm 66df3dc417 Add unit tests for add_source() + related lookup methods
Add unit tests for add_source() and its related find_*_for_source()
methods. The test just verifies that the values provided to
add_source() are the same as the values returned by the find methods.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-01-08 12:00:27 +01:00
Mark Stemm 14d1ca3c97 Add methods to look up the factories provided in add_source()
Add methods that allow looking up the factories provided to
add_source(). This allows not having to keep track of the factories
outside of the engine.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-01-08 12:00:27 +01:00
Mark Stemm 07d7b9a57a Inline find_source() as it can be called in the event path
Inline find_source as it can be called in the event processing path.

Also take the cached variant that assigns/uses m_syscall_source_idx
and put it in find_source() instead of process_event().

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2024-01-08 12:00:27 +01:00
dependabot[bot] 70ce7b936b build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `cd33bc3` to `424b258`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](cd33bc34af...424b258789)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-05 14:46:18 +01:00
Luca Guerra 728c8d7d0e fix(engine): clarify error message for invalid append
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-12-22 21:49:21 +01:00
Luca Guerra 04dd06b2c6 new(tests): add error testing for rule overrides
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-12-22 21:49:21 +01:00
Luca Guerra 4c023b0d93 update(engine): temporary replace for error messages
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-12-22 21:49:21 +01:00
Luca Guerra 8a7ef687b1 update(engine): throw an error if an unexpected top level key is found in an override
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-12-22 21:49:21 +01:00
Luca Guerra 21c629dc4d chore(engine): bump engine version
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-12-22 21:49:21 +01:00
Luca Guerra 2db29af0e8 update(engine): clarify override error messages
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-12-22 21:49:21 +01:00
Luca Guerra bc072502cc new(engine): add selective overrides
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-12-22 21:49:21 +01:00
Melissa Kilby 3976e777a5 update(config): clarify deprecation notices + list all env vars
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-12-22 09:55:19 +01:00
Melissa Kilby 9131261ff3 chore: fix some characters in deprecation notices
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-12-22 09:55:19 +01:00
Luca Guerra e5034323fd cleanup(engine): clarify deprecation notice for engines
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-12-21 17:40:15 +01:00
Federico Di Pierro 213fa392e8 update(cmake): bumped falcoctl to v0.7.0-rc1.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-21 09:35:15 +01:00
Federico Di Pierro a2c128e934 chore(ci): revert #2961.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-20 12:09:12 +01:00
dependabot[bot] f2d0c42911 build(deps): Bump submodules/falcosecurity-testing
Bumps [submodules/falcosecurity-testing](https://github.com/falcosecurity/testing) from `930170b` to `9b9630e`.
- [Commits](930170bb0b...9b9630e2d8)

---
updated-dependencies:
- dependency-name: submodules/falcosecurity-testing
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-19 18:46:08 +01:00
Andrea Terzolo 8ff1ef752d chore: bump falco engine version
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-12-18 19:01:01 +01:00
Andrea Terzolo 454882f518 chore: bump Falco to latest libs
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-12-18 19:01:01 +01:00
dependabot[bot] 3c31c05450 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `262f569` to `cd33bc3`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](262f56986e...cd33bc34af)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 18:26:01 +01:00
Samuel Gaist d99c137b09 feat(outputs_http): implement keep alive
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2023-12-18 17:41:02 +01:00
Samuel Gaist 691bc8b04d feat(outputs_http): implement support for compressed upload
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2023-12-18 17:41:02 +01:00
Mark Stemm ab0133d1dd Add unit tests for enabling/disabling rules
Add unit tests for enabling/disabling rules, covering:

 - matching names by substring
 - using "" to match all rules
 - matching names exactly
 - using ruleset ids in addition to ruleset names

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2023-12-18 15:58:04 +01:00
Mark Stemm 334302e525 Allow enabling rules by ruleset id in addition to name
Add alternate enable_* methods that allow enabling rulesets by ruleset
id in addition to name. This might be used by some filter_rulesets to
enable/disable rules on the fly via the falco engine.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2023-12-18 15:58:04 +01:00
Federico Di Pierro 1ab4e9e0fc chore(ci): enable aarch64 falco driver loader tests.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-18 15:26:02 +01:00
Federico Di Pierro 9e1e68f64b chore(unit_tests): added more tests for yaml env vars expansion.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-14 12:44:47 +01:00
Federico Di Pierro 752e8bf16c chore(falco.yaml): use HOME env var for ebpf probe path.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-13 17:45:45 +01:00
Federico Di Pierro cbbcb61153 new(unit_tests,userspace): properly support env var expansions in all scalar values of yaml file.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-13 17:03:46 +01:00
Federico Di Pierro 3b095a5eda chore(unit_tests): added tests around empty config value resolving to default.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-13 17:03:46 +01:00
Federico Di Pierro 7805bf5ad5 fix(userspace,unit_tests): fixed bool parsing.
Moreover, added some more tests around env vars.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-13 17:03:46 +01:00
Federico Di Pierro 0c0fb63008 chore(unit_test,userspace): allow env var to get expanded in yaml even when part of a string.
Moreover, support env variable embedding another env variable.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-13 17:03:46 +01:00
Andrea Terzolo ed346e90cd update(falco): bump engine version and checksum
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-12-13 16:59:46 +01:00
Andrea Terzolo b190a60da7 chore: bump to latest libs commit
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-12-13 16:59:46 +01:00
Andrea Terzolo 34a896f3a5 new(.gitignore): ignore local `CMakeUserPresets.json`
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-12-13 16:59:46 +01:00
dependabot[bot] 1a338e1a39 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `dd38952` to `262f569`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](dd38952168...262f56986e)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-13 16:01:46 +01:00
Luca Guerra e3f54a14a6 update(readme): add actuated.dev badge
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-12-12 18:56:44 +01:00
Nitro Cao 4bfc42eb7d feat(falco): monitor events with more types for rules directory
Signed-off-by: Nitro Cao <jaycecao520@gmail.com>
2023-12-12 18:49:44 +01:00
Federico Di Pierro 47959abfed chore(docker): improve usage helper message.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-12 18:23:44 +01:00
Federico Di Pierro 8db79da647 chore(cmake,docker): bumped falcoctl to v0.7.0-beta5.
Moreover, small fix in docker images entrypoints regarding the name printed in usage.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-12 18:23:44 +01:00
dependabot[bot] 9c01f3518a build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `64e2adb` to `dd38952`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](64e2adb309...dd38952168)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-12 14:37:43 +01:00
Federico Di Pierro f2ebdfaf8e fix(docker): small fixes in docker entrypoints for new driver loader.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-12 09:56:42 +01:00
Federico Aponte e427c800f3 chore(build): fix error using find_package with ExternalProject_Add
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2023-12-11 16:52:39 +01:00
Federico Aponte 5e17ba6c23 chore(build): allow usage of non-bundled nlohmann-json
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2023-12-11 16:52:39 +01:00
Federico Di Pierro e177898d2b update(cmake): bumped falcoctl to v0.7.0-beta4.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-11 16:37:39 +01:00
Federico Di Pierro 2dfd687912 update(submodules): bumped falcosecurity/testing to latest master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-11 16:37:39 +01:00
Federico Di Pierro b7538429b8 update(cmake): bumped falcoctl to v0.7.0-beta3.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-11 16:37:39 +01:00
Federico Di Pierro 1de6f10ad6 update(cmake): bump falcoctl to 0.7.0-beta2.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-11 16:37:39 +01:00
Federico Di Pierro 5f59fee54f update(submodules): bumped falcosecurity-testing to latest dev.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-11 16:37:39 +01:00
Federico Di Pierro 4d566b2c71 chore(cmake): bumped falcoctl to v0.7.0-beta1.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-11 16:37:39 +01:00
Federico Di Pierro 96f50ddac5 chore(scripts): integrate back master changes `FALCO_DRIVER_CHOICE` and `FALCOCTL_ENABLED` .
Also, env variables always have precedence over dialog (ie: if they are set, we always skip dialog).

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-11 16:37:39 +01:00
Federico Di Pierro ade27c2546 chore(scripts): use new default value for falcoctl driver.host-root config key.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-11 16:37:39 +01:00
Federico Di Pierro 2244cc6f71 update(cmake): bump falcoctl to v0.7.0-alpha2.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-11 16:37:39 +01:00
Federico Di Pierro 1dd47668dd chore(scripts): only configure falcoctl driver type when a driver is selected.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-11 16:37:39 +01:00
Federico Di Pierro 5eb2ae8d76 chore(cmake/modules): bumped falcoctl to latest alpha.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-11 16:37:39 +01:00
Federico Di Pierro 33451cf0bc fix(scripts): fixed driver names for new falcoctl/Falco naming.
But keep old systemd units names to avoid a breaking change.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-11 16:37:39 +01:00
Federico Di Pierro 27161bb508 chore(scripts/systemd): properly make use of new config keys in systemd units.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-11 16:37:39 +01:00
Federico Di Pierro 0c9538241d chore(docker): cleaned up useless removal of falcoctl.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2023-12-11 16:37:39 +01:00
Federico Di Pierro 7452c5dc98 chore(cmake): bumped falcoctl to dev from https://github.com/falcosecurity/falcoctl/pull/343.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-11 16:37:39 +01:00
Federico Di Pierro be100f7ad5 new(docker,scripts): dropped falco-driver-loader in favor of new `falcoctl driver` command.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-11 16:37:39 +01:00
Luca Guerra 8cf9b35b0e new(ci): run CI jobs on ARM64
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-12-07 18:26:28 +01:00
Luca Guerra 6e4ccb0007 update(ci): enable actuated.dev
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-12-07 18:26:28 +01:00
Federico Aponte 44b7352180 cleanup: fix several warnings from a Clang build
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2023-12-06 16:40:26 +01:00
Vicente J. Jiménez Miras 13991f1ea7 Add use of FALCO_DRIVER_CHOICE and FALCOCTL_ENABLED env vars
Signed-off-by: Vicente J. Jiménez Miras <vjjmiras@gmail.com>
2023-12-06 10:13:25 +01:00
Andrea Terzolo 10226a6c87 chore(falco): bump libs to `000d576ef877cb115cbb56f97187a1d62221e2bd`
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-12-06 10:08:25 +01:00
Federico Aponte e558c4f5a5 chore(build): remove outdated development libs
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2023-12-06 05:46:25 +01:00
Federico Di Pierro 0ba0dd8671 chore(docker/falco): add back some deps to falco docker image.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-12-05 18:34:26 +01:00
Jason Dellaluce 305ed75268 update(submodules): bump falcosecurity-testing
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-12-02 09:38:15 +01:00
Jason Dellaluce 390a13bd40 update(userspace): optimizations in validation and description steps
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-12-02 09:38:15 +01:00
Jason Dellaluce 67542ec88e new(userspace/falco): support -L when validating for parity
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-12-02 09:38:15 +01:00
Jason Dellaluce e3943ccac3 refactor(userspace/engine): uniform json lib in rules description and not print from engine
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-12-02 09:38:15 +01:00
dependabot[bot] 95968defa5 build(deps): Bump submodules/falcosecurity-testing
Bumps [submodules/falcosecurity-testing](https://github.com/falcosecurity/testing) from `92c313f` to `5248e6d`.
- [Commits](92c313f5ca...5248e6dff9)

---
updated-dependencies:
- dependency-name: submodules/falcosecurity-testing
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-01 13:12:12 +01:00
Luca Guerra 6411eed4a7 cleanup(falco): remove decode_uri as it is no longer used
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-11-29 17:42:06 +01:00
Andrea Terzolo c5364be191 new: print system info when Falco starts
Print kernel info when Falco starts with a kernel driver

Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-28 22:14:05 +01:00
Luca Guerra ce4d28ef90 chore(falco): update to libs on nov 28th
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-11-28 17:14:04 +01:00
Melissa Kilby 3b068919d0 update(cmake): bump libs and driver to c2fd308 plus bump falco engine version
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-11-28 12:57:04 +01:00
Melissa Kilby 3e4566e5af cleanup(userspace/falco): minor adjustments to stats writer and rebase correction
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-11-28 12:57:04 +01:00
Melissa Kilby 9cb4c09500 cleanup(userspace/falco): enable sinsp_stats_v2
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-11-28 12:57:04 +01:00
Melissa Kilby 8196ee3b83 cleanup(libsinsp): simplify metrics flags config handling
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-11-28 12:57:04 +01:00
Melissa Kilby af7192bdc3 update(userspace/falco): add libsinsp state metrics option
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-11-28 12:57:04 +01:00
Andrea Terzolo 00b7c56d54 cleanup: rename `modern-ebpf` into `modern_ebpf`
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo 2ce8fe9011 docs: improve a log
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo 4443e9d64f fix: fix some broken tests
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo 249ccf2f4b new: add some deprecation warnings
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo 715db9ddb4 cleanup: move some macros inside a shared file
These macros will be used by other files so we need to share them

Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Federico Di Pierro 0368de5229 chore(userspace): small round of review-induced fixes.
Also, properly warn the user that deprecated CLI options will be ignored
when the new `engine` configuration key is in use.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-11-27 15:01:00 +01:00
Federico Di Pierro b92e0d6134 chore(userspace,unit_tests): renamed `engine.replay.trace_file` to `engine.replay.capture_file`.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo 898ba68b3b test: don't test load config if we are under wasm
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo 96f474a29c docs: fix codespell
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo 12122729a4 docs: add a comment on missing config files
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo 335022076f docs: fix some docs
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo 1b14fed380 tests: call the callback `action` only once
moreover this commit corrects `cpus_for_each_syscall_buffer` into test
configs

Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo 11253cc0eb docs: add some descriptions in falco.yaml
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo be16af7fe0 cleanup: rename `cpus_for_each_syscall_buffer`
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo 588a94578a fix: take into consideration that `load_yaml` is called more than once
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo 5e8e0a4722 new: allow to use only one between the config and the command line
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo bfef0e95be fix: use `drop_failed_exit` instead of just `drop_failed`
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo bc8f61ca68 tests: add a basic test to check config precedence
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo 2778b12344 fix: always initialize the engine configs
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Federico Di Pierro 7056cb9035 chore(userspace): properly let old config keys override new ones when set to a non-default value.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo 1f27f3b7f0 cleanup: move some initializations and add helpers
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo 1ee6569a5d fix: use only new config instead of old command line options
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Andrea Terzolo f3f56db5ca cleanup: some renaming from `bpf` to `ebpf`
the idea is to use only the word `ebpf` in Falco

Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Federico Di Pierro 4127764129 chore(userspace): renamed `driver.` config to `engine.`; renamed `engine.replay.scap_file` to `engine.replay.trace_file`.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-11-27 15:01:00 +01:00
Federico Di Pierro 4f1b950e0d chore(userspace,falco.yaml): rename new config key to `driver.kind`.
Moreover, renamed driver kinds to use better naming, and move driver's related
config keys under `driver.$kind`.

Added DEPRECTATION notices on CLI options, and in falco.yaml.

DEPRECATED options (both CLI and config ones) will have priority over the new ones,
to retain compatibility with existing configs.

DEPRECATED options will be dropped in Falco 0.38.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-27 15:01:00 +01:00
Roberto Scolaro 626e609e4b new(userspace/falco): select driver from config
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-27 15:01:00 +01:00
Roberto Scolaro ea2d62d56b new(falco.yaml): added driver selection section
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-27 15:01:00 +01:00
Roberto Scolaro fb4ac046b0 refacotr(configuration): enhance readability of get_driver_mode
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-27 15:01:00 +01:00
Roberto Scolaro d53fa930c2 wip: driver selection in falco.yaml
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-27 15:01:00 +01:00
Richard Tweed 5dc9987877 update(doc): Add Thought Machine as adopters
Signed-off-by: Richard Tweed <RichardoC@users.noreply.github.com>

Signed-off-by: Richard Tweed <RichardoC@users.noreply.github.com>
2023-11-22 14:31:42 +01:00
Andrea Terzolo a1d5bb7009 cleanup: remove `init` in the configuration constructor
This `init({});` in the falco_configuration constructor is unnecessary
since when we call the action `load_config`, if we don't have a config
file, we will call the same `init` we have just removed. This cleanup
avoids calling `falco_configuration::init` 2 times.

Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-11-21 15:44:39 +01:00
Jason Dellaluce 66a122d4ce update(userspace/engine): bump engine version
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-11-16 09:26:19 +01:00
Jason Dellaluce b3775ce91c update(cmake): bump driver to latest
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-11-16 09:26:19 +01:00
Jason Dellaluce 1e3f17150d cleanup(falco.yaml): remove config docs and options about k8s metadata
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-11-16 09:26:19 +01:00
Jason Dellaluce 04e2f19915 refactor: solve compilation issues with latest libs changes
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-11-16 09:26:19 +01:00
Jason Dellaluce ef816e8b06 update(cmake): bump libs to latest
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-11-16 09:26:19 +01:00
dependabot[bot] 2bcd12755f build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `8f0520f` to `64e2adb`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](8f0520fa09...64e2adb309)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-16 09:25:19 +01:00
Jason Dellaluce 359bd6e593 cleanup(userspace/engine): remove legacy k8saudit implementation
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-11-15 16:05:15 +01:00
Luca Guerra f073a6ee88 update(engine): add tests for decode_url()
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-11-14 20:36:15 +01:00
Luca Guerra 8bf40cdf88 update(engine): port decode_uri in falco engine
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-11-14 20:36:15 +01:00
Luca Guerra 22cc2e5add fix(gha): disable branch protection rule trigger for scorecard
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-11-14 15:19:13 +01:00
Roberto Scolaro 92b42c9474 fix(userspace/falco): fix create_dir behaviour
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro fde8da0e5c fix(userspace/falco): split init_ticker for different oses
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro be90768b0a fix(userspace/falco): rename get_sysinfo
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro b9d7eb7ab3 refactor(cmake): selectively remove sources on win32
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro 115729a86a fix(unit_test): new macro for env var setting
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro 1b8525bf80 refactor(cmake): move compiler flags in another file
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro 6d4006a1ec feat(ci): create win32 and macos installer
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro f0d2f17c8d fix(userspace/falco): include windows.h in print actions
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro 907ced9f50 refactor(userspace/falco): add log level enum
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro df4e91476f chore(userspace/falco/app/actions): refactor sysinfo function
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro 29d3173ae3 feat(ci): add experimental other platforms support
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>

wip

Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro 5db29f4692 fix(unit_tests/falco): enable env test on win32
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro 0ca5251128 fix(userspace/falco): enable --support on windows
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro 89e45ced87 fix(userspace/falco): disable sys/select.h on windows
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro 5ee9ff8c8f fix(userspace/falco): disable program_output on windows
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro f7575292c6 fix(userspace/falco): disable sys/time.h+inotify on windows
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro af70b4e770 fix(userspace/falco): remove syslog on windows
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro 00a87234ce fix(userpsace/falco): print page size on windows
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro 325701ce4f fix(userspace/falco): use std::filesystem
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro 5b3cb654ff fix(userspace/falco): add PATH_MAX for windows build
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro e5e5416ade fix(userspace/falco): substitute syscall_evt_drop_action::IGNORE with DISREGARD
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro fb0d757bfe fix(userspace/falco): use io.h instead of unistd.h on win32
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro 7cf23fb7c6 fix(cmake): include jq only on linux
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro 345136c6c8 chore(cmake/modules): yaml-cpp bump
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro 916d571cd0 fix(cmake): various fixes for windows build
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>

Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
Roberto Scolaro e0f7c597be fix(build): various fixes for macos build
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-11-13 10:59:47 +01:00
dependabot[bot] 8cfa79fbc8 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `e206c1a` to `8f0520f`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](e206c1a3f1...8f0520fa09)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-09 15:00:27 +01:00
Lorenzo Susini 7319b93d9b update(userspace/falco): introduce new engine_version_semver key in versions endpoint
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-11-08 16:30:25 +01:00
Luca Guerra 3e95faac44 chore(gha): set cosign-installer to v3.1.2
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-11-05 06:06:14 +01:00
Samuel Gaist d074728994 feat(userspace/falco): add configuration support for IPV6 webserver listen address
The IPV6 capabilities is provided through cpp-httplib.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2023-11-03 09:09:08 +01:00
Samuel Gaist fac48cd145 test(configuration): implement basic webserver listen address test
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2023-11-03 09:09:08 +01:00
Samuel Gaist 91a9717779 feat(userspace/falco): implement configuration of webserver listening
address

Currently the webserver is listening on the hard coded 0.0.0.0. This
patch keeps this default but allows the administrator to change it.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2023-11-03 09:09:08 +01:00
Jason Dellaluce f5985720f1 fix(userspace/engine): cache latest rules compilation output
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-11-02 20:32:07 +01:00
Jason Dellaluce 2e7cacb4e0 fix(userspace/engine): solve description of macro-only rules
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-11-02 16:16:06 +01:00
Federico Di Pierro 214e41d093 new(docs): add changelog for 0.36.2.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-11-01 18:05:05 +01:00
Massimiliano Giovagnoli 1609ee8559 ci(.github): add ossf scorecard pipeline
Open Source Security Foundation Scorecard [1] is an automated tool
that assesses a number of important checks associated with
software security and assigns each check a score of 0-10.

Also, the OSSF Scorecard is one of the metrics monitored by
the CNCF CLO Monitor [2].

1. https://github.com/ossf/scorecard
2. https://github.com/cncf/clomonitor

Signed-off-by: Massimiliano Giovagnoli <me@maxgio.it>
2023-10-26 19:00:45 +02:00
Luca Guerra 3ff2bb5c2b cleanup(engine): strncpy -> strlcpy
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-10-19 17:41:22 +02:00
Luca Guerra 39aa8fe05f new(ci): add semgrep to check for banned functions
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-10-19 17:41:22 +02:00
Luca Guerra 1e38967b18 update(engine): remove banned.h
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-10-19 17:41:22 +02:00
Roberto Scolaro b7cef5bab2 fix(userspace/engine): fix memory leak
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-10-17 21:20:15 +02:00
Luca Guerra fec8a825cd update(ci): update setup-go action
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-10-17 16:20:16 +02:00
Luca Guerra fc35c02015 update(ci): update aws pipeline jobs
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-10-17 16:20:16 +02:00
Luca Guerra e68bb3be7d update(ci): upgrade docker pipeline jobs
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-10-17 16:20:16 +02:00
Andrea Terzolo 099332f958 new(docs): add changelog for 0.36.1
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-10-16 18:59:10 +02:00
dependabot[bot] e4054fc5ea build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `a22d0d7` to `e206c1a`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](a22d0d7a41...e206c1a3f1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-12 13:04:46 +02:00
Melissa Kilby dd807b19c8 feat(userspace): remove experimental outputs queue recovery strategies
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-10-12 13:03:46 +02:00
Gerald Combs 56401340c3 update(doc) Add Wireshark / Logray as adopters
Signed-off-by: Gerald Combs <gerald@wireshark.org>
2023-10-12 11:15:45 +02:00
dependabot[bot] 4b9a8d9388 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `d119706` to `a22d0d7`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](d119706074...a22d0d7a41)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-10 19:21:38 +02:00
Melissa Kilby 32b7ccd8dc cleanup(userspace/falco): reset s_timerid_exists at stats_writer teardown
Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-10-06 15:32:05 +02:00
Melissa Kilby d28f43cd98 chore: apply codespell fixes
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-10-06 15:32:05 +02:00
Melissa Kilby 943446ba97 cleanup(userspace/falco): add more comments around timer_delete workaround
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-10-06 15:32:05 +02:00
Melissa Kilby d4a4de9055 fix(userspace/falco): timer_delete() workaround due to bug in older GLIBC
Workaround for older GLIBC versions (< 2.35), where calling timer_delete()
with an invalid timer ID not returned by timer_create() causes a segfault because of
a bug in GLIBC (https://sourceware.org/bugzilla/show_bug.cgi?id=28257).

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-10-06 15:32:05 +02:00
Luca Guerra e6d71d2e8e fix(gha): update rpmsign
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-10-05 18:39:00 +02:00
Luca Guerra a77e2dec10 fix(gha): use fedora instead of centos 7 for package publishing
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-10-05 11:27:58 +02:00
Luca Guerra f1dec8f444 chore(gha): pin actions with hash, add TODO for upgrades
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-10-03 15:11:54 +02:00
Luca Guerra 27ad4c3aec update(gha): update checkout action to v4
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-10-03 15:11:54 +02:00
dependabot[bot] 28edf94feb build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `c366d5b` to `d119706`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](c366d5bd03...d119706074)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-02 15:53:48 +02:00
Federico Di Pierro 3c93249efb new(ci): properly link libs and driver releases linked to a Falco release.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-09-29 19:01:22 +02:00
Andrea Terzolo 29d2406414 cleanup(falco)!: remove `outputs.rate` and `outputs.max_burst`
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-29 01:47:21 +02:00
Lorenzo Susini 09b1f92267 update(userspace/engine): update falco engine checksum
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-09-28 20:05:21 +02:00
Lorenzo Susini 26e421155b update(submodule): update testing submodule
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-09-28 20:05:21 +02:00
Lorenzo Susini 155b2009f3 update(cmake): bump libs version to add the new sinsp_version class impl
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-09-28 20:05:21 +02:00
Lorenzo Susini 1326ca356e update(userspace/engine): address jasondellaluce comments for maintainability
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-09-28 20:05:21 +02:00
Lorenzo Susini 9bbf9716b6 update(userspace/falco): engine version semver in protobuf and versions_info
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-09-28 20:05:21 +02:00
Lorenzo Susini f8cbeaaa9b update(userspace/engine): let the rule loader reader and collector be able to load rules with both numeric and semver string required_engine_version
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-09-28 20:05:21 +02:00
Lorenzo Susini cd6cb14c08 update(userspace/engine): convert engine version to semver string
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-09-28 20:05:21 +02:00
Jason Dellaluce d3e1a1f746 chore(userspace/engine): apply codespell suggestions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-09-28 12:39:20 +02:00
Jason Dellaluce aae114c331 refactor(userspace/engine)!: rename some description details outputs
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-09-28 12:39:20 +02:00
Jason Dellaluce b67ad907a7 fix(userspace/engine): solve issues with filter details resolver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-09-28 12:39:20 +02:00
Jason Dellaluce dc264a0577 fix(userspace/engine): solve issues in describing rules/macros/lists
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-09-28 12:39:20 +02: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
Jason Dellaluce cba80a404f fix(userspace/engine): print rules fields with arguments
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-09-28 12:39:20 +02:00
Jason Dellaluce 26bdefae8e update(userspace/engine): support printing plugins used by rules
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-09-28 12:39:20 +02:00
Jason Dellaluce dce5cac820 update(userspace/engine): find evt names in filter resolver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-09-28 12:39:20 +02:00
Jason Dellaluce ab77a5d687 update(userspace/engine): refactor rule describe methods to accept plugins
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-09-28 12:39:20 +02:00
Federico Di Pierro 7c7ec800a6 chore(ci): bumped rn2md to latest master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-09-27 11:20:12 +02:00
dependabot[bot] e0ac9c4142 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `7a7cf24` to `c366d5b`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](7a7cf24f7d...c366d5bd03)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-27 11:00:12 +02:00
Andrea Terzolo 4de74f3963 cleanup(falco)!: remove `--userspace` support
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-26 16:14:07 +02:00
Luca Guerra cca1d705c2 fix(docs): 0.36.0 release date
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-26 12:38:07 +02:00
Luca Guerra bbb8b014c5 update(docs): add changelog for 0.36.0
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-26 12:38:07 +02:00
dependabot[bot] 2571225571 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `77ba57a` to `7a7cf24`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](77ba57ab2c...7a7cf24f7d)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-26 11:10:07 +02:00
Federico Di Pierro b02898dc4c chore(cmake): bumped libs to 0.13.1.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-09-25 14:30:05 +02:00
dependabot[bot] 66ece1a9ac build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `69c9be8` to `77ba57a`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](69c9be89d7...77ba57ab2c)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-22 19:36:49 +02:00
Andrea Terzolo ab6d76e6d2 chore: bump submodule testing to 62edc65
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-22 15:20:49 +02:00
Luca Guerra 260f189028 update(gha): add version for rn2md
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-22 14:34:49 +02:00
dependabot[bot] 1b29389ed4 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `6d3fcf0` to `69c9be8`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](6d3fcf0467...69c9be89d7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-22 14:27:49 +02:00
Federico Di Pierro bb92dcfd2f update(cmake): bumped falcoctl to 0.6.2.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-09-22 13:04:49 +02:00
Federico Di Pierro 0884ca4c6f chore: automatically attach release author to release body.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-09-22 12:18:49 +02:00
Federico Di Pierro e836157771 chore(ci): added permissions to release-body job.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-09-21 21:04:47 +02:00
Federico Di Pierro 086deb9c6d chore(ci): only run release-body for latest releases, and properly override release name.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-09-21 21:04:47 +02:00
Federico Di Pierro 49adbf6d08 new(ci): autogenerate release body.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-09-21 21:04:47 +02:00
Andrea Terzolo 16a37e5c2e fix(dockerfile): remove useless CMD
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-21 17:38:47 +02:00
Andrea Terzolo c5996bd0cf chore: bump libs to the latest tag
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-21 16:53:47 +02:00
Andrea Terzolo 83db0bb4e2 docs: add a warning for metrics
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-21 16:53:47 +02:00
Andrea Terzolo d61eaeb5fc chore: bump to the latest libs
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-21 16:53:47 +02:00
Luca Guerra 111a76879b update(falco): bundle rules 2.0.0
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-21 16:16:47 +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
dependabot[bot] e3e854f016 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `bea364e` to `6d3fcf0`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](bea364ef41...6d3fcf0467)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-21 12:36:47 +02:00
Federico Di Pierro 5ed9dc0c3a update(cmake): bumped plugins to latest stable versions.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-09-21 10:53:47 +02:00
Andrea Terzolo 2c95fae9eb chore: bump to latest libs
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-19 14:07:33 +02:00
dependabot[bot] e3e9efa661 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `ee5fb38` to `bea364e`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](ee5fb38eba...bea364ef41)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-19 08:45:41 +02:00
Luca Guerra 9f5e458f92 update(build): update falcoctl to 0.6.1
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-18 16:29:47 +02:00
dependabot[bot] 071910e6dc build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `43580b4` to `ee5fb38`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](43580b4ceb...ee5fb38eba)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-15 10:38:32 +02:00
Federico Di Pierro cf10d9022e update(cmake): bumped libs to 0.13.0-rc2 and driver to 6.0.1+driver.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-09-14 15:49:27 +02:00
Luca Guerra 60a64ac647 fix(docker): get the driver loader legacy from the right directory
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-13 15:19:40 +02:00
Luca Guerra e5e7a4761d fix(build): set the right bucket and version for driver legacy
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-13 15:19:40 +02:00
Andrea Terzolo 6bd40f3ea2 cleanup: thrown exceptions and avoid multiple logs
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-13 11:28:40 +02:00
dependabot[bot] c9a424d75e build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `c6e01fa` to `43580b4`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](c6e01fa7a5...43580b4ceb)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-13 09:29:39 +02:00
dependabot[bot] e2b21402ae build(deps): Bump submodules/falcosecurity-testing
Bumps [submodules/falcosecurity-testing](https://github.com/falcosecurity/testing) from `76d1743` to `30c3643`.
- [Commits](76d1743a0a...30c36439fc)

---
updated-dependencies:
- dependency-name: submodules/falcosecurity-testing
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-13 09:28:40 +02:00
Luca Guerra 7b4264918b update(docs): add driver-loader-legacy to readme and fix bad c&p
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-12 13:33:35 +02:00
Jason Dellaluce 5595212ff9 fix(userspace/falco): clearing full output queue
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-09-12 13:19:35 +02:00
dependabot[bot] fdd520f163 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `d31dbc2` to `c6e01fa`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](d31dbc26ea...c6e01fa7a5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-12 09:16:34 +02:00
Leonardo Grasso b5e3ef95fe docs: add LICENSE file
This commit creates a copy of https://github.com/falcosecurity/falco/blob/master/COPYING (which is kept for historical reasons) to address the recommendation reported by https://github.com/falcosecurity/evolution/issues/317

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-09-12 09:15:34 +02:00
Luca Guerra 37ce18f457 fix(docker): prevent variable expansion with FALCO_DRIVER_LOADER_OPTIONS
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-11 14:59:30 +02:00
Luca Guerra dae36c798a new(docker): allow passing options to falco-driver-loader from the container image
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-11 14:59:30 +02:00
dependabot[bot] 30aa28f2a6 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `b6372d2` to `d31dbc2`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](b6372d2675...d31dbc26ea)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 10:59:14 +02:00
Luca Guerra d5e80fee0b update(docs): add section about the experimental distroless image
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-11 10:03:13 +02:00
Luca Guerra b3b4f4a431 update(build): build and release falco-distroless
Signed-off-by: Luca Guerra <luca@guerra.sh>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2023-09-11 10:03:13 +02:00
Adrian Mouat de5eec5285 new(docker): add distroless Dockerfile
Signed-off-by: Adrian Mouat <adrian@chainguard.dev>
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-11 10:03:13 +02:00
Leonardo Grasso 35cb960917 update(userspace/engine): align `%container.info` defaults with new rule styles
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-09-08 19:00:04 +02:00
Andrea Terzolo e55bedac0b fix(stats): always initialize m_output
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-07 19:13:00 +02:00
Luca Guerra c2b940f8c4 update(docker): remove packages that are not strictly necessary
Signed-off-by: Luca Guerra <luca@guerra.sh>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2023-09-07 15:55:59 +02:00
Luca Guerra 22bd6f7352 update(build): publish the legacy driver image
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-07 15:55:59 +02:00
Luca Guerra 1616ac666b update(docker): add the legacy driver loader image
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-07 15:55:59 +02:00
Luca Guerra 02982e0375 update(docker): upgrade Falco driver loader image
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-07 15:55:59 +02:00
dependabot[bot] eb8e4b9a29 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `6ed73fe` to `b6372d2`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](6ed73fee78...b6372d2675)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 13:41:59 +02:00
Melissa Kilby 73f15e6c5b cleanup(userspace/falco): adjust outputs_queue_num_drops counter for recovery 'empty'
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-09-07 13:15:59 +02:00
Melissa Kilby dad2762ed6 fix(userspace/falco): change outputs_queue_num_drops to atomic
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-09-07 13:15:59 +02:00
Melissa Kilby 88a5e1bf45 cleanup(config): rename default outputs queue macro
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-09-07 13:15:59 +02:00
Melissa Kilby 0eff98aa8e cleanup: apply more reviewers suggestions
Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-09-07 13:15:59 +02:00
Melissa Kilby 016fdae93b cleanup: apply reviewers suggestions
Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-09-07 13:15:59 +02:00
Melissa Kilby a61f24066f cleanup(userspace/falco): always set queue capacity and use largest long as default for unbounded
Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-09-07 13:15:59 +02:00
Melissa Kilby 1e94598eca new(metrics): add falco.outputs_queue_num_drops metrics + plus fix rebase leftovers
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-09-07 13:15:59 +02:00
Melissa Kilby 85883b7200 cleanup(outputs): adopt different style for outputs_queue params encodings
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-09-07 13:15:59 +02:00
Melissa Kilby 03a557725b cleanup(outputs): ensure old defaults in queue_capacity_outputs in new config
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-09-07 13:15:59 +02:00
Melissa Kilby b55b209edf fix(outputs): expose queue_capacity_outputs config for memory control
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-09-07 13:15:59 +02:00
Luca Guerra d1b932d2e9 update(docker): use debian 12 slim for falco no driver
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-07 12:49:59 +02:00
Luca Guerra a22dac6866 update(falco)!: --list-syscall-events is now called --list-events
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-07 12:47:59 +02:00
Luca Guerra bfb22527a2 chore(falco): update engine version and checksum
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-07 12:47:59 +02:00
Luca Guerra b21bfd6e8d new(falco): print all events (not just syscall)
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-07 12:47:59 +02:00
Leonardo Grasso 79b39b54d0 update(cmake/modules): bump rules to falco-rules-2.0.0-rc1
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-09-07 12:34:59 +02:00
Leonardo Grasso 7cd299e658 chore(submodule): bump testing framework to `76d1743`
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-09-07 12:34:59 +02:00
Leonardo Grasso e8e8c6413f fix(ci): make scap file work from within the container
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-09-07 12:34:59 +02:00
Federico Di Pierro 4d590fa6ee update(cmake): bumped libs to 0.13.0-rc1 and driver to 6.0.0+driver.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-09-06 17:20:00 +02:00
Daniel Wright 513f122aff feat: support parsing of system environment variables in yaml
In order to allow the user to supply environment variables in standard
ways performed in other applications the get_scalar function has been
extended to support defining an environment variable in the format
`${FOO}`. Environment variables can be escaped via defining as `$${FOO}`.
As this handles some additional complexity, a unit test has been  added
to cover this new functionality

Signed-off-by: Daniel Wright <danielwright@bitgo.com>
2023-09-06 11:45:00 +02:00
dependabot[bot] 5ffffeeada build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `b42893a` to `6ed73fe`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](b42893a6eb...6ed73fee78)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 09:59:59 +02:00
Vicente J. Jiménez Miras 3dae1cbf91 docs(README.md): correct URL
Signed-off-by: Vicente J. Jiménez Miras <vjjmiras@gmail.com>
2023-09-05 17:07:57 +02:00
Andrea Terzolo 12735bdfb1 chore: bump Falco to latest libs
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-05 16:41:57 +02:00
Andrea Terzolo f7c628f623 ci: disable falco-driver-loader tests on ARM64
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-05 11:15:55 +02:00
Leonardo Grasso b2374b3c19 fix(userspace/falco): apply suggestions for CLI help messages
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-09-04 18:50:52 +02:00
Leonardo Grasso 93e8be1e32 update(userspace/falco): revised CLI help messages
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-09-04 18:50:52 +02:00
Luca Guerra b246bcb052 fix(engine): fix werror reorder
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-09-04 17:26:52 +02:00
Andrea Terzolo 6251af0ab6 new: introduce new stats updated to the latest libs version
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-04 17:24:52 +02:00
Andrea Terzolo ce79e01ae8 ci: support tests on amazon-linux
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-04 15:12:51 +02:00
Leonardo Grasso 9db4c9b2cb build(cmake/modules): upgrade `falcoctl` to version 0.6.0
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-09-04 14:18:51 +02:00
Andrea Terzolo dba685eeda tests: enable e2e falco-driver-loader tests
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-04 12:19:46 +02:00
Andrea Terzolo 4f8d11acdd chore: bump engine version and checksum
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-04 12:19:46 +02:00
Andrea Terzolo 3c47915c56 chore: bump Falco to latest libs master
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-04 12:19:46 +02:00
Federico Di Pierro 0ec492086e fix(userspace/falco): properly delete metrics timer upon leaving.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-09-04 11:22:46 +02:00
Andrea Terzolo 442d1accbe cleanup: deprecate rate limiter mechanism
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-04 10:11:45 +02:00
Melissa Kilby 79577237a1 cleanup(config): add info about performance impact wrt rule_matching
Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-09-04 10:10:46 +02:00
Melissa Kilby 08237b946f cleanup(config): add more info
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-09-04 10:10:46 +02:00
Andrea Terzolo 62e762a467 cleanup: deprecate no more supported `userspace` mode
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-04 10:09:46 +02:00
Andrea Terzolo e6fe0a516d fix: fix falco MINIMAL_BUILD
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-09-04 10:09:46 +02:00
dependabot[bot] a6b12a5c97 build(deps): Bump submodules/falcosecurity-testing
Bumps [submodules/falcosecurity-testing](https://github.com/falcosecurity/testing) from `b39c807` to `9110022`.
- [Commits](b39c807a19...91100227b0)

---
updated-dependencies:
- dependency-name: submodules/falcosecurity-testing
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 10:08:46 +02:00
dependabot[bot] b15a51a825 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `3f52480` to `b42893a`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](3f52480618...b42893a6eb)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-01 06:50:31 +02:00
Jason Dellaluce c8122ff474 fix(userspace/engine): support appending to unknown sources
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-09-01 06:46:31 +02:00
Jason Dellaluce 88dcdaac8a update(submodules): bump falcosecurity-testing to b39c807
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-31 18:33:30 +02:00
Jason Dellaluce eabf49892d update(userspace/falco): bump engine version to 24
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-31 18:33:30 +02:00
Jason Dellaluce 901fca2257 update(userspace/engine): upgrade skip-if-unknown-filter YAML field
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-31 18:33:30 +02:00
Andrea Terzolo cc8d6705f6 fix: fix "ebpf_enabled" output stat
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-08-31 17:37:29 +02:00
Federico Di Pierro 26f626c1d5 chore(userspace/falco): properly check that parent init() did not fail for reasons.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2023-08-31 16:11:29 +02:00
Federico Di Pierro acaaa0b4ca cleanup(userspace/falco): improvements to the http output perf.
Moreover, add option to disable stdout echoing.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-08-31 16:11:29 +02:00
hjenkins 63ba15962b fix(scripts): falco-driver-loader add print env
Fixes #2352

Needed to refactor the target_id code paths to allow this to be used in
env printing and sourcing.

Signed-off-by: hjenkins <henry@henryjenkins.name>
2023-08-31 12:10:28 +02:00
dependabot[bot] f163780d62 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `3ceea88` to `40a9817`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](3ceea88eeb...40a9817330)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-31 09:22:29 +02:00
Jason Dellaluce 01093d2dfc fix(userspace/engine): support both old and new gcc + std::move
Old gcc versions (e.g. 4.8.3) won't allow move elision
but newer versions (e.g. 10.2.1) would complain about
the redundant move.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-30 20:57:27 +02:00
Jason Dellaluce a6c2bf7123 update(cmake): support building libs and driver from forks
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-30 19:13:26 +02:00
Andrea Terzolo 988703b601 clenaup: remove b64 from falco dependencies
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-08-30 19:12:26 +02:00
jabdr 66841d8009 Support reload in falco-modern-bpf.service
Signed-off-by: jabdr <jd@q321.de>
2023-08-30 15:28:26 +02:00
jabdr 43ae8b0cac Support reload in falco-custom.service
Signed-off-by: jabdr <jd@q321.de>
2023-08-30 15:28:26 +02:00
jabdr 9a5f625d5f Support reload in falco-bpf.service
Signed-off-by: jabdr <jd@q321.de>
2023-08-30 15:28:26 +02:00
jabdr 799c09e638 Support reload in falco-kmod.service
Signed-off-by: jabdr <jd@q321.de>
2023-08-30 15:28:26 +02:00
Richard Tweed 2f267a044e Merge in master
Signed-off-by: Richard Tweed <RichardoC@users.noreply.github.com>
2023-08-29 17:57:21 +02:00
Richard Tweed 7b6d45c394 Update README. based on FedeDP's suggestion
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Richard Tweed <RichardoC@users.noreply.github.com>
2023-08-29 17:57:21 +02:00
Richard Tweed 368796df61 Issue 2391 Document why Falco is written in C++ rather than anything else
Signed-off-by: Richard Tweed <RichardoC@users.noreply.github.com>
2023-08-29 17:57:21 +02:00
Andrea Terzolo 8d6c6900d3 cleanup: turn a warning into an error
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-08-29 13:46:21 +02:00
Andrea Terzolo 34d796439f cleanup: fail if the time unit is not specified
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-08-29 13:46:21 +02:00
Anna Simon c8d1637130 feat(userspace/outputs_http): Add option for mTLS
Signed-off-by: Anna Simon <asimon@mercari.com>
2023-08-29 10:28:21 +02:00
Jason Dellaluce 600318aaae update(ci): minimize retention days for build-only CI artifacts
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-29 09:33:21 +02:00
Andrea Terzolo ba1528e3c2 cleanup: remove unused `--pidfile` option
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-08-28 17:06:19 +02:00
Melissa Kilby 37ea9b25c4 feat(userspace): deprecate `-d` daemonize option
Deprecate `-d` option (currently broken).

Symptoms included the message queue filling up without popping any messages
even though events were handled normally.

Maintainers decided to deprecate not needed `-d` option while keeping
the useful `pidfile` command args option.

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-08-25 18:14:45 +02:00
Melissa Kilby b66bf2c6e4 cleanup: remove some unused variables
Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-08-25 15:20:45 +02:00
Melissa Kilby 0d4e77bcbe cleanup(config): assign Stable to metrics config
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-08-25 15:20:45 +02:00
Melissa Kilby 6cdb740786 cleanup(userspace): update parse_prometheus_interval
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-08-25 15:20:45 +02:00
Melissa Kilby 9a12a93342 feat(userspace): deprecate stats command args option in favor of metrics configs in falco.yaml
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-08-25 15:20:45 +02:00
Leonardo Grasso 84fe33a029 fix(userspace/falco): correct typo in `-p` help message
Co-authored-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-08-25 15:18:45 +02:00
Leonardo Grasso 8fbf49bbba update(userspace/falco): new defaults for `-p` presets
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-08-25 15:18:45 +02:00
Leonardo Grasso f10d0499d2 update(userspace/falco): improve help message for `-p` option
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-08-25 15:18:45 +02:00
dependabot[bot] 259095651b build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `bf1639a` to `3ceea88`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](bf1639a574...3ceea88eeb)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-25 10:26:45 +02:00
dependabot[bot] e5b9dd2dfc build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `64ce419` to `bf1639a`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](64ce419d92...bf1639a574)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-24 11:48:39 +02:00
Melissa Kilby 9620515e40 cleanup(config): assign Stable to base_syscalls config
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-08-24 10:41:39 +02:00
Jason Dellaluce 4f3181cb1c update(userspace/engine): bump engine version to 23
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-24 10:30:40 +02:00
Jason Dellaluce fe66abf15c update(cmake): bump libs and driver to 6caaa3c85d7c783b29cd32832f2552a4bd6cd739
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-24 10:30:40 +02:00
Jason Dellaluce 527c42c030 chore: polish conditional compilation flags for emscripten
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-24 10:30:40 +02:00
Jason Dellaluce aa62b65c70 update(cmake): bump libs and drivers to 1bb3eea5380c06a4aceb635f70cf62829951ef00
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-24 10:30:40 +02:00
Jason Dellaluce 78e2ddc63e fix: solve cmake issues
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-24 10:30:40 +02:00
Jason Dellaluce 179b191f70 chore(cmake): cleanup comment
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Rohith Raju <rohithraju488@gmail.com>
2023-08-24 10:30:40 +02:00
Jason Dellaluce a439d5b556 refactor(ci): build and upload WASM packages
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Rohith Raju <rohithraju488@gmail.com>
2023-08-24 10:30:40 +02:00
Jason Dellaluce 828fa7d14d update(cmake): fix wasm package content
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Rohith Raju <rohithraju488@gmail.com>
2023-08-24 10:30:40 +02:00
Jason Dellaluce 590b034a55 fix: solve plugin loading error
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Rohith Raju <rohithraju488@gmail.com>
2023-08-24 10:30:40 +02:00
Jason Dellaluce 54ab1eed9e update(cmake): update add emmc link_options
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Rohith Raju <rohithraju488@gmail.com>
2023-08-24 10:30:40 +02:00
rohith-raju 05f483d751 update(cleanup): clean gitignore file
Signed-off-by: rohith-raju <rohithraju488@gmail.com>
2023-08-24 10:30:40 +02:00
rohith-raju c73e43c973 cleanup: fix workflow and build errors
Signed-off-by: rohith-raju <rohithraju488@gmail.com>
2023-08-24 10:30:40 +02:00
rohith-raju e8ee850dee update(ci,cmake): add support for emscripten build
Signed-off-by: rohith-raju <rohithraju488@gmail.com>
2023-08-24 10:30:40 +02:00
rohith-raju 105f2f6ee3 update(unit_tests): use typecast as wasm can't handle 64 bit int
Signed-off-by: rohith-raju <rohithraju488@gmail.com>
2023-08-24 10:30:40 +02:00
Jason Dellaluce ce6368a89e fix: solve runtime issues with emscripten build
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Rohith Raju <rohithraju488@gmail.com>
2023-08-24 10:30:40 +02:00
Jason Dellaluce 0faa45669b update(build): setup cpack for emscripten build
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Rohith Raju <rohithraju488@gmail.com>
2023-08-24 10:30:40 +02:00
Jason Dellaluce aa6061681d update: adapt code to multi-platform builds
Co-authored-by: Rohith Raju <rohithraju488@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-24 10:30:40 +02:00
Jason Dellaluce 86e76924a1 update: adapt cmake setup for non-linux and emscripten builds
Co-authored-by: Rohith Raju <rohithraju488@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-24 10:30:40 +02:00
Johanan Liebermann e7c5139563 Allow specifying kernel release and version
Signed-off-by: Johanan Liebermann <jliebermann@microsoft.com>
2023-08-24 09:17:39 +02:00
Andrea Terzolo bc12e567e5 docs(config.yaml): fix wrong severity levels in sinsp
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-08-23 11:44:28 +02:00
dependabot[bot] b2ad928d6c build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `0d0e333` to `64ce419`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](0d0e333151...64ce419d92)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-23 10:20:27 +02:00
Johanan Liebermann f4c8833a0e Relocate tools on Flatcar in BPF mode
In https://github.com/falcosecurity/falco/pull/2043 we've added logic
for relocating tools on Flatcar when running falco-driver-loader in kmod
mode. This logic is relevant for BPF mode, too, which is currently
broken on Flatcar. Call flatcar_relocate_tools in BPF mode, too.

Signed-off-by: Johanan Liebermann <jliebermann@microsoft.com>
2023-08-21 10:48:20 +02:00
Leonardo Grasso a2b21fa264 update(cmake/modules): compute version using libs' GetVersionFromGit
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-08-11 16:47:47 +02:00
Leonardo Grasso 5900332f30 chore(cmake/modules): remove GetGitRevisionDescription
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-08-11 16:47:47 +02:00
Leonardo Grasso d24cb7b378 update: bump libs and driver to 942a2249b
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-08-11 16:47:47 +02:00
Lorenzo Susini 4e6149e5da update(userspace/engine): make rule_matching strategy stateless in falco engine
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-08-11 10:11:46 +02:00
Lorenzo Susini 6e50d2ad83 update: directly return match_found variable
Co-authored-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Lorenzo Susini <49318629+loresuso@users.noreply.github.com>
2023-08-09 13:36:39 +02:00
Lorenzo Susini 2660582198 update(userspace/engine): bump engine version to 22
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-08-09 13:36:39 +02:00
Lorenzo Susini 812e131f1e update: bump falcosecurity/testing
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-08-09 13:36:39 +02:00
Lorenzo Susini 0a76cca4ae update(userspace/engine): bump engine version to 21
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-08-09 13:36:39 +02:00
Lorenzo Susini cfecd22ec0 update(falco.yaml): update rule_matching configuration setting description
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-08-09 13:36:39 +02:00
Lorenzo Susini 6acd924c50 perf: avoid stack allocation and make use of switch to select behavior on rule matching strategy
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-08-09 13:36:39 +02:00
Lorenzo Susini 1705c0dab3 update(userspace/engine): allow the engine to match and handle multiple rules while processing events
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-08-09 13:36:39 +02:00
Lorenzo Susini 46e8f2c14b update(userspace/falco): handle the new rule matching configuration key
Added a set method for the rule matching strategy on the engine.
This allows to modify the stategy at runtime withotu the need to
rebuild an engine from scratch.

Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-08-09 13:36:39 +02:00
Lorenzo Susini c6abf6a133 update(falco.yaml): introduce rule_matching config key
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-08-09 13:36:39 +02:00
Andrea Terzolo ac3ba50e7c chore: bump falcosecurity-testing submodule version
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-08-08 14:10:36 +02:00
Andrea Terzolo 528a76a7fe update(userspace/engine): bump engine version to 21
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-08-08 14:10:36 +02:00
Andrea Terzolo f23f4458f7 update(cmake): bump libs version
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-08-08 14:10:36 +02:00
Andrea Terzolo d58e29eb65 update(cmake): bump driver version
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-08-08 14:10:36 +02:00
Andrea Terzolo 7125492704 ci: fix build after openssl bump in falcosecurity libs
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-08-08 14:10:36 +02:00
Jason Dellaluce bc0fef15ca update(userspace/engine): bump engine version to 20
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-07 17:29:32 +02:00
Jason Dellaluce 450bfd4b2f update(cmake): bump driver to 5.1.0+driver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-07 17:29:32 +02:00
Jason Dellaluce 26032fc822 update(cmake): bump libs and driver to 0.12.0
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-07 17:29:32 +02:00
Jason Dellaluce 23a0005b25 fix(ci): solve malformed worflow issues
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-04 16:03:22 +02:00
Jason Dellaluce f44df95304 update(release.md): make engine version bump more strict
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-04 16:03:22 +02:00
Jason Dellaluce 5790f0ff64 update: refine engine checksum docs and scoping
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-04 16:03:22 +02:00
Jason Dellaluce 16a1e9734b new(ci): add message warning for engine version
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-04 16:03:22 +02:00
Jason Dellaluce 3782c4bfd6 update(ci): add engine version checks in PR jobs
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-04 16:03:22 +02:00
Jason Dellaluce 803d131843 fix(userspce/engine): skip deprecated fields in --list -N option
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-04 16:03:22 +02:00
Jason Dellaluce fafb7c4a72 cleanup(userspace/falco): remove lagacy fields checksum check
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-04 16:03:22 +02:00
Leonardo Grasso e3be7a7309 chore(docker): remove UBI
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-08-04 15:43:22 +02:00
Leonardo Grasso 120a3accc8 docs(docker): remove UBI
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-08-04 15:43:22 +02:00
Jason Dellaluce babfafc5ab cleanup: remove builder image
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-04 10:32:21 +02:00
Jason Dellaluce b3e05173f4 cleanup(.github): remove builder bumper job
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-04 10:32:21 +02:00
Jason Dellaluce 1b0871a13a cleanup(.circleci): drop circleci
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-04 10:32:21 +02:00
Jason Dellaluce 35fab0a60c cleanup(docker/builder): remove workaround for circleci tests
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-04 10:32:21 +02:00
Jason Dellaluce b546a3932a cleanup: remove tester and local images
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-04 10:32:21 +02:00
Jason Dellaluce 24dde1cbe0 cleanup(.circleci): remove jobs using python regression tests
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-04 10:32:21 +02:00
Jason Dellaluce b1ae5d3dd9 cleanup(test): remove python regression tests
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-08-04 10:32:21 +02:00
Leonardo Grasso 2583ea9bfd docs(brand): update glossary of key terms
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-08-04 10:14:21 +02:00
Leonardo Grasso 5ba4fd1f9c docs(brand): remove redundancy with the website
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-08-04 10:14:21 +02:00
dependabot[bot] be20f03698 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `9126bef` to `0328c59`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](9126bef2a7...0328c590db)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-04 10:13:21 +02:00
Leonardo Grasso e0c6c9de84 docs(README.md): correct typo
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-08-02 14:58:15 +02:00
Leonardo Grasso 4c008d67d2 docs(README.md): minor improvements
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-08-02 14:58:15 +02:00
Leonardo Grasso 784284c692 update(userspace/falco): improve cli flag description related to drivers
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-07-28 14:59:46 +02:00
Jason Dellaluce 0881aea663 update(ci): integrate tests and ci workflow for release branch and tags
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-07-27 19:35:41 +02:00
dependabot[bot] 743c7c49d5 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `0d0e333` to `9126bef`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](0d0e333151...9126bef2a7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-27 15:11:42 +02:00
dependabot[bot] f8c6242b3a build(deps): Bump certifi from 2022.12.7 to 2023.7.22 in /test
Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.12.7 to 2023.7.22.
- [Commits](https://github.com/certifi/python-certifi/compare/2022.12.07...2023.07.22)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-27 15:10:42 +02:00
dependabot[bot] 1f95b77c13 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `3f52480` to `0d0e333`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](3f52480618...0d0e333151)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-24 21:04:33 +02:00
Luca Guerra 02202620ff update(falco): update libs to 0790cff
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-07-19 10:20:36 +02:00
Luca Guerra 33d4d2d5fc update(cmake): update cpp-httplib to 0.13.1
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-07-17 14:15:31 +02:00
dependabot[bot] edecd99f1b build(deps): Bump submodules/falcosecurity-testing
Bumps [submodules/falcosecurity-testing](https://github.com/falcosecurity/testing) from `4544d3c` to `3cc2024`.
- [Commits](4544d3c1d2...3cc202497a)

---
updated-dependencies:
- dependency-name: submodules/falcosecurity-testing
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-17 14:13:31 +02:00
Luca Guerra 88fb693595 update(falco): update libs to dc02e50
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-07-11 16:23:02 +02:00
Nicolas-Peiffer 8d68952de8 doc: Adding Thalesgroup as Falco adopters
Signed-off-by: Nicolas-Peiffer <Nicolas-Peiffer>

doc: fix typo

Signed-off-by: Nicolas-Peiffer <Nicolas-Peiffer>
2023-07-04 11:49:28 +02:00
Lorenzo Susini fb8986042d docs: update changelog for 0.35.1
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-06-29 13:01:00 +02:00
Luca Guerra 0ad1cb8c61 update(OWNERS): add LucaGuerra to owners
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-06-29 10:27:59 +02:00
Jason Dellaluce b041391e93 update(cmake): bump libs to 0.11.3
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-06-28 10:53:55 +02:00
Andrea Terzolo 2712db5f79 CI: bump ubuntu version for tests-driver-loader-integration
bump Ubuntu version on tests-driver-loader-integration job to fix a
verifier issue as a temp workaround

Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2023-06-27 14:48:54 +02:00
Federico Di Pierro fbcb971751 fix(scripts): fix falco-driver-loader for debian.
Support debian `rt` and `cloud` flavors.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-06-23 16:14:59 +02:00
Jason Dellaluce ba8e9af22d chore(userspace/falco): fix misleading content
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-06-22 17:14:55 +02:00
Jason Dellaluce 8f4b7324ad chore: apply codespell suggestions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-06-22 17:14:55 +02:00
Jason Dellaluce 8c5c672c9e fix(userspace/falco/app): evt sources safety check issues in live mode
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-06-22 17:14:55 +02:00
Jason Dellaluce 9d29a3afb2 update(userspace/falco/app): check illegal source setup in live inspectors
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-06-22 17:14:55 +02:00
Jason Dellaluce 893a3c90da update(userspace/falco/app): print loaded event sources
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-06-22 17:14:55 +02:00
Roberto Scolaro c2af4c3a21 fix(scripts/falco-driver-loader): fixed ubuntu kernel version
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-06-22 15:17:55 +02:00
Melissa Kilby e7534d9455 cleanup(config): minor config clarifications
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-06-22 10:23:55 +02:00
Federico Di Pierro f7e15ca282 chore(userspace): cleanup old code.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-06-22 10:08:55 +02:00
Federico Di Pierro c0ea9b3618 fix(userspace): switch to `timer_settime` API in stats writer.
It seems like `setitimer` is not correctly working when built from CI; perhaps a gcc/glibc bug?

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-06-22 10:08:55 +02:00
Jason Dellaluce 5b0ed1eb56 update(cmake): bump falco rules to v1.0.1
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-06-21 18:45:53 +02:00
Jason Dellaluce 7c387069af chore(userspace/falco): make source matching error more expressive
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-06-21 15:41:52 +02:00
dependabot[bot] 2b9082209b build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `c2c2f6d` to `f5ef8d9`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](c2c2f6d38a...f5ef8d98d5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 10:19:50 +02:00
Melissa Kilby 6939478970 vote: update(OWNERS): add incertum (Melissa Kilby) to approvers
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-06-19 18:27:46 +02:00
Federico Di Pierro aa6b8c97c0 chore(ci): only install awscli from repo.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-06-16 12:42:23 +02:00
Federico Di Pierro 6025e4bcf0 fix(ci): fixed publish deb packages with new debian bookwork.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-06-16 12:42:23 +02:00
Jason Dellaluce 58a29cd359 fix(.github): skip some regression tests in static build
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-06-15 15:03:20 +02:00
dependabot[bot] 4ba46c59ca build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `32b6353` to `c2c2f6d`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](32b635394c...c2c2f6d38a)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-15 15:01:20 +02:00
Aurimas Rudinskis e6b03d2a9d Update ADOPTERS.md
Add Vinted to Falco adapters

Signed-off-by: Aurimas Rudinskis <58468822+arudinskis@users.noreply.github.com>
2023-06-15 15:00:20 +02:00
Jason Dellaluce 20042c3dd4 fix(ci): skip plugins and falcoctl tests for static build
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-06-13 16:55:11 +02:00
Jason Dellaluce 78eac4e2cb update(ci): run GHA regression tests on static falco builds
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-06-13 10:50:10 +02:00
Jason Dellaluce 0a405c9905 update(submodules): bump falcosecurity/testing to 4544d3c1d2bc4516251fcc8766b92e7cd0d489be
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-06-13 10:50:10 +02:00
Jason Dellaluce 4b78c99def update(cmake): bump falcoctl to v0.5.1
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-06-13 10:50:10 +02:00
Jason Dellaluce 598f34ca01 wip: include regression tests in master's CI
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-06-13 10:50:10 +02:00
Jason Dellaluce 47f9f0d878 update(submodules): add falcosecurity/testing submodule
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-06-13 10:50:10 +02:00
Lorenzo Susini 0034d01a50 update(userspace): change description of snaplen option
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-06-12 14:45:09 +02:00
dependabot[bot] c54bc7c566 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `f8f7cf7` to `32b6353`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](f8f7cf77a5...32b635394c)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-08 09:34:47 +02:00
Luca Guerra e476fb1ac7 update(libs): update libs to 0.11.2
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-06-07 15:28:43 +02:00
Luca Guerra 582bb327eb fix(ci): use /tmp/falco-build-* as a temp directory
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-06-07 15:28:43 +02:00
Federico Di Pierro 5084480d4d new(docs): update Changelog for 0.35.0.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-06-07 12:02:42 +02:00
Lorenzo Susini 2ea6190a98 update(cmake): bump Falco rules to 1.0.0
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-06-07 10:31:42 +02:00
dependabot[bot] 5ed85bcfa3 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `16fb709` to `f8f7cf7`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](16fb709527...f8f7cf77a5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-07 09:55:42 +02:00
Lorenzo Susini 14035d8790 update(cmake): bump libs to 0.11.1
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-06-06 16:10:39 +02:00
Leonardo Grasso 004acffd9b docs(README.md): add scope/status badge and simply doc structure
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-06-06 10:42:39 +02:00
Lorenzo Susini 448b97224d update(cmake): bump plugin versions
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-06-05 14:51:37 +02:00
Lorenzo Susini 6f1b548c6b update(cmake): bump falco rules to 1.0.0-rc1
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-06-05 12:02:32 +02:00
Lorenzo Susini 2865260c92 update(cmake): bump libs to 0.11.0
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-06-05 11:38:31 +02:00
Daniel Wright 9097d2c359 fix: unquote quoted URL's to avoid libcurl errors
This commit will unquote URL's allowing them to be supported by
libcurl and eliminate any errors when a valid (quoted) URL is supplied
by a user.

Closes #2579

Signed-off-by: Daniel Wright danielwright@bitgo.com
2023-06-05 11:09:32 +02:00
Melissa Kilby e89f08ff3f cleanup(docs): adjust release.md
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-06-02 19:44:22 +02:00
Melissa Kilby 4f3a60f193 cleanup(docs): adjust release.md
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-06-02 19:44:22 +02:00
Melissa Kilby f682a1dbb8 chore(config): adjust maturity level for modern_bpf.cpus_for_each_syscall_buffer
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-06-02 19:44:22 +02:00
Melissa Kilby 3a0cdd3cb7 cleanup(docs): update release.md w/ relevant info for modern_bpf driver
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-06-02 19:44:22 +02:00
Federico Di Pierro 03128368cf update(cmake): bumped libs to 0.11.0-rc5 and driver to 5.0.1.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-06-01 12:39:16 +02:00
dependabot[bot] 620c83d6a4 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `3471984` to `16fb709`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](3471984e0c...16fb709527)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-01 10:02:16 +02:00
Lorenzo Susini 9fda7dfb93 fix(userspace/engine): store alternatives as array in -L json output
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-05-31 16:16:31 +02:00
Melissa Kilby 017075c346 cleanup(docs): mention roadmap in readme
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-31 16:03:31 +02:00
Melissa Kilby 4338a8adec cleanup(docs): adjust readme
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-31 16:03:31 +02:00
Melissa Kilby 18345b1a1a cleanup(docs): adjust falco readme style and content
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-31 16:03:31 +02:00
Melissa Kilby 1e6d01621f fix formatting
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-31 15:48:32 +02:00
Melissa Kilby aa8c13b4e4 cleanup(userspace): adjust stats n_drops_perc
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-31 15:48:32 +02:00
Melissa Kilby efd0c7421e cleanup(userspace,config): apply reviewers suggestions
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-31 15:48:32 +02:00
Melissa Kilby b29f6f4b2f cleanup(config): add send_numeric_zero_values option to metrics
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-31 15:48:32 +02:00
Melissa Kilby e775fc6f5b cleanup(userspace): improve metrics UX
add send_numeric_zero_values config to allow users to save space
when using metrics option, while still also allowing
to send all keys (especially because we don't document the schema)

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-31 15:48:32 +02:00
Daniel Wright 2e7a0b026f feat: add jq and curl to falco-no-driver docker image
To supoprt the use of outputs that are documented in the falco
examples (e.g. jq piped to curl) I would like to propose including
these tools in the falco-no-driver image. They add a very minimal
size and dependency to the image but would make things a lot easier
for users getting started.

Closes #2580

Signed-off-by: Daniel Wright <danielwright@bitgo.com>
2023-05-31 13:21:31 +02:00
Leonardo Grasso 25d23168f4 docs(proposals): roadamap mgt non-goals
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Co-authored-by: Massimiliano Giovagnoli <me@maxgio.it>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-05-30 15:51:30 +02:00
Leonardo Grasso 2f6f098b07 docs(proposals): apply suggestions from review
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-05-30 15:51:30 +02:00
Leonardo Grasso daa53fb69b docs(proposals): scope of the WG for Falco roadmap
Co-authored-by: Luca Guerra <luca@guerra.sh>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-05-30 15:51:30 +02:00
Leonardo Grasso 403ad1f5e2 docs(proposals): Falco roadmap management
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-05-30 15:51:30 +02:00
Lorenzo Susini 79b9d0ff21 fix(userspace/engine): store required engine version as string in -L json output
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-05-30 12:09:30 +02:00
Lorenzo Susini 6e12b95dd2 update(userspace/engine): address jasondellaluce comments
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-05-30 10:45:30 +02:00
Lorenzo Susini 0bd609d5a4 update(userspace/falco): update description of -l and -L flags
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-05-30 10:45:30 +02:00
Lorenzo Susini cfb96d0562 update(userspace/engine): adding required_engine_version, required_plugin_versions and exception names to -L output
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-05-30 10:45:30 +02:00
Lorenzo Susini 75f556e3b7 update(userspace/engine): add required_engine_version to rule collector
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-05-30 10:45:30 +02:00
Jason Dellaluce 1263c67ac6 chore: apply codespell suggestions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-29 12:26:24 +02:00
Jason Dellaluce a9ea18b99a fix(userspace/falco): report plugin deps rules issues in any case
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-29 12:26:24 +02:00
Daniel Wright 498b64b469 feat: add image source OCI label to docker images
Closes #2591

Signed-off-by: Daniel Wright <danielwright@bitgo.com>
2023-05-29 11:17:24 +02:00
Melissa Kilby e9402b7606 cleanup(config): apply reviewers suggestions
* place falco plugins after falco rules config
* change metadata_download description
* minor formatting

Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-29 11:09:24 +02:00
Melissa Kilby 08ac4ea975 cleanup(config): rephrase numerous configs for technical clarity + add more information
* rephrase descriptions for numerous config options
  without changing the original content, meaning changes
  reflect language improvements and minor extensions
  (such as adding justifications or what it is) only
* add Falco environment variables section
* add Guidance for Kubernetes container engine command-line args settings
* general rewrap formatting w/ IDE
* minor additional re-ordering of configs
* minor general language adjustments

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-29 11:09:24 +02:00
Melissa Kilby f00b853fd4 cleanup(config): fine tune new configs ordering and organization
* incorporate reviewers suggestions re ordering and phrasing
* minor additional cleanups

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-29 11:09:24 +02:00
Melissa Kilby e269057c41 cleanup(config): improve config descriptions for the basic config options
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-29 11:09:24 +02:00
Melissa Kilby b423754575 cleanup(config): re-arrange falco.yaml configs in logical categories
* add an index for logical categories
* move configs around without changing description content,
  solely add a uniform header to each config
* indicate "Stable" or "Experimental" for most configs
  to indicate current stability or maturity

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-29 11:09:24 +02:00
Jason Dellaluce 354c06567a update(cmake): bump libs to 0.11.0-rc3
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-25 17:43:11 +02:00
Jason Dellaluce bc8b987c59 update(cmake): bump libs to latest dev version
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-25 17:43:11 +02:00
Jason Dellaluce aed64b3076 update(cmake): bump plugins to latest dev versions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-25 17:43:11 +02:00
Jason Dellaluce b58a373835 chore(userspace/falco): always print invalid syscalls from custom set
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-25 14:14:11 +02:00
Roberto Scolaro 2dadb05af6 fix(userspace/falco/app/actions): hotreload on wrong metrics
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-25 14:09:10 +02:00
Andrea Terzolo 1098b6f7ca cleanup: rename a file
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-05-25 10:23:10 +02:00
Andrea Terzolo 1a359f5806 fix: add a check on online CPUs
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-05-25 10:23:10 +02:00
dependabot[bot] 6713ace5c6 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `b2290ad` to `3471984`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](b2290adef9...3471984e0c)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-24 19:53:07 +02:00
Jason Dellaluce 0943456ffe fix(userspace/falco): don't hang on terminating error when multi sourcing
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-24 19:12:06 +02:00
Luca Guerra cc986b7749 update(build): bump libs to 0.11.0-rc2
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-24 15:52:06 +02:00
Luca Guerra 464bc0f4d3 update(build): bump falcoctl version
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-24 10:44:37 +02:00
dependabot[bot] 9f6b57f15a build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `3f52480` to `b2290ad`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](3f52480618...b2290adef9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-24 10:14:36 +02:00
Jason Dellaluce b40a6bc703 fix(userspace/falco): right boundary checks for strncat
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-23 16:53:35 +02:00
Jason Dellaluce 75720534d7 fix(userspace/falco): solve escape issues in grpc output
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-23 16:53:35 +02:00
Jason Dellaluce 00acd17ba1 fix(userspace/faclco): output drop perc metric only if drops are present
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-23 16:53:35 +02:00
Jason Dellaluce d550552fc1 fix(userspace/falco): properly format numeric values in metrics
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-23 16:53:35 +02:00
Federico Di Pierro 8c5ebde6a5 cleanup(ci): cleaned up circleci workflow.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-05-23 10:26:34 +02:00
Luca Guerra ca891ad9b2 update(ci): use repo instead of master branch for reusable workflows
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-23 10:03:34 +02:00
dependabot[bot] 2c291424e9 build(deps): Bump requests from 2.26.0 to 2.31.0 in /test
Bumps [requests](https://github.com/psf/requests) from 2.26.0 to 2.31.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.26.0...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-23 10:02:34 +02:00
Melissa Kilby d4c42814d6 cleanup(config): improve metrics config description for technical clarity
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-23 09:58:34 +02:00
Melissa Kilby eaa4354ddf cleanup(userspace/falco): new consistent metrics output fields classes falco. and scap.
* Ensure each metric field name more consistently adheres to the grammar used in Falco rules:
  * `falco.`: new field class representing userspace counters, statistics, resource utilization, or necessary information fields
  * `scap.`: new field class represents counters and statistics mostly obtained from Falco's kernel instrumentation before events are sent to userspace, but can include scap userspace stats as well
* minor cleanup

Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-23 09:58:34 +02:00
Melissa Kilby 9b341b2c49 new(unit_tests): tests for prometheus compliant time durations
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-23 09:58:34 +02:00
Melissa Kilby 8e0c89d3b4 cleanup(userspace/engine): prometheus compliant regex parsing for metrics interval
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-23 09:58:34 +02:00
Melissa Kilby 698ff25f1e cleanup(config): improve config for new metrics
Co-authored-by: Stanley Chan <pocketgamer5000@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-23 09:58:34 +02:00
Melissa Kilby fcecde845d cleanup(userspace): move parse_prometheus_interval to falco_utils
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-23 09:58:34 +02:00
Melissa Kilby f2318a9ac5 cleanup(userspace/falco): address reviewers comments + cleanup
* prefix counters and stats belonging to kernel space w/ `k.` else `u.` for userspace
* add n_drops_perc from old stats writer schema
* revert one change: file output shall reflect exact same "output_fields" key as rule output, note that src is already part of the "output_fields" schema.

Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-23 09:58:34 +02:00
Jason Dellaluce 5d35cda8dc update(userspace): minor polishing
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-23 09:58:34 +02:00
Jason Dellaluce f117d5273c update(userspace): refactor metrics data flow and fix bugs
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-23 09:58:34 +02:00
Melissa Kilby f0ac327f98 cleanup(userspace/falco): add more fields to metrics
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-23 09:58:34 +02:00
Melissa Kilby e37027a1d0 cleanup(userspace/falco): address reviewers comments
* renaming to `metrics` for technical clarity
* adopt Prometheus like metrics interval settings

Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-23 09:58:34 +02:00
Melissa Kilby 134d2630e9 new(userspace/falco): stats v2 config option to convert memory metrics to MB
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-23 09:58:34 +02:00
Melissa Kilby 010e45a4af new(userspace/falco): extend stats v2 configs w/ relevant env variables
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-23 09:58:34 +02:00
Melissa Kilby 78dbfab48f feat(userspace/falco)!: use new resource_utilization metrics / stats v2 schema for stats file ouput logs
These changes break the old stats file output schema and consolidates
them with the new schema.

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-23 09:58:34 +02:00
Melissa Kilby 4d24bcdd2f new(userspace/falco)!: introduce native support for resource_utilization metrics / stats v2
Intended to phase out previous stats writer settings and log schema.

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-23 09:58:34 +02:00
Melissa Kilby 44d9f99c72 new(userspace/falco)!: new stats v2 configs
Intended to phase out previous stats writer settings and log schema.

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-05-23 09:58:34 +02:00
Jason Dellaluce 7248284b12 chore(userspace/falco/app): print all supported plugin caps
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-22 15:23:32 +02:00
Luca Guerra f72489e431 fix(ci): get the manifest for the correct tag
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-22 10:57:31 +02:00
dependabot[bot] 2863ab3756 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `3f52480` to `6da15ae`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](3f52480618...6da15ae98c)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-22 10:11:15 +02:00
Federico Di Pierro 8268c47160 fix(ci): properly use `docker save` to store images.
No buildx-docker does not support direct storing to tar.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-05-19 22:10:06 +02:00
Federico Di Pierro e16cf2661e fix(ci): docker arg is named `TARGETARCH`.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-05-19 18:17:05 +02:00
Federico Di Pierro a28347d150 fix(ci): properly pass `TARGET_ARCH` as build-arg to docker.
It gets automatically defined in buildx.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-05-19 16:48:05 +02:00
Lorenzo Susini e47ece4de9 update(userspace/engine): address jasondellaluce comments
- 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>
2023-05-19 15:56:05 +02:00
Lorenzo Susini a269866976 test(unit_tests/engine): test filter_details_resolver class
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-05-19 15:56:05 +02:00
Lorenzo Susini 1195b1e7f0 update(userspace/engine): better modularize the code for getting json details
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-05-19 15:56:05 +02:00
Lorenzo Susini e11b4c4430 update(userspace/engine): add event codes to json output
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-05-19 15:56:05 +02:00
Lorenzo Susini 46cbc3c589 update(userspace/engine): add info about all macros and lists in -L option
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-05-19 15:56:05 +02:00
Lorenzo Susini e30729555b update(userspace/engine): add enabled information to json output
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-05-19 15:56:05 +02:00
Lorenzo Susini 727aed0c03 update(userspace/engine): avoid solving macros AST at each cycle when getting details of all rules
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-05-19 15:56:05 +02:00
Lorenzo Susini c1623771d8 update(userspace/engine): correctly use describe rule based on config
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-05-19 15:56:05 +02:00
Lorenzo Susini 9947962cb8 update(userspace/engine): let describe_rule function print out json details when requested
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-05-19 15:56:05 +02:00
Lorenzo Susini a6542a6487 new(userspace/engine): introduce new class to get details about rules
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-05-19 15:56:05 +02:00
Federico Di Pierro 35a8a2e4d3 chore(ci): fixed up missing '\' chars.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Luca Guerra <luca@guerra.sh>
2023-05-19 14:55:05 +02:00
Federico Di Pierro 9b96b34445 fix(ci): use normal docker to build docker images, instead of buildx.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-05-19 14:55:05 +02:00
Jason Dellaluce 2818f0906e update(cmake): bump plugins to latest dev versions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce c603055acf fix(userspace/engine): don't count async event for evttype warning
Co-authored-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 2d53fed0b8 update(cmake): bump libs to 2e9e6346eefeddd0afce7b6a06cb42d4265615dd
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 4fab0d5e38 update(cmake): bump libs to 8f52cdc56fce7ff95adaaa58eeb706da244bf0ce
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 81c6564636 fix(ci): solve CI issues
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 0026471714 update(cmake): bump plugins to dev versions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 71e991b606 update(cmake): bump libs to b596458acb265028dbf0505ca45111e464470b4d
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce bb04892baf fix(userspace/falco): avoid double plugin initializations
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 9df72e0f2a fix(userspace/falco/app): properly populate filtercheck lists
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 4e8d1f025c fix(userspace/falco/app): skip unnecessary app steps
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 9bfce8cfae update(userspace): make sure that async event is always matched in rules
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 26d9448ba7 fix(ci): set cmake build type in Falco build jobs
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce fe299a0c9b update(cmake): bump driver to 5.0.0+driver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 733ea88ab3 fix(userspace/falco): properly init configuration
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce b2615de062 new(userspace/falco/app): print a warning if multiple plugins for same source are loaded
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 0649be619b update(userspace/falco/app): support nodriver open mode and plugins sourcing system events
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 301c4efeb7 update(userspace/falco): support new plugin API definitions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 5175a04c6b update(userspace/engine): bump engine checksum
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 3681cacda1 new(userspace/falco): add new --nodriver option
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 6c7754729b update(CMakeLists): fix c++17 compilation issues
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Jason Dellaluce 0e4595596e update(cmake): bump libs and driver to 0b9ca98fee2453a16f4538db55dcfa34bc8f5aef
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-05-19 12:15:04 +02:00
Stanley Chan 3403225d8d cleanup(docs): remove extraneous whitespace in falco.yaml
Signed-off-by: Stanley Chan <pocketgamer5000@gmail.com>
2023-05-18 15:49:03 +02:00
Stanley Chan 1125b92fc3 docs: improve documentation and description of base_syscalls option
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Stanley Chan <pocketgamer5000@gmail.com>
2023-05-18 15:49:03 +02:00
Aizhamal Nurmamat kyzy 52fe77cf5c Update brand/README.md
Adding the proper link to the brand guides

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Aizhamal Nurmamat kyzy <aizhamal@google.com>
2023-05-18 15:24:04 +02:00
Aizhamal Nurmamat kyzy 47cb32998e Adding back the information on Falco branding.
Signed-off-by: Aizhamal Nurmamat kyzy <aizhamal@sysdig.com>
2023-05-18 15:24:04 +02:00
Aizhamal Nurmamat kyzy 455e4346cd Update brand/README.md
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Aizhamal Nurmamat kyzy <aizhamal@google.com>
2023-05-18 15:24:04 +02:00
Aizhamal Nurmamat kyzy 67993c8fa3 Updating Falco branding guidelines
Signed-off-by: Aizhamal Nurmamat kyzy <aizhamal@sysdig.com>
2023-05-18 15:24:04 +02:00
dependabot[bot] 6f198556be build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `f773578` to `6da15ae`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](f7735788b1...6da15ae98c)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-18 09:11:03 +02:00
Andrea Terzolo 696fa43dc2 cleanup(actions): now modern bpf support `-A` flag
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-05-17 12:19:00 +02:00
Federico Di Pierro 7414c2d161 fix(ci): properly pass FALCO_VERSION loaded from extern to docker build for centos7 and arm64 builds.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-05-17 12:16:00 +02:00
Federico Di Pierro 9c483adafa fix(cmake): properly exclude prereleases when fetching latest tag from cmake.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-05-17 12:16:00 +02:00
Federico Di Pierro 577bccabd0 new(scripts): updated falco-driver-loader to properly support talos.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-05-16 16:49:55 +02:00
Luca Guerra 09b5cb7c7b fix(ci): load falco image before building falco-driver-loader
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-15 15:35:24 +02:00
Luca Guerra 92f884e070 new(ci): sign releases with cosign
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-12 16:03:43 +02:00
Luca Guerra 60a006f0b1 fix(ci): correctly tag slim manifest
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-12 14:27:42 +02:00
Luca Guerra ea0b44dc56 fix(ci): simplify and fix multi-arch image publishing process
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-12 12:28:43 +02:00
Andrea Terzolo e83dbe85f7 cleanup(config): modern bpf is no more experimental
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-05-12 12:27:45 +02:00
Luca Guerra f5c7574eba update(ci): fail on non-semver release
Signed-off-by: Luca Guerra <luca@guerra.sh>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
2023-05-10 11:05:10 +02:00
Luca Guerra b50ccd4cd1 update(ci): update needs for build docker
Signed-off-by: Luca Guerra <luca@guerra.sh>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
2023-05-10 11:05:10 +02:00
Luca Guerra fb8205a2f7 update(ci): explicit branch name in action
Signed-off-by: Luca Guerra <luca@guerra.sh>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
2023-05-10 11:05:10 +02:00
Luca Guerra 369f733a36 update(docs): clarify release checking in the readme
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-10 11:05:10 +02:00
Luca Guerra 7e5a578c89 update(readme): add pre-release instructions to RELEASE.md
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-10 11:05:10 +02:00
Luca Guerra 564eed2dee update(ci): move version computation logic to main jobs master/release
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-10 11:05:10 +02:00
Luca Guerra 24693a1e1e update(ci): move release outputs declaration
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-10 11:05:10 +02:00
Luca Guerra 33b0173657 update(ci): react to release publishing, rewire variables
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-10 11:05:10 +02:00
Luca Guerra d4fa8d6d91 new(ci): add RC/prerelease support
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-10 11:05:10 +02:00
jabdr f25c057ce8 Remove MAKEWRAPPER var
Signed-off-by: jabdr <jd@q321.de>
2023-05-04 13:14:32 +02:00
jabdr e1492ae9df Use TMPDIR for falco-driver-loader
Signed-off-by: jabdr <jd@q321.de>
2023-05-04 13:14:32 +02:00
jabdr b83b1e2578 falco-driver-loader add TMPDIR support
Closes 2517
Make wrapper now uses $TMPDIR if set.

Signed-off-by: jabdr <jd@q321.de>
2023-05-04 13:14:32 +02:00
dependabot[bot] c18d545259 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `1bd7e4a` to `f773578`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](1bd7e4ac3a...f7735788b1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-04 10:01:30 +02:00
Luca Guerra b47ea18736 fix(ci): configure ECR public region
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-04 09:48:32 +02:00
Luca Guerra 253100ab75 fix(ci): falco images directory, ecr login
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-03 18:26:27 +02:00
Luca Guerra 293d4c51f1 fix(ci): separate rpm/bin/bin-static/deb packages before publication, rename bin-static
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-03 15:22:27 +02:00
dependabot[bot] f006f2e01a build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `3f52480` to `1bd7e4a`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](3f52480618...1bd7e4ac3a)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-03 11:56:27 +02:00
Luca Guerra 5237aa196c fix(ci): add Cloudfront Distribution ID
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-02 14:25:07 +02:00
Luca Guerra 4e25367350 fix(ci): escape heredoc
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-05-02 09:47:30 +02:00
Federico Di Pierro 593404e79e chore(ci): build-musl-package does not need to wait for build-packages anymore.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-28 14:53:17 +02:00
Luca Guerra 6650a4f31f fix(ci): only add the secret key to env when necessary
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-04-28 13:21:17 +02:00
Luca Guerra d1e6452ad7 fix(ci): download artifacts one by one
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-04-28 13:21:17 +02:00
Luca Guerra 6d0aff7463 fix(ci): update fetch-version steps
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-04-28 13:21:17 +02:00
Federico Di Pierro a193a46981 chore(ci): properly document new reusable_build_packages step.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Luca Guerra <luca@guerra.sh>
2023-04-28 10:14:16 +02:00
Federico Di Pierro f448023a8f fix(ci): properly fetch Falco version in a single step, then force-use it in subsequent steps, in reusable build packages.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-28 10:14:16 +02:00
Federico Di Pierro c225819186 chore(ci): build recent git from source in centos7 reusable build packages workflow.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-28 10:14:16 +02:00
Federico Di Pierro a5efbc9483 fix(ci): try to fix Falco version.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-28 10:14:16 +02:00
Federico Di Pierro ad75c87e21 chore(ci): properly install recent version of git (needed >= 2.18 by checkout action) to fix Falco versioning.
Moreover, fixed path to output packages from Falco `make package` target.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 20:14:15 +02:00
Luca Guerra fb105c4b04 fix(ci): enable toolset before every make command
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-04-27 16:32:14 +02:00
Luca Guerra fe8899c90a fix(ci): remove unnecessary mv
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-04-27 15:47:14 +02:00
Luca Guerra 2de8c06bb1 fix(ci): bucket -> bucket_suffix
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-04-27 15:03:14 +02:00
Federico Di Pierro 86d33ae5ab chore(ci): improved GPG_KEY management through an env.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Luca Guerra <luca@guerra.sh>
2023-04-27 14:25:14 +02:00
Federico Di Pierro 9d6a7d8ca3 chore(ci): use Noelware/docker-manifest-action pinned version to latest tag.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Luca Guerra <luca@guerra.sh>
2023-04-27 14:25:14 +02:00
Federico Di Pierro d27828a0d2 chore(ci): added some comments.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Luca Guerra <luca@guerra.sh>
2023-04-27 14:25:14 +02:00
Federico Di Pierro 89f29e6d4b chore(ci): renamed `bucket` to `bucket_suffix`.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Luca Guerra <luca@guerra.sh>
2023-04-27 14:25:14 +02:00
Federico Di Pierro 2a22189222 chore(ci): added AWS ECR login to reusable_publish_docker.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Luca Guerra <luca@guerra.sh>
2023-04-27 14:25:14 +02:00
Federico Di Pierro a5620b81b2 chore(ci): `reusable_public_packages` needs proper permissions.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro b9c0ca3abe chore(ci): avoid publishing images in `reusable_build_docker.yaml` workflow.
Instead, store image tarballs as artifact and download them in `reusable_publish_docker.yaml` workflow,
to be finally merged in multi-arch images and pushed.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro 008d908ee0 cleanup(ci): dropped test jobs in CI.yml.
Some small fixes in other workflows.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro 2f11d9f506 chore(ci): install awscli in reusable_build_docker workflow.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro 60d8c49772 fix(ci): do not use `inputs.tagname`. Instead, rely on `github.ref_name`.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro 3693cd0685 chore(ci): test reusable_build_docker from PR CI.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro 31da4b4c3d chore(ci): run reusable_build_docker workflow without any container.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro 9551e9f277 chore(ci): added aws credentials role to the reusable_publish_packages workflow.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro 2af7fd9f0f fix(ci): fixed reusable_build_packages to properly install `git` before invoking checkout action, to download full repo.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro 1c3aa7a83b chore(ci): multiple fixes to new master and release ci jobs.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro 18372323d9 cleanup(ci): dropped test arm64 job from pull_request CI, since it is now working.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro be13ee044e chore(ci): fixed up master and release yamls.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro ac4e27ccde update(ci): add an arm test CI job.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro d5b72f89f0 chore(ci): commented out circleCI master and release jobs.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro cafb804c11 chore(ci): disable on push: master trigger for ci.yml.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro 6bf6a34a59 chore(ci): add proper concurrency groups for master and release CI.
Renamed `dev.yaml` to `master.yaml`.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro b138e4c9e1 new(ci): added github action workflows for dev and release CI (packages + docker images publish).
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 14:25:14 +02:00
Federico Di Pierro 53c9f3a743 fix(scripts): fix falco-driver-loader for some debian kernels.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-27 11:46:14 +02:00
Jason Dellaluce 1f4919bfe1 update: improve control and UX of ignored events
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-04-27 11:10:14 +02:00
Jason Dellaluce 4d24a02ad6 fix(userspace/falco): preserve config's plugin loading order
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-04-26 12:59:13 +02:00
Jason Dellaluce 8926022035 update: adapt Falco to new sinsp event source management
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-04-26 12:59:13 +02:00
Jason Dellaluce 95fa953398 update(cmake): bump libs and driver to ffcd702cf22e99d4d999c278be0cc3d713c6375c
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-04-26 12:59:13 +02:00
Federico Di Pierro 0d73f9624d update(scripts): updated falco-driver-loader to support al2022 and al2023.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-14 20:00:08 +02:00
dependabot[bot] 0f1f413221 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `5857874` to `1bd7e4a`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](5857874e95...1bd7e4ac3a)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-11 10:30:16 +02:00
dependabot[bot] a77a58b2a9 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `694adf5` to `5857874`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](694adf59e0...5857874e95)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-06 12:51:56 +02:00
Jason Dellaluce 91cca0bd0e update(cmake): bump libs and drivers to 5b4dd9e2ae0cd2efeaf9da37d8c29631241d448c9ce5b0e35d8dd7f81d814034
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-04-04 19:39:53 +02:00
Jason Dellaluce 06d36d6e1b test(userspace/falco): leverage new sc_set_to_event_names API and solve last few todos
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-04-04 19:39:53 +02:00
Jason Dellaluce 3b64052832 update(userspace/falco): leverage new sc_set_to_event_names API
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-04-04 19:39:53 +02:00
Leonardo Grasso 88b9537618 chore(userspace/falco): remove Mesos support
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-04-04 18:31:52 +02:00
Leonardo Grasso 5c0cd6a170 update!: remove `--mesos-api`,`-pmesos`, and `-pm` command-line flags
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-04-04 18:31:52 +02:00
Melissa Kilby 306d76d06b cleanup(unit_tests): try making test_configure_interesting_sets more robust
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-04-04 17:55:52 +02:00
Federico Di Pierro 597f07ccae update(ci): only set concurrency group for PRs.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Mauro Ezequiel Moltrasio <mmoltras@redhat.com>
2023-04-04 17:09:53 +02:00
Federico Di Pierro de23899e49 cleanup(ci): properly set a concurrency for CI workflows.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-04-04 17:09:53 +02:00
dependabot[bot] 2b29ff7ee6 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `e0646a0` to `694adf5`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](e0646a024f...694adf59e0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-03 20:05:46 +02:00
Melissa Kilby 0b6e243582 cleanup(app_acions): fine-tune base_syscalls.repair behavior
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-03-30 19:08:33 +02:00
Melissa Kilby e178174a93 update(cmake,userspace): bumped to libs master
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-03-30 19:08:33 +02:00
Melissa Kilby dad382edd6 cleanup(config): adjust description for base_syscalls option
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-03-30 19:08:33 +02:00
Melissa Kilby 78daafb56c cleanup(app_actions): finalize base_syscalls.repair option
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-03-30 19:08:33 +02:00
Jason Dellaluce 2b93a79521 refactor: apply review suggestions
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-30 19:08:33 +02:00
Melissa Kilby 3e0f0d3692 cleanup(unit_tests): revert some test extensions in interim
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-03-30 19:08:33 +02:00
Melissa Kilby ea3571564b cleanup(unit_tests): add selection_custom_base_set_repair tests
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-03-30 19:08:33 +02:00
Melissa Kilby e360175c15 fix(app_actions): enforce PPM_SC_SCHED_PROCESS_EXIT for base_syscalls.custom_set
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-03-30 19:08:33 +02:00
Melissa Kilby 692abf71eb new(app_actions): add base_syscalls.repair option
See https://github.com/falcosecurity/falco/issues/2433

Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-03-30 19:08:33 +02:00
Melissa Kilby 1d66eb4d6d cleanup(app_actions): add warnings for invalid syscalls in user base_syscalls set
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-03-30 19:08:33 +02:00
Aldo Lacuku 31335d3c3b new(falco/config): add new configuration for http_output
Support for user provided CA certificate that can verify the remote server. Users
can provide path to the CA certiface store by providing a path to the dir or to the
CA store file. If needed users can decide to tell Falco to not verify the server.

Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2023-03-30 17:11:33 +02:00
dependabot[bot] 7f4fb624dd build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `0b0f50f` to `e0646a0`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](0b0f50fdf6...e0646a024f)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-29 21:31:31 +02:00
Federico Di Pierro 0b7ca2823e chore(userspace): apply review suggestions.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Jason Dellaluca <jasondellaluce@gmail.com>
2023-03-28 19:01:30 +02:00
Federico Di Pierro b2e03b1938 chore(userspace): `syscall_drop_failed` -> `syscall_drop_failed_exit`.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-03-28 19:01:30 +02:00
Federico Di Pierro 70c6c93389 chore(userspace): improved wording.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-03-28 19:01:30 +02:00
Federico Di Pierro bd13ba70e3 update(cmake): bumped to latest libs/driver.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-03-28 19:01:30 +02:00
Federico Di Pierro f8f7e73a7f update(docs): properly document new option in config file.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-03-28 19:01:30 +02:00
Federico Di Pierro bf5e340833 new(userspace/falco): added `syscall_drop_failed` option to drop failed syscalls exit events.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-03-28 19:01:30 +02:00
Federico Di Pierro 804e6fc122 update(cmake): bumped libs to latest master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-03-28 19:01:30 +02:00
dependabot[bot] 4836978ba9 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `3f52480` to `0b0f50f`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](3f52480618...0b0f50fdf6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-23 10:50:12 +01:00
Federico Di Pierro e6078c8d16 chore(userspace): updated fields checksum.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-03-22 11:17:07 +01:00
Federico Di Pierro 17b170b4f9 update(cmake,userspace): bumped to libs master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-03-22 11:17:07 +01:00
dependabot[bot] e4d575b10d build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `dab4474` to `3f52480`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](dab44746af...3f52480618)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-21 12:24:44 +01:00
rabbitstack 03285f4140 define Windows equivalent for srandom and random functions
Signed-off-by: rabbitstack <nedim.sabic@sysdig.com>
2023-03-17 10:23:26 +01:00
dependabot[bot] 9c5d643a90 build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `5b6e2c0` to `dab4474`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](5b6e2c0241...dab44746af)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-17 10:20:26 +01:00
Jason Dellaluce 93ae6bb609 chore(userspace/falco): fix codespell typos
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-15 17:54:49 +01:00
Jason Dellaluce e07e3abfb5 update(userspace/falco): implement debouncing logic in restart handler
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-15 17:54:49 +01:00
Jason Dellaluce 3f69d46f9a update(userspace/falco): minor compilation improvements
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-15 17:54:49 +01:00
Jason Dellaluce 647441c06c fix(userspace/falco): solve gettid compilation issues
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-15 17:54:49 +01:00
Jason Dellaluce cd155ed6f5 refactor(userspace/falco): update actions to use new hot restarter utility with dry-run safetyc checks
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-15 17:54:49 +01:00
Jason Dellaluce 561022ebb6 new(userspace/falco): add utility for handling hot app restarts
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-15 17:54:49 +01:00
Jason Dellaluce af46833ad3 update(userspace/falco): make cmdline options simpler and copyable
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-15 17:54:49 +01:00
Jason Dellaluce e40369648c fix(userspace/falco): solve minor compilation flaws
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-15 17:54:49 +01:00
Jason Dellaluce ee7fa1cb06 new(usersapce/falco): add an app option for dry-run
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-15 17:54:49 +01:00
Jason Dellaluce f976aa8400 update(cmake): bump libs and driver to 6ca2fc1fa9a9f5482dc92468a0a6e3404ae46723
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 18:03:14 +01:00
dependabot[bot] 8b8f42667f build(deps): Bump submodules/falcosecurity-rules
Bumps [submodules/falcosecurity-rules](https://github.com/falcosecurity/rules) from `c558fc7` to `5b6e2c0`.
- [Release notes](https://github.com/falcosecurity/rules/releases)
- [Commits](c558fc7d2d...5b6e2c0241)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-09 11:57:13 +01:00
Jason Dellaluce 85729f3006 update(cmake): bump libs and driver to 652d6d134d5c2b355467de5be922135e53053412
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 09:39:12 +01:00
Jason Dellaluce c41665f12c update(cmake): bump libs and driver to a513c696b68676b872c2ea59636e659960ac38c6
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 09:39:12 +01:00
Jason Dellaluce e8b776a9cb update(userspace/engine): bump engine version to 17
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 09:39:12 +01:00
Jason Dellaluce 3285ead22f update(cmake): bump libs and driver to 172043999fbf3d04c2c40f98cc77957badbbd43e
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 09:39:12 +01:00
Jason Dellaluce b32c0b9283 fix(unit_tests): adapt to connect4 corner cases
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 09:39:12 +01:00
Jason Dellaluce 8fe474088d update(cmake): bump libs and drivers to c2e227697b2a410eeca47fef260f575375154a58
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 09:39:12 +01:00
Jason Dellaluce 09ab9db423 chore(userspace/falco): apply review suggestion
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 09:39:12 +01:00
Jason Dellaluce 61a7f32982 chore(userspace/falco): apply review suggestions
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 09:39:12 +01:00
Jason Dellaluce 3ab7c7d753 chore: fix typos
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 09:39:12 +01:00
Jason Dellaluce aeef99e173 update(cmake): bump libs and driver versions to f0468f32d8d730d0e70d8e103d57f97d74dd374f
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 09:39:12 +01:00
Jason Dellaluce b225549679 test(unit_test): adapt and grow tests on configure_intertesting_sets
The test now take in accoint pre/post-conditions of the actions,
usage of the -A option, and the newly-introduced base_syscall
user configuration. This also makes sure that the event selection
properly handles generic events and options/configs precedence.

Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 09:39:12 +01:00
Jason Dellaluce a7f521b4b8 chore(unit_tests): move existing test in right directory
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 09:39:12 +01:00
Jason Dellaluce 2645f6640c chore(userspace/falco): rename source file using its action name
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 09:39:12 +01:00
Jason Dellaluce fb37d8f365 refactor(userspace/falco): adapt event set selection to only use ppm_sc and new engine features
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 09:39:12 +01:00
Jason Dellaluce 19ffadc763 update(userspace/engine): support searching ppm_sc events in rulesets
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-09 09:39:12 +01:00
Jason Dellaluce 07980b7822 new(.github): add dependabot configuration for updating git submodules
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-03-08 19:03:09 +01:00
m.nabokikh 49cef071cf Add Deckhouse to Falco adopters
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2023-03-08 12:39:07 +01:00
Melissa Kilby 0de9af9ed0 fix(app_actions): base_syscalls check for empty string
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-02-24 11:43:43 +01:00
Melissa Kilby 58dc60e58d cleanup(app_actions): address reviewers comments
* Plus minor adjustments to ensure correct state_event_set for all configurations
* Ensure valid check_for_rules_unsupported_events for all configurations
* Remove user input validation warning -> re-introduce in follow up PR

Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-02-24 11:43:43 +01:00
Melissa Kilby b6f6195725 cleanup(app_actions): include activated syscalls in LOG_DEBUG logs
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-02-24 11:43:43 +01:00
Melissa Kilby d6421d4e67 new(config): add base_syscalls option to config
See https://github.com/falcosecurity/falco/issues/2373

Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Co-authored-by: Stanley Chan <pocketgamer5000@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-02-24 11:43:43 +01:00
Melissa Kilby 76a3c8d7ee new(app_actions): introduce base_syscalls
See https://github.com/falcosecurity/falco/issues/2373

Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-02-24 11:43:43 +01:00
Jason Dellaluce 7d67fbbfe7 chore(userspace/falco): apply review suggestions
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 14:31:28 +01:00
Jason Dellaluce 31d06a5532 update(cmake): bump libs to e1d0fd9b043f1c7dfd91c9d030c11cfe2c062931
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 14:31:28 +01:00
Jason Dellaluce b9d03e8f2b update(cmake): bump driver and libs to c592f4f230e48f36a50c1716fd94e7e279b67513
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 14:31:28 +01:00
Jason Dellaluce 5ed5c63202 refactor: adapt event set configuration changes to new libs definition
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 14:31:28 +01:00
Jason Dellaluce 01faeecee7 update(cmake): bump driver to 8a8d2389e4eea9e89efef9e3b06a70aa2a0bf5d0
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 14:31:28 +01:00
Jason Dellaluce 4706cd8b4e cleanup: solve std namespace issues and remove unused imports
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 14:31:28 +01:00
Jason Dellaluce 010f6c6a9e update(userspace/engine): bump fields checksum
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 14:31:28 +01:00
Jason Dellaluce 1485dc5d68 refactor(userspace/falco): adapt app actions to new event definitions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 14:31:28 +01:00
Jason Dellaluce e7d76ca722 refactor(userspace/falco): use new event definitions in app state
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 14:31:28 +01:00
Jason Dellaluce 6c38ecaf0e update(userspace/engine): adapt engine classes to new libsinsp event definitions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 14:31:28 +01:00
Jason Dellaluce 34ea7a8245 cleanup(userspace/engine): drop filtr_evttype_resolver
Its logic was ported into libsinsp in:
3d8550e70e

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 14:31:28 +01:00
Jason Dellaluce e54eda16f7 fix(test/plugins): solve compilation issues
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 14:31:28 +01:00
Jason Dellaluce 4c72f36748 update(cmake): bump libs to 8a8d2389e4eea9e89efef9e3b06a70aa2a0bf5d0
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 14:31:28 +01:00
Melissa Kilby 3b5633a3e5 cleanup(unit_tests): remove some rebase leftovers
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-02-21 14:31:28 +01:00
Melissa Kilby d89f4b4904 cleanup(app_actions): adjust ignored events
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-02-21 14:31:28 +01:00
Melissa Kilby 16aa36291a fix rebase
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-02-21 14:31:28 +01:00
Melissa Kilby 72439b2eed cleanup(app_actions): adjust configure_interesting_sets
* address reviewers feedback
* improve clarity around new -A and -i behavior
* additional cleanup (e.g. use generic set operations only)
* extend unit tests

Note: sinsp ppm sc API is undergoing a refactor, therefore current lookups are interim
and will subsequently be refactored as well.

Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-02-21 14:31:28 +01:00
Melissa Kilby f77f8667a1 cleanup(tests): add unit tests for configure_interesting_sets
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-02-21 14:31:28 +01:00
Melissa Kilby 30fe065446 cleanup(app_actions): configure -A w/ new default behavior
Define new -A behavior in configure_interesting_sets

* default: all syscalls in rules included, sinsp state enforcement without high volume I/O syscalls
* -A flag set: all syscalls in rules included, sinsp state enforcement and allowing high volume I/O syscalls

Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-02-21 14:31:28 +01:00
Melissa Kilby 91c185a178 cleanup(app_actions): include evttypes from rules in configure_interesting_sets
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2023-02-21 14:31:28 +01:00
Jason Dellaluce 34ed5a5fc9 chore: fix typos
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 11:09:29 +01:00
Jason Dellaluce f34ef41e8a test(userspace/falco): add tests for atomic signal handler
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 11:09:29 +01:00
Jason Dellaluce 70c22c7d2e refactor(userspace/falco): adapt actions to new signal handler constructs
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 11:09:29 +01:00
Jason Dellaluce eb3bf7260d refactor(userspace/falco): add an ad-hoc concurrent object for signal handlers
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 11:09:29 +01:00
Jason Dellaluce 5470a88b61 fix(userspace/falco): add missing constructors/methods on falco semaphore
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-21 11:09:29 +01:00
Luca Guerra e19f536514 new(docs): add security audit from January 2023
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-02-21 08:23:28 +01:00
Aldo Lacuku 7a0ca9f534 new(docs): update Changelog for 0.34.1
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2023-02-20 14:45:17 +01:00
Aldo Lacuku bdca1ce0a6 update(cmake): bumped libs to 0.10.4
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2023-02-17 16:40:44 +01:00
Jason Dellaluce 94882f3fd2 test(unit_tests): add tests for select_event_sources action
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-15 10:51:35 +01:00
Jason Dellaluce 9fd6bbf2bf update(unit_tests): link test suite to falco app cmake target
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-15 10:51:35 +01:00
Jason Dellaluce bf5b8f5c83 new(userspace/falco): add intermediate cmake target for falco app
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-15 10:51:35 +01:00
Jason Dellaluce a7ef45852c fix(unit_tests): invert libraries and dependencies in CMakeLists
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-15 10:51:35 +01:00
Jason Dellaluce c45bf3eb17 chore(userspace/falco): rename falco_init into falco_run
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-14 17:33:31 +01:00
Jason Dellaluce 149544d7ab chore(userspace/falco): fix spacing and license
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-14 17:33:31 +01:00
Jason Dellaluce 1eb915bf2f fix(userspace/falco): solve issues with minimal build
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-14 17:33:31 +01:00
Jason Dellaluce 3d6393ae62 fix: solve unit test issues
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-14 17:33:31 +01:00
Jason Dellaluce 5d35dff2a7 refactor(userspace/falco/app): standalone sources for action helpers
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-14 17:33:31 +01:00
Jason Dellaluce 799557f7f7 refactor(userspace/falco/app): make run and teardown actions consistent
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-14 17:33:31 +01:00
Jason Dellaluce fe859bda2d refactor(userspace/engine): turn app methods into simple functions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-14 17:33:31 +01:00
Jason Dellaluce 374136be18 refactor(userspace/engine): add standalone sources for app signals and options
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-14 17:33:31 +01:00
Jason Dellaluce 623d27ef77 refactor(userspace/engine): create standalone sources for app state and run result
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-14 17:33:31 +01:00
Jason Dellaluce 0f402d01d0 fix(userspace/falco): add missing pragma once
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-14 17:33:31 +01:00
Jason Dellaluce ff68311629 fix(userspace/engine): add missing include
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-14 17:33:31 +01:00
Lorenzo Susini 88ac30650c fix(userspace/engine): correctly bump engine version after introduction of new fields
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-02-14 13:03:06 +01:00
Jason Dellaluce 6ecc708e2b fix(unit_tests): adapt new evttype resolvers to gtest
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-14 12:47:07 +01:00
Jason Dellaluce 79b3f81a02 chore: fix typos
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-14 12:47:07 +01:00
Jason Dellaluce 2495827e0c fix(userspace/engine): correctly handle evttype indexing corner cases
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-14 12:47:07 +01:00
Federico Di Pierro e8a62f6800 new(ci): added new workflow to automatic tag and publish new builder and tester images upon changes.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-02-14 09:49:05 +01:00
Federico Di Pierro 75dc8c050c new(userspace,tests): add proper support for generic events indexing.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-02-13 14:54:03 +01:00
Federico Di Pierro 392b66bd5a update(docs): update release.md to port Falco to use release/M.m.x branches.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-02-13 14:27:02 +01:00
Federico Di Pierro cb5dddf8ec fix(release): fixed tag creation step in release doc.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-02-13 14:27:02 +01:00
Andrea Terzolo 98550e80b3 chore: remove a no more useful cmake file
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-02-10 11:41:24 +01:00
Andrea Terzolo 0d62fb9133 ci: remove unit tests from circleCI
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-02-10 11:41:24 +01:00
Andrea Terzolo af9fbbcdc6 chore: remove no more useful cmake files
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-02-10 11:41:24 +01:00
Andrea Terzolo d7e498caf9 fix after rebase
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-02-10 11:41:24 +01:00
Andrea Terzolo 0004b140b1 ci: use new unit tests where necessary
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-02-10 11:41:24 +01:00
Andrea Terzolo dff127bb65 cleanup: remove old tests
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-02-10 11:41:24 +01:00
Andrea Terzolo 5e5869357a tests: add `Configuration` tests
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-02-10 11:41:24 +01:00
Andrea Terzolo 71d7c574e0 tests: add `Ruleset` tests
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-02-10 11:41:24 +01:00
Andrea Terzolo 0f83411f05 tests: add `PluginRequirements` tests
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-02-10 11:41:24 +01:00
Andrea Terzolo 696a744004 tests: add `WarningResolver` tests
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-02-10 11:41:24 +01:00
Andrea Terzolo 8059e28af5 tests: add `MacroResolver` tests
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-02-10 11:41:24 +01:00
Andrea Terzolo 1faa35552a tests: add `EvtTypeResolver` tests
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-02-10 11:41:24 +01:00
Andrea Terzolo 88bac44f05 test: first scaffolfing of the initial structure
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-02-10 11:41:24 +01:00
Andrea Terzolo dca76ba93c chore: fix building with njson
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-02-10 11:41:24 +01:00
Aldo Lacuku 43c802d045 fix(dockerfile/no-driver): install ca-certificates
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2023-02-09 17:31:31 +01:00
Federico Di Pierro 7343bcf050 cleanup(uerspace/falco): do not enter dropping mode.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-02-09 14:16:31 +01:00
Jason Dellaluce eaeec7c079 fix(userspace): avoid using std namespace in sources
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-08 15:30:29 +01:00
Jason Dellaluce 54f117141b update(userspace/engine): avoid relying on leaked std namespace
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-02-08 15:30:29 +01:00
Federico Di Pierro 01ae266332 fix(cmake): properly check that `git describe` returns a real tag (semversioned).
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-02-07 13:49:28 +01:00
Federico Di Pierro d5907f612c fix(cmake): fixed tag fetching fallback (that is indeed needed).
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-02-07 13:49:28 +01:00
Luca Guerra b978e71919 new(docs): update Changelog for 0.34.0
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-02-07 11:25:29 +01:00
Lorenzo Susini 6f994ee340 chore: bump falcoctl version to 0.4.0
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-02-06 20:05:27 +01:00
Lorenzo Susini de63a36ead update: add allowed types to falcoctl artifact follow service
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-02-06 20:05:27 +01:00
Federico Di Pierro dcaf24164f fix(scripts): force rpm postinstall script to always show dialog, even on upgrade.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-02-03 18:09:20 +01:00
Andrea Terzolo 1b11a041b5 update: change `cpus_for_each_syscall_buffer` default value
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-02-03 12:50:20 +01:00
Luca Guerra 13b66c95ef update(build): update falcoctl to 0.3.0
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-02-02 21:41:15 +01:00
Federico Di Pierro 89b54555d4 fix(scripts): fixed falcoctl config install dir.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-02-02 18:19:16 +01:00
Roberto Scolaro 3cba495e62 fix(scripts): add retrocompatibility to make /usr/share/falco writable
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-02-02 17:59:16 +01:00
Roberto Scolaro ab8ab8fbd0 fix(scripts): make /usr/share/falco writable
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-02-02 17:59:16 +01:00
Luca Guerra b4ec7c60f3 update(build): update falcoctl version
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-02-02 12:39:13 +01:00
Andrea Terzolo 7ebf4b8dff fix(scripts): revert part of `7a794b70a71896a3eb1971ca66cc0c19b9a104e6`
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-31 14:48:05 +01:00
Federico Di Pierro 8e3067361d update(cmake): bumped libs to 0.10.3
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-01-31 11:56:03 +01:00
Andrea Terzolo d8fc259309 cleanup: improve falcoctl yaml readability
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Co-authored-by: Aldo Lacuku <aldo@lacuku.eu>
2023-01-30 17:20:02 +01:00
Andrea Terzolo e0529746af new(scripts): add falcoctl config into falco pkg
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-30 17:20:02 +01:00
Andrea Terzolo 1d99e3d7b3 fix(ci): remove application rules from docker build
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-30 13:44:17 +01:00
Leonardo Grasso 216d3c0e36 chore(cmake/cpack/debian): remove `application_rules.yaml`
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-01-30 13:44:17 +01:00
Leonardo Grasso 99dccc4743 build(cmake): deprecate `/etc/falco/rules.available` and don't ship `application_rules.yaml` any more
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-01-30 13:44:17 +01:00
Federico Di Pierro 132484c158 fix(scripts): switch back to insmod instead of modprobe in driver loader.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-01-30 11:29:56 +01:00
Federico Di Pierro 207fc65d08 chore(scripts): for local installations, only try the dkms build.
In this way, dkms will gracefully handle kernels updates.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-01-30 11:29:56 +01:00
Andrea Terzolo 660da98e4c fix: configure_file in CMake
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-28 12:35:47 +01:00
Andrea Terzolo 7bdebf5d93 update(systemd): solve some issues with systemd unit
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-28 12:35:47 +01:00
Andrea Terzolo 11b98512db fix: falcoctl version
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-26 18:46:43 +01:00
Leonardo Grasso 27f0898c73 build(cmake): upgrade falcoctl to v0.3.0-rc6
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-01-26 18:46:43 +01:00
Leonardo Grasso d4623609c4 Update PULL_REQUEST_TEMPLATE.md
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-01-26 18:21:43 +01:00
Leonardo Grasso 30ea744d12 docs(.github): rules are no longer in this repo
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-01-26 18:21:43 +01:00
Leonardo Grasso e8d9b5a7e7 build(cmake/modules): bump k8saudit to 0.5.0 and cloudtrail to 0.6.0
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-01-26 13:27:43 +01:00
Andrea Terzolo 229633ee8a update(CI): mitigate frequent failure in CircleCI jobs
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-26 12:37:43 +01:00
Andrea Terzolo acd1e0dc28 update: split the build phase in multiple RUN commands
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-26 12:37:43 +01:00
Andrea Terzolo 8eb6fbf32d fix(userspace): use the right path for the `cpus_for_each_syscall_buffer`
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-26 11:44:44 +01:00
Andrea Terzolo a7e991bf1c chore: bump libs version
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-25 17:37:37 +01:00
Andrea Terzolo 059a28184d tests: fix rule paths
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-25 17:37:37 +01:00
Andrea Terzolo 0918cd0c54 chore: bump rules and falcoctl
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-25 17:37:37 +01:00
Andrea Terzolo 328c3e0a29 update: add `falco` alias to kmod unit
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-25 17:37:37 +01:00
Andrea Terzolo 92a5d770f4 fix: create directory for systemd scripts
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-25 17:37:37 +01:00
Federico Di Pierro 84db98376e update(cmake): bumped falcoctl to latest version.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-01-25 17:37:37 +01:00
Federico Di Pierro 26c00a3948 chore: couple of small fixes.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-01-25 17:37:37 +01:00
Andrea Terzolo 3c7fc1a8c5 cleanup: rename plugin unit into custom unit
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-25 17:37:37 +01:00
Andrea Terzolo a67657f316 docs: fix some comments
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-25 17:37:37 +01:00
Andrea Terzolo 7ed5f39da0 scripts: remove falco.target and use require falcoctl with `Wants=`
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-25 17:37:37 +01:00
Andrea Terzolo 9b7ab105d8 chore: fix cmake file copy
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-25 17:37:37 +01:00
Federico Di Pierro 7d355dd2d9 chore(scripts): small fixes to systemd units.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-01-25 17:37:37 +01:00
Federico Di Pierro f96f2179ba fix(scripts): some small fixes around falco and falcoctl systemd services logic.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-01-25 17:37:37 +01:00
Federico Di Pierro 3b2732355a update(cmake): bumped falcoctl to 0.3.0-rc2.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-01-25 17:37:37 +01:00
Federico Di Pierro 0f22fde7cd update(scripts): multiple renamings to falcoctl service + fixed description.
Moreover, now falcoctl service is enabled by default. It being bound to falco.target
allows us to avoid it running when falco.target is not running.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-01-25 17:37:37 +01:00
Federico Di Pierro 2591ed4d68 new(scripts): add a falco.target that consists of falco-X.service units.
falcoctl will then run and bind to falco.target.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-01-25 17:37:37 +01:00
Federico Di Pierro 394d495040 update(cmake,scripts): updated falcoctl to 0.3.0-rc1.
Fix up falcoctl.service.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2023-01-25 17:37:37 +01:00
Federico Di Pierro 7bdd0bf646 chore(scripts): updated falcoctl service.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-01-25 17:37:37 +01:00
Federico Di Pierro ffce069c96 update(scripts): added a falcoctl systemd service.
Add a new dialog to choose whether to enable falcoctl feed.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-01-25 17:37:37 +01:00
Federico Di Pierro 2a886f7a3d new(cmake): added a cmake module to enforce the download and installation of falcoctl.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-01-25 17:37:37 +01:00
Andrea Terzolo 77686cb8b9 update: don't expose available CPU feature
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-24 12:41:34 +01:00
Andrea Terzolo 42670a50c7 new: support multiple buffer modes and online CPUs
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-24 12:41:34 +01:00
Federico Di Pierro e64c14a947 fix(userspace/falco): fixed grpc server shutdown.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-01-24 11:59:34 +01:00
Jason Dellaluce f3546a9a55 update(cmake): new rules checksums
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-21 17:58:08 +01:00
Jason Dellaluce cf76a09425 chore(RELEASE.md): fix typo
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-21 17:58:08 +01:00
Jason Dellaluce 97ec861c02 docs(RELEASE.md): update release guidelines
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-21 17:58:08 +01:00
Jason Dellaluce 4aeb3672e5 fix(test): update rules file reference
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-21 17:58:08 +01:00
Jason Dellaluce 0ad80350a4 chore(README.md): fix reference to rules in readme
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-21 17:58:08 +01:00
Jason Dellaluce 0b324f06f3 update(cmake): add rules external project for building packages
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-21 17:58:08 +01:00
Jason Dellaluce 0ca7fe29fa new: add falcosecurity/rules submodule
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-21 17:58:08 +01:00
Jason Dellaluce aafbbdb31f refactor: remove rules directory as moved to another repo
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-21 17:58:08 +01:00
Jason Dellaluce 32dcb9ffd0 refactor: remove rules_inventory as being moved to another repo
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-21 17:58:08 +01:00
Roberto Scolaro 45f5589b69 fix(scripts): fixed incorrect bash var expansion
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
2023-01-20 17:41:05 +01:00
Jason Dellaluce 099f118e34 fix(scripts): invalidate all signatures at once
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-20 16:56:06 +01:00
Jason Dellaluce 4bc7d3fa65 fix(scripts): aws cp instead of aws sync
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-20 16:56:06 +01:00
Jason Dellaluce 9b644d893b fix(scripts): aws sync flags
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-20 16:56:06 +01:00
Jason Dellaluce 717dcaf473 update(scripts): regenerate repos signatures
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-20 16:56:06 +01:00
Jason Dellaluce 95940d2e16 chore(scripts): fix typos
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-20 16:56:06 +01:00
Jason Dellaluce 1d0c50e272 update(scripts): allow regenerating signatures without publishing new packages
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-20 16:56:06 +01:00
Jason Dellaluce 61bc6c8d32 update(scripts): sync regenerated signatures in s3
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-20 16:56:06 +01:00
Jason Dellaluce 9f4573a26a update(scripts): add option for updating all signatures in publish-rpm
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-20 16:56:06 +01:00
Jason Dellaluce ac2555ca3c update(scripts): add option for updating all signatures in publish-deb
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-20 16:56:06 +01:00
Jason Dellaluce cfc96e899b fix(docker/falco): trust latest GPG key
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-19 12:33:46 +01:00
Federico Di Pierro 306f9ba468 fix(userspace/falco): fixed build.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-01-17 16:00:23 +01:00
Federico Di Pierro a8377d544a update(cmake): updated libs to latest 0.10.1 tag.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2023-01-17 16:00:23 +01:00
Jason Dellaluce 41a5de670a docs(falco.yaml): update webserver config docs
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-16 17:24:54 +01:00
Jason Dellaluce 55a6436ee8 new(userspace/falco): add webserver endpoint for retrieving internal versions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-16 17:24:54 +01:00
Jason Dellaluce ea48ec70be refactor(userspace/falco): use new utility for printing versions and support
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-16 17:24:54 +01:00
Jason Dellaluce 7724ad940a new(userspace/falco): standaline utility for retrieving internal version numbers
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-16 17:24:54 +01:00
Thomas Labarussias bb9edea666 install ca-certificates in falco:no-driver image
Signed-off-by: Thomas Labarussias <issif+github@gadz.org>
2023-01-16 10:35:18 +01:00
Jason Dellaluce c69b198777 chore(userspace/falco): cleanup error message when no output is configured
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-15 18:30:15 +01:00
Jason Dellaluce db2f5d5e9c fix(userspace/falco): solve tests issues
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-15 18:30:15 +01:00
Jason Dellaluce 4aefb7fd7d fix(userspace/falco): require config file only when needed
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-15 18:30:15 +01:00
Jason Dellaluce 149c95c3fb fix(userspace/falco): load config before every other action
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-15 18:30:15 +01:00
Jason Dellaluce 46f15facfe fix(userspace/falco): adapt tests
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-15 18:30:15 +01:00
Jason Dellaluce 78312c8c15 update(userspace/falco): clean up configuration and allow re-initialization
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-15 18:30:15 +01:00
Jason Dellaluce d6bbf5d442 refactor(userspace/falco): isolate yaml helpers (2)
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-15 18:30:15 +01:00
Jason Dellaluce 2eac8f88cb refactor(userspace/falco): isolate yaml helpers (1)
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-15 18:30:15 +01:00
Jason Dellaluce bc3ec30f3e chore(userspace/falco) remove unused var
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-15 18:30:15 +01:00
Jason Dellaluce 42ef8db26f refactor(userspace/falco): deprecate version-json option and rely on json_output
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-15 18:30:15 +01:00
Jason Dellaluce 09d9ae135b update(userspace/falco): load default config at app initialization
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-15 18:30:15 +01:00
Jason Dellaluce 57cafcb65a refator(userspace/falco): allow loading default config with no file
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-15 18:30:15 +01:00
Jason Dellaluce c1985a7c99 fix(userspace/engine): absolute rule condition position in validation context
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-10 12:55:43 +01:00
Jason Dellaluce d79d7112a0 fix(userspace/engine): catch YAML parsing and validation errors with right context
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2023-01-10 12:55:43 +01:00
Luca Guerra 1b2c7ef7d9 new(falco): add --version-json to print version information in json format
Signed-off-by: Luca Guerra <luca@guerra.sh>
2023-01-10 12:35:43 +01:00
Leonardo Grasso 280fcfe5d3 update: deprecate Mesos support, `--mesos-api`, and `-pm` command-line flags
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2023-01-09 14:04:55 +01:00
Furkan 8381d58f2c chore(scripts/falco-driver-loader): improve curl resiliency
Fixes #2334

Signed-off-by: Furkan <furkan.turkal@trendyol.com>
2023-01-09 10:12:55 +01:00
Andrea Terzolo 19d5430f5d update: modern falco builder
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2023-01-09 09:04:54 +01:00
Andrea Terzolo 609171fe14 doc: reword
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-21 14:56:02 +01:00
Andrea Terzolo de6292ce09 doc(userspace): fix a warning message
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-21 14:56:02 +01:00
Andrea Terzolo decabbc519 update(ci): bump also `musl` job
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-21 11:26:02 +01:00
Andrea Terzolo 647c085041 ci: bump resource class
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-21 11:26:02 +01:00
Andrea Terzolo e1ff4db67a update(ci): support modern bpf with musl build
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-21 11:26:02 +01:00
Andrea Terzolo c861f0b02a update(ci): update ci jobs to generate Falco images with modern probe
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-21 11:26:02 +01:00
Andrea Terzolo e5ed3284db chore: bump libs/driver version
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-21 11:26:02 +01:00
Federico Di Pierro 9d2f1e0729 new(scripts): add bottlerocket support in falco-driver-loader.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-19 17:33:09 +01:00
Andrea Terzolo 100e92a6fb fix: job step name
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-19 11:48:00 +01:00
Andrea Terzolo 9b41b77d53 cleanup(ci): move static analysis from circle CI to GHA
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-19 11:48:00 +01:00
Oscar Utbult b17d513251 rules: use list of Falco containers instead of repeating them
Signed-off-by: Oscar Utbult <oscar.utbult@gmail.com>
2022-12-16 12:56:23 +01:00
Luca Guerra 6ea233dd75 new(falco): add engine version to --version
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-12-16 12:09:24 +01:00
Luca Guerra dde2fdd67c new(falco): add driver_api_version, driver_schema_version, default_driver_version, libs_version to support
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-12-16 12:09:24 +01:00
Luca Guerra a4ff604021 update(falco): update cpp-httplib to 0.11.3
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-12-16 11:53:23 +01:00
Alberto Pellitteri d9a9fdf577 Rule: detecting executions from /dev/shm
Signed-off-by: Alberto Pellitteri <albertopellitteri96@gmail.com>
2022-12-16 11:33:23 +01:00
Alberto Pellitteri 68b87a6f13 Rule: detecting executions looking for AWS credentials
Signed-off-by: Alberto Pellitteri <albertopellitteri96@gmail.com>
Co-authored-by: Alessandro Brucato <alessandro.brucato@sysdig.com>
2022-12-16 10:42:23 +01:00
Melissa Kilby e5f3b724a5 update(docs): reference Falco default rules overview markdown document
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-12-15 16:46:20 +01:00
Melissa Kilby f04ff10bd7 new(rules): init rules_inventory/
* add ad-hoc python script to generate Falco default rules overview markdown document
* init rules_inventory/rules_overview.md doc

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-12-15 16:46:20 +01:00
Melissa Kilby 6afe9d9200 update(rules): ehanced rules tagging for inventory / threat modeling
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-12-15 16:46:20 +01:00
cappellinsamuele cec135b4b6 fix(ci): fix rpm sign job dependencies
Signed-off-by: cappellinsamuele <cappellinsamuele@gmail.com>
2022-12-15 16:32:20 +01:00
Leonardo Grasso 73b9273472 chore(scripts): rename env var
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-12-15 16:19:20 +01:00
Andrea Bonanno 7e52db2b42 update(script): makes user able to pass additional custom option to driver-loader curl command
Signed-off-by: Andrea Bonanno <andrea@bonanno.cloud>
2022-12-15 16:19:20 +01:00
Federico Di Pierro a1d68e848f chore(scripts): avoid failing if mkdir/cp/depmod fail.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro d0ac5981a7 update(scripts): typo
Co-authored-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro 380dd23a60 update(scripts): typo
Co-authored-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro 4c550bbe06 chore(scripts): manage dialog cancel button, and increase dialog vertical size to comprehend all of 5 options.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro 76c8a645f1 chore(scripts): properly configure falco-kmod dependency on falco-kmod-inject with `PartOf`.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Andrea Terzolo 5bb566d613 fix: stop also `falco-kmod-inject.service` unit
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-15 14:09:19 +01:00
Andrea Terzolo ee08c4d3de update: remove falco target
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-15 14:09:19 +01:00
Federico Di Pierro 988256d930 fix(scripts): fixed rpm dialog script.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro a94f26ec43 chore(scripts): fallback at previous insmod method, if modprobe fails.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro d4d2777876 fix(scripts): fixed PartOf in bpf and modern-bpf systemd units.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro 4fc10bc774 chore(scripts,cmake): rename modern_bpf to modern-bpf in deb and rpm scripts.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro 87416ab67c chore(scripts): try to install kmod system wide.
Then, we can always use `modprobe` to load it instead of `insmod`.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro 01f4af480d fix(scripts): fixed some debian issues by directly using systemctl tool.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro cb20cf83ff new(scripts, cmake): added support for modern bpf probe.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro c6f668bc71 cleanup(scripts, cmake): fix switch in deb and rpm postinst scripts.
Cleanup cmake cpackgenerator options.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-15 14:09:19 +01:00
Federico Di Pierro 1570e9f235 chore(scripts, cmake): add falco-plugin.service to install files.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro cbea78b283 fix(scripts): by default, do not enable any driver.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro ca55e70a33 chore: make dontstart default dialog selection.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro 4596c919a6 fix(scripts): improve gcc skip logic.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro 4e57670599 chore(scripts): add back a dontstart option.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro 91fe2e9e24 chore(scripts): added support for falco@plugin.target.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro b04bb2e32e chore(scripts): renamed Don't Start to Plugin.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro e26aa6a385 chore(scripts): when running in non-interactive mode, do not enable neither start any driver.
Eg: when building Falco docker image, and installing Falco package, we don't want it to build any driver.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro 818f717622 chore(scripts,cmake): dialog is an optional dep, do not list it among deps.
Cleaned up unused vars in postinst scripts.
Finally, only show dialog window in interactive shells.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro 9232383616 chore(cmake): dkms is actually needed by falco driver loader.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro 41ffc90633 cleanup(scripts): allow falco-driver-loader script to manage more gcc versions.
AmazonLinux uses `gcc-$Vers`, like gcc-10, but our regex prevented that to work.
Instead, rely on the fact that **real** gcc has some `--version` fixed output.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro b6078ce1be new(scripts): allow rpm/deb users to decide at configure time which driver to use (kmod or ebpf).
Manage it via a bash dialog interface.
Moreover, use falco-driver-loader instead of dkms to build bpf/kmod after package install.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Federico Di Pierro 06fe9e6985 new(scrips): improve systemd units for rpm and debian.
Unify them; plus, rework systemd units to support eBPF too.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-15 14:09:19 +01:00
Oscar Utbult f43e6c445a rules: add OpenSSH private key to macro private_key_or_password
Signed-off-by: Oscar Utbult <oscar.utbult@gmail.com>
2022-12-15 13:36:18 +01:00
Nicolas-Peiffer 1f15af1e4f feat: Support for detecting outbound connection to c2 servers with FQDN domains and IP addresses.
Signed-off-by: Nicolas-Peiffer <102670102+Nicolas-Peiffer@users.noreply.github.com>

feat: Support for detecting outbound connection to c2 servers with FQDN domains and IP addresses.

doc: add comment

Fixing DCO append amend

Signed-off-by: Nicolas-Peiffer <102670102+Nicolas-Peiffer@users.noreply.github.com>

Revert to original C2 rule name

Signed-off-by: Nicolas-Peiffer <102670102+Nicolas-Peiffer@users.noreply.github.com>

modify comments on C2 rule

Signed-off-by: Nicolas-Peiffer <102670102+Nicolas-Peiffer@users.noreply.github.com>

comment

Signed-off-by: Nicolas-Peiffer <102670102+Nicolas-Peiffer@users.noreply.github.com>

clean comments

Signed-off-by: Nicolas-Peiffer <102670102+Nicolas-Peiffer@users.noreply.github.com>

clean comments

Signed-off-by: Nicolas-Peiffer <102670102+Nicolas-Peiffer@users.noreply.github.com>

modify stdout

Signed-off-by: thedetective <nicolas@lrasc.fr>
2022-12-15 13:27:18 +01:00
Andrea Terzolo 39753b6130 update(ci): remove 2 usages of falco-builder
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-15 12:31:19 +01:00
Andrea Terzolo b758206cf1 cleanup(ci): remove some no more useful jobs
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-15 12:31:19 +01:00
Leonardo Grasso 9c04622bd6 chore(proposals): fix typo found by FedeDP
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-12-14 17:32:14 +01:00
Leonardo Grasso 0200ec288e chore(proposals): fix typo found by codespell
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-12-14 17:32:14 +01:00
Leonardo Grasso 50c169987e docs(proposal): new artifacts distribution proposal
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-12-14 17:32:14 +01:00
Jason Dellaluce 5552bcab76 chore: fix typo
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-12-13 15:06:10 +01:00
Jason Dellaluce cb58ea9c57 test: add regression tests for ref loops in lists and macros
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-12-13 15:06:10 +01:00
Jason Dellaluce 0a6db28783 fix(test/engine): solve compilation issues with macro resolver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-12-13 15:06:10 +01:00
Jason Dellaluce 25ddc3c6a2 update(userspace/engine): broader err catching support in macro resolver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-12-13 15:06:10 +01:00
Jason Dellaluce 35dd0fc153 fix(userspace/engine): implement loop detection in macro resolver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-12-13 15:06:10 +01:00
Federico Di Pierro 0c39776557 chore(ci): properly checkout pull request HEAD instead of merge commit in gh actions.
See https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-12 11:11:44 +01:00
Federico Di Pierro 4696948754 fix(cmake): properly fetch dev version by appending latest Falco tag, delta between master and tag, and hash.
`describe` can no more be used as tags are now made on release branches.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-12 11:11:44 +01:00
dependabot[bot] ec04b758e6 chore(deps): Bump certifi from 2020.4.5.1 to 2022.12.7 in /test
Bumps [certifi](https://github.com/certifi/python-certifi) from 2020.4.5.1 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2020.04.05.1...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-12 11:01:44 +01:00
Andrea Terzolo 52ee61b800 chore(userspace): add `njson` lib as a dependency for `falco_engine`
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-10 17:07:06 +01:00
gentooise 70dfdb2e75 support older rhel distros in falco-driver-loader
Tested on RHEL 6

Signed-off-by: gentooise <andrea.genuise@ibm.com>
2022-12-09 12:03:13 +01:00
Federico Di Pierro 1b227cf90b update(cmake): bumped libs and driver to latest RC.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-06 12:59:50 +01:00
Andrea Terzolo ff3a38415d fix: remove conflicting helper methods
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-06 12:59:50 +01:00
Andrea Terzolo 94ed56df95 chore: bump libs
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-06 12:59:50 +01:00
Andrea Terzolo 6a972272c0 update: the capture will be stopped in the inspector destructor
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-06 12:59:50 +01:00
Andrea Terzolo 55deb452d8 update: start/stop capture inside `do_inspect`
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-12-06 12:59:50 +01:00
Federico Di Pierro 87371492c5 update(userspace/engine): updated checksum.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-06 12:59:50 +01:00
Federico Di Pierro 17dfe4f55d fix(userspace/falco): properly start/stop capture.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-06 12:59:50 +01:00
Federico Di Pierro 928ad6625b update(cmake): update libs to 8eef2e445364d892dba12564d20f9651232eba7c
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-12-06 12:59:50 +01:00
Mark Stemm 356a4a0749 Also copy ruleset when copying falco source
In the copy constructor and assignment operator for falco_source, also
copy the ruleset along with factories/name.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-12-01 17:07:52 +01:00
Mark Stemm 910b8ff858 Fix(engine) Save parse positions when finding unresolved macros
Now that ASTs contain parse positions, use them when reporting errors
about unknown macros.

When doing the first pass to find all macro references, save macros as
a map<macro name,parse position> instead of a set<macro name>. While
making that change, change the visitor struct to use references
instead of pointers.

In the second pass, when reporting any unresolved macro references,
also report the parse position.

The unit tests also check that the positions of macros are properly
returned in the resolved/unresolved maps.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-12-01 17:03:52 +01:00
Mark Stemm 83b12bab1d Fix(engine): include parse positions in compile errors
Now that ASTs have parse positions and the compiler will return the
position of the last error, use that in falco rules to return errors
within condition strings instead of reporting the position as the
beginning of the condition.

This led to a change in the filter_ruleset interface--now, an ast is
compiled to a filter before being passed to the filter_ruleset
object. That avoids polluting the interface with a lot of details
about rule_loader contexts, errors, etc. The ast is still provided in
case the filter_ruleset wants to do indexing/analysis of the filter.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-12-01 17:03:52 +01:00
Lorenzo Susini ecc1853d60 update(rule): improve insmod detection within container using CAP_SYS_MODULE
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2022-12-01 11:17:50 +01:00
Andrea Terzolo fbd6628693 new(config): add the `simulate_drops` config explicitly
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-11-30 19:26:47 +01:00
Jason Dellaluce ba61706557 update(userspace/falco): enable using zlib with webserver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-11-30 19:24:47 +01:00
vin01 234026e14b rule(macro rpm_procs): let salt-call write to rpm database
Signed-off-by: vin01 <vinc.i@protonmail.ch>
2022-11-30 19:20:47 +01:00
vin01 d03826379b rule(Read sensitive file untrusted): let salt-call read sensitive files
Signed-off-by: vin01 <vinc.i@protonmail.ch>
2022-11-30 19:20:47 +01:00
Alessandro Brucato 3697d1fae2 Fixed typo
Signed-off-by: Alessandro Brucato <alessandro.brucato@sysdig.com>
2022-11-30 19:12:47 +01:00
Alessandro Brucato e76c31b493 Added PTRACE_SEIZE, PTRACE_POKETEXT, PTRACE_POKEDATA, PTRACE_SETREGS and whitelist macro
Signed-off-by: Alessandro Brucato <alessandro.brucato@sysdig.com>
2022-11-30 19:12:47 +01:00
Alessandro Brucato d95e36b526 Rule: PTRACE attached to process
Signed-off-by: Alessandro Brucato <alessandro.brucato@sysdig.com>
2022-11-30 19:12:47 +01:00
Jason Dellaluce 15b57bd972 fix: remove minor string view dependencies
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-11-29 16:27:42 +01:00
Leonardo Grasso 68f4d5bb59 fix(userspace/engine): no need to use external deps
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-11-29 16:27:42 +01:00
Leonardo Grasso 138e373ace chore(cmake/modlule): cleanup DownloadStringViewLite
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-11-29 16:27:42 +01:00
Leonardo Grasso 47fd90bb7f chore: remove not used dependency - string-view-lite
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-11-29 16:27:42 +01:00
Luca Guerra 3a56804cff new(CHANGELOG): add entry for 0.33.1
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-11-29 10:29:41 +01:00
Melissa Kilby 8f188ebe06 update(docs): polish release.md based on community feedback
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-11-28 10:45:35 +01:00
Melissa Kilby 7ead21daac update(docs): polish overview and versioning sections of release.md
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-11-28 10:45:35 +01:00
Melissa Kilby d3badeb77e update(docs): add overview and versioning to release.md
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-11-28 10:45:35 +01:00
Edvin Norling 588ab01bfd Add Xenit AB to adopters
Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
2022-11-23 13:12:57 +01:00
Luca Guerra f08a5b4067 update(cli): also add cg / kg container-gvisor / kubernetes-gvisor
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-11-23 13:03:57 +01:00
Luca Guerra dea02f82e8 update(falco): add container-gvisor and kubernetes-gvisor print options
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-11-23 13:03:57 +01:00
Luca Guerra e3dbae3259 fix(engine): fix warning about redundant std::move
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-11-11 16:19:11 +01:00
Federico Di Pierro d0ceba83b4 update(cmake, docker, circleci): updated libs and driver to latest master.
Docker builder image was updated to remove the libelf and libz deps as they are now properly bundled, in BUNDLED_DEPS mode.
Finally, circleci musl job was updated to enforce the use of alpine-provided libelf package, since it is already static,
and building libelf on musl is pretty cumbersome.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-11-11 14:56:10 +01:00
Aldo Lacuku 161246fe1a fix(output): do not print syscall_buffer_size when gvisor is enabled
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2022-11-10 10:32:05 +01:00
Jason Dellaluce 240c0b870d fix(userspace/falco): verify engine fields only for syscalls
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-11-07 15:37:25 +01:00
Federico Di Pierro 136eacc17f chore(scripts): when ENABLE_COMPILE is disabled, exit immediately if target distro could not be fetched.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-11-02 12:06:29 +01:00
Federico Di Pierro c0c0246927 fix(scripts): force falco-driver-loader script to try to compile the driver anyway even on unsupported platforms.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-11-02 12:06:29 +01:00
Mark Stemm acf5c4ce5f fix(engine): save syscall source only when processing events
The optimization in https://github.com/falcosecurity/falco/pull/2210
had a bug when the engine uses multiple sources at the same
time--m_syscall_source is a pointer to an entry in the indexed vector
m_sources, but if add_source is called multiple times, the vector is
resized, which copies the structs but invalidates any pointer to the
vector entries.

So instead of caching m_syscall_source in add_source(), cache it in
process_events(). m_sources won't change once processing events starts.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-10-27 18:23:25 +02:00
Yarden Shoham 4a4fa2592b fix(plugins): trim whitespace in `open_params`
`open_params` is read from the falco YAML configuration file and parsed using Go's URL.

For example:
c349be6e84/plugins/k8saudit/pkg/k8saudit/source.go (L41-L42)

Go's URL parser does not handle whitespace, so if a user defines the `open_params` in the falco configuration file as follows

```yaml
open_params: >
/file/path
```

the parser returns an error. To avoid this, we now trim this parameter so no whitespace will be left for Go's URL parser to error out on.

For reference see #2262.

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
2022-10-21 19:12:58 +02:00
Federico Di Pierro d0467de0a7 fix(ci): fixed version bucket for release jobs.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-10-21 11:19:19 +02:00
Jason Dellaluce c1be1496d3 update(CHANGELOG.md): change release date
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-19 10:52:57 +02:00
Jason Dellaluce fa1a5d58e6 update(changelog.md): add entry for Falco 0.33.0
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-19 10:52:57 +02:00
Andrea Terzolo 62abefddf6 chore: bump libs version
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-10-14 15:30:52 +02:00
Andrea Terzolo 784fa8b374 chore: bump plugin version
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-10-14 14:32:22 +02:00
Jason Dellaluce 10fe9fd84b fix(userspace/falco): avoid using CPU when main thread waits for parallel event sources
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-14 13:12:22 +02:00
Jason Dellaluce 3d7677ce5b update(userspace/falco): create struct for sync parallel event sources parallelization
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-14 13:12:22 +02:00
Jason Dellaluce 0fd765f7c3 new(userspace/falco): add simple semaphre implementation
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-14 13:12:22 +02:00
Jason Dellaluce cca90b2f80 update(userspace/falco): move on from deprecated libs API for printing event list
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-13 17:00:18 +02:00
Jason Dellaluce 6c873418ce chore(userspace/falco): improve the CLI options helper
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-13 15:39:18 +02:00
Jason Dellaluce f12531a153 chore(userspace/falco): log cli options with debug level
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-13 15:39:18 +02:00
Andrea Terzolo d5e3085b54 chore: bump to latest libs commit
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-10-12 18:47:15 +02:00
Andrea Terzolo 90d6d9080a fix: inject kmod script
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-10-12 16:40:21 +02:00
Jason Dellaluce 7d28637f44 fix(test): fix regresstion test
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-12 14:03:20 +02:00
Jason Dellaluce 9d8f130f47 fix(userspace/falco): make sure validation summary is populated even when json output is requested
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-12 14:03:20 +02:00
Jason Dellaluce 9ee0298c4d fix(userspace/engine): avoid macro/list used checks if we encounter an error
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-12 14:03:20 +02:00
Jason Dellaluce 7da30ca661 chore(userspace/falco): make logging optional when terminating, restarting, and reopening outputs
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-12 13:14:20 +02:00
Andrea Terzolo 12d709b8b1 chore: bump libs version
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-10-12 12:36:21 +02:00
Jason Dellaluce 57b26530b6 update(userspace) fix cppcheck warnings
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-12 12:07:20 +02:00
Jason Dellaluce 3629c4dc4a update(userspace): solve cppcheck performance suggestions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-12 12:07:20 +02:00
Jason Dellaluce 5e531870a9 fix(userspace/engine): fix unit test segfault
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-12 11:17:20 +02:00
Jason Dellaluce c2dc0a7259 test(engine): fix unit tests
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-12 11:17:20 +02:00
Jason Dellaluce f684e144be chore(userspace/falco): polish ignored event warning message
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-12 11:17:20 +02:00
Jason Dellaluce a4218a4b4f fix(userspace/falco): print right list in ignored events warning
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-12 11:17:20 +02:00
Jason Dellaluce 48fbe0801d fix(userspace/falco): print right list of ignored events when in simple cons mode
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-12 11:17:20 +02:00
Jason Dellaluce c47492ab6d update(userspace/falco): populate list of interesting event types in app state
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-12 11:17:20 +02:00
Jason Dellaluce 4cb556aed2 update(userspace/engine): use sinsp api to access event table information
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-12 11:17:20 +02:00
Andrea Terzolo 7da3041cb3 feature(falco_service): add a service unit to inject the kmod
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-10-12 10:50:21 +02:00
Andrea Terzolo 48ce85f4da fix(falco_service): falco service needs to write under `/sys/module/falco`
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-10-12 10:50:21 +02:00
Jason Dellaluce 5f2bc6a2d3 fix(userspace/falco): properly handle termination at source opening failures
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-11 19:23:17 +02:00
Jason Dellaluce 88c7202fdc fix(userspace/falco): check conditions in right order
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-11 19:23:17 +02:00
Jason Dellaluce a98a1b2c4c fix(userspace/falco/falco): allow output reopening to happen multiple times
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-11 19:23:17 +02:00
Jason Dellaluce 77857a7236 fix(userspace/falco): solve warning
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-11 19:23:17 +02:00
Jason Dellaluce e011b3b5e5 chore(userspace/falco): fix typo
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-11 19:23:17 +02:00
Jason Dellaluce fd4d521a5f fix(userspace/falco): make multi-source termination condition more stable
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-11 19:23:17 +02:00
Jason Dellaluce 3f3386cfe0 fix(userspace/falco): make signal handlers safe with multi-threading
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-11 19:23:17 +02:00
Jason Dellaluce 11160f8463 fix(userspace): safely check string bounded access
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-11 11:23:15 +02:00
Stanley Chan 79d875c28f cleanup(scripts): cleanup systemd unit in RPM installer
Signed-off-by: Stanley Chan <pocketgamer5000@gmail.com>
2022-10-07 14:47:00 +02:00
Stanley Chan 7610ee53e5 cleanup(scripts): cleanup systemd unit in DEB installer
Signed-off-by: Stanley Chan <pocketgamer5000@gmail.com>
2022-10-07 14:47:00 +02:00
Jason Dellaluce 3c02b40a21 chore(userspace/falco): make log message termination consistent
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-06 21:27:06 +02:00
Jason Dellaluce e85a8c914f chore(userspace/falco): move enabled sources list printout when capture is opened
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-06 21:27:06 +02:00
Jason Dellaluce 21c2b1f472 update(userspace/falco): use unordered_set where possible for faster lookups
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-06 21:27:06 +02:00
Jason Dellaluce 909f6d0961 chore(userspace/falco): make log messages formatting more consistent
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-06 21:27:06 +02:00
Jason Dellaluce 83a83a5853 update(userspace): pass string as const refs when possible
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-06 21:27:06 +02:00
Jason Dellaluce b4ea2f4da2 fix(userspace/falco): stabilize termination signal handler
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-06 18:21:05 +02:00
Jason Dellaluce 59ba2f9aab fix(userspace/falco): properly terminate threads
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-06 18:21:05 +02:00
Jason Dellaluce 32ec3240b4 fix(rules): add falco no-driver images to k8s_containers macro
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-06 15:44:10 +02:00
Andrea Terzolo fbac2a9570 tests: fix broken tests
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-10-05 19:38:21 +02:00
Andrea Terzolo 805f0cdd78 chore: bump libs to latest release branch commit
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-10-05 19:38:21 +02:00
Federico Di Pierro e68151eb07 chore(test,userspace/falco): fixed tests after libs bump.
Moreover, try to create grpc socket folder path only if grpc is actually enabled.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-10-05 19:38:21 +02:00
Andrea Terzolo ec7ddbbaf8 chore: bump libs/driver to pre-release tag
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-10-05 19:38:21 +02:00
Jason Dellaluce 663c1d073a fix(userspace/falco): check plugin requirements when validating rule files
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-05 13:21:20 +02:00
Jason Dellaluce bbb821fb8e refactor(userspace/falco): move rules plugin requirements check in an internal funcion
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-10-05 13:21:20 +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
Andrea Terzolo 545b58ee14 update(open_inspector): use variable buffer dim in modern bpf
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-28 18:55:06 +02:00
Andrea Terzolo cf83ff5447 chore: bump libs to latest master
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-28 18:55:06 +02:00
Andrea Terzolo 8d8e7622e1 update(cmd_line): put modern bpf to `false`
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-28 18:55:06 +02:00
Andrea Terzolo fd097e94d7 new(cmdline): add support for modern BPF probe
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-28 18:55:06 +02:00
Luca Guerra 6634c896b7 fix(falco): print container info and gvisor info in the same way
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-09-28 12:45:04 +02:00
spyder-kyle 38c823533c Add PIDs to falco_rules.yaml rules
Signed-off-by: Kyle Smith Hanna <kyle.smithhanna@spyderbat.com>
2022-09-27 10:51:00 +02:00
Andrea Terzolo 3aa9267b48 fix(syscall_buffer): set dimension if page size not available
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-27 10:47:59 +02:00
Andrea Terzolo 725714726d update(configuration): define `m_syscall_buf_size_preset` as `uint16_t`
improve also some logs for `m_syscall_buf_size_preset` configuration errors

Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-27 10:47:59 +02:00
Andrea Terzolo c9fa585801 update: address some review comments
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-09-27 10:47:59 +02:00
Andrea Terzolo 90e4634a79 update(syscall_buffer_size): don't crash in case of `getpagesize` error
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
2022-09-27 10:47:59 +02:00
Andrea Terzolo b0b2f05eb5 new: configure syscall buffer dimension from Falco
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-27 10:47:59 +02:00
Jason Dellaluce 8aea0935c9 chore(userspace/engine): remove unused var
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-27 10:42:59 +02:00
Jason Dellaluce 9c240198a0 refactor(userspace/engine): refactor falco_engine with new loader defs
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-27 10:42:59 +02:00
Jason Dellaluce f6f763fe84 refactor(userspace/engine): clean up rule collector
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-27 10:42:59 +02:00
Jason Dellaluce 9b5f3ee99e refactor(userspace/engine): clean up rule compiler
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-27 10:42:59 +02:00
Jason Dellaluce 89e8f70de0 refactor(userspace/engine): clean up and rename rule reader
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-27 10:42:59 +02:00
Jason Dellaluce b0f0105116 refactor(userspace/engine): clean up rule loader
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-27 10:42:59 +02:00
Jason Dellaluce 5f2267f716 update(userspace/engine): add new loader files to CMakeLists
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-27 10:42:59 +02:00
Jason Dellaluce b65157af5e refactor(userspace/engine): split rule loader git history (5)
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-27 10:42:59 +02:00
Jason Dellaluce b2b1feb1f2 refactor(userspace/engine): split rule loader git history (4)
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-27 10:42:59 +02:00
Jason Dellaluce b900e46dfe refactor(userspace/engine): split rule loader git history (3)
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-27 10:42:59 +02:00
Jason Dellaluce a98c9cdd20 refactor(userspace/engine): split rule loader git history (2)
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-27 10:42:59 +02:00
Jason Dellaluce 2a427925a0 refactor(userspace/engine): split rule loader git history (1)
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-27 10:42:59 +02:00
Andrea Terzolo c0c37d87f5 fix(process_events): check the return value of `open_live_inspector`
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-20 18:07:30 +02:00
Andrea Terzolo f57c67cc96 docs(falco.yaml): fix a typo
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-09-20 11:35:28 +02:00
Andrea Terzolo 7686c03a36 update(app_actions): add a depraction comment for BPF
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-20 11:35:28 +02:00
Andrea Terzolo aa0abb4288 tests: fix `traces-positive/run-shell-untrusted.scap` test
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-20 11:35:28 +02:00
Andrea Terzolo 8b927fb010 chore: bump libs version
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-20 11:35:28 +02:00
Andrea Terzolo a325086363 test(falco): fix broken tests
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-20 11:35:28 +02:00
Andrea Terzolo 1930ec56c7 test(plugin): bump plugin API in test
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-20 11:35:28 +02:00
Andrea Terzolo 3902779409 chore(plugins.cmake): bump plugin versions
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-20 11:35:28 +02:00
Andrea Terzolo 7e37c72431 update: falco works with the latest libs commit
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-20 11:35:28 +02:00
Federico Di Pierro e068df514c chore(userspace/engine,userspace/falco): upgraded to latest libs.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-09-20 11:35:28 +02:00
Federico Di Pierro 9048d84ed4 chore(cmake): bumped libs to latest master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-09-20 11:35:28 +02:00
Federico Di Pierro 00459f3447 chore(cmake): dropped SCAP_BPF_PROBE_ENV_VAR_NAME variable; unused.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-20 11:35:28 +02:00
Federico Di Pierro 0274959981 update(userspace/falco, cmake): updated libs to latest master.
Adapted API to sinsp::open API break, and simple consumer API break.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-20 11:35:28 +02:00
Hi120ki 30b56d2960 revert and create new known macro
Signed-off-by: Hi120ki <12624257+hi120ki@users.noreply.github.com>
2022-09-16 14:24:40 +02:00
Hi120ki d6b5789b7a add user_known_mount_in_privileged_containers
Signed-off-by: Hi120ki <12624257+hi120ki@users.noreply.github.com>
2022-09-16 14:24:40 +02:00
Hi120ki af4524491d put open_read in the beginning of the rule
Signed-off-by: Hi120ki <12624257+hi120ki@users.noreply.github.com>
2022-09-16 14:22:39 +02:00
Hi120ki 36a08aee13 Update rules/falco_rules.yaml to delete enabled field
Co-authored-by: schie <77834235+darryk10@users.noreply.github.com>
Signed-off-by: Hi120ki <12624257+hi120ki@users.noreply.github.com>
2022-09-16 14:22:39 +02:00
Hi120ki 39de011751 Update rules/falco_rules.yaml to add argoexec into allowlist
Co-authored-by: schie <77834235+darryk10@users.noreply.github.com>
Signed-off-by: Hi120ki <12624257+hi120ki@users.noreply.github.com>
2022-09-16 14:22:39 +02:00
Hi120ki a83d38c6d7 add allowlist
Signed-off-by: Hi120ki <12624257+hi120ki@users.noreply.github.com>
2022-09-16 14:22:39 +02:00
Hi120ki 86c3a9cd69 revert to container
Signed-off-by: Hi120ki <12624257+hi120ki@users.noreply.github.com>
2022-09-16 14:22:39 +02:00
Hi120ki 8473706526 add systemd-sysctl to allowlist
Signed-off-by: Hi120ki <12624257+hi120ki@users.noreply.github.com>
2022-09-16 14:22:39 +02:00
Hi120ki 4e622fc033 add host to target
Signed-off-by: Hi120ki <12624257+hi120ki@users.noreply.github.com>
2022-09-16 14:22:39 +02:00
Hi120ki 16dca8f905 add rule Read environment variable from /proc files
Signed-off-by: Hi120ki <12624257+hi120ki@users.noreply.github.com>
2022-09-16 14:22:39 +02:00
Mark Stemm 2d5fc0b647 Use the same falco_rule struct for every call to filter_ruleset
Instead of using a falco_rule struct on the stack, use a single value
inside the falco_source struct. It's mutable as find_source returns a
const struct.

At very high event volumes (> 1M syscalls/second), even the tiny time
it takes to create/destroy the struct starts to add up, and this
switch has some small cpu savings.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-09-16 12:50:39 +02:00
Mark Stemm e5cd5eacf5 Save syscall source separately and check explicitly in process_event
When doing some testing of falco on very high event volumes (> 1.5M
events/second), I found that the time taken to look up a falco_source
struct had a non-negligible contribution to cpu usage.

So instead of looking up the source from the source_idx every time,
separately save the source for syscalls in the falco_engine object
directly. The separately saved copy is only used once someone calls
add_source with source="syscall".

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-09-16 12:50:39 +02:00
Stefano 366bcfd7a3 Added disable by default option to reduce noise
Signed-off-by: darryk10 <stefano.chierici@sysdig.com>
2022-09-16 12:44:38 +02:00
Stefano c844eb9ef3 Added rule to detect CVE-2019-5736
Co-authored-by: wcc526 <wcc526@gmail.com>
Signed-off-by: darryk10 <stefano.chierici@sysdig.com>
2022-09-16 12:44:38 +02:00
Leonardo Grasso b71eb7e6ed chore(OWNERS): cleanup inactive reviewer
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-09-14 15:31:25 +02:00
Leonardo Grasso c732e5d800 update: gRPC server sock defaults to `/run/falco/falco.sock`
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-09-14 10:27:24 +02:00
Leonardo Grasso c0ea753262 update(userspace/falco): gVisor sock now defaults to `/run/falco/gvisor.sock`
Co-authored-by: Vicente J. Jiménez Miras <vjjmiras@gmail.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-09-14 10:27:24 +02:00
Vicente JJ. Miras e4008217b9 Replacing /tmp/gvisor.sock with /run/gvisor.sock
According to the FHS 3.0 (https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s15.html), transient UNIX-domain sockets should be placed under the directory /run, so this commit updates the implicit value generated by the application.

Signed-off-by: Vicente J. Jiménez Miras <vjjmiras@gmail.com>
2022-09-14 10:27:24 +02:00
Jason Dellaluce 9c184af2a1 fix(userspace/falco): adopt stricter memory order semantics
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce d11aec28d5 fix(userspace/falco): move stats collection in event success path
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce d17e173e35 chore(userspace/falco): rename `sources` app state list for more clarity
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce 25e9bd1c91 chore(userspace/falco): fix codespell typo
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce 4bc9fc74c8 update(userspace/falco)!: adapt stats writer for multiple parallel event sources
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce b65cc49221 update(userspace/falco): rename init_inspector action into init_inspectors
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce ce769b1fbe fix(test): adapt plugin tests to new error msgs and features
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce 65993ad1ed refactor(userspace/falco): support multiple parallel event processing loops
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce f4c6a81ed8 update(userspace/falco): fix plugin list access in rule file loading action
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce f9a152b24c refactor(userspace/falco): generalize responsibilities of init_inspector action
Now, the action takes care of inizializing all app inspectors
(just one in capture mode, one for each evt source in live mode), and of
registering and initializing all loaded plugins in the right inspector as needed.
The plugin initialization logic, which also involves the filtercheck list
population and checks, was moved and refactored from the previous
implementation of the load_plugins action.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce ed025f1a86 refactor(userspace/falco): init all event sources in falco engine and in the right order
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce 8ba779de8c refactor(userspace/falco): restrict load_plugins action responsibilities
Now, the action is in charge of loading all plugins and initializing:
- the offline inspector
- the list of loaded event sources
- the list of loaded plugins and their config

After this action runs, plugins are loaded but not yet initialized.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce cf8b85ad86 refactor(userspace/falco): turn open inspector action into convenience private methods
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce 9cf3d118f6 update(userspace/falco): restrict clients init action to syscall inspector only
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce 63bdc1119f cleanup(userspace/falco): remove legacy hacks on source selection action
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce 9dc3eb2fc6 update(userspace/falco): reorder actions for their new semantics
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce 7bb319b21e update(userspace/falco): add convenience method for merging app run results
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce 3f7d61f150 refactor(userspace/falco): re-design application state and methods
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 16:14:15 +02:00
Jason Dellaluce cf9baea624 fix(userspace/engine): avoid reading duplicate exception values
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-12 15:53:15 +02:00
Federico Di Pierro ccd3c896de fix(userspace/engine): properly include stdexcept header to fix build.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-09-12 12:28:15 +02:00
Federico Di Pierro 11644ecafc chore(userspace/falco): be somewhat more portable, avoiding assuming that '/' is the path delim.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-09-09 09:59:06 +02:00
Federico Di Pierro 23df49a47f new(userspace/falco): create grpc unix socket and gvisor endpoint path automatically.
It is also able to handle multipart paths, like /run/falco/falco/falco/falco.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-09-09 09:59:06 +02:00
Federico Di Pierro 3e1ef070b8 fix(circleci): falco-driver-loader image build must be done starting from just-pushed falco master image.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Aldo Lacuku <aldo@lacuku.eu>
2022-09-07 16:04:04 +02:00
Aldo Lacuku 670b0733de apply suggestions from the review
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
2022-09-07 10:14:03 +02:00
Aldo Lacuku 752c3d8332 update(scripts/falco-driver-loader): minikube environment is now correctly detected
If there is a file in `/etc/VERSION` the script assumes that it is running in a minikube
enviroment. Furthermore the logic in building the `KERNEL_VERSION` has been updated
according to how the kernel and probe modules are saved in the S3 bucket. The kernel version
for the minikube kernels includes also the minikube version.

Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2022-09-07 10:14:03 +02:00
Aldo Lacuku daba85b61c update(scripts/falco-driver-loader): make some config variables configurable using env variables
When running falco-driver-loader in local we need to set some config variables to meaningful values.
Those variables usually are set by the CI during the image/packages builds. The changes introduced
by this commit allow to set them at start-up time using env variables

Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2022-09-07 10:14:03 +02:00
Mark Stemm 103d7e08b8 Update tests for rules loading (item names)
Update a few tests related to rules loading to use new names for
items (e.g. "rules content" for top level errors instead of "file")

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-09-07 10:13:02 +02:00
Mark Stemm 0f45cf49db Use enums for rules content item type
Use an enum instead of a string for the item_type aka "parts of a
rules file" field of contexts.

The set of values is mostly defined by the contexts that were already
created. There are a couple of forward-looking values for rule
outputs/macro conditions/etc. that may be useful for later.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-09-07 10:13:02 +02:00
Mark Stemm 7a5a4c32ee Support condition parse errors in rule loading results
In #2098 and #2158, we reworked how rules loading errors/warnings were
returned to provide a richer set of information, including
locations/context for the errors/warnings.

That did *not* include locations within condition expressions,
though. When parsing a condition expression resulted in a
warning/error, the location simply pointed to the condition property
of the rule.

This commit improves this to handle parse errors:

- When libsinsp::filter::parser::parse() throws an exception, use
  get_pos() to get the position within the condition string.
- Add a new context() constructor that takes a filter pos_info instead
  of a YAML::Mark.

Now that positions aren't always related to the location of yaml
nodes, Make up a generic "position" struct for locations and convert
YAML::Mark and parser positions to a position struct.

Also allow a context to contain an alternate content string which is
used to build the snippet. For contexts related to condition strings,
the content is the condition.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-09-07 10:13:02 +02:00
VadimZy af95455bab dropping fix for list parsing due to the absence of regex portability.
reverting to the inefficient code.

Signed-off-by: VadimZy <vadim.zyarko@sysdig.com>
2022-09-05 17:42:31 +02:00
VadimZy 4b75f213c6 use <onigposix.h> instead of <regex.h>
Signed-off-by: VadimZy <vadim.zyarko@sysdig.com>
2022-09-05 17:42:31 +02:00
VadimZy 0de617a7fb remove sinsp.h public dependencies
Signed-off-by: VadimZy <vadim.zyarko@sysdig.com>
2022-09-05 17:42:31 +02:00
VadimZy 5745faeccc fix tests, remove dead code
Signed-off-by: VadimZy <vadim.zyarko@sysdig.com>
2022-09-05 17:42:31 +02:00
VadimZy f9ee45b38e Improve Falco engine performance when loading rules and creating the rule sets
- replace std::set<uint16_t> with fixed size vector in event types propagation
- rework lists expansion by replacing repetitive string::find in constantly growing expansion string with regex tokenization
- improve json_event parsing by moving const initializations into static routines

Signed-off-by: VadimZy <vadim.zyarko@sysdig.com>
2022-09-05 17:42:31 +02:00
Jason Dellaluce 7d2f82fddc update(usperspace/engine): bump engine version to 15
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-05 14:40:31 +02:00
Jason Dellaluce 0956bac0de tests: add unit tests for plugin requirements checks in the engine
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-05 14:40:31 +02:00
Jason Dellaluce 1b410ea2cc update(userspace/engine): consider plugin version requirements in engine checks
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-05 14:40:31 +02:00
Jason Dellaluce 52402ac805 update(userspace/engine): support plugin version requirement alternatives in rule reader
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-05 14:40:31 +02:00
Jason Dellaluce 6e0971f1e1 update(userspace/engine): support plugin version requirement alternatives in rule loader
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-09-05 14:40:31 +02:00
Andrea Terzolo 934ae2f1a6 update(OWNERS): add Andrea Terzolo to owners
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-09-02 12:14:42 +02:00
Leonardo Grasso fab95f38a9 update(.circleci): re-enabled cppcheck
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-09-02 08:54:27 +02:00
Mauro Ezequiel Moltrasio 0be0191c53 Add StackRox to adopters
Co-authored-by: mfosterrox <mfoster@redhat.com>
Signed-off-by: Mauro Ezequiel Moltrasio <mmoltras@redhat.com>
2022-09-01 22:33:25 +02:00
Melissa Kilby 5dcc329339 chore(rules): change FALCO_ENGINE_VERSION to 13
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-09-01 14:45:23 +02:00
Melissa Kilby 721aa30e80 cleanup(rules): cleanup redundant use of always_true macros - 2
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-09-01 14:45:23 +02:00
Melissa Kilby 565ddd70d3 cleanup(rules): cleanup rules disabled by default - 4
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-09-01 14:45:23 +02:00
Leonardo Grasso c000695816 docs(README.md): cross linking resources and minor improvements
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-08-31 15:27:42 +02:00
Leonardo Grasso d67edeb39d docs(README.md): update URLs
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-08-31 15:27:42 +02:00
Leonardo Grasso 1a22bfc654 docs(README.md): remove `client-rs` and `client-py` SDKs
Those SDKs are now archived projects, see:
 - https://github.com/falcosecurity/evolution/issues/161
 - https://github.com/falcosecurity/evolution/issues/162

Hoping we can restore them in the future.

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-08-31 15:27:42 +02:00
Federico Di Pierro bd865450ef new(scripts): improved falco-driver-loader supporting any ubuntu flavor.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-08-30 12:25:37 +02:00
Jason Dellaluce 98b8e390a1 chore(rules): fix old url redirection
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-29 15:42:33 +02:00
Jason Dellaluce 6c1f908ca5 cleanup(cmake): rename legacy cmake variables
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-29 15:42:33 +02:00
Jason Dellaluce 574a4b9f0a update(userspace/falco): fix copyright notice year
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 12:48:18 +02:00
Jason Dellaluce c05ad6fde4 update(userspace/falco): fix copyright notice year
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 12:48:18 +02:00
Jason Dellaluce e361069092 chore(userspace/falco): fix typos
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 12:48:18 +02:00
Jason Dellaluce 9c6ad6ce84 update(userspace/falco): use json lib in stats writer
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 12:48:18 +02:00
Jason Dellaluce 2d8efee73e refactor(userspace/falco): improve design and docs of stats writer
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 12:48:18 +02:00
Jason Dellaluce 28ff6ad3bd refactor(userspace/falco): rename stats writer source files
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 12:48:18 +02:00
Jason Dellaluce 2f5461bed0 refactor(userspace/falco): use new stats writer in event processing action
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 12:48:18 +02:00
Jason Dellaluce 605dd2816d refactor(userspace/falco): re-implement stats writer
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 12:48:18 +02:00
Jason Dellaluce c5442ccb41 new(userspace/falco): introduce new refactored stats writer class
This new model uses an async worker and a concurrent queue to handle
stats writing. This ensures better performance, because the live event
processing loop will just need to do a push on the queue instead of writing
to a file (only when the timer triggers), and should be thread-safe by design.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 12:48:18 +02:00
Jason Dellaluce 9646308651 update(test): use event source selection in plugins tests
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 12:47:18 +02:00
Jason Dellaluce e15d9f6f51 update(test): use event source selection in k8s audit tests
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 12:47:18 +02:00
Jason Dellaluce ce0dd918fb refactor(test): enable selecting event sources in regression test suite
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 12:47:18 +02:00
Jason Dellaluce cc4ccc40d7 refactor(userspace/falco): implement complete event source selection
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-08-26 12:47:18 +02:00
Jason Dellaluce 0e2a053151 new(userspace/falco): add new cli option to selectively enable event sources
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 12:47:18 +02:00
Jason Dellaluce 97bf0338b9 refactor(userspace/falco): introduce standalone action for event source selection
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 12:47:18 +02:00
Melissa Kilby 6c12cc655e cleanup(rules): cleanup redundant use of always_true macros
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-08-26 11:40:18 +02:00
Melissa Kilby 7387fffcef cleanup(rules): cleanup rules disabled by default - 3
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-08-26 11:40:18 +02:00
Jason Dellaluce 34ca78786a refactor(userspace/falco): make signal handlers thread-safe
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 11:31:18 +02:00
Jason Dellaluce f2aba88a6c refactor(userspace/falco): ensure falco outputs are non-blocking and define exiting condition
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 11:31:18 +02:00
Jason Dellaluce bc765f1b7d chore(userspace/falco): log in signal handlers instead than in event processing loop
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 11:31:18 +02:00
Jason Dellaluce c2a8efc329 chore(userspace/engine): fix typos
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 11:26:18 +02:00
Jason Dellaluce 978f192c38 chore(userspace/engine): fix codespell typos
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 11:26:18 +02:00
Jason Dellaluce 1120fb2564 doc(userspace/engine): define thread-safety guarantees of falco_engine::process_event
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 11:26:18 +02:00
Jason Dellaluce 1b8847c06b refactor(userspace/engine): make stats manager thread-safe for on_event method
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 11:26:18 +02:00
Jason Dellaluce 3839fdca1e update(userspace/falco): avoid using zlib in webserver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 11:23:17 +02:00
Jason Dellaluce f599fab439 update(falco.yaml): update default configuration and its comments
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 11:23:17 +02:00
Jason Dellaluce 2b7bcc87a7 update(userspace/falco): add configuration entry for webserver threadiness
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 11:23:17 +02:00
Jason Dellaluce 0eacd41cd5 refactor(userspace/falco): support zlib and custom threadiness in webserver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 11:23:17 +02:00
Jason Dellaluce d9b6473db2 refactor(userspace/engine): increase const coherence of falco engine
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-26 11:04:18 +02:00
Melissa Kilby a6137e9475 update(rules): Directory traversal monitored file read - include failed open attempts w/ new macro open_file_failed
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-08-25 21:44:15 +02:00
Melissa Kilby dd49038b0d cleanup(rules): Directory traversal monitored file read
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-08-25 21:44:15 +02:00
Melissa Kilby 6efc5b42f7 new(rules): Directory traversal monitored file read
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-08-25 21:44:15 +02:00
Jason Dellaluce 7d3dacc6d7 refactor(userspace/falco): cleanup actions order
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-25 17:02:15 +02:00
Jason Dellaluce a9d185f5e1 refactor(userspace/falco): drop inspector dependency on print_plugin_info action
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-25 17:02:15 +02:00
Jason Dellaluce bd26bc09c2 refactor(userspace/falco): drop inspector dependency on print_ignored_events action
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-25 17:02:15 +02:00
Jason Dellaluce 97e3209222 refactor(userspace/falco): drop inspector dependency on load_rule_files action
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-25 17:02:15 +02:00
Jason Dellaluce 6d30061576 refactor(userspace/falco): drop inspector dependency on list_plugins action
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-25 17:02:15 +02:00
Jason Dellaluce 2caadd1af5 refactor(userspace/falco): add action for printing syscall events
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-25 17:02:15 +02:00
Jason Dellaluce b307853e39 update(userspace/falco): use move semantics in falco logger
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-25 17:00:15 +02:00
Leonardo Grasso 8e8491f280 update(test/output_files): add "hostname" to fixture
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-08-25 16:59:15 +02:00
Leonardo Grasso 3d61d3427e fix: correct env var name `FALCO_HOSTNAME`
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-08-25 16:59:15 +02:00
Leonardo Grasso 928e10f0ce fix(userspace/falco): print `hostname` when json formating is enabled
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-08-25 16:59:15 +02:00
Leonardo Grasso 34ad5c43fb update(userspace/engine): add support for hostname
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-08-25 16:59:15 +02:00
Jason Dellaluce f7b662f936 update(cmake): bump libs and driver version to 6599e2efebce30a95f27739d655d53f0d5f686e4
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-25 16:32:15 +02:00
Jason Dellaluce 45bf4db077 fix(cmake/libs): enforce using bundled re2
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-25 16:32:15 +02:00
Jason Dellaluce a8353307c7 update(cmake): bump libs and driver version to 2433c822e1c3ed55f6528c18a27373a677ce76af
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-25 16:32:15 +02:00
Jason Dellaluce 6db7353264 update(tests/engine): sync ast structs to new libs definitions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-25 16:32:15 +02:00
Jason Dellaluce d35dba30ed update(userspace/engine): sync ast structs to new libs definitions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-25 16:32:15 +02:00
Ian Robertson 8872f256f6 Support multiple URLs for DRIVERS_REPO environment variable (comma separated)
Signed-off-by: Ian Robertson <ian.robertson@wpengine.com>
2022-08-24 18:25:10 +02:00
Ian Robertson c40a216434 Identify DRIVER_VERSION and ARCH by storing in their proper directories
Signed-off-by: Ian Robertson <ian.robertson@wpengine.com>
2022-08-24 18:25:10 +02:00
Andrea Terzolo 3e3a380702 update(CI): do not check hidden files with codespell
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-08-23 16:29:05 +02:00
Andrea Terzolo 5e65e195ae fix(CI): codespell should ignore `ro` word
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-08-23 16:29:05 +02:00
Andrea Terzolo 02fce93d02 update(CI): remove release branches from the `push` event
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-23 15:55:05 +02:00
Andrea Terzolo 6051f2de81 update(CI): build Falco to run CodeQL Analysis
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-08-23 15:55:05 +02:00
Andrea Terzolo 9359db904b update(CI): remove `python` from languages
we use python only in out tests

Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-08-23 15:55:05 +02:00
Andrea Terzolo 4c3b797003 update(CI): remove codeQL `schedule` option
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-08-23 15:55:05 +02:00
Andrea Terzolo 8259a2cd5f new(CI): add CodeQL security scanning to Falco.
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Co-authored-by: Chris Aniszczyk <caniszczyk@gmail.com>
2022-08-23 15:55:05 +02:00
Jason Dellaluce e7502431a2 update(userspace/falco): move rate limiter out of falco outputs framework
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-23 15:52:05 +02:00
Jason Dellaluce bec103de1a docs(falco.yaml): improve rate limiter config docs
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-23 15:52:05 +02:00
Jason Dellaluce 6c74aa1a29 update(userspace/falco): enable per-event-source rate limiter
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-23 15:52:05 +02:00
Jason Dellaluce af0b624a3a fix(userspace/falco): set alert throttling config defaults
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-23 15:52:05 +02:00
Jason Dellaluce 8760f04bf2 refactor(userspace/falco): make output framework explicitly thread-safe
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-23 15:52:05 +02:00
Jason Dellaluce 88494d1412 update(falco.yaml): disable alert throttling by default
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-23 15:52:05 +02:00
Mark Stemm 8e61e46016 Add an "Ok, with warnings" overall status.
In outputs it could be confusing to see a line:

<filename>: Ok

followed by a set of warnings.

To differentiate this, add a top level status "Ok, with warnings" when
rule loading was successful but had warnings.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-08-19 11:55:43 +02:00
Mark Stemm 3c7b6e037a Falco engine changes to support multiple files in rule load results
The methods that throw exceptions from stringified results need to
additionally pass a rules_contents_t struct. This also meant that they
need to call the filename + content version of load_rules.

To avoid some duplicate code between the two load_rules_file methods,
move the work of opening the file into a private method
read_file(). It can throw an exception, which is passed through for
the void return method and caught + converted into a load_result error
for the method that returns a load_result.

Also, to avoid duplicate code between the void load_rules and
load_rules_file methods, add a private method interpret_load_result()
which throws an exception if the result has an error and prints
warnings otherwise if verbose is true.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-08-19 11:55:43 +02:00
Mark Stemm 49b7f0474f Falco application changes to support multiple files in rules results
Application changes to support multiple files when stringifying rules
results:

- In both validate_rules_files and load_rules_files, instead of
  loading each file individually and then calling load_rules(), add a
  separate step that loads all the files at once. The actual rules
  content strings are held in a vector. The map from filename to
  content (reference) points to entries in that vector.

- Both actions do the same work for this step, so put the
  implementation in a shared application template method read_files
  that works on iterators. It uses itertors because the load filenames
  are a list and the validate filenames are a vector.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-08-19 11:55:43 +02:00
Mark Stemm 98c1e3d3f1 Restructure rules result to properly support multiple files
The old version of rules_result assumed that all errors/warnings were
related to a single file. That was generally correct for errors, as
rules parsing always stopped at the first error, so there is only one
relevant file.

However, for warnings that was not the case. When reading multiple
files A and B, you might get a warning from file A *only* after
reading file B. For example, B might redefine a rule in such a way
that you could get unused list/macro warnings from file A.

To properly address this, make some changes to how contexts are
managed:

- Instead of creating snippets at the time the error/warning was
  generated, create snippets at the time the error/warning is
  converted into a string. This requires passing all rules contents to
  as_string()/as_json(), so define a
  falco::load_result::rules_contents_t map from filename to rules
  content (reference) and pass it in as_string/as_json(). Snippets are
  now generated from the rules content matching the filename in the
  context.
- When creating warnings/errors, there's no need to pass along the
  rules content. This is only used when converting an error into a
  string/json.

Also change snippet() to handle potentially very long lines. Instead
of always printing the entire line matching a location, print up to
snippet_width(param, with default 160 chars)/2 characters surrounding
the column from the location.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-08-19 11:55:43 +02:00
Melissa Kilby 0828296abc cleanup(rules): cleanup rules disabled by default - 2
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-08-17 10:55:14 +02:00
Andrea Terzolo 6971ed2dce update(PR-template): restore release-note
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-08-11 10:32:21 +02:00
Andrea Terzolo be10b1f8cb update(PR-template): add some `area`/`kind` to the template
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-08-11 10:32:21 +02:00
Andrea Terzolo 1efea20f57 update(PR-template): set `NONE` as default `release-note`
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-08-11 10:32:21 +02:00
Mark Stemm fefd23f2f1 fix: print full rule load errors without verbose/-v
The latest released falco always prints full details on errors when
used with -r (read rules)/-V (validate rules). However #2098 changed
this to only print full details when verbose is true.

Fix the regression by always printing errors when loading
rules. Warnings will be printed only with -v.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-08-10 14:39:17 +02:00
Andrea Terzolo 2a640daf13 update(docs): changelog for version 0.32.2
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-08-09 12:13:11 +02:00
Melissa Kilby 0ab66c6fb5 update(userspace/falco): rename some buffer kernel side event drop metrics, add comments
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-08-08 10:28:42 +02:00
Melissa Kilby 1588f37788 update(userspace/falco): extend buffer kernel side event drop metrics
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-08-08 10:28:42 +02:00
incertum 66af8ad52b new(userspace/falco): extend ebpf buffer kernel side event drop metrics
Signed-off-by: incertum <melissa.kilby.oss@gmail.com>
2022-08-08 10:28:42 +02:00
Andrea Terzolo ff247f922d chore(test/utils): remove unused script
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-08-05 17:56:28 +02:00
Melissa Kilby e9ba5d751f cleanup(rules): cleanup rules disabled by default
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2022-08-05 14:50:28 +02:00
Andrea Terzolo c81f3fc87e docs(falco-driver-loader): add some comments in falco-driver-loader
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-08-05 11:36:28 +02:00
Mark Stemm a37e2252b2 Update tests to use result struct + json-based validation
Update tests that validated rules files (typically looking for
errors/warnings) to use the new result struct + json based validation:

- When validating rules files, always use json output.

- In test cases, instead of parsing stderr/stdout, use new test
  properties "validate_ok", "validate_errors",
  "validate_warnings". These parse the json output and look for
  specific tuples of (error code, error message, item type, item name)
  in the output.

- There were a few tests that were actually validation tests but using
  the -r argument to load rules. Convert them to validation tests. In
  one case, split the test into two separate tests--one for
  validation, one ensuring that the rule doesn't match anything.

- There were a couple of tests that were duplicates of existing
  validation tests, just checking for the error in a different
  way. Remove them.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-08-04 14:49:23 +02:00
Mark Stemm 550cdbd176 Falco application changes to support rule loading result struct
Update the load_rules_files and validate_rules_files actions to use
the new falco_engine methods that return a rules result struct. The
app action interface is the same, returning ::fatal on error,
ok()/exit() otherwise. The difference is how any warnings/errors are
obtained--from the struct instead of an exception.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-08-04 14:49:23 +02:00
Mark Stemm f7f6d72ac0 Rule loader changes to support result objects
Changes to the rule loader to support result objects:

- Instead of throwing falco_exception on internal error, throw a
  rule_load_exception instead, which contains distinct
  error/message/context information.

- A context object contains a chain of location structs chaining from
  the document root to the object where the error occurred. Each
  location has a file position (as a YAML::Mark), an item
  type (e.g. "rule", "list", "exception"), and an item name (e.g. "Write
  Below Etc"). This will allow showing the exact location of an
  error (e.g. list item/exception field) while also remembering the item
  that contained it.

- All the _info structs now contain a context so errors that occur
  after yaml parsing can still point to the original location in the
  yaml file.

- rule_loader::result is an implementation of the abstract class
  defined in falco_load_result. The implementation keeps track of a
  list of errors/warnigns that used to be in the configuration object,

- Clean up compile_ methods to just throw rule_load_exceptions or
  return nothing, and ensure that all rule_load_exceptions are caught in
  compile(). When caught, errors are added to the result object.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-08-04 14:49:23 +02:00
Mark Stemm cbe7cceb87 Modify rule reader to use a result struct
Modify rule reader to use a result struct for errors and warnings:

- Instead of throwing a falco_exception to pass back errors, use a
  rule_load_exception, which contains distinct error codes, messages,
  and a context that points to the location of the error.

- The static method context_yaml_get_context() has moved to a method
  of the rule_loader context object + the result as_string() method.

- As objects are parsed, create relevant context objects as reading
  drills down into the contents of a rule/list/exception. This will
  enable for specific errors in, say, the middle of an exception/list
  while remembering the object that contains it.

- Modify decode_val()/decode_seq() to always return errors as
  exceptions. Previously, it was a mix of a bool return + some
  exceptions.

- decode_val()/decode_seq() are now more consistent about returning
  distinct errors for the property not existing, the property existing
  but not being a scalar/sequence value, and not being convertable to
  the templated value.

- Combine the two nearly identical decode_seq() functions into a
  single one that uses a lambda to perform the final step of adding to
  the vector/set.

- There are some item-specific decode_xxx functions for specific
  item properties like tags, exceptions fields/comps/values, etc.
  that call the above functions.

These changes simplify the calls to decode_seq()/decode_val() as they
don't need to add their own errors when returning false. Also some
calls weren't checking the return value.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-08-04 14:49:23 +02:00
Mark Stemm bb44d992ab Change filter_warning_resolver to use warning codes
Now that we have a result struct and set of warning codes, change the
filter_warning_resolver to use them. This involves populating a set of
warning codes instead of strings.

Also, the methods to format warnings into human-readable strings is
now in the falco_load_result static methods, so move the text there
and remove the methods here.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-08-04 14:49:23 +02:00
Mark Stemm 0066ba49ea Falco engine changes to support load_rules result class
Add new load_rules methods that return a result object instead of
throwing exceptions on error. The existing load_rules methods call the
new methods internally and continue to throw exceptions on
error/return individual values on success.

The result is returned as a unique_ptr so it can be populated while
loading rules (as a part of the configuration object) and then move()d
to the return value.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-08-04 14:49:23 +02:00
Mark Stemm 8497f25a43 Add a load result interface for use in new load_rules methods
Define a falco_load_result abstract class for use in new load_rules
methods. It's abstract so the implementation details in
rule_loader/rule_reader can be hidden from someone who wants to use
the API to load rules and work with a result.

The class defines a set of error codes/warning codes and has static
methods to get a short and long description of each error/warning.

There are virtual methods to access the important parts of a result:
 - successful or not
 - a string representation of the result, suitable for display to
   users. Takes a verbose argument. When verbose is true, the string is
   multi-line and has full details, including locations, item names,
   etc. When verbose is false, the string is single-line and just
   returns error codes.
 - a json representation of the result, suitable for automated
   parsing/interpretation later.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-08-04 14:49:23 +02:00
Andrea Terzolo 6b7be38e41 test: update a comment
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-08-04 11:47:22 +02:00
Andrea Terzolo 9d443685ea new(userspace): support `SCAP_FILTERED_EVENT` return code
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-08-04 11:47:22 +02:00
Jason Dellaluce 928d3225b9 fix(cmake): force using bundled valijson
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-03 15:58:21 +02:00
Jason Dellaluce a531e8b3ed fix(test): use old event versions in trace tests
Co-authored-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-03 15:58:21 +02:00
Jason Dellaluce 07fde46e7c fix(test): sync plugin tests to new plugin loader errors
Co-authored-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-03 15:58:21 +02:00
Jason Dellaluce 136b528849 fix(tests): index old version of events in rulesets
Co-authored-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-03 15:58:21 +02:00
Jason Dellaluce a46cbcffe8 fix(engine): index old version of events in rulesets
Co-authored-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-03 15:58:21 +02:00
Jason Dellaluce 577ba5904b update(engine): bump version to 14 and update fields checksum
Co-authored-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-03 15:58:21 +02:00
Jason Dellaluce 1b8c8a86ec update(cmake): bump libs version to b4c198773bf05486e122f6d3f7f63be125242413
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-03 15:58:21 +02:00
Jason Dellaluce 7317d80dd8 update(cmake): bump driver version to b4c198773bf05486e122f6d3f7f63be125242413
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-08-03 15:58:21 +02:00
Andrea Terzolo c8bc5758c3 new(userspace): print architecture information
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-07-31 19:57:29 +02:00
Federico Di Pierro ae43f30b0d fix(ci): fixed docker manifest circleci.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-07-29 12:29:02 +02:00
Federico Di Pierro fb579615a3 cleanup(ci): natively builds docker images for x86_64 and arm64 and then use docker manifest to combine them.
This allows for native-speed build of docker images, reducing CI time spent in
docker buildx qemu cross build for arm64 up to 10x.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-07-29 10:11:02 +02:00
Andrea Terzolo b759e77fda new(userspace): print if the BPF probe is enabled
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-07-28 12:25:57 +02:00
Andrea Terzolo 74b6186f7d new(userspace): print enabled sources when falco starts
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-07-28 12:25:57 +02:00
Mark Stemm baf5540c30 Remove required_engine_version from falco engine load_rules APIs
The only use of it was to include in --support output, which is
redundant as the support output already includes the full contents of
each rules file.

Additionally, it wasn't even being updated after the switch from lua
rules loading to c++ rules
loading (https://github.com/falcosecurity/falco/pull/1966/ or
surrounding PRs).

This will simplify follow-on changes to add a real "result" to rules
loading methods, as there will be fewer API variants to support.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-07-25 17:57:42 +02:00
Eric Engberg c3ddd7d5f1 fix: added arch to bpf download url
Signed-off-by: Eric Engberg <eric.engberg@hardrockdigital.com>
2022-07-22 11:06:07 +02:00
Stefano b378c3a77d Add darryk10 as rules OWNERS as reviewer
Signed-off-by: darryk10 <stefano.chierici@sysdig.com>
2022-07-21 17:42:07 +02:00
Jason Dellaluce 0cab9ba6ed chore(OWNERS): remove duplicates in reviewers
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-07-20 10:39:56 +02:00
Jason Dellaluce 8cb6fc532f cleanup(OWNERS): remove inactive approvers
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-07-20 10:39:56 +02:00
Andrea Terzolo 35db0b4a24 cleanup(userspace): remove unused logic
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-07-14 09:58:50 +02:00
Andrea Terzolo 4136a27de1 new(userspace): add exception management
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-07-14 09:58:50 +02:00
Andrea Terzolo e73dbd4b42 new(userspace): add current `drop_pct`
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Co-authored-by: Shane Lawrence <shane@lawrence.dev>
2022-07-14 09:58:50 +02:00
Andrea Terzolo b57a2d5a5f update(userspace): introduce nlohmann json library
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-07-14 09:58:50 +02:00
Federico Di Pierro 1bf5f864bc chore(docs): updated release.md template for packages adding aarch64 packages.
Moreover, updated readme using aarch64 instead of arm64 (same that is used in the badge), and adding "-x86_64" suffix to x86 packages.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-07-13 12:01:23 +02:00
Alessandro Brucato c40d1a5141 Update rules/falco_rules.yaml
Signed-off-by: Alessandro Brucato <alessandro.brucato@sysdig.com>
2022-07-13 11:54:23 +02:00
Alessandro Brucato 409ca4382e Update rules/falco_rules.yaml
Signed-off-by: Alessandro Brucato <alessandro.brucato@sysdig.com>

Co-authored-by: schie <77834235+darryk10@users.noreply.github.com>
2022-07-13 11:54:23 +02:00
Alessandro Brucato a71a635b7e Update rules/falco_rules.yaml
Signed-off-by: Alessandro Brucato <alessandro.brucato@sysdig.com>

Co-authored-by: schie <77834235+darryk10@users.noreply.github.com>
2022-07-13 11:54:23 +02:00
Alessandro Brucato 07024a2e0f Update rules/falco_rules.yaml
Signed-off-by: Alessandro Brucato <alessandro.brucato@sysdig.com>

Co-authored-by: schie <77834235+darryk10@users.noreply.github.com>
2022-07-13 11:54:23 +02:00
Brucedh 6feeaee0cd Added exception to Launch Privileged Container
Signed-off-by: Alessandro Brucato <alessandro.brucato@sysdig.com>
2022-07-13 11:54:23 +02:00
Andrea Terzolo a7153f2fd8 fix(userspace): compute the `drop ratio` in the right way
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Co-authored-by: Shane Lawrence <shane@lawrence.dev>
2022-07-13 09:38:22 +02:00
Ravi Ranjan c078f7c21d Falco Rules/Conditions Updates
Signed-off-by: Ravi Ranjan <ravi.ranjan@elastisys.com>
2022-07-12 12:08:38 +02:00
Aldo Lacuku 46f625c449 chore(engine): remove trailing colon from logs when loading rule files
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2022-07-12 10:40:43 +02:00
Luca Guerra 4c4ed56c19 update(docs): changelog for version 0.32.1
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-07-11 11:19:44 +02:00
Luca Guerra 773156de04 update(falco): update libs to 0.7.0
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-07-11 10:16:43 +02:00
Jason Dellaluce 62c1e875d5 update(userspace/falco): simplify sinsp logger sev decoding
Co-authored-by: Luca Guerra <luca@guerra.sh>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-07-07 12:46:51 +02:00
Jason Dellaluce 7dade32688 refactor(userspace/falco): make sinsp logging part of the configuration (default to false)
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-07-07 12:46:51 +02:00
Jason Dellaluce bae68b37ee new(userspace/falco): enable attaching libsinsp logger to the falco one
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-07-07 12:46:51 +02:00
Federico Di Pierro 3ddabc3b95 docs(readme): added arm64 mention + packages + badge.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-07-05 17:46:00 +02:00
Federico Di Pierro a8b9ec18b0 fix(circleci): properly set BUILD_DIR and SOURCE_DIR to /build and /source respectively.
Inside job "build-arm64" these are the locations used inside the container.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-07-05 17:45:01 +02:00
Federico Di Pierro 34404141e4 fix(circleci): share docker socket with docker container.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-07-05 17:45:01 +02:00
Federico Di Pierro 315b44dc17 new(circleci): enable integration tests for arm64.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-07-05 17:45:01 +02:00
Luca Guerra 161fe6fb3c update(falco): upgrade drivers to 2.0.0, libs to latest rc
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-07-05 11:02:38 +02:00
Luca Guerra 3cde70eda8 fix(falco): parameter ordering in initialization
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-07-01 14:17:38 +02:00
Luca Guerra 982e8663be update(gvisor): make gvisor_enable depend on config
Signed-off-by: Luca Guerra <luca@guerra.sh>

Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-07-01 14:17:38 +02:00
Luca Guerra 993516f430 new(falco): add compile-time option to enable or disable gvisor support
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-07-01 14:17:38 +02:00
Luca Guerra 60b149709d fix(gvisor): formatting
Signed-off-by: Luca Guerra <luca@guerra.sh>
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>

Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-07-01 14:17:38 +02:00
Luca Guerra 698eda8680 new(gvisor): add option to generate gVisor configuration
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-07-01 14:17:38 +02:00
Luca Guerra 0b75433cee update(gvisor): update to the latest sinsp interface
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-07-01 14:17:38 +02:00
Luca Guerra 0ba492c280 new(falco): do not alert on syscall frequency when gvisor is enabled
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-07-01 14:17:38 +02:00
Luca Guerra 927c1c4126 new(falco): enable gVisor event collection
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-07-01 14:17:38 +02:00
Luca Guerra 1966fa1f91 update(falco): update libs to 0.7.0-rc2, 2.0.0-rc1+driver
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-07-01 12:53:23 +02:00
Andrea Terzolo e4fe6a3353 chore(cmake): bump plugins versions
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-06-29 16:41:29 +02:00
Federico Di Pierro 610b67838b fix(docker): fixed deb tester sub image.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-29 11:52:31 +02:00
Jason Dellaluce effabf533d test(plugins): drop macro source warning test
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-06-28 11:33:08 +02:00
Jason Dellaluce 3c2effb498 refactor(userspace/engine): remove source field from macros in rule loader
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-06-28 11:33:08 +02:00
Jason Dellaluce 555bf9971c fix(test): update expected test result for docker-compose scap file
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Luca Guerra <luca@guerra.sh>
2022-06-23 18:12:24 +02:00
Leonardo Grasso c309107949 fix(test): correct "incompat_plugin_api" expectation
See https://github.com/falcosecurity/libs/pull/389

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-06-23 18:12:24 +02:00
Leonardo Grasso b6245d77c7 update(rules): lower priority to noisy rule (after the dup improvement)
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-06-23 18:12:24 +02:00
Leonardo Grasso 2f208b52fc fix(userspace/falco/app_actions/print_version.cpp): correct getter call for schema version
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>

Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-06-23 12:47:03 +02:00
Leonardo Grasso f3bc178e40 fix(userspace/falco/app_actions/print_version.cpp): ensure destructor gets invoked
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>

Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-06-23 12:47:03 +02:00
Leonardo Grasso 308f001b87 chore(cmake/modules): remove leftover
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-06-23 12:47:03 +02:00
Leonardo Grasso fda9fb36de update(userspace/falco): add more info to `--version` output
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-06-23 12:47:03 +02:00
Leonardo Grasso 92fdbbcc52 update(userspace/falco): do not print driver version by default
Since now each Falco version is compatible with a range of driver version and not just one.

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-06-23 12:47:03 +02:00
Leonardo Grasso 4b694896a4 build: temporarily bump libs and driver
Note that another bump is required before releasing Falco, since this commit uses alpha versions.

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-06-23 12:47:03 +02:00
Leonardo Grasso d589ec2144 build(cmake/modules): dedicated cmake module for the driver
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-06-23 12:47:03 +02:00
Leonardo Grasso 6c08fa2a20 build(cmake/modules): divorce driver from falcosecurity-libs module
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-06-23 12:47:03 +02:00
Leonardo Grasso 9af20a000d chore(cmake/modules): duplicate git history (part 2)
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-06-23 12:47:03 +02:00
Leonardo Grasso 7e1e7c2e42 chore(cmake/modules): duplicate git history (part 1)
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-06-23 12:47:03 +02:00
Leonardo Grasso 1f2e6d4629 chore(cmake/modules): indentation
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-06-23 12:47:03 +02:00
Mark Stemm 85ca1eb3dd fix(app_actions): perform validate_rules before load_rules action
Perform the validate_rules action before the load_rules action. This
ensures that *only* the rules files named with -V arguments are
validated.

This fixes https://github.com/falcosecurity/falco/issues/2087.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-06-23 12:24:03 +02:00
Luca Guerra 5dce4d2025 fix(tests): make tests run locally (take 2)
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-06-23 12:22:03 +02:00
Aldo Lacuku d90421387f update(rules): add macro for dup syscalls
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2022-06-23 10:06:13 +02:00
Aldo Lacuku 07b4d5a47a fix(rules): use exit event in reverse shell detection rule
In some cases the rule is not triggered when a reverse shell is spawned.
That's because in the rule we are checking that the file descriptor passed
as argument to the dup functions is of type socket and its fd number is "0, 1, or 2"
and the event direction is "enter".
The following event does not trigger the rule: dup2(socket_fd, STDIN_FILENO);
But using the exit event the rule is triggered.

Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2022-06-23 10:06:13 +02:00
Kaizhe Huang 8a1f43f284 remove kaizhe from falco rule owner
Signed-off-by: Kaizhe Huang <khuang@aurora.tech>
2022-06-22 22:16:21 -05:00
Federico Di Pierro fcac635780 update(OWNERS): add Federico Di Pierro to owners.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-22 19:06:20 +02:00
Vicente J. Jiménez Miras 5d10e54ad4 fix(ci): fix sign script - avoid interpreting {*}$argv
Signed-off-by: Vicente J. Jiménez Miras <vjjmiras@gmail.com>
2022-06-20 13:54:29 +02:00
Vicente JJ. Miras 5f17b7bd41 fix(ci): creates ~/sign instead of ./sign
Signed-off-by: Vicente J. Jiménez Miras <vjjmiras@gmail.com>
2022-06-20 10:19:11 +02:00
Federico Di Pierro 9231fe3c1f chore(ci): improved rpm command to check for SHA256 sign.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Vicente J. Jiménez Miras <vjjmiras@gmail.com>
2022-06-17 14:52:53 +02:00
Federico Di Pierro 99784874eb chore(ci): small refactor.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Vicente J. Jiménez Miras <vjjmiras@gmail.com>
2022-06-17 14:52:53 +02:00
Federico Di Pierro a3c8fa85d4 fix(ci): sign arm64 rpm packages.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-17 14:52:53 +02:00
Jeremi Piotrowski bcda81f700 update(falco_scripts): Change Flatcar dynlinker path
The Flatcar kernel module build needs to relocate binaries in /host/lib/modules
to run with the host's ld and glibc. While testing with glibc 2.34 that we plan
to introduce soon, we found that the previous dynlinker symlink (ld-xxx.so)
doesn't exist any longer. Update the hostld variable to use a path that is
present in all versions of glibc.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2022-06-17 13:41:52 +02:00
Jason Dellaluce 1e5ef912de chore: improve falco.yaml comments
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-06-14 22:13:37 +02:00
Jason Dellaluce 50039316ce update(userspace/falco): make plugin configuration more robust
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-06-14 22:13:37 +02:00
Jason Dellaluce eb365f1a3e new(userspace/falco): add action and option to print detailed plugin info
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-06-14 22:13:37 +02:00
joon 625201f9f6 Add Java compatibility note
Signed-off-by: joon <pirxthepilot@users.noreply.github.com>
2022-06-14 17:01:12 +02:00
joon 583ac4192c rule(Java Process Class Download): detect potential successful log4shell exploitation
Signed-off-by: joon <pirxthepilot@users.noreply.github.com>
2022-06-14 17:01:12 +02:00
Jeremi Piotrowski 85f91a3ec4 update(falco_scripts): support pre-built module/probe on Flatcar
Pre-built kernel modules/eBPF probes for Flatcar use the value of the OS
VERSION_ID field as KERNEL_RELEASE in the filename. A specific kernel release
version does not uniquely identify a Flatcar configuration, because Flatcar is
image-based instead of package-based. Here's a more specific example: the same
kernel version can be part of various Flatcar releases (across channels
alpha/beta/stable) with differences in configuration. This is why we use the
VERSION_ID value during offline builds with driverkit. Flatcar version numbers
are all higher than 1500.0.0, so there is no risk of collision with kernel
version numbers.

When locally building the kernel module on the system, we have access to the
correct kernel build directory at /lib/modules/$(uname -r)/build with the right
configuration and so for that branch, we need to reset KERNEL_RELEASE=$(uname -r).

See also the driverkit PR that introduces a builder for Flatcar:
https://github.com/falcosecurity/driverkit/pull/131

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2022-06-13 10:34:43 +02:00
Jeremi Piotrowski 6d56571e23 update(docker,falco_scripts): fix kernel module build on Flatcar
Relocate necessary tools from the kernel module build system to run using host
dynlinker and libraries, so that compiling falco module on Flatcar works.

Since Flatcar v2983.0.0, Flatcar ships with glibc-2.33, but the
falco-driver-loader container is based on debian:buster and so has a much older
glibc. This prevents some necessary tools within /lib/modules/*/build from
working which causes the falco module to fail to compile using dkms.

To make the tools work, we need to relocate them so we add patchelf to the
falco and local dockerfiles. The relocation is based on the approach done by
the sysdig agent-kmodule build system, but I'm unable to find the source code
for it. The host linker and libs will be found at /host/usr/lib64, so we change
the interpreter and rpath on the tools. The relocation happens on a copy of the
tools which are then bind mounted at the right location. The result allows the
module build to work.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2022-06-13 10:34:43 +02:00
Luca Guerra 9d7153e119 fix(tests): make run_regression_tests.sh work locally
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-06-13 09:38:44 +02:00
Federico Di Pierro 4097661ba8 fix(scripts): fixed path in publish-deb script.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-11 00:11:09 +02:00
Vicente J. Jiménez Miras 83700d6d6a update(build): Switch from RSA/SHA1 to RSA/SHA256 signature in the RPM packages
Signed-off-by: Vicente J. Jiménez Miras <vjjmiras@gmail.com>
2022-06-10 17:51:12 +02:00
Federico Di Pierro fccd3fa7b6 new(scripts): support InRelease file creation for publish-deb script.
Newest Debian/Ubuntu versions look for this file instead of Release + Release.asc, hitting lots of 404 (and a retry on the old format).

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-10 17:50:12 +02:00
Federico Di Pierro 1327c796d0 fix(scripts): fixed falco-driver-loader driver download url.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-10 16:49:42 +02:00
stephanmiehe c782655a53 Fix rule linting
Signed-off-by: Stephan Miehe <stephanmiehe@github.com>
2022-06-10 13:58:42 +02:00
Federico Di Pierro ba6c86696f fix(build): docker-container buildx engine does not support retagging images. Tag all images together.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-10 12:54:43 +02:00
Federico Di Pierro 9d2aba240d fix(build): fixed publish-docker-dev job context.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-06-10 09:33:42 +02:00
Federico Di Pierro b059e83dd2 fix(scripts): fixed publish-deb script with manual arch filter.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-09 17:52:40 +02:00
Federico Di Pierro 6a034c17e0 fix(scripts): forcefully create packages dir for debian packages.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-09 17:52:40 +02:00
Aldo Lacuku e6f99a61c9 chore(falco): fix indentation
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2022-06-09 12:50:39 +02:00
Aldo Lacuku 7b83943059 fix(falco): compilation issues with new libs version
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2022-06-09 12:50:39 +02:00
Aldo Lacuku 2111699a96 chore(engine): bump falco engine version number to 13
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2022-06-09 12:50:39 +02:00
Aldo Lacuku b6d0607716 chore(cmake): bump falco-security libs version to 075da069af359954122ed7b8a9fc98bc7bcf3116
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2022-06-09 12:50:39 +02:00
Federico Di Pierro 1c83a449bc fix(build): removed leftover line in circleci config.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-09 12:11:39 +02:00
Federico Di Pierro 534f66e601 fix(build): fixed circleCI artifacts publish for arm64.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-09 10:51:39 +02:00
Federico Di Pierro a98bf52345 update(docker): updated falco-builder to fix multiarch support.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-06-09 09:33:39 +02:00
Leonardo Grasso aad70f3de2 fix(.circleci): correct command for build-arm64
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-06-09 08:35:39 +02:00
odidev 4aa0fe1b95 ARM64 build
Signed-off-by: odidev <odidev@puresoftware.com>
2022-06-09 08:35:39 +02:00
odidev 0ebc7cd969 ARM64 build
Signed-off-by: odidev <odidev@puresoftware.com>
2022-06-09 08:35:39 +02:00
Federico Di Pierro 4f759b6b2b fix(build): use apt instead of apk when installing deps for aws ecr publish.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-08 15:40:18 +02:00
Federico Di Pierro ca677db651 update(build): avoid double build of docker images when pushing to aws ecr.
Moreover, fixed subtle whitespace-bug in various buildx lines.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-08 12:58:17 +02:00
Federico Di Pierro 0a98e11428 fix(build): try to use root user for cimg/base.
Moreover, fixed buildx usage.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-08 11:11:55 +02:00
Andrea Terzolo 7068e9958f tests(k8s_audit_plugin): fix a k8s_audit_plugin test
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-06-07 16:07:53 +02:00
Andrea Terzolo e5af3899f9 chore(k8s_audit_plugin): bump k8s_audit_plugin version
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-06-07 16:07:53 +02:00
Federico Di Pierro 3f29660258 update(scripts): ported publish-deb and publish-rpm scripts to be multi arch.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-07 11:02:54 +02:00
Federico Di Pierro 62794966b1 update(build): updated circle ci to properly use `docker buildx` to build multiplatform images.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-07 11:02:54 +02:00
Federico Di Pierro 984b94f734 new(docker,scripts): port all docker images to be multiarch ready.
They can be pushed with `docker buildx` for various architectures.

Moreover, updated falco-driver-loader to support multiple architectures.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-07 11:02:54 +02:00
Federico Di Pierro f9b0568187 update(changelog): added 0.32.0 release notes.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-03 10:29:43 +02:00
Federico Di Pierro 13eb8d2d48 update(build): updated plugins to latest versions.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-06-01 14:50:38 +02:00
Aldo Lacuku 7a774f6b2e chore(userpace/falco): do not print error code in process_events.cpp
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2022-06-01 13:35:38 +02:00
Federico Di Pierro 3fef329d11 update(build): updated libs to 39ae7d40496793cf3d3e7890c9bbdc202263836b for Falco 0.32.0.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-31 18:12:09 +02:00
Andrea Terzolo 9392c0295a fix(falco-scripts): remove driver versions with `dkms-3.0.3`
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-05-30 13:08:40 +02:00
Aldo Lacuku 765ef5daaf chore(userspace/falco): fix punctuation typo in output message when loading plugins
Signed-off-by: Aldo Lacuku <aldo@lacuku.eu>
2022-05-30 10:46:40 +02:00
Matan Monitz 9f163f3fe0 Update rules/falco_rules.yaml
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Matan Monitz <mmonitz@gmail.com>
2022-05-28 10:13:30 +02:00
Matan Monitz 4c95c717d2 known_shell_spawn_cmdlines - lighttpd
Signed-off-by: Matan Monitz <mmonitz@gmail.com>
2022-05-28 10:13:30 +02:00
beryxz 54a2f7bdaa rule(macro net_miner_pool): additional syscall for detection
Signed-off-by: beryxz <coppi.lore@gmail.com>
2022-05-28 09:29:30 +02:00
Federico Di Pierro eb9a9c6e7d update(build): updated libs to 1be924900a09cf2e4db4b4ae13d03d838959f350
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-26 18:19:26 +02:00
Federico Di Pierro 75712caa9a fix(test): dropped `file://` from k8s audit log tests.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-26 12:37:26 +02:00
Federico Di Pierro db5f1bec3d update(cmake): updated plugins.
Moreover, add support for aarch64 plugins, even if Falco 0.32 won't be distributed with official arm64 support.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-26 12:37:26 +02:00
Federico Di Pierro 1d343c93f3 update(build): updated libs version for Falco 0.32.0 release.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-26 11:07:27 +02:00
Jason Dellaluce 3b462af58e fix(userspace/falco): enable k8s and mesos clients only when syscall source is enabled
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-05-25 19:23:26 +02:00
Jason Dellaluce 09eae35f3a refactor(userspace/falco): create action for initializing k8s and mesos clients (step 2)
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-05-25 19:23:26 +02:00
Jason Dellaluce 383b8f9660 refactor(userspace/falco): create action for initializing k8s and mesos clients
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-05-25 19:23:26 +02:00
Jason Dellaluce 13d70b65ae update(userspace/engine): rename ruleset.h in filter_ruleset.h
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-05-25 09:16:45 +02:00
Jason Dellaluce 9fd10220a5 update(userspace/falco): sync falco with new engine definitions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-05-25 09:16:45 +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 5ddc8e20f4 test(userspace/engine): adapt test_rulesets to new definitions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-05-25 09:16:45 +02:00
Jason Dellaluce a1bdf95a0f refactor(userspace/engine): improve ruleset interface definitions
The filter_ruleset interface its implementation evt_type_index_ruleset
have been modified as follows:
- Only keep track of ruleset ids and not names. The falco engine will take
care of mapping easy-to-remember ruleset names to ruleset ids.
To emphasize this, use ruleset_id everywhere and not ruleset.
Also, make it non-optional.
- Have explicit separate functions to enable/disable rules, instead of a single enable() method combined with a boolean flag.
This does *not* change the falco_engine interface, which has
similar methods, to avoid breaking API changes.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Mark Stemm <mark.stemm@gmail.com>
2022-05-25 09:16:45 +02:00
Jason Dellaluce 833fec8537 refactor(userspace/engine): leverage falco_rule def in stats manager
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-05-25 09:16:45 +02:00
Jason Dellaluce 50c2aa9c81 refactor(userspace/engine): update rule loader to use new filter_ruleset interface
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-05-25 09:16:45 +02:00
Jason Dellaluce f41f51f736 refactor(userspace/engine): update falco engine to use new ruleset interface and have one ruleset for each source
This also fixes a couple of bugs. With the current implementation, the multi-ruleset feature is broken with multiple sources.

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 bbbdb311e0 refactor(userspace/engine): introduce interface for rulesets and their factory
This interface will allow us to use different ruleset implementations inside the same engine.
The goal is to define API boundaries that will allow swapping the current evttype-index
ruleset implementation more easily. Key benefits include: smaller component with less responsibilities,
easier substituibility, more testable design, opportunity to adopt different index strategies
depending on the ruleset implementation.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-05-25 09:16:45 +02:00
Andrea Terzolo d860472987 update(userspace/falco): improve falco termination
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-05-24 18:35:18 +02:00
Andrea Terzolo 3a3d5dfdcd Update userspace/falco/app_actions/load_rules_files.cpp
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>

Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-05-24 15:55:17 +02:00
Andrea Terzolo 46159b8de9 update(userspace/engine): introduce new `check_plugin_requirements` API
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-05-24 15:55:17 +02:00
Andrea Terzolo e751bf79c3 fix(userspace/engine): improve rule loader source checks for macros and lists
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-05-24 15:54:17 +02:00
Federico Di Pierro d9d8dedc32 update(test): fixed tests.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-21 16:33:38 +02:00
Federico Di Pierro 39f55f4b5c update(userspace): split filterchecks list for each source idx.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-21 16:33:38 +02:00
Federico Di Pierro 5f00cea3c9 fix(userspace/falco): do not start webserver in capture mode.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-21 16:33:38 +02:00
Federico Di Pierro f6dba24b81 update(build): updated libs to latest master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-21 16:33:38 +02:00
Brad Clark 9d41b0a151 use endswith ash_history to catch both bash and ash
Signed-off-by: Brad Clark <bdashrad@gmail.com>
2022-05-14 07:55:29 +02:00
Brad Clark b9bcf79035 rule(macro truncate_shell_history): include .ash_history
Signed-off-by: Brad Clark <bdashrad@gmail.com>
2022-05-14 07:55:29 +02:00
Brad Clark 3cca4c23cc rule(macro modify_shell_history): include .ash_history
Signed-off-by: Brad Clark <bdashrad@gmail.com>
2022-05-14 07:55:29 +02:00
Federico Di Pierro a7ebfbf137 update(ci): add `workflow_dispatch` to be able to manually trigger ci.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-13 17:28:54 +02:00
Federico Di Pierro fbc7ede75a Update .github/workflows/ci.yml
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-05-13 17:28:54 +02:00
Federico Di Pierro 7b45520f37 fix(ci): fetch all history from git to correctly populate FALCO_VERSION.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-13 17:28:54 +02:00
Federico Di Pierro 2b6c0f3f9e fix(ci): fixed ubuntu kernel headers install.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-13 17:28:54 +02:00
Federico Di Pierro f5f836ca8b fix(ci): fixed centos debug job.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-13 17:28:54 +02:00
Federico Di Pierro 3b73433c48 update(ci): dropped circleCI jobs that are now provided by gh actions.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-13 17:28:54 +02:00
Federico Di Pierro 1a3556affc update(ci): ported all no-output jobs to github actions.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-13 17:28:54 +02:00
Federico Di Pierro b3aec1967b fix(ci): use sudo.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-13 17:28:54 +02:00
Federico Di Pierro 004e93f19f new(ci): initial build minimal action ported to gh action.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-13 17:28:54 +02:00
Jason Dellaluce 96e2864c16 test(falco_k8s_audit): fix k8s audit tests to used plugin ruleset
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-05-12 18:28:34 +02:00
Leonardo Grasso e2b7b1208a build(cmake/modules): add plugins rules and bump plugins versions
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-05-12 18:28:34 +02:00
Leonardo Grasso d4f76f1f93 update!: moving out plugins ruleset files
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-05-12 18:28:34 +02:00
Leonardo Grasso 65de03aa29 update(rules): remove plugins ruleset files
Plugins' rules files now lives in their repositories. See https://github.com/falcosecurity/plugins/pull/98

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-05-12 18:28:34 +02:00
Leonardo Grasso 298913471c wip: bump libs version to ff0b1f8d4612d197368b3f7feff28178f3bd3ad184f3707942ab52219e98f461
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-05-12 18:28:34 +02:00
Stefano 3e603188d4 Changed field in thread.cap_effective
Signed-off-by: darryk10 <stefano.chierici@sysdig.com>
Co-authored-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2022-05-12 14:42:34 +02:00
Stefano c3bcf604a5 Changed Rule focus to be broader then just a specific CVE
Signed-off-by: darryk10 <stefano.chierici@sysdig.com>
Co-authored-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2022-05-12 14:42:34 +02:00
Stefano 2e2b13236b Fixed CVE number
Signed-off-by: darryk10 <stefano.chierici@sysdig.com>
Co-authored-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2022-05-12 14:42:34 +02:00
Stefano 24bd1abc43 Added new rule for CVE-2022-4092
Signed-off-by: darryk10 <stefano.chierici@sysdig.com>
Co-authored-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2022-05-12 14:42:34 +02:00
Federico Di Pierro acbbcf7481 Update userspace/falco/app_cmdline_options.h
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-05-12 14:26:34 +02:00
Federico Di Pierro 3ba64d8a49 new(userspace/falco): new inotify watcher is now able to properly watch rules folders, when specified.
This means that when starting Falco passing to it a folder for its rules, it will properly manage
changes to any file inside the folders, plus any created/deleted file inside it.

Unified list of rules parsing, instead of having it done twice inside cmdline_options and configuration.
Instead, it is done only once, inside load_rules_files.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-12 14:26:34 +02:00
Federico Di Pierro 293a6c2b40 update(userspace/falco): moved to a config option.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-12 14:26:34 +02:00
Federico Di Pierro a9fe979071 chore(userspace/falco): small cleanup.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-12 14:26:34 +02:00
Federico Di Pierro e32f5a66c5 new(userspace/falco): added an option to listen to changes on the config file and rules files, and trigger a Falco reload.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-05-12 14:26:34 +02:00
Milkshak3s 8c6cfae18f Include origin host in output json
Signed-off-by: Milkshak3s <justchris.vantine@gmail.com>
2022-05-09 12:16:50 +02:00
Leonardo Grasso eae193ade0 build(userspace/engine): cleanup unused include dir
`CURL_INCLUDE_DIR` is a leftover since now the correct include path is injected via libs.

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-05-04 16:12:30 +02:00
Sebastien Le Digabel 2bc4fec33c rule(Anonymous Request Allowed): exclude {/livez, /readyz}
Fixes #1794.

/livez and /readyz don't require authentication and can generate a lot
of noise if the cluster is checked by an anonymous external
system.

Some k8s systems have those endpoints required to be anonymous, as per this
[link to an OpenShift
setup](http://static.open-scap.org/ssg-guides/ssg-ocp4-guide-cis.html#xccdf_org.ssgproject.content_rule_api_server_anonymous_auth).

Signed-off-by: Sebastien Le Digabel <sledigabel@gmail.com>
2022-05-04 13:04:29 +02:00
Jason Dellaluce dbbc93f69d fix(userspace/falco): listen to proper host in webserver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-04-29 20:47:19 +02:00
Jason Dellaluce de754fb4e7 chore(falco.yaml): comment-out k8s plugin default config values
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-29 20:47:19 +02:00
Jason Dellaluce 63b7aabc81 chore: solve compilation issues and polish code
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-04-29 20:47:19 +02:00
Jason Dellaluce 69db6adf9d refactor(test): use SKIP_PLUGINS_TESTS to skip k8s audit regression tests
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-29 20:47:19 +02:00
Jason Dellaluce 67d2fe45a5 refactor: add k8saudit plugin and adapt config, tests, and rulesets
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-29 20:47:19 +02:00
Jason Dellaluce b91ff34b97 refactor: drop civetweb dependency and implement healtz using cpp-httplib
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-29 20:47:19 +02:00
Jason Dellaluce 42fcc7291f refactor(userspace/falco): remove k8s audit references from falco
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-29 20:47:19 +02:00
Andrea Terzolo 21b127ef65 docs(falco_scripts): update Copyright
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-04-29 13:46:58 +02:00
Andrea Terzolo 9937565416 docs(falco_scripts): add some punctuation marks in comments
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-04-29 13:46:58 +02:00
Andrea Terzolo b94226569f update(falco_scripts): delete all versions of the module from dkms
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-04-29 13:46:58 +02:00
Andrea Terzolo f8b97bfbce docs(falco_scripts): update comments in falco-driver-loader.
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-04-29 13:46:58 +02:00
Andrea Terzolo 1ebdb5648f update(falco_scripts): remove only the current version
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-04-29 13:46:58 +02:00
Andrea Terzolo a11d513bff chore(falco_scripts): Update `falco-driver-loader` cleaning phase
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-04-29 13:46:58 +02:00
Federico Di Pierro 7aed3b6d01 fix(test): fixed wrong test expected output.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-04-29 10:16:50 +02:00
Leonardo Grasso 98916e547d build(cmake): bump libs version to c778e452985aa7f17be781754d4ad0658fcc3254
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-04-29 10:16:50 +02:00
Federico Di Pierro 9ec05c7048 fix(test): dropped get_type() api from test_source/extract tests.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-04-29 10:16:50 +02:00
Federico Di Pierro fd9bb83d85 update(build): updated libs version to latest master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-04-29 10:16:50 +02:00
Federico Di Pierro 08ded97596 new(userspace/falco): use new plugin caps API.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-04-29 10:16:50 +02:00
Lorenzo Susini 9fb9215dbf new(rule): excessively capable containers
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
Co-authored-by: Kaizhe Huang <khuang@aurora.tech>
2022-04-29 07:35:50 +02:00
Leonardo Grasso 3a6274ab36 build: correct conffiles for DEB packages
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-04-28 17:01:45 +02:00
Mark Stemm 86d632d343 fix: allow empty exceptions property
This matches prior behavior before the lua-to-c++ switch.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-28 14:42:24 +02:00
Mark Stemm e909babe20 fix: add implied exception comp to item for single item variant
When adding an implied "in" comparison to an exception using the
single value form, add it to item, not items.

This fixes #1984.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-28 14:42:24 +02:00
Furkan 990a8fd6d5 update(rules): k8s: secret get detection
Signed-off-by: Furkan <furkan.turkal@trendyol.com>
2022-04-28 11:33:00 +02:00
Jason Dellaluce a16eac221e refactor(userspace/engine): apply C++ best practices to newest engine classes
This include making a coherent use of const, remove private inheritance, and adding virtual destructors.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-27 16:22:59 +02:00
Jason Dellaluce be177795c2 refactor(userspace/engine): use supported_operators helper from libsinsp filter parser
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-27 16:22:59 +02:00
Jason Dellaluce c36300a48c update(build): bump libs version to d6b75db133602dee81b4408902f2510275feae57
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-27 16:22:59 +02:00
Mark Stemm 120027dc2e Add constructor/destructor to stats_manager
This ensures m_total is properly initialized.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm b89b3f82ee Falco main changes for app actions
This involves moving the code in falco_init() into individual files
below app_actions/. falco_init() simply calls app.run() now. When
app.run() returns false, print any erorr. When app.run() sets restart
to true, falco_init() is called again.

app.run() is still inside a catch block to catch any uncaught
exception.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 1639e22462 Move most code from falco_init() to individual app actions
Each file below app_actions/ defines some of the methods declared in
falco::app::application.

Any state that needs to be shared betweeen methods, or between the run
and teardown methods, resides in falco::app::application::state(), so
the moved code stays pretty much as-is, other than replacing stack
variables with member variables in app_state.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm e3b82c00e1 Copying falco.cpp to process_events.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 6e10d3d884 Copying falco.cpp to process_events.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 0daff8f829 Copying falco.cpp to open_inspector.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 5d7bed8d74 Copying falco.cpp to open_inspector.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 64b7092f56 Copying falco.cpp to daemonize.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm a9417d60df Copying falco.cpp to daemonize.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 365b97a9db Copying falco.cpp to validate_rules_files.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 70dc7360c9 Copying falco.cpp to validate_rules_files.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm b845fccc72 Copying falco.cpp to start_webserver.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm d4def892be Copying falco.cpp to start_webserver.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 6b9714eadc Copying falco.cpp to start_grpc_server.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 54ef2a2b1e Copying falco.cpp to start_grpc_server.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 5496741aae Copying falco.cpp to print_version.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm c975df57a0 Copying falco.cpp to print_version.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 8634d8b3a2 Copying falco.cpp to print_support.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 4ca13bc0f0 Copying falco.cpp to print_support.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm de58872b2e Copying falco.cpp to print_ignored_events.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 2963bbab98 Copying falco.cpp to print_ignored_events.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm f5c18399e1 Copying falco.cpp to print_help.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 35261c4a3a Copying falco.cpp to print_help.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 78a297ac62 Copying falco.cpp to load_rules_files.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 9325658d5b Copying falco.cpp to load_rules_files.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 2d53fecf4b Copying falco.cpp to load_plugins.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 0f8386326e Copying falco.cpp to load_plugins.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 2e8d3c6486 Copying falco.cpp to load_config.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 444daef2f0 Copying falco.cpp to load_config.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 88b951abe2 Copying falco.cpp to list_plugins.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 4a818eeeec Copying falco.cpp to list_plugins.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 8c40b18428 Copying falco.cpp to list_fields.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 91a7bcae86 Copying falco.cpp to list_fields.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 9d9fb2538d Copying falco.cpp to init_outputs.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 98a2224ee5 Copying falco.cpp to init_outputs.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm ccbc8ec196 Copying falco.cpp to init_inspector.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 344dc3930b Copying falco.cpp to init_inspector.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 431b8885b4 Copying falco.cpp to init_falco_engine.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 22674f6bf8 Copying falco.cpp to init_falco_engine.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm ae7c8190d3 Copying falco.cpp to create_signal_handlers.cpp to preserve history (step 2, restoring falco.cpp)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm da7efbc96e Copying falco.cpp to create_signal_handlers.cpp to preserve history (step 1, copying file)
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 9de80b7b92 Application changes to support actions
Changes to the falco::app::application object to support actions:

- All of the code that was in falco_init is now in methods of
  application. (A later commit actually moves the code from falco_init
  and into the split-up methods, this commit just declares them).
- Methods return an application::run_result object, which is a tuple
  of success/errstr/proceed. proceed=false is used to short circuit
  calling methods (think --help, --list, --support, etc.)
- application now has a run() method which runs the methods in an order
  that honors any implicit dependencies (e.g. you have to init an
  inspector before you open it, you have to do almost everything else
  before processing events, etc.)
- There are a few methods devoted to teardown, they are always called
  after the group of run methods are called.
- State that needs to be saved between methods, or saved between the
  run and teardown functions, is in a
  falco::app::application::state object.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 0a51f4f1f1 Convert direct pointer refs to shared_ptr
Some objects used by falco (falco outputs, falco_formats, etc) were
using raw pointer references, which isn't great.

So convert use of raw pointers (originally passed from falco_init or
functions it called) with shared_ptr, as they are now held in
application state.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 531bc3eb5a Falco test changes (small output matches) for actions
With the split of falco_init into application:: methods, including a
notion of a success/error/proceed result, there is a
more concrete line between runtime errors (e.g. things that throw
exceptions) and errors returned by methods that run the application.

Some of the plugins tests were expecting errors to be returned by
exceptions (e.g. with a leading "Runtime error: and a trailing "
Exiting.").

Now, the errors are just returned directly in application::run(), so
drop the leading and trailing bits in expected test outputs.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Mark Stemm 62d4fffcb2 Add missing pragma
Without this, if webserver is included more than once you get
duplicate defined classes.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-04-22 13:27:52 +02:00
Leonardo Grasso 2c3c8b92e0 build: MUSL builds can't have plugins
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-04-22 09:41:56 +02:00
Leonardo Grasso d443bcfe5f build: components opt-in mechanism for packages
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-04-22 09:41:56 +02:00
Leonardo Grasso 01b407a358 build: define "plugins" component
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-04-22 09:41:56 +02:00
Leonardo Grasso b4d9261ce2 build: define "falco" component
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-04-22 09:41:56 +02:00
Leonardo Grasso 3300c72db0 build(cmake/modules): explicitly set libs package and driver component names
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-04-22 09:41:56 +02:00
Jason Dellaluce 0bf53f0f88 refactor(userspace/engine): restrict unsafe-na-check warning to k8s audit fields
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-21 18:50:58 +02:00
Jason Dellaluce 37d03cf7bc chore(userspace/engine): fix typo spotted with codespell
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-21 18:50:58 +02:00
Jason Dellaluce 71274b4369 test(userspace/engine): add unit tests for filter_warning_resolver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-21 18:50:58 +02:00
Jason Dellaluce 95727b268f new(userspace/engine): add a resolver to generate warnings from a filter AST
The first warnings we support involve the unsafe comparisons with <NA>, which were present
in the legacy regression tests for PSPs.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-21 18:50:58 +02:00
Jason Dellaluce 391ab028fc refactor!: deprecate PSP regression tests
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-21 18:50:58 +02:00
Leonardo Grasso 8dd4beac73 build(cmake): upgrade catch2 to 2.13.9
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-04-21 16:17:59 +02:00
Mateusz Gozdek b080d20525 Add codespell GitHub Action
Folllow up to #1961 to prevent common typos to be added to the repo.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
2022-04-20 12:21:27 +02:00
Mateusz Gozdek 1fdfbd3a3d Fix more typos
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
2022-04-20 12:21:27 +02:00
Kevin Krakauer 53eb6112a6 add gVisor to ADOPTERS.md
Signed-off-by: Kevin Krakauer <krakauer@google.com>
2022-04-20 12:20:27 +02:00
Jason Dellaluce 13256fb7ef update(userspace/engine): bump engine version to 12
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-19 16:29:40 +02:00
Jason Dellaluce df6dced96b update(build): bump cloudtrail and json plugin versions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-19 16:29:40 +02:00
Jason Dellaluce d9d23cd31d update: bump libs version to b19f87e8aee663e4987a3db54570725e071ed105
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-19 16:29:40 +02:00
Jason Dellaluce b8a95d262f refactor(userspace/engine): polish evttype resolver and use it in rule loader
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-19 16:29:40 +02:00
Jason Dellaluce dd3d235d7f refactor(tests): adapting test_rulesets to new method signatures
At the same time, this also simplifies the unit test cases by using the SCENARIO construct of catch2,
which allows sharing a setup phases between different unit tests, and removes a bunch of repeated LOC in our case.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-19 16:29:40 +02:00
Jason Dellaluce 71ca58cebd test(userspace/engine): port unit tests for evttypes resolver from linsinsp
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-19 16:29:40 +02:00
Jason Dellaluce b5870a8656 new(userspace/engine): add a resolver class to search evttypes from filters and event names
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-19 16:29:40 +02:00
Jason Dellaluce f638706ba3 chore(userspace/engine): renamings and code polishing in rule_loader and rule_reader
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-15 10:54:58 +02:00
Jason Dellaluce e1a5427874 update(userspace): add method to clear rule loader state
Once all rule files have been loaded, and all the rules have been compiled into filters and inserted in the engine rulesets, the loader definitions are maintained in memory without really being used. This commit adds a convenience method to clear the loader state and free-up some memory when engine consumers do not require such information in memory anymore.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-15 10:54:58 +02:00
Jason Dellaluce 30fb58ed48 refactor(userspace/engine): update falco_engine to use new rule_reader
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-15 10:54:58 +02:00
Jason Dellaluce 2c0e6d3b88 update(userspace/engine): introduce new rule_reader class
The rule_reader class is responsible of parsing the YAML ruleset text and of using the rule_loader
to store the new definition in the internal state. This is a first step towards separating the YAML
reading logic from the rule parsing one. Potentially, this will allow us to read rulesets from another
YAML library or from something different than YAML files too.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-15 10:54:58 +02:00
Jason Dellaluce 9ed7d57838 refactor(userspace/engine): reduce responsibilities of rule_loader
The rule_loader is now simply responsible of collecting list/macro/rule definitions and then compiling them as falco_rules. The ruleset file reading code will be moved to another class

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-15 10:54:58 +02:00
Clemence Saussez af96a930eb rules(allowed_kube_namespace_image_list): add container threat detection image
Signed-off-by: Clemence Saussez <clemence@zen.ly>
2022-04-15 10:52:58 +02:00
Clemence Saussez 5d65671d3a rules(falco_privileged_images): add container threat detection image
Signed-off-by: Clemence Saussez <clemence@zen.ly>
2022-04-15 10:52:58 +02:00
Stefano d3383b4b23 Fixed ouput Rules K8s Serviceaccount Created/Deleted
Signed-off-by: darryk10 <stefano.chierici@sysdig.com>
Co-authored-by: AlbertoPellitteri <alberto.pellitteri@sysdig.com>
2022-04-15 10:49:58 +02:00
Stefano 65435d4418 Removed use cases not triggering
Signed-off-by: darryk10 <stefano.chierici@sysdig.com>
Co-authored-by: Brucedh <alessandro.brucato@sysdig.com>
Co-authored-by: AlbertoPellitteri <alberto.pellitteri@sysdig.com>
2022-04-13 10:03:25 +02:00
Jason Dellaluce 06b6565fa6 refactor(userspace): sync falco codebase to new falco_common definitions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-11 22:21:20 +02:00
Jason Dellaluce 55ec8c0e1b refactor(userspace/engine): polish falco_common and improve priority parsing/formatting
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-11 22:21:20 +02:00
Lorenzo Susini 4343fe8a8b new(rules/k8s_audit): add rules to detect pods sharing host pid and IPC namespaces
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2022-04-11 18:29:19 +02:00
Jason Dellaluce 2934ef29b9 chore(userspace/engine): fix indentations and use improve indexed_vector
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-11 12:22:18 +02:00
Jason Dellaluce 47426fbe0d update(userspace/engine): minor improvements and bug fixes on engine and rule loader
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-11 12:22:18 +02:00
Jason Dellaluce e50d22f013 fix(userspace/engine): solve integration test errors
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-11 12:22:18 +02:00
Jason Dellaluce c0f8171d89 test: adapt integration tests to new rule loader error messages
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-11 12:22:18 +02:00
Jason Dellaluce 43020d8a7d refactor(userspace/engine): re-implement the rule loader in C++
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-11 12:22:18 +02:00
Jason Dellaluce d483b897e7 new(userspace/engine): create stats_manager inside falco engine
This is a porting of what we had inside the Lua codebase. This now handles the single responsibility
of gathering stats about rule-event matching, and of formatting them to print them to the user.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-11 12:22:18 +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
Jason Dellaluce 6c9e6c5918 new(userspace/engine): add new indexed_vector class to achieve string-based O(1) access in vectors
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-11 12:22:18 +02:00
Jason Dellaluce c2cac5af92 refactor(userspace/engine): add run() overload in filter_macro_resolver to support shared_ptrs
This change allows working with safety with AST nodes wrapped into shared pointers.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-11 12:22:18 +02:00
Jason Dellaluce cf83a91d4e refactor(userspace/engine): re-implement wrap_text() function in falco_utils
The function implementation was removed, however it was still defined in the .h header. Moreover,
this will now be required in order to replace its lua equivalent.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-11 12:22:18 +02:00
Jason Dellaluce 3201479392 refactor(userspace/engine): turn falco_common into a namespace containing common static utilities
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-11 12:22:18 +02:00
Jason Dellaluce b74dcbd851 cleanup(userspace/engine): remove lua files and lua-related code sections
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-11 12:22:18 +02:00
Jason Dellaluce 7db9dd66ff refactor(build): drop dependencies to chisels, luajit, lyaml, and libyaml
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-04-11 12:22:18 +02:00
Angelo Puglisi e8cb96a57b perf: change falco_engine::process_event to lookup sources by index
falco_engine::process_event gets called for every inspector event.
Profiling showed that std::map::find takes about 10% of
falco_engine::process_event, and that can easily improved by accessing
the source by index.

Signed-off-by: Angelo Puglisi <angelopuglisi86@gmail.com>
2022-04-06 14:46:31 +02:00
Mateusz Gozdek cb4cec6f57 Fix typos
Found by running the following command:
codespell -f -H -L aks,creat,chage -S .git

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
2022-04-06 14:40:31 +02:00
Stefano 36bd07d82d Fix spaces
Signed-off-by: darryk10 <stefano.chierici@sysdig.com>
2022-04-01 19:38:40 +02:00
Stefano bcff88922a Added eks_allowed_k8s_users list to whitelist EKS users
Signed-off-by: darryk10 <stefano.chierici@sysdig.com>
Co-authored-by: Alberto Pellitteri <alberto.pellitteri@sysdig.com>
2022-04-01 19:38:40 +02:00
Stefano 1988f3b0be Disabled by default noisy rules
Signed-off-by: darryk10 <stefano.chierici@sysdig.com>
2022-03-29 17:39:25 +02:00
schie 64f0cefab0 Update rules/okta_rules.yaml
Signed-off-by: darryk10 <stefano.chierici@sysdig.com>
Co-authored-by: Thomas Labarussias <issif+github@gadz.org>
2022-03-29 17:39:25 +02:00
schie 48041a517b Update rules/okta_rules.yaml
Signed-off-by: darryk10 <stefano.chierici@sysdig.com>
Co-authored-by: Thomas Labarussias <issif+github@gadz.org>
2022-03-29 17:39:25 +02:00
Stefano 6a1492a828 Added okta_rules.yaml
Signed-off-by: darryk10<stefano.chierici@sysdig.com>
2022-03-29 17:39:25 +02:00
Leonardo Grasso 5023851000 chore(rules): remove leftover
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-03-25 13:02:28 +01:00
Jason Dellaluce ecf13762b8 test(userspace/engine): add unit test cases for filter_macro_resolver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-03-23 18:31:43 +01:00
Jason Dellaluce a0a87e443f update(userspace/engine): support undefining macros
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-03-23 18:31:43 +01:00
Jason Dellaluce 20c59970f5 update(engine): rename and improve sinsp filter macro resolvers
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-03-23 18:31:43 +01:00
Jason Dellaluce c801c09e7d update(test): adapt integration test error messages to comply to new parser errors
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-03-23 18:31:43 +01:00
Jason Dellaluce b7db0f9b14 refactor(engine/lua): update lua rule loader to use new sinsp parser
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-03-23 18:31:43 +01:00
Jason Dellaluce 2ee95122df refactor(engine): remove unused lua modules
Both the parser.lua and compiler.lua modules are not necessary anymore, because all the logic related
to filter parsing and compilation is handled inside libsinsp now. Accordingly, they have been removed from
the lua-to-cpp.sh scripts. README.md and parse-smoke.sh have been removed since they are not needed anymore:
lpeg is not used by the project, and the smoke tests are implemented in libsisnsp unit test suite.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-03-23 18:31:43 +01:00
Jason Dellaluce 911bd16556 update(engine): create a lua helper for rule filter manipulation
The lua_filter_helper class is a simple Lua wrapper that can be used in the Lua rule loader to
parse/compile rule filters, and manipulate them to resolve/replace list and macro references.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-03-23 18:31:43 +01:00
Jason Dellaluce 3879a283bf refactor(engine): remove dependency from lua parser
The Lua parser grabbed from libs chisels is not used anymore, as the compilation logic happen inside the new
filter parser of libsinsp.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-03-23 18:31:43 +01:00
Jason Dellaluce c5818e6273 new(engine): add rule filter macro-resolver
This is a first step towards porting the rule filter building logic that is currently implemented in Lua.
filter_macro_resolver uses the newly introduced AST constructs from libsinsp, and
allow manipulating filter ASTs to resolve/replace macro references. This is meant to be used
at boot time by the rule loader (which we still want to maintain implemented in Lua for now).

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-03-23 18:31:43 +01:00
Jason Dellaluce 0a132f453a update(cmake): remove lpeg dependency
The Lua PEG parser is not longer needed, since we now use the new filter parser implemented
in libsinsp.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-03-23 18:31:43 +01:00
Frederico Araujo 26a3b7a01e refator(image): commented and moved symlinks inside SKIP_DRIVER_LOADER check
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
2022-03-23 15:39:03 +01:00
Frederico Araujo 55700f80e4 refactor(image): remove -x flag in ubi docker entrypoint
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
2022-03-23 15:39:03 +01:00
Frederico Araujo 54a817bf3c feat(image): set default value for UBI_VERSION build arg
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
2022-03-23 15:39:03 +01:00
Frederico Araujo 04cadee6fa fix(image): update package cache cleanup command
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
2022-03-23 15:39:03 +01:00
Frederico Araujo 4f5fb12a13 docs(docker/readme): updated table to include experimental UBI-based image for Falco
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
2022-03-23 15:39:03 +01:00
Frederico Araujo 5b99c0d481 refactor(build): moved Dockerfile and entrypoint script for UBI-based image to its own directory
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
2022-03-23 15:39:03 +01:00
Frederico Araujo 7c85349674 fix(docker/readme): fix grammatically incorrect split of infinitive
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
2022-03-23 15:39:03 +01:00
Frederico Araujo 9aa9ad9ee0 build(image): added label for ubi version and updated description labels
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
2022-03-23 15:39:03 +01:00
Frederico Araujo b18f2084c0 build(image): fixed handling of default falco version
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
2022-03-23 15:39:03 +01:00
TPT dc5b332cd1 build(image): simplified untarring command to install falco binary and scripts in ubi
Signed-off-by: TPT <teryl.taylor@gmail.com>
2022-03-23 15:39:03 +01:00
TPT 5b7260f706 build(image): updated UBI image to build dkms, and use falco binaries rather than rpm. This reduces dependencies.
Signed-off-by: TPT <teryl.taylor@gmail.com>
2022-03-23 15:39:03 +01:00
TPT dc40f82318 build(image): added falco ubi Dockerfile to provide a falco ubi image
Signed-off-by: TPT <teryl.taylor@gmail.com>
2022-03-23 15:39:03 +01:00
Jason Dellaluce 9607cbc2c7 update(build): temporarely bump cloudtrail and json plugin version to dev builds
This is required due to the plugin API version being bumped to 1.0.0 in the framework after
the recent breaking changes. cloudtrail and json will be switched back to a stable build
once they get released to require the plugin API version with the newest major.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-03-18 23:20:01 +01:00
Jason Dellaluce 481e32cab9 update(build): bump libs version to caa0e4d0044fdaaebab086592a97f0c7f32aeaa9
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-03-18 23:20:01 +01:00
Mark Stemm df219b5e1d New tests for rule + exception, macro with unknown source
Add new test cases for a rule with an unknown source *and* an
exception, and a macro with an unknown source.

The first results in a rule warning (and no error), and the second
prints an error and skips.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-03-18 13:54:47 +01:00
Mark Stemm 3fbc90e99e Skip macros with unknown sources
Also skip macros with unknown sources. This matters primarily for
macros related to plugins that have a distinct event source.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-03-18 13:54:47 +01:00
Mark Stemm ad42baed7a Check for unknown sources earlier (to handle exceptions)
If a rule has an unknown source, *and* has exceptions, loading the
rule will result in an error and not skipping the rule. This is
because exceptions are also validated for unknown fields, and that
occurs before the current check for unknown sources.

The fix is to move the check for unknown sources as soon as the rules
object is read.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-03-18 13:54:47 +01:00
Leonardo Grasso 31111ab87b docs(README.md): update slack channel URLs
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-03-17 17:10:30 +01:00
Leonardo Grasso 7d6b46218f docs(brand): add plugin definition
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-03-17 17:10:30 +01:00
Leonardo Grasso fded42c203 docs(README.md): adding plugins
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-03-17 17:10:30 +01:00
Leonardo Grasso 5ff9101b95 docs(README.md): moving section on top
I am co-authoring original authors to keep their credits.

Co-Authored-by: Kris Nova <kris@nivenly.com>
Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com>
Co-Authored-By: Massimiliano Giovagnoli <massimiliano.giovagnoli.1992@gmail.com>
Co-Authored-By: Jonah Jones <jonahjones094@gmail.com>
Co-Authored-By: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-03-17 17:10:30 +01:00
Matt Moyer 36acd6dfbf Add user_known_mount_in_privileged_containers
This adds a new macro `user_known_mount_in_privileged_containers` which
allows the easier user-defined exclusions for the "Mount Launched in
Privileged Container" rule.

This would be cleaner with the exclusions feature, but this feature
is not used in the default ruleset yet, if I understand correctly.

Signed-off-by: Matt Moyer <mmoyer@figma.com>
2022-03-17 10:50:56 +01:00
Luca Guerra 4819748ab0 fix(cli): update markdown description
Signed-off-by: Luca Guerra <luca@guerra.sh>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-03-17 10:41:56 +01:00
Luca Guerra f7a5dd0d5b new(falco): add CLI option to print docs in markdown format
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-03-17 10:41:56 +01:00
Claudio Vellage 4705a92c49 Allow to whitelist config modifiers
Signed-off-by: Claudio Vellage <claudio.vellage@pm.me>
2022-03-15 22:32:59 +01:00
Luca Guerra a5d3663c75 update(changelog): add link to security fix for 0.31.1
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-03-11 18:59:56 +01:00
Luca Guerra 58b6496f51 docs(CHANGELOG.md): Changelog for 0.31.1
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-03-09 17:52:02 +01:00
Luca Guerra 9dd85bf9db fix(cli): restore behavior of -pc -pm -pk CLI options
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-03-08 09:00:10 +01:00
Luca Guerra 6c4b267109 chore(build): update falco libs to b7eb0dd
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-03-04 10:48:49 +01:00
Josh Soref 7c005aa9dc spelling: workaround
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 2f2c5c4a9b spelling: whether
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref aadb76f2e9 spelling: validating
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 23f4f0eee0 spelling: unusual
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 97373a8b6e spelling: unknown
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 4ecb907223 spelling: unambiguously
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref db30d0e1c7 spelling: triggered
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref d173ab7a9e spelling: trailing
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref e4e8dcf06b spelling: third
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref e8aac31890 spelling: themselves
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 073339eff1 spelling: the
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 001e7557e6 spelling: the extraction
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 73f98de005 spelling: that
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 3760155ec8 spelling: temporarily
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref d8cfaee242 spelling: syntactic
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref e173bf89a3 spelling: suspicious
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref f12149dc87 spelling: superseded
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 19a6cf74f8 spelling: successfully
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref c62cc5e8c0 spelling: substituted
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref ead40f898a spelling: separate
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 8eef71b801 spelling: rules
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 97883e7535 spelling: resolutions
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 4f897e0dc0 spelling: readability
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref d0ee656dac spelling: provided
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 49b88c14b2 spelling: processing
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 9a314d9443 spelling: privileged
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 2b8a88c335 spelling: priorities
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 4a0c9d6ccb spelling: prerequisites
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref d55cd79ebd spelling: parentheses
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 5e7346ccb0 spelling: official
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 35d0f0603f spelling: multitrailing
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref d685e0967a spelling: minikube
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref be35c45590 spelling: manageable
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref d700d2f768 spelling: lexicographically
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 4a215ced6c spelling: launch
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref f5dab2eb5a spelling: implicit
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 53c77ea6b5 spelling: https://cryptoioc.ch
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 6e56ef77fd spelling: hipaa
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 1306fd6ac1 spelling: hierarchy
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 530f999556 spelling: github
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 86cf80d05f spelling: falcosecurity
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref ed11b8833f spelling: extractor
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 19ab9e5f35 spelling: expand
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 4a8bec09d7 spelling: error
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 3646fb6e03 spelling: discretion
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 88a5404d1c spelling: defining
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 5a19a1d3b0 spelling: content type
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 3806e62c3a spelling: constitute
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 25b07e134c spelling: complaints
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref bda7d7bb11 spelling: comparisons
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref ab05026065 spelling: commands
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref cc30fcc0cf spelling: command
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref fa7fab525f spelling: command lines
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref ae56a10932 spelling: cmake
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 676fc9efa8 spelling: between
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref ff94383ed9 spelling: berkeley
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 655ff76c3d spelling: attribute
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref cacbb3928d spelling: arg lists
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 72725a7f87 spelling: archiving
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref 00c3fa4908 spelling: among
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref eabd3ad24b spelling: altogether
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Josh Soref a84adbd231 spelling: allowed
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-01 16:30:24 +01:00
Andrea Terzolo 04ce76becc chore: bump libs to latest master `e71045b`
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-03-01 16:10:24 +01:00
Andrea Terzolo 6dbccfcac5 new: add a new drop category `n_drops_scratch_map`
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-03-01 16:10:24 +01:00
Andrew Suderman bd725cb655 Add Fairwinds to ADOPTERS.md
Signed-off-by: Andrew Suderman <andrew@sudermanjr.com>
2022-03-01 15:46:24 +01:00
Luca Guerra 4d29b872ab fix(build): fix civetweb linking in cmake module
Signed-off-by: Luca Guerra <luca@guerra.sh>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
2022-03-01 14:31:58 +01:00
Federico Di Pierro f78c816abd update(build): updated libs to latest master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-02-25 09:31:19 +01:00
Federico Di Pierro 1d76df3831 new(userspace/falco): allow to pass multiple --cri options.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-02-25 09:31:19 +01:00
Jason Dellaluce 335d79e79c chore(userspace/engine): remove unused lua functions and state vars
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-02-24 18:24:19 +01:00
Jason Dellaluce ef6888181d fix(userspace/falco): correct plugins init config conversion from YAML to JSON
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-02-24 18:23:14 +01:00
Andrea Bonanno d3083cde92 chore(userspace/falco): fixes truncated -b option description.
Signed-off-by: Andrea Bonanno <andrea@bonanno.cloud>
2022-02-24 16:14:27 +01:00
Mark Stemm 83353985f7 Update falco main to use falco application + cmdline_opts
Update falco's main falco_init() to use a falco::app::application and
falco::app::cmdline_opts object instead of storing all its command
line state in stack variables.

The bulk of the removed code is in usage() (not needed as cxxopt's
help() is self-documenting.) and getopt_long() which is replaced by
app.init(argc, argv).

For the most part, this is simply replacing references to local
variables (e.g. "all_events") to the bound variable inside the
cmdline_opts object (e.g. app.copts().all_events).

There are a few cases where more complex logic was used (output
formats, initializing k8s/mesos with string pointers), and those
changes are still in falco_init().

For the most part, the monolithic parts of falco_init that involve
reading config files, creating the inspector, loading rules, etc are
still present. Those will be addressed in later changes.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-02-24 10:40:16 +01:00
Mark Stemm 83b036bc0e Small changes to falco engine/config wrt new cmdline option parsing
For the most part, replacing getopt() with cxxopts + falco application
had no effect on falco engine/config interfaces. However, there were a
few places where it was wasier to change the interface than add
middleware code that transformed from, for example, vectors to lists.

This commit has those changes.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-02-24 10:40:16 +01:00
Mark Stemm 216f56b73b Initial falco::app::cmdline_options class
Fill in an initial falco::app::cmdline_options class using cxxopts
library to hold options:

- falco::app::cmdline_options contains a cxxopts::Options object to
  parse options and a cxxopts::ParseResult to hold the result.
- The only meaningful public method is parse() which parses argc/argv
  and returns true/false + error.
- The parsed options are all public instance variables of the object
  and generally use the same names of the corresponding variables in
  the old falco_init(). These variables are all bound to the
  corresponding command line option and are updated in parse().
- In a few cases, the command line option does not directly map to a
  bound variable (e.g. -b to set buffer format, -p/-pk/-pc to set
  extra formatting options, etc.) In these cases the option values are
  read after parsing and update the public instance variable.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-02-24 10:40:16 +01:00
Mark Stemm 17d8eea3bc Add notion of falco application object/cmdline opts skeleton
Add a notion of a falco application object. Eventually this will
replace the bulk of falco_init and contain methods to:

- Parse/validate command line options
- Parse/validate falco config
- Initialize prerequsites (inspector, falco engine, webserver, etc)
- Load plugins
- Load/validate rules
- Command/subcommand execution (e.g. --list/--list-fields, or
  nothing specified to run "main" loop)

For now, it is only responsible for command line options handling,
which is stubbed out.

Currently, the only public methods are init() to initialize everything
and copts() to access command line options.

Command line options are held in a different class
falco::app::cmdline_opts. application::copts() returns a reference to
that object, which allows access to parsed command line options bound
to various public instance variables.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-02-24 10:40:16 +01:00
Mark Stemm d74c8d6d4d Add cxxopts command line parsing library
We'll use this to better manage the fairly large set of command line
options in self-contained objects instead of a scattering of
individual stack variables.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-02-24 10:40:16 +01:00
Andrea Bonanno 888c15c6ee update(falco): updates usage description for -o, --option
Signed-off-by: Andrea Bonanno <andrea@bonanno.cloud>
2022-02-21 18:50:12 +01:00
Andrea Bonanno eedb794fd5 fix(userspace/falco): applies FALCO_INSTALL_CONF_FILE as the default config.
Signed-off-by: Andrea Bonanno <andrea@bonanno.cloud>
2022-02-18 17:33:43 +01:00
Mark Stemm 83c527dd91 Use cmake function to copy files, as a single target
Replace nearly-identical blocks of code that defined individual custom
targets/custom commands to copy files from source to build dir with
the copy_files_to_build_dir function.

This reduces the number of build targets and speeds up/cleans up the
make output.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-02-18 16:47:43 +01:00
Mark Stemm cbcc680c77 Cmake function to copy files from source to build dir, as a target
Define a cmake function copy_files_to_build_dir(source_files,
targetsuffix) that defines a single custom target and single custom
command to copy the set of source files to
CMAKE_CURRENT_BINARY_DIR. All of the real work is done via cmake -E
copy_if_different.

This function will replace the nearly identical cmake code in several
other directories. This function has the advantage of being a single
target for the set of source files instead of a target per-file.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-02-18 16:47:43 +01:00
Mark Stemm ad90209177 Always skip update command for git based external projects
I noticed that some external projects were being reconfigured/built
with every make, even though no files in the external project had been
updated.

With some debugging I noticed that git based external projects were
re-running their "update" step every time, and that in turn caused the
configure/build/install steps to re-run as well. (Generally the build
step is a no-op as the Makefile/etc. in the external project is well
formed and doesn't do anything, but the configure/install steps still
run).

It seems related to this cmake bug:
https://gitlab.kitware.com/cmake/cmake/-/issues/19703. In short, the
git update step for an external project does not create any "done"
file that denotes that the files are still up-to-date. Without that
"done" file, the update step is always run, and that in turn causes
the other steps for the external project to re-run as well.

The best way to fix this seems to be to skip the update step by
defining an empty UPDATE_COMMAND. As long as the downloaded code for a
given hash/tag/etc does not change, the update step is unnecessary.

And if we *really* wanted to ensure unchanged dependencies, we would
download our own copies anyway.

Making this change significantly cleans up the falco build to avoid
rebuilding git based external dependencies.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-02-18 16:47:43 +01:00
Leonardo Grasso 204f9ff875 fix(scripts): correct typo in `falco-driver-loader` help message
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-02-14 10:06:41 +01:00
pablopez 87c410e49e upgrade macro(keepalived_writing_conf)
Signed-off-by: pablopez <pablo.lopezzaldivar@sysdig.com>
2022-02-11 11:36:47 +01:00
schie b9925577ef Update rules/falco_rules.yaml
Signed-off-by: darryk10 stefano.chierici@sysdig.com

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-02-11 11:28:46 +01:00
Stefano ae5342c54b Fixed rule condition
Signed-off-by: darryk10 <stefano.chierici@sysdig.com>
2022-02-11 11:28:46 +01:00
Stefano 1324522721 Added new Rule Polkit Local Privilege Escalation Vulnerability (CVE-2021-4034)
Co-authored-by: javery-sysdig <jason.avery@sysdig.com>

Signed-off-by: Stefano <stefano.chierici@sysdig.com>
2022-02-11 11:28:46 +01:00
rileydakota 7999e33aea Rule Update - Adds npm support
Adds `npm` to `package_mgmt_binaries` for detection of "living off the land" style attacks that utilize NPM pull down additional tooling

Signed-off-by: rileydakota <dakotariley2@gmail.com>
2022-02-11 11:27:46 +01:00
m4wh6k f49a95f334 rule(macro modify_shell_history): Fix missing s on endswith
Signed-off-by: m4wh6k m4wh6k@users.noreply.github.com
2022-02-11 11:26:46 +01:00
m4wh6k 9e8687401d fix(macro truncate_shell_history): avoid false positives from .zsh_history.new and .LOCK files
Signed-off-by: m4wh6k m4wh6k@users.noreply.github.com
2022-02-11 11:26:46 +01:00
m4wh6k 6ead925f51 fix(macro modify_shell_history): avoid false positives from .zsh_history.new and .LOCK files
Signed-off-by: m4wh6k <m4wh6k@users.noreply.github.com>
2022-02-11 11:26:46 +01:00
Mac Chaffee 8a3a4c4d57 rule(maco write_etc_common): Fix false-positive of sssd updating /etc/krb5.keytab
Signed-off-by: Mac Chaffee <me@macchaffee.com>
2022-02-11 11:25:47 +01:00
Federico Di Pierro ff21544186 update(build)!: replaced various `PROBE` with `DRIVER` where necessary.
Follow-up of https://github.com/falcosecurity/libs/pull/197.
Updated libs too to master version, as needed.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-02-08 09:50:39 +01:00
Mike Stewart ee2f7c50e8 Potential fix for falcosecurity/falco#1884
Signed-off-by: Mike Stewart <mike.stewart@introhive.com>
2022-02-04 11:40:09 +01:00
pablopez 5da10a3b89 rule_output(Delete Bucket Public Access Block) typo
Signed-off-by: pablopez <pablo.lopezzaldivar@sysdig.com>
2022-02-03 18:23:08 +01:00
Federico Di Pierro f86423db76 fix(build): fixed build folder path for publish bin static.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-31 17:02:48 +01:00
Federico Di Pierro 5eed3a6638 fix(build): hotfix for release 0.31.0.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-31 17:02:48 +01:00
Leonardo Grasso d585343483 docs(CHANGELOG.md): last update
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-01-31 14:01:48 +01:00
Teryl 9e57b5b4ba docs(changelog.md): update for release 0.31.0
Signed-off-by: Teryl <terylt@ibm.com>
2022-01-31 14:01:48 +01:00
Federico Di Pierro 47f38c8ae2 chore(build): dropped centos8 circleci build because it is useless and right now it is causing issues with yum.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-31 12:48:48 +01:00
Federico Di Pierro 332d828204 update(userspace/engine): properly value required_version because it is used by caller.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-28 15:33:22 +01:00
Federico Di Pierro 75c6cfb414 update(userpace/engine): properly implement semver check for required plugin versions.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-28 15:33:22 +01:00
Leonardo Grasso a4199814a0 fix(tests/engine): correct unit tests
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-01-28 15:33:22 +01:00
Leonardo Grasso 24e7e84153 update(rules): updated aws cloudtrail rule bumping plugins version
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-01-28 15:33:22 +01:00
Federico Di Pierro 70bfb2426c fix(userspace/engine): forcefully set PPME_PLUGINEVENT_E event type for "plugin" source events.
This workaround an issue in libs, targeting Falco 0.31.0.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-01-28 15:33:22 +01:00
Federico Di Pierro ce3598f801 update(plugins): updated json plugin to latest v0.2.2.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-27 17:22:09 +01:00
Federico Di Pierro 8e6ffc6fc9 fix(userspace/engine): actually make m_filter_all_event_types useful by properly using it as fallback when no filter event types is provided.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-27 17:22:09 +01:00
Luca Guerra 6a42f4a133 new(build): publish both static and glibc binaries
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-01-26 17:45:50 +01:00
Federico Di Pierro 8d9dd4440f chore(userspace/engine): cleanup unused alternate-lua-dir option and remove config_falco_engine.h.in, now unused since lua scripts are embedded in Falco.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-26 16:19:50 +01:00
Luca Guerra c49093005d fix(build): do not include plugins in musl builds
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-01-26 16:18:50 +01:00
Luca Guerra 69767bb51b fix(build): do not show plugin options in musl optimized builds
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-01-26 16:18:50 +01:00
Andrea Terzolo 7750b6f209 rule: update Copyright in falco rules
Signed-off-by: Andrea Terzolo <s276109@studenti.polito.it>
2022-01-25 18:58:05 +01:00
Andrea Terzolo 8c705448cc rule: add execveat as evt.type for spawned_process macro in falco rules
Signed-off-by: Andrea Terzolo <s276109@studenti.polito.it>
2022-01-25 18:58:05 +01:00
Shay Berkovich 6b9fafb75f rule update(Sudo Potential Privilege Escalation): trigger the most common CVE-2021-3156 exploit
Signed-off-by: Shay Berkovich <sberkovich@blackberry.com>
Co-authored-by: Meera Balsara <mbalsara@blackberry.com>
2022-01-25 17:54:06 +01:00
Shay Berkovich fdcd7bffd0 rule update(Detect crypto miners using the Stratum protocol): update protocols
Signed-off-by: Shay Berkovich <Sberkovich@blackberry.com>
Co-authored-by: Meera Balsara <mbalsara@blackberry.com>
2022-01-25 17:54:06 +01:00
Shay Berkovich d989e9c2d5 new(rules): Create Hardlink Over Sensitive Files
New rule to prevent hardlink bypass and symlink rule set to WARNING for consistency
Signed-off-by: Shay Berkovich <sberkovich@blackberry.com>
Co-authored-by: Meera Balsara <mbalsara@blackberry.com>
2022-01-25 17:54:06 +01:00
Federico Di Pierro 996ccf555c rule: updated aws_cloudtrail_rules with correct copyright year and required plugin versions.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-25 17:50:06 +01:00
Federico Di Pierro 2f82a9baa1 Update userspace/falco/falco.cpp
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-01-24 17:52:31 +01:00
Federico Di Pierro dfb743838e Update userspace/engine/rules.cpp
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-01-24 17:52:31 +01:00
Federico Di Pierro c7609192c7 Update userspace/engine/lua/rule_loader.lua
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-01-24 17:52:31 +01:00
Federico Di Pierro 4d3fc354fa update(userspace/engine): updated no evt.type specified lua warning string.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-24 17:52:31 +01:00
Federico Di Pierro 43bdfce6e5 update(userspace/falco): divide each plugin infos when dumping list of plugin with a newline.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-24 17:52:31 +01:00
Federico Di Pierro a3976463d5 update(userspace/engine): fixed lua CMakeLists deps, to let it be gracefully rebuilt when lua files are updated.
Moreover, added back warning about performance impact for rules without event types.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-24 17:52:31 +01:00
Federico Di Pierro 1a485c3447 update(userspace/engine,userspace/falco): improved some string warnings.
Always print warnings while loading rules.
Print a single line when warning for ignored events.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-24 17:52:31 +01:00
Leonardo Grasso 96529300f6 fix(script/falco-driver-loader): fix typo
Co-Authored-By: Thomas Spear <tspear@conquestcyber.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-01-24 17:49:34 +01:00
Leonardo Grasso 27922faa27 fix(scripts/falco-driver-loader): missing compression formats for .ko files
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-01-24 17:49:34 +01:00
Leonardo Grasso 8a1de131f4 update(scripts/falco-driver-loader): load the latest version first
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-01-24 17:49:34 +01:00
Federico Di Pierro e1e8715a0f build: updated cloudtrail plugin to latest version.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-24 16:12:12 +01:00
Leonardo Grasso 9ae8d281f5 fix(test): falco_hostnetwork_images list is now in k8s_audit_rules.yaml
Co-Authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-01-24 15:03:12 +01:00
Leonardo Di Donato c705623f9e update(rules): move falco_hostnetwork_images list to k8s audit rules
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2022-01-24 15:03:12 +01:00
Leo Di Donato 3640871725 update(rules): remove falco_hostnetwork_images list (unused)
The `falco_hostnetwork_images` list is unused.

This PR removes it to avoid the warning.

```console
When reading rules content: 1 warnings:
list falco_hostnetwork_images not refered to by any rule/macro/list
```

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2022-01-24 15:03:12 +01:00
Federico Di Pierro 6d507b054c update(build): update libs version for 0.31 release.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-20 14:43:49 +01:00
Federico Di Pierro f19a1d81c6 update(build): updated plugins to latest versions adding platform name to artifact url.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-20 14:43:49 +01:00
Andrea Terzolo 18c7b6500d refactor: remove apt-config from debian_packages monitoring
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Co-authored-by: karthikc911 <ckinnovative@gmail.com>
2022-01-20 11:07:47 +01:00
Andrea Terzolo 8239fa41f4 docs: fix priority level "info" to "informational"
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
2022-01-18 18:49:18 +01:00
yoshi314 a9e7512936 fix setting the variable of User-Agent, it was missing the prefix. Switched to dedicated curl's method to do this
Signed-off-by: Marcin Kowalski <marcin.kowalski@assecobs.pl>
2022-01-18 09:49:34 +01:00
Marcin Kowalski f67e8bdad7 fix indentation in outputs_http.cpp
add sample config entry for user-agent variable

Signed-off-by: Marcin Kowalski <marcin.kowalski@assecobs.pl>
2022-01-18 09:49:34 +01:00
Marcin Kowalski a94e6de458 add useragent string to output
Signed-off-by: Marcin Kowalski <marcin.kowalski@assecobs.pl>
2022-01-18 09:49:34 +01:00
Leonardo Grasso 3e9f8c1ef1 chore(userpsace/engine): update fields checksum
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-01-17 18:15:43 +01:00
Mark Stemm d20a326e09 Skip EPF_TABLE_ONLY fields with --list -N
When listing fields with -N (names only), also skip fields with the
EPF_TABLE_ONLY flag. (Skipping fields without -N is handled in libs,
in the as_string() method).

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-01-17 18:15:43 +01:00
Federico Di Pierro 0c290d98f8 fix(tests): avoid hardcoding plugin version 0.1.0 in plugin tests.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-17 17:20:33 +01:00
Federico Di Pierro 1befb053d0 update(gitignore): drop 2 useless lines from gitignore that are now installed in the build folder.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-17 17:20:33 +01:00
Federico Di Pierro ae57718bda update(build): updated libs to latest master version. Updated plugins versions. Updated falco engine version.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-17 17:20:33 +01:00
Luca Guerra 55ce38cf3a use debian 11 slim as nodriver image
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-01-17 16:26:07 +01:00
Luca Guerra 18571eb20d ci: build stripped tgz
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-01-17 16:26:07 +01:00
Luca Guerra 9c449901f3 cmake: do not strip tar gz builds
Signed-off-by: Luca Guerra <luca@guerra.sh>
2022-01-17 16:26:07 +01:00
Jason Dellaluce 4ab8d6db98 refactor(configuration): remove plugin config loading from file feature
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-01-17 14:55:11 +01:00
Jason Dellaluce 5e354859a9 new(configuration): allow defining plugin config as YAML maps
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-01-17 14:55:11 +01:00
Jason Dellaluce f4b79296fc fix: improve nested configuration field support
This fixes the parser introduced in https://github.com/falcosecurity/falco/pull/1792.
Now, nested fields such as `arr[1].subval` are supported, whereas the parser used
to recognize the `.` as an unexpected character.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-01-17 14:55:11 +01:00
Jason Dellaluce 6bf8f34d9f fix(engine): correctly format json output in json_event
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-01-14 13:29:33 +01:00
vadim.zyarko f8f053c7fa Add an emty line to sattisfy the rules tests
Signed-off-by: vadim.zyarko <vadim.zyarko@sysdig.com>
2022-01-13 09:44:57 +01:00
VadimZy b88a1cbb09 replace .. with table concat
Signed-off-by: vadim.zyarko <vadim.zyarko@sysdig.com>
2022-01-13 09:44:57 +01:00
Mark Stemm c86615f68c Embed .lua files into falco executable
Instead of having .lua files external to the program responsible for
loading rules, embed the contents of those files into the executable
and load them as strings instead of as files:

Add a cmake custom command below userspace/engine/lua that calls a
bash script lua-to-cpp.sh to generate falco_engine_lua_files.{cpp,hh}
that are compiled into the falco engine library.

The script creates a .cpp file that has const char * symbols for each
file, as well as lists of files that should be loaded when the falco
engine is loaded. There are actually two lists:

- lua_module_strings: these are loaded and also added to the lua
  runtime package.preload table, so they are available when lua code
  require()s them.

- lua_code_strings: these are loaded *and* evaluated, so the functions
  in them are availble to be called from C++.

This simplifies some of the falco_common methods, as there's no need
to keep track of a "main" lua file to load or paths from which the lua
loader should find files for modules, and there's no need to keep
track of an "alternate" lua directory that occurs for debug builds.

Also, there's no need to include any .lua files in the installed
packages, as they're built into the falco binary.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-01-13 09:26:35 +01:00
Mark Stemm 08df1c63cf Clean up lyaml build a bit
change LYAML_SRC to LYAML_ROOT, which points to the top source
directory now.

LYAML_LIB and (new) LYAML_LUA_DIR are based relative to that
directory.

There's no install step at all now--the static library and the .lua
files are now used directly from the source tree.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-01-13 09:26:35 +01:00
Mark Stemm 10512b9ef9 Move compiler/parser lua files to a "modules" subdir
This will distinguish it from rule_loader.lua, which is *not* a module
but lua code with functions that can be called directly.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-01-13 09:26:35 +01:00
Jason Dellaluce 0e52ef9971 fix(grpc): ignore protobuf deprecation warning
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-01-12 00:16:49 +01:00
Jason Dellaluce a371a995b4 update(outputs): adapt grpc output to new protobuf definitions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-01-12 00:16:49 +01:00
Jason Dellaluce 0f984c4dbe update(grpc): substitute and deprecate enum source field from protobuf
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-01-12 00:16:49 +01:00
Federico Di Pierro 48a23121df new(userspace/falco): add support for kernel side simple consumer.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2022-01-10 10:58:44 +01:00
Federico Di Pierro 475ed0dbeb fix(userspace/engine,userspace/falco): set http output contenttype to text/plain when json output is disabled
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2022-01-10 10:57:44 +01:00
Zach Stone eaccfbe82d Pick some lint
Signed-off-by: Zach Stone <zach@giantswarm.io>
2022-01-10 10:56:44 +01:00
Zach Stone e496c91562 Add Giant Swarm to Adopters list
Signed-off-by: Zach Stone <zach@giantswarm.io>
2022-01-10 10:56:44 +01:00
Lorenzo Susini cef2c2d5c1 chore: improve --list output using is_source_valid
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2022-01-10 10:53:44 +01:00
Jason Dellaluce 2ee0645f25 update(tests): remove token_bucket unit tests
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-01-04 16:41:18 +01:00
Mark Stemm 42f8b1cd83 Update to version of libs with better output formatting
This has required changes to print info on fields.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-12-23 17:05:39 +01:00
Mark Stemm 455be15b0b Fill in new shortdesc/data_type/tags for json fields
Update json_event_filter_factory::get_fields() to add the new
info (shortdesc, data_type, tags) to field descriptions.

This allows for richer outputs when printing info on the fields.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-12-23 17:05:39 +01:00
Mark Stemm 64e8feb200 Update fields checksum (no changes, order only)
With the new implementation of list_fields(), the order of fields
changed slightly. So update the checksum.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-12-23 17:05:39 +01:00
Mark Stemm eded1062cd Use filter_fieldclass_info::as_string to print field info
Instead of having a falco-specific function to print field info, use
the built-in filter_fieldclass_info::as_string() instead. This is a
better implementation (displays addl info, has better wrapping, wider
output) and having a single implementation allows for consistent
outputs between falco and other potential programs that could use the libs.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-12-23 17:05:39 +01:00
Luca Guerra 473b94b386 fix(build): use consistent 7-character build abbrev sha
Signed-off-by: Luca Guerra <luca@guerra.sh>
2021-12-23 16:23:39 +01:00
Jason Dellaluce 226d1fb728 update(OWNERS): add jasondellaluce
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-12-22 18:15:40 +01:00
Lorenzo Susini 6319be8146 update(rules): Add containerd socket to sensitive_mount macro
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
2021-12-21 16:53:57 +01:00
Akos Kaldy cf4672675c add Phoenix to adopters list
Signed-off-by: Akos Kaldy <kaldyka@gmail.com>
2021-12-20 17:44:12 +01:00
Angelo Puglisi f035829ca2 fix(rules): typo in Create Symlink Over Sensitive Files rule output
Signed-off-by: Angelo Puglisi <angelopuglisi86@gmail.com>
2021-12-13 20:05:33 +01:00
Calvin Bui cd471a78db re-add double empty newline
Signed-off-by: Calvin Bui <3604363+calvinbui@users.noreply.github.com>
2021-12-10 10:27:33 +01:00
Calvin Bui 65969c30f9 Add ECR repository to rules
Signed-off-by: Calvin Bui <3604363+calvinbui@users.noreply.github.com>
2021-12-10 10:27:33 +01:00
Federico Di Pierro bb8b75a2cd update(userspace/falco): enforce check that content-type actually starts with "application/json" string.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2021-12-09 21:04:47 +01:00
Federico Di Pierro b359f71511 fix(userspace/falco): accept 'Content-Type' header that contains "application/json", but it is not strictly equal to it.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-12-09 21:04:47 +01:00
Federico Di Pierro 9dcd8bccac fix(userspace/falco): in case output_file cannot be opened, throw a falco exception.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-12-09 21:02:48 +01:00
Jason Dellaluce b5667cab99 chore(test): remove unused files in test directory
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-12-09 10:36:45 +01:00
Jason Dellaluce 2a00a4d853 rules: adding support to openat2
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-12-06 19:12:14 +01:00
Jason Dellaluce 697d4427a7 chore(scripts): refine removal output messages
Signed-off-by: Jason Dellaluce jasondellaluce@gmail.com
Co-authored-by: Leonardo Grasso me@leonardograsso.com
2021-12-06 19:09:14 +01:00
Jason Dellaluce bf04fed71c fix(scripts): correctly remove loaded drivers
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2021-12-06 19:09:14 +01:00
Jason Dellaluce c005af22cc fix: set config value and create node if not existing
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-12-06 19:04:15 +01:00
Jason Dellaluce c93029ce74 fix(build): use correct libyaml variable in tests cmake
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-12-06 19:04:15 +01:00
Jason Dellaluce 076aabcea6 test(falco): adding unit tests for yaml_configuration
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-12-06 19:04:15 +01:00
Jason Dellaluce d8c588becf update: add yaml-cpp to unit tests
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-12-06 19:04:15 +01:00
Jason Dellaluce 1a7611a761 chore(engine): using is_defined config method instead of private get_node
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-12-06 19:04:15 +01:00
Jason Dellaluce 7fb61ba4a3 refactor(engine): access config fields with new key syntax
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-12-06 19:04:15 +01:00
Jason Dellaluce 9ab810f431 update(engine): support accessing nested config fields
Since now, the maximum depth supported to access config fields is two.
This adds support for accessing fields of arbitrary nesting depth.
A formal grammar has been explicited for the regular language representing
the field keys. The accessor methods have been updated accordingly.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-12-06 19:04:15 +01:00
Jason Dellaluce 7781385769 refactor(engine): support string config loading and add ad-hoc methods
This is a change of direction from the current design, that imposes loading
the configuration from file only, and in the object constructor. Instead,
yaml_configuration objects can now be reused ad can load the YAML config
from either file or string. This also makes it easier to unit test this class.

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-12-06 19:04:15 +01:00
Erick Cheng 205a8fd23b Move wget and curl to own rule
Signed-off-by: Erick Cheng <19863605+ec4n6@users.noreply.github.com>
2021-11-29 17:42:40 +01:00
Erick Cheng bdba37a790 Fix remove scp and add curl
Signed-off-by: Erick Cheng <19863605+ec4n6@users.noreply.github.com>
2021-11-29 17:42:40 +01:00
Erick Cheng 19fb3458ef Add wget and curl to remote_file_copy_binaries
Signed-off-by: Erick Cheng <19863605+ec4n6@users.noreply.github.com>
2021-11-29 17:42:40 +01:00
Erick Cheng b0565794f5 Move user_known_ingress_remote_file_copy_activities to outside condition
Signed-off-by: Erick Cheng <19863605+ec4n6@users.noreply.github.com>
2021-11-29 17:42:40 +01:00
Erick Cheng 66df790b9d Fix syntax error
Signed-off-by: Erick Cheng <19863605+ec4n6@users.noreply.github.com>
2021-11-29 17:42:40 +01:00
Erick Cheng 749d4b4512 Add more curl download checks
Signed-off-by: Erick Cheng <19863605+ec4n6@users.noreply.github.com>
2021-11-29 17:42:40 +01:00
Erick Cheng 851033c5f4 Add curl macro
Signed-off-by: Erick Cheng <19863605+ec4n6@users.noreply.github.com>
2021-11-29 17:42:40 +01:00
Erick Cheng af6f3bfeab Move wget and curl to own rule
Signed-off-by: Erick Cheng <19863605+ec4n6@users.noreply.github.com>
2021-11-29 17:42:40 +01:00
Erick Cheng c4d25b1d24 Fix remove scp and add curl
Signed-off-by: Erick Cheng <19863605+ec4n6@users.noreply.github.com>
2021-11-29 17:42:40 +01:00
Erick Cheng d434853d5f Add wget and curl to remote_file_copy_binaries
Signed-off-by: Erick Cheng <19863605+ec4n6@users.noreply.github.com>
2021-11-29 17:42:40 +01:00
Jason Dellaluce 4c8e369691 update(build): bump fakeit version
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-11-22 18:25:44 +01:00
Jason Dellaluce b15a0458b7 update(build): allow using local libs source dir
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2021-11-18 16:26:18 +01:00
Jason Dellaluce d6cb8bc4bd refactor(build): setting variable defaults according to newest libs version
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2021-11-18 16:26:18 +01:00
Jason Dellaluce 2cc7fd9072 update(build): bump libs version
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2021-11-18 16:26:18 +01:00
Jason Dellaluce 589829ae2f update(build): remove libscap patch
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2021-11-18 16:26:18 +01:00
Jason Dellaluce 85db078dc4 chore: renaming comment references
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2021-11-18 16:26:18 +01:00
sai-arigeli 23706da75e Allow append of new exceptions to rules
Signed-off-by: Sai Arigeli <saiharisharigeli@gmail.com>

Return warnings after validation of rule exceptions

Signed-off-by: Sai Arigeli <saiharisharigeli@gmail.com>

Update FALCO_ENGINE_VERSION

Signed-off-by: Sai Arigeli <saiharisharigeli@gmail.com>
2021-11-18 09:11:20 +01:00
Federico Di Pierro 35302f6f09 update(build): update libs to falcosecurity/libs master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-11-17 17:25:24 +01:00
Federico Di Pierro 375a6f66c5 update(build): force using libs-bundled luajit.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2021-11-17 17:25:24 +01:00
Federico Di Pierro e8a243d6ea wip: point to my own library for CI purposes.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-11-17 17:25:24 +01:00
Federico Di Pierro 7927f45d9f update(build): dropped Falco local luajit module, use the one provided by libs (upgraded) instead.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-11-17 17:25:24 +01:00
Federico Di Pierro d9aff8d564 update(build): switched back to falcosecurity libs on master.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-11-17 16:18:23 +01:00
Federico Di Pierro 40e3fdd09c update(build): updated libs.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-11-17 16:18:23 +01:00
Federico Di Pierro ba2323046a fix(build): properly use correct lib/lib64 folder for CIVETWEB_LIB variables.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-11-17 16:18:23 +01:00
Federico Di Pierro 5e6f30109e update(build): dropped civetweb patch. Use different ExternalProject_Add when building with bundled openssl or not, to avoid depending on an unexhistent target.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-11-17 16:18:23 +01:00
Federico Di Pierro f3c3de7e05 fix(build): properly share OPENSSL_INCLUDE_DIR and OPENSSL_LIBRARIES vars to civetweb cmake.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-11-17 16:18:23 +01:00
Federico Di Pierro ca61f87682 update(build): civetweb depends on openssl.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2021-11-17 16:18:23 +01:00
Federico Di Pierro 113bb5cdd6 update(build): update falcosecurity libs to use my own libs repo and version to be able to test the build against FedeDP:fix_ssl_1_1_get_all_data branch (not yet merged).
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-11-17 16:18:23 +01:00
Federico Di Pierro 8a603c3c5d update(build): latest libs correctly set OPENSSL_LIBRARIES for us.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-11-17 16:18:23 +01:00
Federico Di Pierro 0539e948c8 update(build): moved civetweb to its own cmake module. Moved its patch too.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-11-17 16:18:23 +01:00
Federico Di Pierro 5f1d04ec82 fix(build): build civetweb using cmake and linking to static openssl built by us.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-11-17 16:18:23 +01:00
Federico Di Pierro 9d8fc4c8d2 update(build): updated civetweb to version 1.15 to correctly support openssl1.1.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2021-11-17 16:18:23 +01:00
Luca Guerra 09799e125d chore(build): update libs version to 7906f7ec416a8b67b82d92d37b25f28d545bcb8f
Signed-off-by: Luca Guerra <luca@guerra.sh>
2021-11-16 19:02:21 +01:00
Jason Dellaluce 446c65007d test(userspace/engine): add integration test for rules enabled with enabled flag only
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-11-16 16:37:45 +01:00
Jason Dellaluce df3728ec3f test(userspace/engine): add integration test for rules disabled with enabled flag only
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-11-16 16:37:45 +01:00
Jason Dellaluce a66dda3daa test(userspace/engine): update integration tests to support enabled-only rules
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-11-16 16:37:45 +01:00
Jason Dellaluce eec2f5062f update(userspace/engine): allow overwriting rules with enabled flag only
This allows defining rules that simply enable/disable already defined rules, like the following:
- rule: A rule enabled by default
  enabled: false
- rule: A rule disabled by default
  enabled: true

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-11-16 16:37:45 +01:00
Federico Di Pierro 7dcf8f4bf7 update(userspace/engine): use s_ prefix for static var.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Mark Stemm <mark.stemm@gmail.com>
2021-11-16 15:34:12 +01:00
Federico Di Pierro bea91ca844 fix(userspace/engine): properly constify m_default_ruleset.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-11-16 15:34:12 +01:00
Federico Di Pierro ea2ca56d5b style(userspace/engine): avoid creating multiple versions of methods only to assume default ruleset. Use a default argument instead.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-11-16 15:34:12 +01:00
Mark Stemm cb51522423 Skip plugins list/load/tests for MUSL_OPTIMIZED_BUILD
When MUSL_OPTIMIZED_BUILD is specified, falco is statically linked under
musl, and can't dlopen() files: see
https://inbox.vuxu.org/musl/20200423162406.GV11469@brightrain.aerifal.cx/T/

So skip listing/loading/testing plugins when MUSL_OPTIMIZED_BUILD is specified.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-11-12 18:27:59 +01:00
Mark Stemm 9f53089bcb Detect strlcpy on the fly (musl libc)
Detect strlcpy on the fly, as was done in https://github.com/falcosecurity/libs/pull/110.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-11-12 18:27:59 +01:00
Mark Stemm 2a4e4d555d Add automated tests for plugins
Test infrastructure and sample confs/rules/traces for plugins
automated tests:

New test cases are in falco_tests_plugins.yaml and cover:
- Listing plugins and fields when plugins are loaded.
- Basic cloudtrail + json plugin on a fake cloudtrail json file and a
  sample rule that uses both plugins.
- Conflicts between source/extractor plugins
- Incompatible plugin api
- Wrong plugin path
- Checking for warnings when reading rules with unnown sources (e.g. when plugins are not loaded)

Some test-only plugins written in C are in test/plugins and built on
the fly. (They aren't included in packages of course).

The test framework needed some small changes to handle these tests:
- Add a mode to not check detection counts at all (for --list/--list-plugins)
- addl_cmdline_opts to allow specifying --list/--list-plugins
- Using DOTALL when matching stderr/stdout (allows multi-line matches more easily)

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-11-12 18:27:59 +01:00
Mark Stemm 6a1f4f7374 Plugins support in falco executable
Update the falco binary to add support for plugins.

- Keep track of an "event source", which is initially "syscall" but
  changes to the input plugin's source if an source plugin ends up being
  loaded.

- New argument --list-plugins will return info on any loaded plugins,
  using sinsp_plugin::plugin_infos.

- Create filter/formatter factories for plugins. This ensures that
  filterchecks for syscalls are not used for plugins and vice versa.

- Use sinsp_plugin::register_plugin() to load each plugin found in
  config. The first source plugin found (if any) calls
  engine->add_source withthe source plugin's event source.

- If a second source plugin is found, exit with an error.

- Extractor plugins must be compatible with the event source (usually
  the plugin event source, but could be "syscall"). If not, exit with
  an error.

- Multiple Extractor plugins are allowed, but they can not have
  overlapping compatible event sources. This is mostly to avoid
  confusion, but we might change this later.

- After loading plugins, use engine is_plugin_compatible to ensure
  that the plugin is compatible with any required_plugin_version blocks
  in falco rules.

- Normally falco would log warnings if too many SCAP_TIMEOUT results
  were received. These are more expected when using plugins, so only
  log these warnings when using syscalls.

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Co-authored-by: Loris Degioanni <loris@sysdig.com>
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-11-12 18:27:59 +01:00
Mark Stemm 98599d5e25 Plugins support (outputs)
The generic events support already handled most of this, with a
dedicated formatter factory for plugin sources. Just one missing
header include and change the logic slightly for json parsing.

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Co-authored-by: Loris Degioanni <loris@sysdig.com>
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-11-12 18:27:59 +01:00
Mark Stemm e7d41f8166 Rules loading changes for plugins
Rules loading changes for plugins:

 - parse required_engine_versions from yaml and pass up to rules
   loader as a lua table as an additional return value from load_rules().
 - c++ rules loader converts to map: plugin -> list of required plugin
   versions
 - support is_source_valid callback from lua, calls engine method. If
   a source is not valid, skip any rules for that source and add a warning.

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Co-authored-by: Loris Degioanni <loris@sysdig.com>
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-11-12 18:27:59 +01:00
Mark Stemm 9075eea62f Falco engine support for plugins
Mostly plugins are just handled as a new filter/formatter factory with
a new source based on the loaded input plugin, but there are a few
changes at the engine level:

- is_source_valid returns whether a filter/formatter factory exists
  for a given source. Will be used by rules loaded to skip rules for
  an unknown source.

- the falco engine now holds the required_plugin_version predicates
  found in rules files and a method is_plugin_compatible returns whether
  a plugin semver is compatible with the predicates in the rules

- Update the falco engine version and fields checksum for plugins

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Co-authored-by: Loris Degioanni <loris@sysdig.com>
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-11-12 18:27:59 +01:00
Mark Stemm 69e32f7ed1 Add initial set of Cloudtrail rules
These rules can be used when combined with the cloudtrail plugin.

They're installed to /etc/falco like the other rules files.

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Co-authored-by: Loris Degioanni <loris@sysdig.com>
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-11-12 18:27:59 +01:00
Mark Stemm 38a7f7ada0 cmake/build changes for plugins
Add a cmake module "plugins" that does the following:

 - Downloads/installs the plugins artifacts from a known tag
 - Copies the resulting cloudtrail/json shared libraries to
   CMAKE_CURRENT_BINARY_DIR/plugins
 - Installs them to FALCO_SHARE_DIR/plugins

The default config will define the plugins but they will be disabled
by default.

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Co-authored-by: Loris Degioanni <loris@sysdig.com>
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-11-12 18:27:59 +01:00
Mark Stemm 6a4e4eaa4f Finish moving token bucket impl from falco to libs
It took a while, but we remembered to finish moving the token_bucket
from falco engine to libs. There were 2 copies for a while.

This brings over one change to libs--to have an optional timer
function.

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Co-authored-by: Loris Degioanni <loris@sysdig.com>
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-11-12 18:27:59 +01:00
Mark Stemm 1313e77113 Falco yaml config for plugins
Update config code/default falco.yaml to add support for plugins:

- Update config parsing methods to support reading plugin config
  objects in a list from yaml.

- The default config defines the cloudtrail/json plugins but does not
  give them any actual config for init config/open
  params (cloudtrail), or init config (json).

- load_plugins is empty so neither plugin is actually loaded by default.

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Co-authored-by: Loris Degioanni <loris@sysdig.com>
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>-
2021-11-12 18:27:59 +01:00
Mark Stemm a1fa8edf7e Update falcosecurity/libs version
This moves up the commit to one that has plugins support.

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Co-authored-by: Loris Degioanni <loris@sysdig.com>
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-11-12 18:27:59 +01:00
Dominic Evans d4aa7b9747 build: always populate partial version variables
When FALCO_VERSION was provided via a CMake variable, the build would
eventually fail because the partial version variables hadn't been
populated. Move the creation of those outside the check of FALCO_VERSION
being set so they also happen when that is provided too.

Contributes-to: #1654

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
2021-11-12 17:19:24 +01:00
Manuel Gauto 2312afe9cd Set digest-algo for gpg to use SHA256 for linux packages.
Signed-off-by: Manuel Gauto <mgauto@mgenterprises.org>
2021-11-12 17:17:27 +01:00
Jason Dellaluce 6ee0b353ac test: adding a test for correct json pointer parsing
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-11-11 18:36:21 +01:00
Jason Dellaluce 28d6a293fc update(userspace/engine): support jsonpointer escaping in rule parser
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-11-11 18:36:21 +01:00
Hitesh Sharma 5ee62f66f7 adding raft in the adopters list
Signed-off-by: Hitesh Sharma <33040859+teshsharma@users.noreply.github.com>
2021-11-10 16:16:40 +01:00
Mark Stemm b33fb6052a Update ubuntu image for driver-loader tests (20.04LTS)
Update the ubuntu image for driver-loader/integration tests from
16.04LTS to 20.04LTS.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-11-03 16:49:11 +01:00
David Windsor 8448d02980 falco-driver-loader: don't fail if chcon is missing in load_kernel_module()
Signed-off-by: David Windsor <dwindsor@secureworks.com>
2021-11-02 16:49:55 +01:00
David Windsor 74661a7d8f Apply suggestions from code review
Don't fail if chcon is not present

Co-authored-by: Leo Di Donato <leodidonato@gmail.com>
Signed-off-by: David Windsor <dwindsor@secureworks.com>
2021-11-02 16:49:55 +01:00
David Windsor e7b320b00c Fix falco-driver-loader SELinux insmod denials
Signed-off-by: David Windsor <dwindsor@secureworks.com>
2021-11-02 16:49:55 +01:00
Sverre Boschman 762500a361 add known k8s service accounts
Signed-off-by: Sverre Boschman <1142569+sboschman@users.noreply.github.com>
2021-10-29 10:41:54 +02:00
Sverre Boschman 8563af8a79 reformat known_sa_list
Signed-off-by: Sverre Boschman <1142569+sboschman@users.noreply.github.com>
2021-10-29 10:41:54 +02:00
Mark Stemm f7893fbd14 Change expected result for old trace file with old execve event num
The trace file traces-positive/run-shell-untrusted.scap has an old
execve event number (PPME_SYSCALL_EXECVE_18), which was replaced by
PPME_SYSCALL_EXECVE_19 in 2018.

Given the changes in https://github.com/falcosecurity/libs/pull/94,
these events are now skipped. So change the test to note that *no*
events will be detected.

As a bit of context, event numbers won't be changing any longer--a
change around the same time 298fbde8029020ce3fbddd07e2910b59cc402b8b
allowed for extending existing events to add new parameters instead of
having to define a new event number just to add a new parameter. So
the notion of "old events" should not exist for any event created
after mid-to-late 2018.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm 3b390793b9 Fix bug in macro that was masked by old evttype checking
It turns out that the macro inbound_outbound had a logical bug where
joining the beginning and end of the macro with "or" led to the macro
matching all event types by accident.

Most of the time this isn't harmful but it turns out some trace files
will do operations on inet connection fds like "dup", and those get
mistakenly picked up by this macro, as the fd for the event does
happen to be a network connection fd.

This fixes the macro to only match those event types *and* when the fd
is a inet connection fd.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm 10d47cb1f5 Update automated tests to reflect evttypes behavior
With the changes in https://github.com/falcosecurity/libs/pull/74,
there isn't any need to warn about the order of operators and the
evt.type field--the set of event types for a filter should be exact
now regardless of the order of operators.

So update tests that were logging those warnings to note that the
warnings won't occur any more.

Also, some tests more accurately *do* note that they have an overly
permissive evttype (e.g. ones related to syscalls, which are uncommon
and are evaluated for all event types) to reflect the new behavior.

Finally, in unit tests create an actual sinsp filter instead of a
gen_event_filter, which is the base class and shouldn't be created
directly.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm 204892816b Update falco engine checksum
This makes the output of --list a bit more precise to only include
filter fields and not output fields.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm 6156fbb4cb Update falcosecurity-libs cmake revision
This has recent changes to support more general purpose event
formatting.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm 20b5ea8f85 Check for ignored syscall event types after loading rules
This step used to be done in the lua rule loading code, but now we can
get it directly from the filters, so do it in falco instead.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm cc43c721c9 Add a default ruleset version of evttypes_for_ruleset
This allows for working with the default ruleset like other methods.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm 230c22b674 Update lua rule loading to reflect other changes
Update the lua side of rule loading to reflect other changes:

- install_filter renamed to create_filter_obj, and takes just a
  lua_parser object created via falco_rules.create_lua_parser() and
  uses a single lua callback "filter" instead of separate ones for
  syscall/k8s_audit. It can return an error, including about
  undefined fields

- is_defined_filter, which used to be local and based on the result of
  sinsp_rule_utils.check_for_ignored_syscalls_events, is now a
  lua_callback falco_rules.is_defined_field().

- Don't need to pass down sinsp_lua_parser/json_lua_parser now,
  creating filters is handled via lua callbacks.

- Checking for ignored syscalls/events is now done in falco itself,
  after loading rules.

- add_xxx_filter replaced by add_filter + source.

- Use is_format_valid instead of formats.formatter/formats.free_formatter.

- We don't need the functions in sinsp_rule_utils any longer, so
  remove the file and don't import it.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm 04f3cc503c Add ability to check if field is defined
Add a function is_defined_field(source, fldname) that returns whether
a field with name fldname exists for the given event source. This uses
the filter factory to create a filtercheck, and returns true if an
object was created.

This prevents having to push down the entire set of defined fields
before calling load_rules().

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm 84d7020e3e Use the new falco engine interface w/ generic events
Use the new falco engine interface with support for generic events
instead of event-specific process_xxx_event methods.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm 0cae713412 Use new outputs interface with engine
Use the new outputs interface, that uses the engine to provide a
formatter.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm bbbac6203c Update rules loader to be general purpose, through factories
Update rules loader to be more general purpose by using factories and
the general purpose engine:

- A lua callback create_lua_parser creates a lua_parser with a filter
  object of the right type. The lua parser can then iterate the AST
  and populate the filter object.

- Like the falco engine, the rules loader is configured with a list of
  factories, and add_filter is now general purpose, taking a source.

Given the fix in https://github.com/falcosecurity/libs/pull/72, there
isn't any need to pass down the entire set of sinsp event
types/syscalls and validate that all filter event types are
valid. That job is now handled by the sinsp filter parsing
code. add_filter now returns the number of event types used by the new
filter, and if that number is excessive the lua code will return a
warning.

Format handling is mostly not handled by the rules loader any more. As
a convienence, there's a new lua callback is_format_valid which takes
a source and output string and uses the right formatter factory to
create a formatter. As long as that doesn't throw an exception, the
format is valid.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm 8275730bf8 Use factories to provide filters/formatting
Instead of having hard-coded support for syscall/k8s_audit events, use
the notions of filter factories/formatter factories to provide generic
support for events having a given source:

- Within the engine, maps m_filter_factories / m_rulesets /
  m_format_factories map from a given source to something that can
  create filters, hold filters, and create formatters for a given
  source. The hard-coded sinsp_factory/json_factory objects are removed.

- The specific add_xxx_filter/process_xxx_event are general purpose
  and take an event source.

- A new method create_formatter() takes a source/output format and
  provides a shared_ptr to a formatter than can resolve format
  strings. This is used by the falco outputs code.

- In falco main, create the syscall/k8s_audit filter and formatter
  factories and pass them to the engine. Later, we might make this
  configurable/selective.

With all of the above changes, the falco engine doesn't need a direct
inspector any longer, so remove it.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm de4b2fa831 Make json_event_formatter a gen_event_formatter
Make json_event_formatter a generic event formatter by inheriting from
gen_event_formatter and implementing its methods.

Most of the actual work is still done by resolve_format (previously
resolve_tokens, to avoid confusion with sinsp formatter, as it behaves
slightly differently).

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm 943a37fcf7 General-purpose list_fields(), via factories
Take advantage of the changes in
https://github.com/falcosecurity/libs/pull/75 to have a
general-purpose way to list fields for a given event source.

in the engine, list_fields() now takes a source, iterates over filter
factories, and calls get_fields() for each factory, printing the results.

list_source_fields now calls the engine regardless of source.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm 3202921355 falco_formats only formats events now, no lua bindings
Modify falco_formats to only be responsible for resolving a rule's
output string or coming up with a map of field name->field values from
a given output string.

It relies on the changes in
https://github.com/falcosecurity/libs/pull/77 to use generic
formatters for a given source.

Remove lua bindings to create a formatter/free a formatter. Those were
unused as of the changes in
https://github.com/falcosecurity/falco/pull/1451, so finally remove
them now.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm 1c60dab87e Move json -> k8s audit event conversion out of falco engine
Move the code that splits a json object into a list of k8s audit/json
events out of falco engine and into json_evt.

This, along with other changes, allows the falco engine to be more
general purpose and not directly tied to the notion of syscall vs k8s
audit events.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm 044a7c153e Don't track event "tags" i.e. event types in rulesets
Modify rulesets to not keep track of the event types for a given set
filter. Instead, using the changes in
https://github.com/falcosecurity/libs/pull/74 event types are returned
directly by the filter.

Within each ruleset, there's a vector that maps from event number to
set of filters that are related to that event number. There's also a
general set of filters for all event types.

run() both indexes into the per-event vector as well as iterate over
the all event types set.

Also, used shared_ptr instead of direct pointers, which matches the
updated interface used by lua_parser. This simplifies the bookkeeping
a bit (no more delete when removing rulesets).

Given these changes, there's no need for a separate
falco_sinsp_ruleset class any longer, so remove it.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Frederico Araujo a0f7d7cf85 update(adopters.md): add falco libs users section
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
2021-10-07 12:32:12 +02:00
Frederico Araujo bb81133201 docs(changelog.md): update for release 0.30.0
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
2021-09-30 17:20:15 +02:00
Michele Zuccala 46d5266ac8 build(cmake): bump libs version to 3aa7a83
Signed-off-by: Michele Zuccala <michele@zuccala.com>
2021-09-29 19:50:14 +02:00
Leo Di Donato 3414ca5361 update(proposal): clarify that old drivers are not removed anymore
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-09-29 16:51:25 +02:00
Jason Dellaluce 0eb170cf5f update(test): enhance test cases for tags in json outputs
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-09-28 12:44:27 +02:00
Jason Dellaluce 21fa6e9505 update(outputs): make tags configurable in json output
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-09-28 12:44:27 +02:00
Michele Zuccala b82cbb1b59 build(cmake): bump libs version to 5727c45
Signed-off-by: Michele Zuccala <michele@zuccala.com>
2021-09-24 17:58:22 +02:00
Domenico Chirabino d033868ab9 falso.service: set `StandardOutput` to null
Signed-off-by: Domenico Chirabino <chirabino@protonmail.com>
2021-09-23 08:46:47 +02:00
Jason Dellaluce 7c98d0047c update(outputs): fixing spacing issue
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-09-21 18:59:10 +02:00
Jason Dellaluce c7d9b6ee7f test(outputs): add source and tags to json output
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-09-21 18:59:10 +02:00
Jason Dellaluce 8273e57598 new(outputs): add source and tags to json output
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-09-21 18:59:10 +02:00
Jason Dellaluce b0562242e8 test(grpc): Test tags on outputs service
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-09-21 18:59:10 +02:00
Jason Dellaluce ca66b84e5a new(grpc): Add tags to outputs service
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-09-21 18:59:10 +02:00
spartan 7c9ec9fc17 fix bugs
Signed-off-by: Spartan-65 <liuyanchong@outlook.com>
2021-09-21 18:54:09 +02:00
Jason Dellaluce 9ea43c2663 update(test): check output order in output_strictly_contains
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-09-21 18:53:09 +02:00
Jason Dellaluce 4d55847bd4 fix(test): avoid output_strictly_contains failures
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-09-21 18:53:09 +02:00
Michele Zuccala a684bec007 update(userspace/falco): throw logic errors on invalid config values for metadata download
Signed-off-by: Michele Zuccala <michele@zuccala.com>
2021-09-20 16:56:15 +02:00
Michele Zuccala 812aa9b566 new(userspace/falco): add customizable metadata fetching params
Signed-off-by: Michele Zuccala <michele@zuccala.com>
2021-09-20 16:56:15 +02:00
Tom Keyte e0f8b81692 Remove duplicate allowed ecr registry rule
Signed-off-by: Tom Keyte <tom.keyte@onsecurity.co.uk>
2021-09-17 11:12:54 +02:00
Alberto Pellitteri 874809351f rules(list https_miner_domains): fix typo in the list
Co-authored-by: darryk10 <stefano.chierici@sysdig.com>
Signed-off-by: Alberto Pellitteri <albertopellitteri96@gmail.com>
2021-09-17 09:16:54 +02:00
Alberto Pellitteri 4527228ef8 rules(list https_miner_domains): add new miner domains
Signed-off-by: Alberto Pellitteri <albertopellitteri96@gmail.com>
Co-authored-by: darryk10 <stefano.chierici@sysdig.com>
2021-09-17 09:16:54 +02:00
Alberto Pellitteri e684c95e23 rules(list miner_domains): add new miner domains
Signed-off-by: Alberto Pellitteri <albertopellitteri96@gmail.com>
Co-authored-by: darryk10 <stefano.chierici@sysdig.com>
2021-09-17 09:16:54 +02:00
Leonardo Grasso 2390ca447a new: ability to filter by a node when fetching K8S metadata
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-09-16 15:33:41 +02:00
Leonardo Grasso af0e6da375 build(cmake/modules): upgrade driver version to `f7029e`
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-09-16 15:33:41 +02:00
Michal Schott 84e7d3f18f Switching from stable to old-stable (buster).
Added libssl-dev package.

Signed-off-by: Michal Schott <michal.schott@onegini.com>
2021-09-10 01:11:38 +02:00
Thomas Labarussias 2a8c0e8bb7 add Qonto as adopter
Signed-off-by: Thomas Labarussias <issif+github@gadz.org>
2021-09-02 17:36:36 +02:00
Michele Zuccala f28688551c fix(build): adapt to new debian 11 package names
Signed-off-by: Michele Zuccala <michele@zuccala.com>
2021-08-25 17:18:20 +02:00
Leonardo Grasso b12d37a3b8 docs(RELEASE.md): switch to 3 releases per year
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-08-25 17:17:20 +02:00
Loris Degioanni 5e027c7fe2 Proposal for a libs plugin system
Description of changes to falcosecurity/libs and /falco to support
plugins to provide events and extract fields from events.

Signed-off-by: Loris Degioanni <loris@sysdig.com>
Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
Co-authored-by: Mark Stemm <mark.stemm@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2021-08-24 17:52:19 +02:00
Leo Di Donato efbe887d6e docs: CHANGELOG for 0.29.1 cleanup
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-07-30 12:20:10 +02:00
Leonardo Grasso 7dcbeb1f44 build(.circleci): `ncurses` is not required anymore
Since `libs` version 13ec67ebd23417273275296813066e07cb85bc91

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-07-29 18:20:47 +02:00
Leonardo Grasso 93667f2d3e build(docker/builder): `ncurses-dev` is not required anymore
Since `libs` version 13ec67ebd23417273275296813066e07cb85bc91

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-07-29 18:20:47 +02:00
Leonardo Di Donato b5b1763d09 docs: CHANGELOG for Falco 0.29.1 changeset
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-06-30 16:14:26 +02:00
Leonardo Di Donato d6690313a0 update(rules): bump the required engine version to version 9
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-06-23 10:44:03 +02:00
Leonardo Di Donato 98ce88f7ef chore(rules): imporve name of the list for userfaultfd exceptions
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-06-23 10:44:03 +02:00
Leonardo Di Donato 9ff8099501 update(userspace/engine): bump falco engine version
Co-authored-by: Kaizhe Huang <derek0405@gmail.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-06-23 10:44:03 +02:00
Leonardo Di Donato 7db4778f55 update(rules): introducing list user_known_userfaultfd_activities to exclude processes known to use userfaultfd syscall
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-06-23 10:44:03 +02:00
Leonardo Di Donato 7f761ade4b update(rules): introducing the macro consider_userfaultfd_activities to act as a gate
Co-authored-by: Kaizhe Huang <derek0405@gmail.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-06-23 10:44:03 +02:00
Leonardo Di Donato 84257912e0 update(rules): tag rule as syscall
Co-authored-by: Kaizhe Huang <derek0405@gmail.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-06-23 10:44:03 +02:00
Leonardo Di Donato 9bc942c654 new(rules): detect unprivileged (successful) userfaultfd syscalls
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-06-23 10:44:03 +02:00
Leonardo Di Donato 8216b435cb update(rules): adding container info to the output of the Lryke detecting kernel module injections from containers
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-06-23 10:44:03 +02:00
maxgio 78f710c706 docs(release.md): update
Signed-off-by: maxgio92 massimiliano.giovagnoli.1992@gmail.com

Co-authored-by: Leo Di Donato <leodidonato@gmail.com>
2021-06-22 18:59:28 +02:00
maxgio 1dd97c1b6f docs(release.md): update
Signed-off-by: maxgio92 massimiliano.giovagnoli.1992@gmail.com

Co-authored-by: Leo Di Donato <leodidonato@gmail.com>
2021-06-22 18:59:28 +02:00
maxgio92 3ef5716fa2 docs(release.md): document website snapshot for new minor versions
Signed-off-by: maxgio92 <massimiliano.giovagnoli.1992@gmail.com>
2021-06-22 18:59:28 +02:00
maxgio92 64102078c7 docs(release.md): update gh release description template
Signed-off-by: maxgio92 <massimiliano.giovagnoli.1992@gmail.com>
2021-06-22 18:59:28 +02:00
maxgio92 9703853da8 docs(changelog.md): add new non-user facing change
Signed-off-by: maxgio92 <massimiliano.giovagnoli.1992@gmail.com>
2021-06-21 16:55:25 +02:00
maxgio92 96403fa275 docs(changelog.md): fix typo in rules change log
Signed-off-by: maxgio92 <massimiliano.giovagnoli.1992@gmail.com>
2021-06-21 16:55:25 +02:00
Thomas Spear acd5422b55 Fix link to CONTRIBUTING.md in the Pull Request Template
Signed-off-by: Thomas Spear <tspear@conquestcyber.com>
2021-06-21 11:01:38 +02:00
maxgio92 099c79ddde docs(changelog.md): add release 0.29.0
Signed-off-by: maxgio92 <massimiliano.giovagnoli.1992@gmail.com>
2021-06-17 17:43:54 +02:00
Lorenzo Fontana 0f24448d18 rules(list miner_domains): add rx.unmineable.com for anti-miner detection
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2021-06-17 09:59:25 +02:00
Leonardo Grasso 1b63ad1aed build: upgrade driver version to 17f5d
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-06-16 14:50:07 +02:00
Kaizhe Huang b268d4d6c3 rule update(Non sudo setuid): check user id as well in case user name info is not available
Signed-off-by: Kaizhe Huang <khuang@aurora.tech>
2021-06-10 13:44:05 +02:00
Kaizhe Huang 684a5d85ff disable test
Signed-off-by: Kaizhe Huang <khuang@aurora.tech>
2021-06-07 12:17:21 +02:00
Kaizhe Huang 58cea0c5e7 minor fix
Signed-off-by: Kaizhe Huang <khuang@aurora.tech>
2021-06-07 12:17:21 +02:00
Kaizhe Huang 38ebc61808 fix tests
Signed-off-by: Kaizhe Huang <khuang@aurora.tech>
2021-06-07 12:17:21 +02:00
Kaizhe Huang 535db19991 disable change thread namespace test
Signed-off-by: Kaizhe Huang <khuang@aurora.tech>
2021-06-07 12:17:21 +02:00
Kaizhe Huang abe46a19a0 minor changes
Signed-off-by: Kaizhe Huang <derek0405@gmail.com>
2021-06-07 12:17:21 +02:00
Kaizhe Huang 96fc8d1a27 update test
Signed-off-by: Kaizhe Huang <derek0405@gmail.com>
2021-06-07 12:17:21 +02:00
Kaizhe Huang ad82f66be3 rules update(Change thread namespace and Set Setuid or Setgid bit): disable by default
Signed-off-by: Kaizhe Huang <derek0405@gmail.com>
2021-06-07 12:17:21 +02:00
Leonardo Grasso c60fac9e34 build(test): upgrade urllib3 to 1.26.5
CVE-2021-33503 has been fixed in urllib3 v1.26.5.
See:
 - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-33503
 - https://github.com/urllib3/urllib3/releases/tag/1.26.5

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-06-04 22:15:33 +02:00
Sverre Boschman 35dc315390 add known k8s service accounts
Signed-off-by: Sverre Boschman
2021-06-04 10:46:09 +02:00
maxgio92 62c995f309 revert: add notes for 0.28.2 release
This reverts commit 3432551295.

Signed-off-by: maxgio92 <massimiliano.giovagnoli.1992@gmail.com>
2021-06-01 15:47:37 +02:00
maxgio92 3432551295 changelog: add notes for 0.28.2 release
Signed-off-by: maxgio92 <massimiliano.giovagnoli.1992@gmail.com>
2021-05-27 14:51:17 +02:00
Kaizhe Huang 09e1604fe0 rule update(Debugfs Launched in Privileged Container): fix typo in description
Signed-off-by: Kaizhe Huang <khuang@aurora.tech>
2021-05-27 11:21:30 +02:00
Leonardo Grasso da7279da1d build(cmake/modules): upgrade libs and drivers version to 13ec67ebd23417273275296813066e07cb85bc91
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-05-21 10:24:08 +02:00
Leonardo Grasso 05f5aa2af3 chore(cmake/modules): do not build libscap examples
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-05-21 10:24:08 +02:00
Leonardo Grasso 53a1be66b0 chore(docker/builder): remove never used MINIMAL_BUILD option
The option was added but could not work since MINIMAL_BUILD is not declared in this scope (also not currently needed).
Furthermore, it never took effect since the builder image was never built and pushed. For the same reason, we have not noticed it until now.

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-05-21 10:24:08 +02:00
Leonardo Grasso f7b572bea5 build(docker/builder): upgrade cmake version
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-05-21 10:24:08 +02:00
Leonardo Grasso ed59f33f3f build(userspace/falco): add GRPC_LIBRARIES when gRPC is bundled
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-05-21 10:24:08 +02:00
Leonardo Grasso b41acdff1c build(cmake/modules): always use bundled jsoncpp
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-05-21 10:24:08 +02:00
Leonardo Grasso 4acc089b1f build(userspace/falco): add_depenedency for gRPC when bundled
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-05-21 10:24:08 +02:00
Leonardo Grasso 591d4e500e build: always use bundled b64
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-05-21 10:24:08 +02:00
Leonardo Grasso 79bdcb030b build: correct yamlcpp dependency for falco
Co-authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-05-21 10:24:08 +02:00
Leonardo Grasso f4dba52ee2 build(cmake/modules): ncurses dependency is not required anymore
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-05-21 10:24:08 +02:00
Leonardo Grasso bfc0021cdd build: update build system to support libs cmake modules
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-05-21 10:24:08 +02:00
Leonardo Grasso e616f79bac build: switch to falcosecurity-libs external project
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-05-21 10:24:08 +02:00
Leonardo Grasso 4006452b1f chore(cmake/modules): rename sysdig to falcosecurity-libs
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-05-21 10:24:08 +02:00
maxgio92 59831b077e docs(release.md): update github release template mentioning the release manager
Signed-off-by: maxgio92 <massimiliano.giovagnoli.1992@gmail.com>
2021-05-18 15:34:07 +02:00
maxgio92 0d95beb1e3 docs(release.md): update post-release tasks order
Signed-off-by: maxgio92 <massimiliano.giovagnoli.1992@gmail.com>
2021-05-18 15:34:07 +02:00
maxgio92 2e27d5dded docs(release.md): add blog announcement to post-release tasks
Signed-off-by: maxgio92 <massimiliano.giovagnoli.1992@gmail.com>
2021-05-18 15:34:07 +02:00
Leonardo Di Donato 24f64cab33 docs(proposals): fix libs contribution name
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-05-17 16:24:53 +02:00
Yu Kitazume 0f36ff030e add Yahoo!Japan as an adopter
Signed-off-by: Yu Kitazume <u.kitazume@gmail.com>
2021-05-12 11:37:34 +02:00
diamonwiggins 601ec5cf85 add Replicated to adopters
Signed-off-by: diamonwiggins <diamonw757@gmail.com>
2021-05-11 11:59:54 +02:00
Carlos Panato f237f277e7 changelog: add notes for 0.28.1 release
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-05-07 14:55:02 +02:00
ismail yenigul 2226a1508c exception to privileged container for EKS images
Signed-off-by: ismail yenigul <ismailyenigul@gmail.com>
2021-05-06 02:36:48 +02:00
Carlos Panato 6f64c21ad9 urelease/docs: fix link and small refactor in the text
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-04-30 14:27:26 +02:00
maxgio92 fd6a1d0d05 clean(rules/falco_rules.yaml): remove deprecated oci image repositories
Signed-off-by: maxgio92 <massimiliano.giovagnoli.1992@gmail.com>
2021-04-29 11:51:35 +02:00
David Windsor 87438ec723 Add Secureworks to adopters
Signed-off-by: David Windsor <dwindsor@secureworks.com>
2021-04-26 10:34:00 +02:00
Leonardo Grasso d0be6d96d0 build: enable ASLR for statically linked build
Co-authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-04-22 18:12:05 +02:00
Leonardo Grasso aefd67eb8a build: hardening flags
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-04-22 18:12:05 +02:00
Leonardo Di Donato 6e94c37399 new(test): regression test for FAL-01-003
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-04-21 15:11:17 +02:00
Leonardo Di Donato d3c22d3d0c new(test/trace_files): test fixture for FAL-01-003
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-04-21 15:11:17 +02:00
natchaphon-r 366975bc3b Adding MathWorks to Falco's adopter list
Signed-off-by: natchaphon-r <natchaphon.r@gmail.com>
2021-04-20 09:30:11 +02:00
natchaphon-r f9692fcb82 Adding MathWorks to Falco's adopter list
Signed-off-by: natchaphon-r <natchaphon.r@gmail.com>
2021-04-20 09:30:11 +02:00
Leonardo Grasso e95ab26f33 update(rules): stricter detection of man-db postinst exception
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-04-19 17:01:10 +02:00
Leonardo Grasso 23a611b343 chore(rules): remove too week macro `python_running_sdchecks`
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-04-19 17:01:10 +02:00
Dan POP 2658d65373 adding known users /and how to add your name
added list from the survey that allowed mentions of their name publically in the adopters file. 

@jonahjon     --  please approve or change any verbiage to adding AWS as contributors with all you and the teams work on PROW and all the contributions thus far.

Signed-off-by: Dan Papandrea <dan.papandrea@sysdig.com>
2021-04-19 16:58:59 +02:00
Leonardo Di Donato 600501e141 update(userspace/falco): handle the case there wasn't been any previously processed event
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-04-19 16:56:53 +02:00
Leonardo Di Donato 0df18fd786 update(userspace/falco): print out current time when a timeouts notification gets emitted
Also, print out the time of the last processed event in the output
fields of the notification.

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-04-19 16:56:53 +02:00
Leonardo Di Donato c1da6d21b9 new: syscall_event_timeouts configuration block
Falco uses a shared buffer between the kernel and userspace to receive
the events (eg., system call information) in userspace.
Anyways, the underlying libraries can also timeout for various reasons.
For example, there could have been issues while reading an event.
Or the particular event needs to be skipped.
Normally, it's very unlikely that Falco does not receive events consecutively.
Falco is able to detect such uncommon situation.
Here you can configure the maximum number of consecutive timeouts without an event
after which you want Falco to alert.
By default this value is set to 1000 consecutive timeouts without an event at all.

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-04-19 16:56:53 +02:00
Leonardo Di Donato c4a73bdd8e update(userspace/falco): a null event when there's a timeout is unlikely
Co-authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-04-19 16:56:53 +02:00
Leonardo Di Donato 28a339e4bc new(userspace/engine): likely/unlikely macros in utils
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-04-19 16:56:53 +02:00
Leonardo Di Donato 65a168ab5a new(userspace/falco): output msg when the number of consecutive timeouts without an event is greater than a given threshold
The rationale is that in case Falco obtains a consistent number of
consecutive timeouts (in a row) without a valid event, something is
going wrong.

This because, normally, the libs send timeouts to Falco (also) to signal events to discard.
In such cases, which are the majority of cases, `ev` exists and is not
`null`.

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-04-19 16:56:53 +02:00
Lorenzo Fontana 46425b392c fix(userspace): handle exceptions for process_k8s_audit_event
This fix has two major points in it:

- when `std::stoll` is used in parse_as_int64 handle all the exceptions it
can throw (https://en.cppreference.com/w/cpp/string/basic_string/stol)
- when `process_k8s_audit_event` an eventual exception in it does not
stop the webserver process. This is done by doing a catch all handle
outside it and by logging an error message to the caller as well as in
stderr

Signed-off-by: Lorenzo Fontana <lo@linux.com>
2021-04-19 12:32:22 +02:00
Leo Di Donato 8b0d22dee9 docs: update link for HackMD community call notes
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-04-13 15:26:53 +02:00
Mark Stemm a7e04fe6e6 Add falco engine info to --support output
In some cases, it might be useful to know what falco engine version a
given falco binary supports. We already have a --support option that
prints info about the system, config, rules files, etc.

Add a engine_info object, with an engine_version property containing the
falco engine version in falco_engine_version.h. In the output, it looks
like this:

...
  "engine_info": {
      "engine_version": 8
   },
...

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-04-13 10:49:19 +02:00
619 changed files with 34241 additions and 27720 deletions

View File

@ -1,4 +1,2 @@
approvers:
- jonahjon
reviewers:
emeritus_approvers:
- jonahjon

View File

@ -1,751 +0,0 @@
version: 2
jobs:
# Build a statically linked Falco release binary using musl
# This build is 100% static, there are no host dependencies
"build/musl":
docker:
- image: alpine:3.12
steps:
- checkout:
path: /source-static/falco
- run:
name: Update base image
command: apk update
- run:
name: Install build dependencies
command: apk add g++ gcc cmake cmake make ncurses-dev git bash perl linux-headers autoconf automake m4 libtool elfutils-dev libelf-static patch binutils
- run:
name: Prepare project
command: |
mkdir -p /build-static/release
cd /build-static/release
cmake -DCPACK_GENERATOR=TGZ -DBUILD_BPF=Off -DBUILD_DRIVER=Off -DCMAKE_BUILD_TYPE=Release -DUSE_BUNDLED_DEPS=On -DMUSL_OPTIMIZED_BUILD=On -DFALCO_ETC_DIR=/etc/falco /source-static/falco
- run:
name: Build
command: |
cd /build-static/release
make -j4 all
- run:
name: Package
command: |
cd /build-static/release
make -j4 package
- run:
name: Run unit tests
command: |
cd /build-static/release
make tests
- run:
name: Prepare artifacts
command: |
mkdir -p /tmp/packages
cp /build-static/release/*.tar.gz /tmp/packages
- store_artifacts:
path: /tmp/packages
destination: /packages
- persist_to_workspace:
root: /
paths:
- build-static/release
- source-static
# Build the minimal Falco
# This build only contains the Falco engine and the basic input/output.
"build/minimal":
docker:
- image: ubuntu:focal
steps:
- checkout
- run:
name: Update base image
command: apt update -y
- run:
name: Install dependencies
command: DEBIAN_FRONTEND=noninteractive apt install libjq-dev libncurses-dev libyaml-cpp-dev libelf-dev cmake build-essential git -y
- run:
name: Prepare project
command: |
mkdir build-minimal
pushd build-minimal
cmake -DMINIMAL_BUILD=On -DBUILD_BPF=Off -DBUILD_DRIVER=Off -DCMAKE_BUILD_TYPE=Release ..
popd
- run:
name: Build
command: |
pushd build-minimal
make -j4 all
popd
- run:
name: Run unit tests
command: |
pushd build-minimal
make tests
popd
# Build using ubuntu LTS
# This build is dynamic, most dependencies are taken from the OS
"build/ubuntu-focal":
docker:
- image: ubuntu:focal
steps:
- checkout
- run:
name: Update base image
command: apt update -y
- run:
name: Install dependencies
command: DEBIAN_FRONTEND=noninteractive apt install libssl-dev libyaml-dev libncurses-dev libc-ares-dev libprotobuf-dev protobuf-compiler libjq-dev libyaml-cpp-dev libgrpc++-dev protobuf-compiler-grpc rpm libelf-dev cmake build-essential libcurl4-openssl-dev linux-headers-generic clang llvm git -y
- run:
name: Prepare project
command: |
mkdir build
pushd build
cmake -DBUILD_BPF=On ..
popd
- run:
name: Build
command: |
pushd build
KERNELDIR=/lib/modules/$(ls /lib/modules)/build make -j4 all
popd
- run:
name: Run unit tests
command: |
pushd build
make tests
popd
# Debug build using ubuntu LTS
# This build is dynamic, most dependencies are taken from the OS
"build/ubuntu-focal-debug":
docker:
- image: ubuntu:focal
steps:
- checkout
- run:
name: Update base image
command: apt update -y
- run:
name: Install dependencies
command: DEBIAN_FRONTEND=noninteractive apt install libssl-dev libyaml-dev libncurses-dev libc-ares-dev libprotobuf-dev protobuf-compiler libjq-dev libyaml-cpp-dev libgrpc++-dev protobuf-compiler-grpc rpm libelf-dev cmake build-essential libcurl4-openssl-dev linux-headers-generic clang llvm git -y
- run:
name: Prepare project
command: |
mkdir build
pushd build
cmake -DCMAKE_BUILD_TYPE=debug -DBUILD_BPF=On ..
popd
- run:
name: Build
command: |
pushd build
KERNELDIR=/lib/modules/$(ls /lib/modules)/build make -j4 all
popd
- run:
name: Run unit tests
command: |
pushd build
make tests
popd
# Build using Ubuntu Bionic Beaver (18.04)
# This build is static, dependencies are bundled in the Falco binary
"build/ubuntu-bionic":
docker:
- image: ubuntu:bionic
steps:
- checkout
- run:
name: Update base image
command: apt update -y
- run:
name: Install dependencies
command: DEBIAN_FRONTEND=noninteractive apt install cmake build-essential clang llvm git linux-headers-generic libncurses-dev pkg-config autoconf libtool libelf-dev -y
- run:
name: Prepare project
command: |
mkdir build
pushd build
cmake -DBUILD_BPF=On -DUSE_BUNDLED_DEPS=On ..
popd
- run:
name: Build
command: |
pushd build
KERNELDIR=/lib/modules/$(ls /lib/modules)/build make -j4 all
popd
- run:
name: Run unit tests
command: |
pushd build
make tests
popd
# Build using CentOS 8
# This build is static, dependencies are bundled in the Falco binary
"build/centos8":
docker:
- image: centos:8
steps:
- checkout
- run:
name: Update base image
command: dnf update -y
- run:
name: Install dependencies
command: dnf install gcc gcc-c++ git make cmake autoconf automake pkg-config patch ncurses-devel libtool elfutils-libelf-devel diffutils kernel-devel kernel-headers kernel-core clang llvm which -y
- run:
name: Prepare project
command: |
mkdir build
pushd build
cmake -DBUILD_BPF=On -DUSE_BUNDLED_DEPS=On ..
popd
- run:
name: Build
command: |
pushd build
KERNELDIR=/lib/modules/$(ls /lib/modules)/build make -j4 all
popd
- run:
name: Run unit tests
command: |
pushd build
make tests
popd
# Build using our own builder base image using centos 7
# This build is static, dependencies are bundled in the Falco binary
"build/centos7":
docker:
- image: falcosecurity/falco-builder:latest
environment:
BUILD_TYPE: "release"
steps:
- checkout:
path: /source/falco
- run:
name: Prepare project
command: /usr/bin/entrypoint cmake
- run:
name: Build
command: /usr/bin/entrypoint all
- run:
name: Run unit tests
command: /usr/bin/entrypoint tests
- run:
name: Build packages
command: /usr/bin/entrypoint package
- persist_to_workspace:
root: /
paths:
- build/release
- source
- run:
name: Prepare artifacts
command: |
mkdir -p /tmp/packages
cp /build/release/*.deb /tmp/packages
cp /build/release/*.tar.gz /tmp/packages
cp /build/release/*.rpm /tmp/packages
- store_artifacts:
path: /tmp/packages
destination: /packages
# Debug build using our own builder base image using centos 7
# This build is static, dependencies are bundled in the Falco binary
"build/centos7-debug":
docker:
- image: falcosecurity/falco-builder:latest
environment:
BUILD_TYPE: "debug"
steps:
- checkout:
path: /source/falco
- run:
name: Prepare project
command: /usr/bin/entrypoint cmake
- run:
name: Build
command: /usr/bin/entrypoint all
- run:
name: Run unit tests
command: /usr/bin/entrypoint tests
- run:
name: Build packages
command: /usr/bin/entrypoint package
# Execute integration tests based on the build results coming from the "build/centos7" job
"tests/integration":
docker:
- image: falcosecurity/falco-tester:latest
environment:
SOURCE_DIR: "/source"
BUILD_DIR: "/build"
BUILD_TYPE: "release"
steps:
- setup_remote_docker
- attach_workspace:
at: /
- run:
name: Execute integration tests
command: /usr/bin/entrypoint test
- store_test_results:
path: /build/release/integration-tests-xunit
"tests/integration-static":
docker:
- image: falcosecurity/falco-tester:latest
environment:
SOURCE_DIR: "/source-static"
BUILD_DIR: "/build-static"
BUILD_TYPE: "release"
SKIP_PACKAGES_TESTS: "true"
steps:
- setup_remote_docker
- attach_workspace:
at: /
- run:
name: Execute integration tests
command: /usr/bin/entrypoint test
- store_test_results:
path: /build-static/release/integration-tests-xunit
"tests/driver-loader/integration":
machine:
image: ubuntu-1604:202004-01
steps:
- attach_workspace:
at: /tmp/ws
- run:
name: Execute driver-loader integration tests
command: /tmp/ws/source/falco/test/driver-loader/run_test.sh /tmp/ws/build/release/
# Code quality
"quality/static-analysis":
docker:
- image: falcosecurity/falco-builder:latest
environment:
BUILD_TYPE: "release"
steps:
- run:
name: Install cppcheck
command: |
yum update -y
yum install epel-release -y
yum install cppcheck cppcheck-htmlreport -y
- checkout:
path: /source/falco
- run:
name: Prepare project
command: /usr/bin/entrypoint cmake
- run:
name: cppcheck
command: /usr/bin/entrypoint cppcheck
- run:
name: cppcheck html report
command: /usr/bin/entrypoint cppcheck_htmlreport
- store_artifacts:
path: /build/release/static-analysis-reports
destination: /static-analysis-reports
# Sign rpm packages
"rpm/sign":
docker:
- image: falcosecurity/falco-builder:latest
steps:
- attach_workspace:
at: /
- run:
name: Install rpmsign
command: |
yum update -y
yum install rpm-sign -y
- run:
name: Sign rpm
command: |
echo "%_signature gpg" > ~/.rpmmacros
echo "%_gpg_name Falcosecurity Package Signing" >> ~/.rpmmacros
cd /build/release/
echo '#!/usr/bin/expect -f' > sign
echo 'spawn rpmsign --addsign {*}$argv' >> sign
echo 'expect -exact "Enter pass phrase: "' >> sign
echo 'send -- "\n"' >> sign
echo 'expect eof' >> sign
chmod +x sign
echo $GPG_KEY | base64 -d | gpg --import
./sign *.rpm
test "$(rpm -qpi *.rpm | awk '/Signature/' | grep -i none | wc -l)" -eq 0
- persist_to_workspace:
root: /
paths:
- build/release/*.rpm
# Publish the dev packages
"publish/packages-dev":
docker:
- image: docker.io/centos:7
steps:
- attach_workspace:
at: /
- run:
name: Setup
command: |
yum install epel-release -y
yum update -y
yum install createrepo gpg python python-pip -y
pip install awscli==1.19.47
echo $GPG_KEY | base64 -d | gpg --import
- run:
name: Publish rpm-dev
command: |
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
/source/falco/scripts/publish-rpm -f /build/release/falco-${FALCO_VERSION}-x86_64.rpm -r rpm-dev
- run:
name: Publish bin-dev
command: |
FALCO_VERSION=$(cat /build-static/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
/source/falco/scripts/publish-bin -f /build-static/release/falco-${FALCO_VERSION}-x86_64.tar.gz -r bin-dev -a x86_64
"publish/packages-deb-dev":
docker:
- image: docker.io/debian:stable
steps:
- attach_workspace:
at: /
- run:
name: Setup
command: |
apt update -y
apt-get install apt-utils bzip2 gpg python python-pip -y
pip install awscli
echo $GPG_KEY | base64 -d | gpg --import
- run:
name: Publish deb-dev
command: |
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
/source/falco/scripts/publish-deb -f /build/release/falco-${FALCO_VERSION}-x86_64.deb -r deb-dev
# Publish docker packages
"publish/docker-dev":
docker:
- image: docker:stable
steps:
- attach_workspace:
at: /
- checkout
- setup_remote_docker
- run:
name: Build and publish no-driver-dev
command: |
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
docker build --build-arg VERSION_BUCKET=bin-dev --build-arg FALCO_VERSION=${FALCO_VERSION} -t falcosecurity/falco-no-driver:master docker/no-driver
docker tag falcosecurity/falco-no-driver:master falcosecurity/falco:master-slim
echo ${DOCKERHUB_SECRET} | docker login -u ${DOCKERHUB_USER} --password-stdin
docker push falcosecurity/falco-no-driver:master
docker push falcosecurity/falco:master-slim
- run:
name: Build and publish dev
command: |
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
docker build --build-arg VERSION_BUCKET=deb-dev --build-arg FALCO_VERSION=${FALCO_VERSION} -t falcosecurity/falco:master docker/falco
echo ${DOCKERHUB_SECRET} | docker login -u ${DOCKERHUB_USER} --password-stdin
docker push falcosecurity/falco:master
- run:
name: Build and publish dev falco-driver-loader-dev
command: |
docker build --build-arg FALCO_IMAGE_TAG=master -t falcosecurity/falco-driver-loader:master docker/driver-loader
echo ${DOCKERHUB_SECRET} | docker login -u ${DOCKERHUB_USER} --password-stdin
docker push falcosecurity/falco-driver-loader:master
# Publish container images to AWS ECR Public
"publish/container-images-aws-dev":
docker:
- image: docker:stable
steps:
- attach_workspace:
at: /
- checkout
- setup_remote_docker
- run:
name: Build and publish no-driver (dev) to AWS
command: |
apk update
apk add --update groff less py-pip
pip install awscli
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
docker build --build-arg VERSION_BUCKET=bin-dev --build-arg FALCO_VERSION=${FALCO_VERSION} -t "public.ecr.aws/falcosecurity/falco-no-driver:master" docker/no-driver
docker tag public.ecr.aws/falcosecurity/falco-no-driver:master public.ecr.aws/falcosecurity/falco:master-slim
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/falcosecurity
docker push "public.ecr.aws/falcosecurity/falco-no-driver:master"
docker push "public.ecr.aws/falcosecurity/falco:master-slim"
- run:
name: Build and publish falco (dev) to AWS
command: |
apk update
apk add --update groff less py-pip
pip install awscli
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
docker build --build-arg VERSION_BUCKET=deb-dev --build-arg FALCO_VERSION=${FALCO_VERSION} -t "public.ecr.aws/falcosecurity/falco:master" docker/falco
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/falcosecurity
docker push "public.ecr.aws/falcosecurity/falco:master"
- run:
name: Build and publish driver-loader (dev) to AWS
command: |
apk update
apk add --update groff less py-pip
pip install awscli
docker build --build-arg FALCO_IMAGE_TAG=master -t "public.ecr.aws/falcosecurity/falco-driver-loader:master" docker/driver-loader
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/falcosecurity
docker push "public.ecr.aws/falcosecurity/falco-driver-loader:master"
# Publish the packages
"publish/packages":
docker:
- image: docker.io/centos:7
steps:
- attach_workspace:
at: /
- run:
name: Setup
command: |
yum install epel-release -y
yum update -y
yum install createrepo gpg python python-pip -y
pip install awscli==1.19.47
echo $GPG_KEY | base64 -d | gpg --import
- run:
name: Publish rpm
command: |
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
/source/falco/scripts/publish-rpm -f /build/release/falco-${FALCO_VERSION}-x86_64.rpm -r rpm
- run:
name: Publish bin
command: |
FALCO_VERSION=$(cat /build-static/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
/source/falco/scripts/publish-bin -f /build-static/release/falco-${FALCO_VERSION}-x86_64.tar.gz -r bin -a x86_64
"publish/packages-deb":
docker:
- image: docker.io/debian:stable
steps:
- attach_workspace:
at: /
- run:
name: Setup
command: |
apt update -y
apt-get install apt-utils bzip2 gpg python python-pip -y
pip install awscli
echo $GPG_KEY | base64 -d | gpg --import
- run:
name: Publish deb
command: |
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
/source/falco/scripts/publish-deb -f /build/release/falco-${FALCO_VERSION}-x86_64.deb -r deb
# Publish docker packages
"publish/docker":
docker:
- image: docker:stable
steps:
- attach_workspace:
at: /
- checkout
- setup_remote_docker
- run:
name: Build and publish no-driver
command: |
docker build --build-arg VERSION_BUCKET=bin --build-arg FALCO_VERSION=${CIRCLE_TAG} -t "falcosecurity/falco-no-driver:${CIRCLE_TAG}" docker/no-driver
docker tag "falcosecurity/falco-no-driver:${CIRCLE_TAG}" falcosecurity/falco-no-driver:latest
docker tag "falcosecurity/falco-no-driver:${CIRCLE_TAG}" "falcosecurity/falco:${CIRCLE_TAG}-slim"
docker tag "falcosecurity/falco-no-driver:${CIRCLE_TAG}" "falcosecurity/falco:latest-slim"
echo ${DOCKERHUB_SECRET} | docker login -u ${DOCKERHUB_USER} --password-stdin
docker push "falcosecurity/falco-no-driver:${CIRCLE_TAG}"
docker push "falcosecurity/falco-no-driver:latest"
docker push "falcosecurity/falco:${CIRCLE_TAG}-slim"
docker push "falcosecurity/falco:latest-slim"
- run:
name: Build and publish falco
command: |
docker build --build-arg VERSION_BUCKET=deb --build-arg FALCO_VERSION=${CIRCLE_TAG} -t "falcosecurity/falco:${CIRCLE_TAG}" docker/falco
docker tag "falcosecurity/falco:${CIRCLE_TAG}" falcosecurity/falco:latest
echo ${DOCKERHUB_SECRET} | docker login -u ${DOCKERHUB_USER} --password-stdin
docker push "falcosecurity/falco:${CIRCLE_TAG}"
docker push "falcosecurity/falco:latest"
- run:
name: Build and publish falco-driver-loader
command: |
docker build --build-arg FALCO_IMAGE_TAG=${CIRCLE_TAG} -t "falcosecurity/falco-driver-loader:${CIRCLE_TAG}" docker/driver-loader
docker tag "falcosecurity/falco-driver-loader:${CIRCLE_TAG}" falcosecurity/falco-driver-loader:latest
echo ${DOCKERHUB_SECRET} | docker login -u ${DOCKERHUB_USER} --password-stdin
docker push "falcosecurity/falco-driver-loader:${CIRCLE_TAG}"
docker push "falcosecurity/falco-driver-loader:latest"
# Publish container images to AWS ECR Public
"publish/container-images-aws":
docker:
- image: docker:stable
steps:
- attach_workspace:
at: /
- checkout
- setup_remote_docker
- run:
name: Build and publish no-driver to AWS
command: |
apk update
apk add --update groff less py-pip
pip install awscli
docker build --build-arg VERSION_BUCKET=bin --build-arg FALCO_VERSION=${CIRCLE_TAG} -t "public.ecr.aws/falcosecurity/falco-no-driver:${CIRCLE_TAG}" docker/no-driver
docker tag "public.ecr.aws/falcosecurity/falco-no-driver:${CIRCLE_TAG}" public.ecr.aws/falcosecurity/falco-no-driver:latest
docker tag "public.ecr.aws/falcosecurity/falco-no-driver:${CIRCLE_TAG}" "public.ecr.aws/falcosecurity/falco:${CIRCLE_TAG}-slim"
docker tag "public.ecr.aws/falcosecurity/falco-no-driver:${CIRCLE_TAG}" "public.ecr.aws/falcosecurity/falco:latest-slim"
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/falcosecurity
docker push "public.ecr.aws/falcosecurity/falco:${CIRCLE_TAG}-slim"
docker push "public.ecr.aws/falcosecurity/falco:latest-slim"
docker push "public.ecr.aws/falcosecurity/falco-no-driver:${CIRCLE_TAG}"
docker push "public.ecr.aws/falcosecurity/falco-no-driver:latest"
- run:
name: Build and publish falco to AWS
command: |
apk update
apk add --update groff less py-pip
pip install awscli
docker build --build-arg VERSION_BUCKET=deb --build-arg FALCO_VERSION=${CIRCLE_TAG} -t "public.ecr.aws/falcosecurity/falco:${CIRCLE_TAG}" docker/falco
docker tag "public.ecr.aws/falcosecurity/falco:${CIRCLE_TAG}" public.ecr.aws/falcosecurity/falco:latest
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/falcosecurity
docker push "public.ecr.aws/falcosecurity/falco:${CIRCLE_TAG}"
docker push "public.ecr.aws/falcosecurity/falco:latest"
- run:
name: Build and publish falco-driver-loader to AWS
command: |
apk update
apk add --update groff less py-pip
pip install awscli
docker build --build-arg FALCO_IMAGE_TAG=${CIRCLE_TAG} -t "public.ecr.aws/falcosecurity/falco-driver-loader:${CIRCLE_TAG}" docker/driver-loader
docker tag "public.ecr.aws/falcosecurity/falco-driver-loader:${CIRCLE_TAG}" public.ecr.aws/falcosecurity/falco-driver-loader:latest
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/falcosecurity
docker push "public.ecr.aws/falcosecurity/falco-driver-loader:${CIRCLE_TAG}"
docker push "public.ecr.aws/falcosecurity/falco-driver-loader:latest"
workflows:
version: 2
build_and_test:
jobs:
- "build/musl"
- "build/minimal"
- "build/ubuntu-focal"
- "build/ubuntu-focal-debug"
- "build/ubuntu-bionic"
- "build/centos8"
- "build/centos7"
- "build/centos7-debug"
- "tests/integration":
requires:
- "build/centos7"
- "tests/integration-static":
requires:
- "build/musl"
- "tests/driver-loader/integration":
requires:
- "build/centos7"
- "rpm/sign":
context: falco
filters:
tags:
ignore: /.*/
branches:
only: master
requires:
- "tests/integration"
- "publish/packages-dev":
context:
- falco
- test-infra
filters:
tags:
ignore: /.*/
branches:
only: master
requires:
- "rpm/sign"
- "tests/integration-static"
- "publish/packages-deb-dev":
context:
- falco
- test-infra
filters:
tags:
ignore: /.*/
branches:
only: master
requires:
- "tests/integration"
- "publish/docker-dev":
context: falco
filters:
tags:
ignore: /.*/
branches:
only: master
requires:
- "publish/packages-dev"
- "publish/packages-deb-dev"
- "tests/driver-loader/integration"
- "publish/container-images-aws-dev":
context: test-infra # contains Falco AWS credentials
filters:
tags:
ignore: /.*/
branches:
only: master
requires:
- publish/docker-dev
# - "quality/static-analysis" # This is temporarly disabled: https://github.com/falcosecurity/falco/issues/1526
release:
jobs:
- "build/musl":
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- "build/centos7":
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- "rpm/sign":
context: falco
requires:
- "build/centos7"
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- "publish/packages":
context:
- falco
- test-infra
requires:
- "build/musl"
- "rpm/sign"
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- "publish/packages-deb":
context:
- falco
- test-infra
requires:
- "build/centos7"
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- "publish/docker":
context:
- falco
- test-infra
requires:
- "publish/packages"
- "publish/packages-deb"
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- "publish/container-images-aws":
context: test-infra # contains Falco AWS credentials
requires:
- "publish/docker"
filters:
tags:
only: /.*/
branches:
ignore: /.*/

View File

@ -1,16 +1,36 @@
---
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -8
BreakBeforeBraces: Allman
BasedOnStyle: Google
AccessModifierOffset: -4
BreakBeforeBraces: Attach
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
BinPackArguments: false
BinPackParameters: false
ColumnLimit: 100
DerivePointerBinding: false
IndentCaseLabels: false
IndentWidth: 4
SpaceAfterTemplateKeyword: false
TabWidth: 4
UseTab: ForIndentation
BreakConstructorInitializers: AfterColon
ColumnLimit: 0
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
DerivePointerAlignment: true
IndentWidth: 8
SortIncludes: false
SpaceAfterTemplateKeyword: false
SortIncludes: Never
SpaceBeforeCtorInitializerColon: false
SpaceBeforeParens: Never
UseTab: Always
InsertNewlineAtEOF: true
---
Language: Proto
DisableFormat: true
---
Language: JavaScript
DisableFormat: true
---
Language: Java
DisableFormat: true

3
.clang-format-ignore Normal file
View File

@ -0,0 +1,3 @@
# These files contain some JSON schema definitions that are not C++ code
userspace/falco/config_json_schema.h
userspace/engine/rule_json_schema.h

View File

@ -1,119 +0,0 @@
# --------------------------
# General Formatting Options
# --------------------------
# How wide to allow formatted cmake files
line_width = 120
# How many spaces to tab for indent
tab_size = 2
# If arglists are longer than this, break them always
max_subargs_per_line = 3
# If true, separate flow control names from their parentheses with a space
separate_ctrl_name_with_space = False
# If true, separate function names from parentheses with a space
separate_fn_name_with_space = False
# If a statement is wrapped to more than one line, than dangle the closing
# parenthesis on it's own line
dangle_parens = False
# If the statement spelling length (including space and parenthesis is larger
# than the tab width by more than this amoung, then force reject un-nested
# layouts.
max_prefix_chars = 2
# If a candidate layout is wrapped horizontally but it exceeds this many lines,
# then reject the layout.
max_lines_hwrap = 2
# What style line endings to use in the output.
line_ending = 'unix'
# Format command names consistently as 'lower' or 'upper' case
command_case = 'canonical'
# Format keywords consistently as 'lower' or 'upper' case
keyword_case = 'unchanged'
# Specify structure for custom cmake functions
additional_commands = {
"pkg_find": {
"kwargs": {
"PKG": "*"
}
}
}
# A list of command names which should always be wrapped
always_wrap = []
# Specify the order of wrapping algorithms during successive reflow attempts
algorithm_order = [0, 1, 2, 3, 4]
# If true, the argument lists which are known to be sortable will be sorted
# lexicographicall
enable_sort = True
# If true, the parsers may infer whether or not an argument list is sortable
# (without annotation).
autosort = False
# If a comment line starts with at least this many consecutive hash characters,
# then don't lstrip() them off. This allows for lazy hash rulers where the first
# hash char is not separated by space
hashruler_min_length = 10
# A dictionary containing any per-command configuration overrides. Currently
# only `command_case` is supported.
per_command = {}
# --------------------------
# Comment Formatting Options
# --------------------------
# What character to use for bulleted lists
bullet_char = '*'
# What character to use as punctuation after numerals in an enumerated list
enum_char = '.'
# enable comment markup parsing and reflow
enable_markup = True
# If comment markup is enabled, don't reflow the first comment block in each
# listfile. Use this to preserve formatting of your copyright/license
# statements.
first_comment_is_literal = False
# If comment markup is enabled, don't reflow any comment block which matches
# this (regex) pattern. Default is `None` (disabled).
literal_comment_pattern = None
# Regular expression to match preformat fences in comments
# default=r'^\s*([`~]{3}[`~]*)(.*)$'
fence_pattern = '^\\s*([`~]{3}[`~]*)(.*)$'
# Regular expression to match rulers in comments
# default=r'^\s*[^\w\s]{3}.*[^\w\s]{3}$'
ruler_pattern = '^\\s*[^\\w\\s]{3}.*[^\\w\\s]{3}$'
# If true, then insert a space between the first hash char and remaining hash
# chars in a hash ruler, and normalize it's length to fill the column
canonicalize_hashrulers = True
# ---------------------------------
# Miscellaneous Options
# ---------------------------------
# If true, emit the unicode byte-order mark (BOM) at the start of the file
emit_byteorder_mark = False
# Specify the encoding of the input file. Defaults to utf-8.
input_encoding = 'utf-8'
# Specify the encoding of the output file. Defaults to utf-8. Note that cmake
# only claims to support utf-8 so be careful when using anything else
output_encoding = 'utf-8'

254
.cmake-format.json Normal file
View File

@ -0,0 +1,254 @@
{
"_help_format": "Options affecting formatting.",
"format": {
"_help_disable": [
"Disable formatting entirely, making cmake-format a no-op"
],
"disable": false,
"_help_line_width": [
"How wide to allow formatted cmake files"
],
"line_width": 100,
"_help_tab_size": [
"How many spaces to tab for indent"
],
"tab_size": 4,
"_help_use_tabchars": [
"If true, lines are indented using tab characters (utf-8",
"0x09) instead of <tab_size> space characters (utf-8 0x20).",
"In cases where the layout would require a fractional tab",
"character, the behavior of the fractional indentation is",
"governed by <fractional_tab_policy>"
],
"use_tabchars": true,
"_help_fractional_tab_policy": [
"If <use_tabchars> is True, then the value of this variable",
"indicates how fractional indentions are handled during",
"whitespace replacement. If set to 'use-space', fractional",
"indentation is left as spaces (utf-8 0x20). If set to",
"`round-up` fractional indentation is replaced with a single",
"tab character (utf-8 0x09) effectively shifting the column",
"to the next tabstop"
],
"fractional_tab_policy": "use-space",
"_help_max_subgroups_hwrap": [
"If an argument group contains more than this many sub-groups",
"(parg or kwarg groups) then force it to a vertical layout."
],
"max_subgroups_hwrap": 2,
"_help_max_pargs_hwrap": [
"If a positional argument group contains more than this many",
"arguments, then force it to a vertical layout."
],
"max_pargs_hwrap": 6,
"_help_max_rows_cmdline": [
"If a cmdline positional group consumes more than this many",
"lines without nesting, then invalidate the layout (and nest)"
],
"max_rows_cmdline": 2,
"_help_separate_ctrl_name_with_space": [
"If true, separate flow control names from their parentheses",
"with a space"
],
"separate_ctrl_name_with_space": false,
"_help_separate_fn_name_with_space": [
"If true, separate function names from parentheses with a",
"space"
],
"separate_fn_name_with_space": false,
"_help_dangle_parens": [
"If a statement is wrapped to more than one line, than dangle",
"the closing parenthesis on its own line."
],
"dangle_parens": true,
"_help_dangle_align": [
"If the trailing parenthesis must be 'dangled' on its on",
"line, then align it to this reference: `prefix`: the start",
"of the statement, `prefix-indent`: the start of the",
"statement, plus one indentation level, `child`: align to",
"the column of the arguments"
],
"dangle_align": "prefix",
"_help_min_prefix_chars": [
"If the statement spelling length (including space and",
"parenthesis) is smaller than this amount, then force reject",
"nested layouts."
],
"min_prefix_chars": 4,
"_help_max_prefix_chars": [
"If the statement spelling length (including space and",
"parenthesis) is larger than the tab width by more than this",
"amount, then force reject un-nested layouts."
],
"max_prefix_chars": 10,
"_help_max_lines_hwrap": [
"If a candidate layout is wrapped horizontally but it exceeds",
"this many lines, then reject the layout."
],
"max_lines_hwrap": 2,
"_help_line_ending": [
"What style line endings to use in the output."
],
"line_ending": "unix",
"_help_command_case": [
"Format command names consistently as 'lower' or 'upper' case"
],
"command_case": "canonical",
"_help_keyword_case": [
"Format keywords consistently as 'lower' or 'upper' case"
],
"keyword_case": "unchanged",
"_help_always_wrap": [
"A list of command names which should always be wrapped"
],
"always_wrap": [],
"_help_enable_sort": [
"If true, the argument lists which are known to be sortable",
"will be sorted lexicographicall"
],
"enable_sort": true,
"_help_autosort": [
"If true, the parsers may infer whether or not an argument",
"list is sortable (without annotation)."
],
"autosort": false,
"_help_require_valid_layout": [
"By default, if cmake-format cannot successfully fit",
"everything into the desired linewidth it will apply the",
"last, most agresive attempt that it made. If this flag is",
"True, however, cmake-format will print error, exit with non-",
"zero status code, and write-out nothing"
],
"require_valid_layout": false,
"_help_layout_passes": [
"A dictionary mapping layout nodes to a list of wrap",
"decisions. See the documentation for more information."
],
"layout_passes": {}
},
"_help_markup": "Options affecting comment reflow and formatting.",
"markup": {
"_help_bullet_char": [
"What character to use for bulleted lists"
],
"bullet_char": "*",
"_help_enum_char": [
"What character to use as punctuation after numerals in an",
"enumerated list"
],
"enum_char": ".",
"_help_first_comment_is_literal": [
"If comment markup is enabled, don't reflow the first comment",
"block in each listfile. Use this to preserve formatting of",
"your copyright/license statements."
],
"first_comment_is_literal": false,
"_help_literal_comment_pattern": [
"If comment markup is enabled, don't reflow any comment block",
"which matches this (regex) pattern. Default is `None`",
"(disabled)."
],
"literal_comment_pattern": null,
"_help_fence_pattern": [
"Regular expression to match preformat fences in comments",
"default= ``r'^\\s*([`~]{3}[`~]*)(.*)$'``"
],
"fence_pattern": "^\\s*([`~]{3}[`~]*)(.*)$",
"_help_ruler_pattern": [
"Regular expression to match rulers in comments default=",
"``r'^\\s*[^\\w\\s]{3}.*[^\\w\\s]{3}$'``"
],
"ruler_pattern": "^\\s*[^\\w\\s]{3}.*[^\\w\\s]{3}$",
"_help_explicit_trailing_pattern": [
"If a comment line matches starts with this pattern then it",
"is explicitly a trailing comment for the preceding",
"argument. Default is '#<'"
],
"explicit_trailing_pattern": "#<",
"_help_hashruler_min_length": [
"If a comment line starts with at least this many consecutive",
"hash characters, then don't lstrip() them off. This allows",
"for lazy hash rulers where the first hash char is not",
"separated by space"
],
"hashruler_min_length": 10,
"_help_canonicalize_hashrulers": [
"If true, then insert a space between the first hash char and",
"remaining hash chars in a hash ruler, and normalize its",
"length to fill the column"
],
"canonicalize_hashrulers": true,
"_help_enable_markup": [
"enable comment markup parsing and reflow"
],
"enable_markup": true
},
"_help_lint": "Options affecting the linter",
"lint": {
"_help_disabled_codes": [
"a list of lint codes to disable"
],
"disabled_codes": [],
"_help_function_pattern": [
"regular expression pattern describing valid function names"
],
"function_pattern": "[0-9a-z_]+",
"_help_macro_pattern": [
"regular expression pattern describing valid macro names"
],
"macro_pattern": "[0-9A-Z_]+",
"_help_global_var_pattern": [
"regular expression pattern describing valid names for",
"variables with global (cache) scope"
],
"global_var_pattern": "[A-Z][0-9A-Z_]+",
"_help_internal_var_pattern": [
"regular expression pattern describing valid names for",
"variables with global scope (but internal semantic)"
],
"internal_var_pattern": "_[A-Z][0-9A-Z_]+",
"_help_local_var_pattern": [
"regular expression pattern describing valid names for",
"variables with local scope"
],
"local_var_pattern": "[a-z][a-z0-9_]+",
"_help_private_var_pattern": [
"regular expression pattern describing valid names for",
"privatedirectory variables"
],
"private_var_pattern": "_[0-9a-z_]+",
"_help_public_var_pattern": [
"regular expression pattern describing valid names for public",
"directory variables"
],
"public_var_pattern": "[A-Z][0-9A-Z_]+",
"_help_argument_var_pattern": [
"regular expression pattern describing valid names for",
"function/macro arguments and loop variables."
],
"argument_var_pattern": "[a-z][a-z0-9_]+",
"_help_keyword_pattern": [
"regular expression pattern describing valid names for",
"keywords used in functions or macros"
],
"keyword_pattern": "[A-Z][0-9A-Z_]+",
"_help_max_conditionals_custom_parser": [
"In the heuristic for C0201, how many conditionals to match",
"within a loop in before considering the loop a parser."
],
"max_conditionals_custom_parser": 2,
"_help_min_statement_spacing": [
"Require at least this many newlines between statements"
],
"min_statement_spacing": 1,
"_help_max_statement_spacing": [
"Require no more than this many newlines between statements"
],
"max_statement_spacing": 2,
"max_returns": 6,
"max_branches": 12,
"max_arguments": 5,
"max_localvars": 15,
"max_statements": 50
}
}

4
.codespellignore Normal file
View File

@ -0,0 +1,4 @@
aks
creat
chage
ro

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
*
!config/
!docker/

2
.git-blame-ignore-revs Normal file
View File

@ -0,0 +1,2 @@
# This commit formatted the Falco code for the first time.
50b98b30e588eadce641136da85bc94a60eb6a3d

View File

@ -1,8 +1,7 @@
<!-- Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines in the [CONTRIBUTING.md](CONTRIBUTING.md) file and learn how to compile Falco from source [here](https://falco.org/docs/source).
<!-- Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines in the https://github.com/falcosecurity/.github/blob/main/CONTRIBUTING.md file.
2. Please label this pull request according to what type of issue you are addressing.
3. . Please add a release note!
3. Please add a release note!
4. If the PR is unfinished while opening it specify a wip in the title before the actual title, for example, "wip: my awesome feature"
-->
@ -22,11 +21,7 @@
> /kind feature
> If contributing rules or changes to rules, please make sure to also uncomment one of the following line:
> /kind rule-update
> /kind rule-create
> /kind release
<!--
Please remove the leading whitespace before the `/kind <>` you uncommented.
@ -40,12 +35,12 @@ Please remove the leading whitespace before the `/kind <>` you uncommented.
> /area engine
> /area rules
> /area tests
> /area proposals
> /area CI
<!--
Please remove the leading whitespace before the `/area <>` you uncommented.
-->
@ -67,11 +62,13 @@ Fixes #
**Does this PR introduce a user-facing change?**:
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below.
If the PR requires additional action from users switching to the new release, prepend the string "action required:".
For example, `action required: change the API interface of the rule engine`.
If NO, just write "NONE" in the release-note block below.
If YES, a release note is required, enter your release note in the block below.
The convention is the same as for commit messages: https://github.com/falcosecurity/.github/blob/main/CONTRIBUTING.md#commit-convention
If the PR introduces non-backward compatible changes, please add a line starting with "BREAKING CHANGE:" and describe what changed.
For example, `BREAKING CHANGE: the API interface of the rule engine has changed`.
Your note will be included in the changelog.
-->
```release-note

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2019 The Falco Authors.
# Copyright (C) 2023 The Falco Authors.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
@ -14,6 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
- list: my_list
items: [not-cat]
append: true
version: 2
updates:
- package-ecosystem: gitsubmodule
schedule:
interval: "daily"
directory: /

21
.github/release_template.md vendored Normal file
View File

@ -0,0 +1,21 @@
[![LIBS](https://img.shields.io/badge/LIBS-LIBSVER-yellow)](https://github.com/falcosecurity/libs/releases/tag/LIBSVER)
[![DRIVER](https://img.shields.io/badge/DRIVER-DRIVERVER-yellow)](https://github.com/falcosecurity/libs/releases/tag/DRIVERVER)
| Packages | Download |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| rpm-x86_64 | [![rpm](https://img.shields.io/badge/Falco-FALCOVER-%2300aec7?style=flat-square)](https://download.falco.org/packages/rpmFALCOBUCKET/falco-FALCOVER-x86_64.rpm) |
| deb-x86_64 | [![deb](https://img.shields.io/badge/Falco-FALCOVER-%2300aec7?style=flat-square)](https://download.falco.org/packages/debFALCOBUCKET/stable/falco-FALCOVER-x86_64.deb) |
| tgz-x86_64 | [![tgz](https://img.shields.io/badge/Falco-FALCOVER-%2300aec7?style=flat-square)](https://download.falco.org/packages/binFALCOBUCKET/x86_64/falco-FALCOVER-x86_64.tar.gz) |
| tgz-static-x86_64 | [![tgz-static](https://img.shields.io/badge/Falco-FALCOVER-%2300aec7?style=flat-square)](https://download.falco.org/packages/binFALCOBUCKET/x86_64/falco-FALCOVER-static-x86_64.tar.gz) |
| rpm-aarch64 | [![rpm](https://img.shields.io/badge/Falco-FALCOVER-%2300aec7?style=flat-square)](https://download.falco.org/packages/rpmFALCOBUCKET/falco-FALCOVER-aarch64.rpm) |
| deb-aarch64 | [![deb](https://img.shields.io/badge/Falco-FALCOVER-%2300aec7?style=flat-square)](https://download.falco.org/packages/debFALCOBUCKET/stable/falco-FALCOVER-aarch64.deb) |
| tgz-aarch64 | [![tgz](https://img.shields.io/badge/Falco-FALCOVER-%2300aec7?style=flat-square)](https://download.falco.org/packages/binFALCOBUCKET/aarch64/falco-FALCOVER-aarch64.tar.gz) |
| Images |
|---------------------------------------------------------------------------|
| `docker pull docker.io/falcosecurity/falco:FALCOVER` |
| `docker pull public.ecr.aws/falcosecurity/falco:FALCOVER` |
| `docker pull docker.io/falcosecurity/falco-driver-loader:FALCOVER` |
| `docker pull docker.io/falcosecurity/falco-driver-loader:FALCOVER-buster` |
| `docker pull docker.io/falcosecurity/falco:FALCOVER-debian` |

63
.github/workflows/bump-libs.yaml vendored Normal file
View File

@ -0,0 +1,63 @@
---
name: Bump Libs
on:
workflow_dispatch:
schedule:
- cron: '30 6 * * 1' # on each monday 6:30
# Checks if any concurrent jobs is running for kernels CI and eventually cancel it.
concurrency:
group: bump-libs-ci
cancel-in-progress: true
jobs:
bump-libs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Download libs master tar.gz
run: |
wget https://github.com/falcosecurity/libs/archive/refs/heads/master.tar.gz
- name: Store libs hash and shasum
id: store
run: |
gunzip -c master.tar.gz > master.tar
commit=$(cat master.tar | git get-tar-commit-id)
echo "COMMIT=$commit" >> "$GITHUB_OUTPUT"
wget https://github.com/falcosecurity/libs/archive/$commit.tar.gz
echo "SHASUM=$(sha256sum $commit.tar.gz | awk '{print $1}')" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: falco
- name: Bump libs version and hash
run: |
cd falco
sed -i -E '45s/FALCOSECURITY_LIBS_VERSION "(.+)"/FALCOSECURITY_LIBS_VERSION "${{ steps.store.outputs.COMMIT }}"/' cmake/modules/falcosecurity-libs.cmake
sed -i -E '47s/"SHA256=(.+)"/"SHA256=${{ steps.store.outputs.SHASUM }}"/' cmake/modules/falcosecurity-libs.cmake
sed -i -E '38s/DRIVER_VERSION "(.+)"/DRIVER_VERSION "${{ steps.store.outputs.COMMIT }}"/' cmake/modules/driver.cmake
sed -i -E '40s/"SHA256=(.+)"/"SHA256=${{ steps.store.outputs.SHASUM }}"/' cmake/modules/driver.cmake
- name: Create Pull Request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
path: falco
signoff: true
base: master
branch: update/libs
title: 'update(cmake): update libs and driver to latest master'
body: |
This PR updates libs and driver to latest commit.
/kind release
/area build
```release-note
NONE
```
commit-message: 'update(cmake): update libs and driver to latest master.'
token: ${{ secrets.GITHUB_TOKEN }}

157
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,157 @@
name: CI Build
on:
pull_request:
branches:
- master
- release/*
workflow_dispatch:
# Checks if any concurrent jobs under the same pull request or branch are being executed
# NOTE: this will cancel every workflow that is being ran against a PR as group is just the github ref (without the workflow name)
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
fetch-version:
uses: ./.github/workflows/reusable_fetch_version.yaml
build-dev-packages-x86_64:
needs: [fetch-version]
uses: ./.github/workflows/reusable_build_packages.yaml
with:
arch: x86_64
version: ${{ needs.fetch-version.outputs.version }}
enable_debug: true
enable_sanitizers: true
use_mimalloc: true
build-dev-packages-arm64:
needs: [fetch-version]
uses: ./.github/workflows/reusable_build_packages.yaml
with:
arch: aarch64
version: ${{ needs.fetch-version.outputs.version }}
enable_debug: true
use_mimalloc: true
test-dev-packages:
needs: [fetch-version, build-dev-packages-x86_64]
uses: ./.github/workflows/reusable_test_packages.yaml
# See https://github.com/falcosecurity/falco/pull/3482
# Since musl build does not support dynamically loaded plugins,
# many tests would fail (the ones using `container.foo` fields).
# Disable tests on static builds for now.
# strategy:
# fail-fast: false
# matrix:
# static: ["static", ""]
with:
arch: x86_64
# sanitizers: ${{ matrix.static == '' && true || false }}
sanitizers: true
# static: ${{ matrix.static != '' && true || false }}
version: ${{ needs.fetch-version.outputs.version }}
test-dev-packages-arm64:
needs: [fetch-version, build-dev-packages-arm64]
uses: ./.github/workflows/reusable_test_packages.yaml
with:
arch: aarch64
version: ${{ needs.fetch-version.outputs.version }}
build-dev-minimal:
uses: ./.github/workflows/reusable_build_dev.yaml
with:
arch: x86_64
git_ref: ${{ github.event.pull_request.head.sha }}
minimal: true
build_type: Debug
build-dev-minimal-arm64:
uses: ./.github/workflows/reusable_build_dev.yaml
with:
arch: aarch64
git_ref: ${{ github.event.pull_request.head.sha }}
minimal: true
build_type: Debug
# builds using system deps, checking out the PR's code
# note: this also runs a command that generates an output of form: "<engine_version> <some_hash>",
# of which <some_hash> is computed by hashing in order the following:
# - Driver schema version supported by the built-in falcosecurity/libs
# - The supported event types usable in Falco rules (evt.type=xxx)
# - The supported rules fields with their name, type, and description
build-dev:
uses: ./.github/workflows/reusable_build_dev.yaml
with:
arch: x86_64
git_ref: ${{ github.event.pull_request.head.sha }}
minimal: false
sanitizers: true
build_type: Debug
cmd: "echo $(build/userspace/falco/falco -c ./falco.yaml --version | grep 'Engine:' | awk '{print $2}') $(echo $(build/userspace/falco/falco -c ./falco.yaml --version | grep 'Schema version:' | awk '{print $3}') $(build/userspace/falco/falco -c ./falco.yaml --list --markdown | grep '^`' | sort) $(build/userspace/falco/falco -c ./falco.yaml --list-events | sort) | sha256sum)"
# checks the falco engine checksum for consistency
check-engine-checksum:
runs-on: ubuntu-latest
needs: [build-dev]
steps:
- name: Checkout PR head ref
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Check Engine checksum
run: |
prev_hash=$(grep CHECKSUM "./userspace/engine/falco_engine_version.h" | awk '{print $3}' | sed -e 's/"//g')
cur_hash=$(echo "${{ needs.build-dev.outputs.cmdout }}" | cut -d ' ' -f 2)
echo "encoded checksum: $prev_hash"
echo "current checksum: $cur_hash"
if [ $prev_hash != $cur_hash ]; then
echo "current engine checksum differs from the one encoded in userspace/engine/falco_engine_version.h"
exit 1
else
echo "current and encoded engine checksum are matching"
fi
# checks the falco engine version and enforce bumping when necessary
check-engine-version:
runs-on: ubuntu-latest
needs: [build-dev]
steps:
- name: Checkout base ref
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
ref: ${{ github.base_ref }}
- name: Check Engine version
run: |
base_hash=$(grep CHECKSUM "./userspace/engine/falco_engine_version.h" | awk '{print $3}' | sed -e 's/"//g')
base_engine_ver_major=$(grep ENGINE_VERSION_MAJOR "./userspace/engine/falco_engine_version.h" | head -n 1 | awk '{print $3}' | sed -e 's/(//g' -e 's/)//g')
base_engine_ver_minor=$(grep ENGINE_VERSION_MINOR "./userspace/engine/falco_engine_version.h" | head -n 1 | awk '{print $3}' | sed -e 's/(//g' -e 's/)//g')
base_engine_ver_patch=$(grep ENGINE_VERSION_PATCH "./userspace/engine/falco_engine_version.h" | head -n 1 | awk '{print $3}' | sed -e 's/(//g' -e 's/)//g')
base_engine_ver="${base_engine_ver_major}.${base_engine_ver_minor}.${base_engine_ver_patch}"
cur_hash=$(echo "${{ needs.build-dev.outputs.cmdout }}" | cut -d ' ' -f 2)
cur_engine_ver=$(echo "${{ needs.build-dev.outputs.cmdout }}" | cut -d ' ' -f 1)
echo "baseref checksum: $base_hash"
echo "baseref engine version: $base_engine_ver"
echo "headref checksum: $cur_hash"
echo "headref engine version: $cur_engine_ver"
if [ "$base_hash" != "$cur_hash" ]; then
echo "engine checksum for baseref and headref differ"
if [ "$base_engine_ver" == "$cur_engine_ver" ]; then
echo "engine version must be bumped"
exit 1
else
echo "engine version for baseref and headref differ too, so no bump is required"
fi
fi

73
.github/workflows/codeql.yaml vendored Normal file
View File

@ -0,0 +1,73 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
permissions:
contents: read
jobs:
analyze:
name: Analyze
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@47b3d888fe66b639e431abf22ebca059152f1eea # v3.24.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- name: Update base image
run: sudo apt update -y
- name: Install build dependencies
run: sudo DEBIAN_FRONTEND=noninteractive apt install libssl-dev libc-ares-dev libprotobuf-dev protobuf-compiler libyaml-cpp-dev libgrpc++-dev protobuf-compiler-grpc rpm libelf-dev cmake build-essential libcurl4-openssl-dev linux-headers-$(uname -r) clang llvm git -y
- name: Prepare project
run: |
cmake -B build -S . -DBUILD_BPF=On -DBUILD_FALCO_MODERN_BPF=Off -DUSE_BUNDLED_DEPS=Off -DUSE_BUNDLED_NLOHMANN_JSON=On -DUSE_BUNDLED_CXXOPTS=On -DUSE_BUNDLED_CPPHTTPLIB=On
- name: Build
run: |
KERNELDIR=/lib/modules/$(uname -r)/build cmake --build build -j4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@47b3d888fe66b639e431abf22ebca059152f1eea # v3.24.5

18
.github/workflows/codespell.yml vendored Normal file
View File

@ -0,0 +1,18 @@
name: Codespell
on:
pull_request:
permissions:
contents: read
jobs:
codespell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: codespell-project/actions-codespell@94259cd8be02ad2903ba34a22d9c13de21a74461 # v2.0
with:
skip: .git
ignore_words_file: .codespellignore
check_filenames: true
check_hidden: false

View File

@ -0,0 +1,44 @@
# NOTE: it is UNSAFE to run ANY kind of script when using the pull_request_target trigger!
# DO NOT TOUCH THIS FILE UNLESS THE TRIGGER IS CHANGED.
# See warning in https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
name: Engine version checks (weak)
on:
pull_request_target:
paths:
- 'userspace/engine/*.cpp'
- 'userspace/engine/*.h'
permissions:
contents: read
jobs:
paths-filter:
runs-on: ubuntu-latest
outputs:
engine_version_changed: ${{ steps.filter.outputs.engine_version }}
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: filter
with:
filters: |
engine_version:
- 'userspace/engine/falco_engine_version.h'
check-engine-version-weak:
runs-on: ubuntu-22.04
permissions:
pull-requests: write
needs: paths-filter
if: needs.paths-filter.outputs.engine_version_changed == 'false'
steps:
- name: Check driver Falco engine version
uses: mshick/add-pr-comment@7c0890544fb33b0bdd2e59467fbacb62e028a096 # v2.8.1
with:
message: |
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](https://github.com/falcosecurity/falco/blob/master/RELEASE.md#falco-repo-this-repo).
/hold

38
.github/workflows/format.yaml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Format code
on:
pull_request:
push:
branches:
- master
- "release/**"
jobs:
format:
name: format code 🐲
runs-on: ubuntu-22.04
steps:
- name: Checkout repository 🎉
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
- name: Install deps ⛓️
run: |
sudo apt update -y
sudo apt install -y --no-install-recommends ca-certificates pip git
pip install pre-commit
- name: Run pre-commit ©️
run: |
pre-commit run --all-files
- name: Generate the git-diff 🚒
if: failure()
run: git diff > format_diff.patch
- name: Upload the git diff artifact 📦
if: failure()
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: format_diff.patch
path: ./format_diff.patch

29
.github/workflows/insecure-api.yaml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Insecure API check
on:
pull_request:
branches:
- master
- 'release/**'
- 'maintainers/**'
permissions:
contents: read
jobs:
insecure-api:
name: check-insecure-api
runs-on: ubuntu-latest
container:
image: semgrep/semgrep:1.85.0@sha256:b4c2272e0a2e59ca551ff96d3bbae657bd2b7356e339af557b27a96d9e751544
steps:
- name: Checkout Falco ⤵️
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
- name: Scan PR for insecure API usage 🕵️
run: |
semgrep scan \
--error \
--metrics=off \
--baseline-commit ${{ github.event.pull_request.base.sha }} \
--config=./semgrep

87
.github/workflows/master.yaml vendored Normal file
View File

@ -0,0 +1,87 @@
name: Dev Packages and Docker images
on:
push:
branches: [master]
# Checks if any concurrent jobs is running for master CI and eventually cancel it
concurrency:
group: ci-master
cancel-in-progress: true
jobs:
fetch-version:
uses: ./.github/workflows/reusable_fetch_version.yaml
build-dev-packages:
needs: [fetch-version]
uses: ./.github/workflows/reusable_build_packages.yaml
with:
arch: x86_64
version: ${{ needs.fetch-version.outputs.version }}
secrets: inherit
build-dev-packages-arm64:
needs: [fetch-version]
uses: ./.github/workflows/reusable_build_packages.yaml
with:
arch: aarch64
version: ${{ needs.fetch-version.outputs.version }}
secrets: inherit
test-dev-packages:
needs: [fetch-version, build-dev-packages]
uses: ./.github/workflows/reusable_test_packages.yaml
# See https://github.com/falcosecurity/falco/pull/3482
# Since musl build does not support dynamically loaded plugins,
# many tests would fail (the ones using `container.foo` fields).
# Disable tests on static builds for now.
# strategy:
# fail-fast: false
# matrix:
# static: ["static", ""]
with:
arch: x86_64
# static: ${{ matrix.static != '' && true || false }}
version: ${{ needs.fetch-version.outputs.version }}
test-dev-packages-arm64:
needs: [fetch-version, build-dev-packages-arm64]
uses: ./.github/workflows/reusable_test_packages.yaml
with:
arch: aarch64
version: ${{ needs.fetch-version.outputs.version }}
publish-dev-packages:
needs: [fetch-version, test-dev-packages, test-dev-packages-arm64]
uses: ./.github/workflows/reusable_publish_packages.yaml
with:
bucket_suffix: '-dev'
version: ${{ needs.fetch-version.outputs.version }}
secrets: inherit
build-dev-docker:
needs: [fetch-version, publish-dev-packages]
uses: ./.github/workflows/reusable_build_docker.yaml
with:
arch: x86_64
bucket_suffix: '-dev'
version: ${{ needs.fetch-version.outputs.version }}
tag: master
secrets: inherit
build-dev-docker-arm64:
needs: [fetch-version, publish-dev-packages]
uses: ./.github/workflows/reusable_build_docker.yaml
with:
arch: aarch64
bucket_suffix: '-dev'
version: ${{ needs.fetch-version.outputs.version }}
tag: master
secrets: inherit
publish-dev-docker:
needs: [fetch-version, build-dev-docker, build-dev-docker-arm64]
uses: ./.github/workflows/reusable_publish_docker.yaml
with:
tag: master
secrets: inherit

193
.github/workflows/release.yaml vendored Normal file
View File

@ -0,0 +1,193 @@
name: Release Packages and Docker images
on:
release:
types: [published]
# Checks if any concurrent jobs is running for release CI and eventually cancel it.
concurrency:
group: ci-release
cancel-in-progress: true
jobs:
release-settings:
runs-on: ubuntu-latest
outputs:
is_latest: ${{ steps.get_settings.outputs.is_latest }}
bucket_suffix: ${{ steps.get_settings.outputs.bucket_suffix }}
steps:
- name: Get latest release
uses: rez0n/actions-github-release@27a57820ee808f8fd940c8a9d1f7188f854aa2b5 # v2.0
id: latest_release
env:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
type: "stable"
- name: Get settings for this release
id: get_settings
shell: python
run: |
import os
import re
import sys
semver_no_meta = '''^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?$'''
tag_name = '${{ github.event.release.tag_name }}'
is_valid_version = re.match(semver_no_meta, tag_name) is not None
if not is_valid_version:
print(f'Release version {tag_name} is not a valid full or pre-release. See RELEASE.md for more information.')
sys.exit(1)
is_prerelease = '-' in tag_name
# Safeguard: you need to both set "latest" in GH and not have suffixes to overwrite latest
is_latest = '${{ steps.latest_release.outputs.release }}' == tag_name and not is_prerelease
bucket_suffix = '-dev' if is_prerelease else ''
with open(os.environ['GITHUB_OUTPUT'], 'a') as ofp:
print(f'is_latest={is_latest}'.lower(), file=ofp)
print(f'bucket_suffix={bucket_suffix}', file=ofp)
build-packages:
needs: [release-settings]
uses: ./.github/workflows/reusable_build_packages.yaml
with:
arch: x86_64
version: ${{ github.event.release.tag_name }}
use_jemalloc: true
secrets: inherit
build-packages-arm64:
needs: [release-settings]
uses: ./.github/workflows/reusable_build_packages.yaml
with:
arch: aarch64
version: ${{ github.event.release.tag_name }}
use_jemalloc: true
secrets: inherit
test-packages:
needs: [release-settings, build-packages]
uses: ./.github/workflows/reusable_test_packages.yaml
# See https://github.com/falcosecurity/falco/pull/3482
# Since musl build does not support dynamically loaded plugins,
# many tests would fail (the ones using `container.foo` fields).
# Disable tests on static builds for now.
# strategy:
# fail-fast: false
# matrix:
# static: ["static", ""]
with:
arch: x86_64
# static: ${{ matrix.static != '' && true || false }}
version: ${{ github.event.release.tag_name }}
test-packages-arm64:
needs: [release-settings, build-packages-arm64]
uses: ./.github/workflows/reusable_test_packages.yaml
with:
arch: aarch64
version: ${{ github.event.release.tag_name }}
publish-packages:
needs: [release-settings, test-packages, test-packages-arm64]
uses: ./.github/workflows/reusable_publish_packages.yaml
with:
bucket_suffix: ${{ needs.release-settings.outputs.bucket_suffix }}
version: ${{ github.event.release.tag_name }}
secrets: inherit
# Both build-docker and its arm64 counterpart require build-packages because they use its output
build-docker:
needs: [release-settings, build-packages, publish-packages]
uses: ./.github/workflows/reusable_build_docker.yaml
with:
arch: x86_64
bucket_suffix: ${{ needs.release-settings.outputs.bucket_suffix }}
version: ${{ github.event.release.tag_name }}
tag: ${{ github.event.release.tag_name }}
secrets: inherit
build-docker-arm64:
needs: [release-settings, build-packages, publish-packages]
uses: ./.github/workflows/reusable_build_docker.yaml
with:
arch: aarch64
bucket_suffix: ${{ needs.release-settings.outputs.bucket_suffix }}
version: ${{ github.event.release.tag_name }}
tag: ${{ github.event.release.tag_name }}
secrets: inherit
publish-docker:
needs: [release-settings, build-docker, build-docker-arm64]
uses: ./.github/workflows/reusable_publish_docker.yaml
secrets: inherit
with:
is_latest: ${{ needs.release-settings.outputs.is_latest == 'true' }}
tag: ${{ github.event.release.tag_name }}
sign: true
release-body:
needs: [release-settings, publish-docker]
if: ${{ needs.release-settings.outputs.is_latest == 'true' }} # only for latest releases
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Extract LIBS and DRIVER versions
run: |
cp .github/release_template.md release-body.md
LIBS_VERS=$(cat cmake/modules/falcosecurity-libs.cmake | grep 'set(FALCOSECURITY_LIBS_VERSION' | tail -n1 | grep -o '[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*')
DRIVER_VERS=$(cat cmake/modules/driver.cmake | grep 'set(DRIVER_VERSION' | tail -n1 | grep -o '[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*+driver')
sed -i s/LIBSVER/$LIBS_VERS/g release-body.md
sed -i s/DRIVERVER/$DRIVER_VERS/g release-body.md
- name: Append release matrixes
run: |
sed -i s/FALCOBUCKET/${{ needs.release-settings.outputs.bucket_suffix }}/g release-body.md
sed -i s/FALCOVER/${{ github.event.release.tag_name }}/g release-body.md
- name: Generate release notes
uses: leodido/rn2md@9c351d81278644c0e17b1ca68edbdba305276c73
with:
milestone: ${{ github.event.release.tag_name }}
output: ./notes.md
- name: Merge release notes to pre existent body
run: cat notes.md >> release-body.md
- name: Attach release creator to release body
run: |
echo "" >> release-body.md
echo "#### Release Manager @${{ github.event.release.author.login }}" >> release-body.md
- name: Download debug symbols for Falco x86_64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: falco-${{ github.event.release.tag_name }}-x86_64.debug
- name: Rename x86_64 debug symbols
run: mv falco.debug falco-x86_64.debug
- name: Download debug symbols for Falco aarch64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: falco-${{ github.event.release.tag_name }}-aarch64.debug
- name: Rename aarch64 debug symbols
run: mv falco.debug falco-aarch64.debug
- name: Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
body_path: ./release-body.md
tag_name: ${{ github.event.release.tag_name }}
name: ${{ github.event.release.name }}
files: |
falco-x86_64.debug
falco-aarch64.debug

View File

@ -0,0 +1,93 @@
# This is a reusable workflow used by the master CI
on:
workflow_call:
outputs:
cmdout:
description: "Post-build command output"
value: ${{ jobs.build-and-test.outputs.cmdout }}
inputs:
arch:
description: x86_64 or aarch64
required: true
type: string
minimal:
description: Minimal build
required: true
type: boolean
sanitizers:
description: Enable sanitizer support
required: false
default: false
type: boolean
build_type:
description: One of 'Debug' or 'Release'
required: true
type: string
git_ref:
description: Git ref used for checking out the code
required: true
type: string
cmd:
description: If defined, this command is executed after a successful build and its output is set in the `cmdout` output
required: false
default: ''
type: string
permissions:
contents: read
jobs:
build-and-test:
# See https://github.com/actions/runner/issues/409#issuecomment-1158849936
runs-on: ${{ (inputs.arch == 'aarch64' && 'ubuntu-22.04-arm') || 'ubuntu-22.04' }}
outputs:
cmdout: ${{ steps.run_cmd.outputs.out }}
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}
- name: Update base image
run: sudo apt update -y
- name: Install build dependencies
run: sudo DEBIAN_FRONTEND=noninteractive apt install libelf-dev libyaml-cpp-dev cmake build-essential git -y
- name: Install build dependencies (non-minimal)
if: inputs.minimal != true
run: sudo DEBIAN_FRONTEND=noninteractive apt install libssl-dev libc-ares-dev libprotobuf-dev protobuf-compiler libgrpc++-dev protobuf-compiler-grpc rpm libcurl4-openssl-dev linux-headers-$(uname -r) clang llvm -y
- name: Prepare project
run: |
cmake -B build -S .\
-DBUILD_FALCO_UNIT_TESTS=On \
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \
-DBUILD_FALCO_MODERN_BPF=Off \
-DBUILD_BPF=${{ inputs.minimal == true && 'OFF' || 'ON' }} \
-DBUILD_DRIVER=${{ inputs.minimal == true && 'OFF' || 'ON' }} \
-DMINIMAL_BUILD=${{ inputs.minimal == true && 'ON' || 'OFF' }} \
-DUSE_ASAN=${{ inputs.sanitizers == true && 'ON' || 'OFF' }} \
-DUSE_UBSAN=${{ inputs.sanitizers == true && 'ON' || 'OFF' }} \
-DUSE_BUNDLED_DEPS=Off \
-DUSE_BUNDLED_NLOHMANN_JSON=On \
-DUSE_BUNDLED_CXXOPTS=On \
-DUSE_BUNDLED_CPPHTTPLIB=On \
- name: Build
run: |
KERNELDIR=/lib/modules/$(uname -r)/build cmake --build build -j4
- name: Run unit tests
run: |
pushd build
sudo ./unit_tests/falco_unit_tests
popd
- name: Run command
id: run_cmd
if: inputs.cmd != ''
run: |
OUT=$(${{ inputs.cmd }})
echo "out=${OUT}" >> $GITHUB_OUTPUT

View File

@ -0,0 +1,84 @@
# This is a reusable workflow used by master and release CI
on:
workflow_call:
inputs:
arch:
description: x86_64 or aarch64
required: true
type: string
bucket_suffix:
description: bucket suffix for packages
required: false
default: ''
type: string
version:
description: The Falco version to use when building images
required: true
type: string
tag:
description: The tag to use (e.g. "master" or "0.35.0")
required: true
type: string
# Here we just build all docker images as tarballs,
# then we upload all the tarballs to be later downloaded by reusable_publish_docker workflow.
# In this way, we don't need to publish any arch specific image,
# and this "build" workflow is actually only building images.
permissions:
contents: read
jobs:
build-docker:
# See https://github.com/actions/runner/issues/409#issuecomment-1158849936
runs-on: ${{ (inputs.arch == 'aarch64' && 'ubuntu-22.04-arm') || 'ubuntu-latest' }}
env:
TARGETARCH: ${{ (inputs.arch == 'aarch64' && 'arm64') || 'amd64' }}
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Build falco image
run: |
docker build -f docker/falco/Dockerfile -t docker.io/falcosecurity/falco:${{ inputs.arch }}-${{ inputs.tag }} \
--build-arg VERSION_BUCKET=bin${{ inputs.bucket_suffix }} \
--build-arg FALCO_VERSION=${{ inputs.version }} \
--build-arg TARGETARCH=${TARGETARCH} \
.
docker save docker.io/falcosecurity/falco:${{ inputs.arch }}-${{ inputs.tag }} --output /tmp/falco-${{ inputs.arch }}.tar
- name: Build falco-debian image
run: |
docker build -f docker/falco-debian/Dockerfile -t docker.io/falcosecurity/falco:${{ inputs.arch }}-${{ inputs.tag }}-debian \
--build-arg VERSION_BUCKET=deb${{ inputs.bucket_suffix }} \
--build-arg FALCO_VERSION=${{ inputs.version }} \
--build-arg TARGETARCH=${TARGETARCH} \
.
docker save docker.io/falcosecurity/falco:${{ inputs.arch }}-${{ inputs.tag }}-debian --output /tmp/falco-${{ inputs.arch }}-debian.tar
- name: Build falco-driver-loader image
run: |
docker build -f docker/driver-loader/Dockerfile -t docker.io/falcosecurity/falco-driver-loader:${{ inputs.arch }}-${{ inputs.tag }} \
--build-arg FALCO_IMAGE_TAG=${{ inputs.arch }}-${{ inputs.tag }} \
--build-arg TARGETARCH=${TARGETARCH} \
.
docker save docker.io/falcosecurity/falco-driver-loader:${{ inputs.arch }}-${{ inputs.tag }} --output /tmp/falco-driver-loader-${{ inputs.arch }}.tar
- name: Build falco-driver-loader-buster image
run: |
docker build -f docker/driver-loader-buster/Dockerfile -t docker.io/falcosecurity/falco-driver-loader:${{ inputs.arch }}-${{ inputs.tag }}-buster \
--build-arg VERSION_BUCKET=deb${{ inputs.bucket_suffix }} \
--build-arg FALCO_VERSION=${{ inputs.version }} \
--build-arg TARGETARCH=${TARGETARCH} \
.
docker save docker.io/falcosecurity/falco-driver-loader:${{ inputs.arch }}-${{ inputs.tag }}-buster --output /tmp/falco-driver-loader-${{ inputs.arch }}-buster.tar
- name: Upload images tarballs
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: falco-images-${{ inputs.arch }}
path: /tmp/falco-*.tar
retention-days: 1

View File

@ -0,0 +1,409 @@
# This is a reusable workflow used by master and release CI
on:
workflow_call:
inputs:
arch:
description: x86_64 or aarch64
required: true
type: string
version:
description: The Falco version to use when building packages
required: true
type: string
enable_debug:
description: Also create a debug build
required: false
type: boolean
default: false
enable_sanitizers:
description: Also create a sanitizer build
required: false
type: boolean
default: false
use_jemalloc:
description: Use jemalloc memory allocator
required: false
type: boolean
default: false
use_mimalloc:
description: Use mimalloc memory allocator
required: false
type: boolean
default: false
permissions:
contents: read
jobs:
build-modern-bpf-skeleton:
# See https://github.com/actions/runner/issues/409#issuecomment-1158849936
runs-on: ${{ (inputs.arch == 'aarch64' && 'ubuntu-22.04-arm') || 'ubuntu-latest' }}
container: fedora:41
steps:
# Always install deps before invoking checkout action, to properly perform a full clone.
- name: Install build dependencies
run: |
dnf install -y bpftool ca-certificates cmake make automake gcc gcc-c++ kernel-devel clang git pkg-config autoconf automake
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Build modern BPF skeleton
run: |
cmake -B skeleton-build -S . \
-DUSE_BUNDLED_DEPS=ON -DCREATE_TEST_TARGETS=Off -DFALCO_VERSION=${{ inputs.version }}
cmake --build skeleton-build --target ProbeSkeleton -j6
- name: Upload skeleton
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: bpf_probe_${{ inputs.arch }}.skel.h
path: skeleton-build/skel_dir/bpf_probe.skel.h
retention-days: 1
build-packages-release:
# See https://github.com/actions/runner/issues/409#issuecomment-1158849936
runs-on: ${{ (inputs.arch == 'aarch64' && 'ubuntu-22.04-arm') || 'ubuntu-latest' }}
needs: [build-modern-bpf-skeleton]
steps:
# Always install deps before invoking checkout action, to properly perform a full clone.
- name: Install build deps
run: |
sudo apt update && sudo apt install -y --no-install-recommends ca-certificates cmake curl wget build-essential git pkg-config autoconf automake libtool m4 rpm alien
- name: Install systemd rpm macros
run: |
wget https://www.rpmfind.net/linux/centos-stream/9-stream/BaseOS/${{ inputs.arch }}/os/Packages/systemd-rpm-macros-252-51.el9.noarch.rpm
sudo alien -d -i systemd-rpm-macros-252-51.el9.noarch.rpm
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Download skeleton
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: bpf_probe_${{ inputs.arch }}.skel.h
path: /tmp
- name: Install zig
if: inputs.sanitizers == false
uses: falcosecurity/libs/.github/actions/install-zig@master
- name: Prepare project
run: |
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DUSE_BUNDLED_DEPS=On \
-DFALCO_ETC_DIR=/etc/falco \
-DMODERN_BPF_SKEL_DIR=/tmp \
-DBUILD_DRIVER=Off \
-DBUILD_BPF=Off \
-DUSE_JEMALLOC=${{ inputs.use_jemalloc }} \
-DUSE_MIMALLOC=${{ inputs.use_mimalloc }} \
-DFALCO_VERSION=${{ inputs.version }}
- name: Build project
run: |
cmake --build build --target falco -j6
- name: Build packages
run: |
cmake --build build --target package
- name: Upload Falco tar.gz package
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: falco-${{ inputs.version }}-${{ inputs.arch }}.tar.gz
path: |
${{ github.workspace }}/build/falco-*.tar.gz
- name: Upload Falco deb package
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: falco-${{ inputs.version }}-${{ inputs.arch }}.deb
path: |
${{ github.workspace }}/build/falco-*.deb
- name: Upload Falco rpm package
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: falco-${{ inputs.version }}-${{ inputs.arch }}.rpm
path: |
${{ github.workspace }}/build/falco-*.rpm
- name: Upload Falco debug symbols
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: falco-${{ inputs.version }}-${{ inputs.arch }}.debug
path: |
${{ github.workspace }}/build/userspace/falco/falco.debug
build-packages-debug:
# See https://github.com/actions/runner/issues/409#issuecomment-1158849936
runs-on: ${{ (inputs.arch == 'aarch64' && 'ubuntu-22.04-arm') || 'ubuntu-22.04' }}
if: ${{ inputs.enable_debug == true }}
needs: [build-modern-bpf-skeleton]
steps:
# Always install deps before invoking checkout action, to properly perform a full clone.
- name: Install build deps
run: |
sudo apt update && sudo apt install -y --no-install-recommends ca-certificates cmake curl wget build-essential git pkg-config autoconf automake libtool m4 rpm
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Download skeleton
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: bpf_probe_${{ inputs.arch }}.skel.h
path: /tmp
- name: Install zig
if: inputs.sanitizers == false
uses: falcosecurity/libs/.github/actions/install-zig@master
- name: Prepare project
run: |
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=Debug \
-DUSE_BUNDLED_DEPS=On \
-DFALCO_ETC_DIR=/etc/falco \
-DMODERN_BPF_SKEL_DIR=/tmp \
-DBUILD_DRIVER=Off \
-DBUILD_BPF=Off \
-DUSE_JEMALLOC=${{ inputs.use_jemalloc }} \
-DUSE_MIMALLOC=${{ inputs.use_mimalloc }} \
-DFALCO_VERSION=${{ inputs.version }}
- name: Build project
run: |
cmake --build build --target falco -j6
- name: Build packages
run: |
cmake --build build --target package
- name: Upload Falco tar.gz package
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: falco-${{ inputs.version }}-${{ inputs.arch }}-debug.tar.gz
path: |
${{ github.workspace }}/build/falco-*.tar.gz
build-packages-sanitizers:
# See https://github.com/actions/runner/issues/409#issuecomment-1158849936
runs-on: ${{ (inputs.arch == 'aarch64' && 'ubuntu-22.04-arm') || 'ubuntu-latest' }}
if: ${{ inputs.enable_sanitizers == true }}
needs: [build-modern-bpf-skeleton]
steps:
# Always install deps before invoking checkout action, to properly perform a full clone.
- name: Install build deps
run: |
sudo apt update && sudo apt install -y --no-install-recommends ca-certificates cmake curl wget build-essential git pkg-config autoconf automake libtool m4 rpm
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Download skeleton
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: bpf_probe_${{ inputs.arch }}.skel.h
path: /tmp
- name: Prepare project
# Jemalloc and ASAN don't play very well together.
run: |
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=Debug \
-DUSE_BUNDLED_DEPS=On \
-DFALCO_ETC_DIR=/etc/falco \
-DMODERN_BPF_SKEL_DIR=/tmp \
-DBUILD_DRIVER=Off \
-DBUILD_BPF=Off \
-DUSE_JEMALLOC=Off \
-DUSE_MIMALLOC=Off \
-DUSE_ASAN=On \
-DFALCO_VERSION=${{ inputs.version }}
- name: Build project
run: |
cmake --build build --target falco -j6
- name: Build packages
run: |
cmake --build build --target package
- name: Upload Falco tar.gz package
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: falco-${{ inputs.version }}-${{ inputs.arch }}-sanitizers.tar.gz
path: |
${{ github.workspace }}/build/falco-*.tar.gz
build-musl-package:
# x86_64 only for now
if: ${{ inputs.arch == 'x86_64' }}
runs-on: ubuntu-latest
container: alpine:3.17
steps:
# Always install deps before invoking checkout action, to properly perform a full clone.
- name: Install build dependencies
run: |
apk add g++ gcc cmake make git bash perl linux-headers autoconf automake m4 libtool elfutils-dev libelf-static patch binutils clang llvm
git clone https://github.com/libbpf/bpftool.git --branch v7.3.0 --single-branch
cd bpftool
git submodule update --init
cd src && make install
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
- name: Prepare project
run: |
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=Release \
-DCPACK_GENERATOR=TGZ \
-DBUILD_BPF=Off -DBUILD_DRIVER=Off \
-DUSE_JEMALLOC=${{ inputs.use_jemalloc }} \
-DUSE_MIMALLOC=${{ inputs.use_mimalloc }} \
-DUSE_BUNDLED_DEPS=On \
-DMUSL_OPTIMIZED_BUILD=On \
-DFALCO_ETC_DIR=/etc/falco \
-DFALCO_VERSION=${{ inputs.version }}
- name: Build project
run: |
cmake --build build -j6
- name: Build packages
run: |
cmake --build build -j6 --target package
- name: Rename static package
run: |
cd build
mv falco-${{ inputs.version }}-x86_64.tar.gz falco-${{ inputs.version }}-static-x86_64.tar.gz
- name: Upload Falco static package
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: falco-${{ inputs.version }}-static-x86_64.tar.gz
path: |
${{ github.workspace }}/build/falco-${{ inputs.version }}-static-x86_64.tar.gz
build-wasm-package:
if: ${{ inputs.arch == 'x86_64' }}
runs-on: ubuntu-22.04
steps:
# Always install deps before invoking checkout action, to properly perform a full clone.
- name: Install build dependencies
run: |
sudo apt update
sudo DEBIAN_FRONTEND=noninteractive apt install cmake build-essential git emscripten -y
- name: Select node version
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: 14
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
- name: Prepare project
run: |
emcmake cmake -B build -S . \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_BUNDLED_DEPS=On \
-DFALCO_ETC_DIR=/etc/falco \
-DBUILD_FALCO_UNIT_TESTS=On \
-DFALCO_VERSION=${{ inputs.version }}
- name: Build project
run: |
cd build
emmake make -j6 all
- name: Run unit Tests
run: |
cd build
node ./unit_tests/falco_unit_tests.js
- name: Build packages
run: |
cd build
emmake make -j6 package
- name: Upload Falco WASM package
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: falco-${{ inputs.version }}-wasm.tar.gz
path: |
${{ github.workspace }}/build/falco-${{ inputs.version }}-wasm.tar.gz
build-win32-package:
if: ${{ inputs.arch == 'x86_64' }}
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
# NOTE: Backslash doesn't work as line continuation on Windows.
- name: Prepare project
run: |
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DMINIMAL_BUILD=On -DUSE_BUNDLED_DEPS=On -DBUILD_FALCO_UNIT_TESTS=On -DFALCO_VERSION=${{ inputs.version }}
- name: Build project
run: |
cmake --build build --target package --config Release
- name: Run unit Tests
run: |
build/unit_tests/Release/falco_unit_tests.exe
- name: Upload Falco win32 installer
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: falco-installer-Release-win32.exe
path: build/falco-*.exe
- name: Upload Falco win32 package
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: falco-Release-win32.exe
path: |
${{ github.workspace }}/build/userspace/falco/Release/falco.exe
build-macos-package:
if: ${{ inputs.arch == 'x86_64' }}
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
- name: Prepare project
run: |
cmake -B build -S . \
-DMINIMAL_BUILD=On -DUSE_BUNDLED_DEPS=On -DBUILD_FALCO_UNIT_TESTS=On -DFALCO_VERSION=${{ inputs.version }}
- name: Build project
run: |
cmake --build build --target package
- name: Run unit Tests
run: |
sudo build/unit_tests/falco_unit_tests
- name: Upload Falco macos package
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: falco-${{ inputs.version }}-macos
path: |
${{ github.workspace }}/build/userspace/falco/falco

View File

@ -0,0 +1,42 @@
# This is a reusable workflow used by master and release CI
on:
workflow_call:
outputs:
version:
description: "Falco version"
value: ${{ jobs.fetch-version.outputs.version }}
permissions:
contents: read
jobs:
# We need to use an ubuntu-latest to fetch Falco version because
# Falco version is computed by some cmake scripts that do git sorceries
# to get the current version.
# But centos7 jobs have a git version too old and actions/checkout does not
# fully clone the repo, but uses http rest api instead.
fetch-version:
runs-on: ubuntu-latest
# Map the job outputs to step outputs
outputs:
version: ${{ steps.store_version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
- name: Install build dependencies
run: |
sudo apt update
sudo apt install -y cmake build-essential
- name: Configure project
run: |
cmake -B build -S . -DUSE_BUNDLED_DEPS=On -DUSE_DYNAMIC_LIBELF=Off
- name: Load and store Falco version output
id: store_version
run: |
FALCO_VERSION=$(cat build/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
echo "version=${FALCO_VERSION}" >> $GITHUB_OUTPUT

View File

@ -0,0 +1,174 @@
# This is a reusable workflow used by master and release CI
on:
workflow_call:
inputs:
tag:
description: The tag to push
required: true
type: string
is_latest:
description: Update the latest tag with the new image
required: false
type: boolean
default: false
sign:
description: Add signature with cosign
required: false
type: boolean
default: false
permissions:
contents: read
jobs:
publish-docker:
runs-on: ubuntu-latest
permissions:
attestations: write
id-token: write
contents: read
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Download x86_64 images tarballs
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: falco-images-x86_64
path: /tmp/falco-images
- name: Download aarch64 images tarballs
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: falco-images-aarch64
path: /tmp/falco-images
- name: Load all images
run: |
for img in /tmp/falco-images/falco-*.tar; do docker load --input $img; done
- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_SECRET }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1
with:
role-to-assume: "arn:aws:iam::292999226676:role/github_actions-falco-ecr"
aws-region: us-east-1 # The region must be set to us-east-1 in order to access ECR Public.
- name: Login to Amazon ECR
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@2f9f10ea3fa2eed41ac443fee8bfbd059af2d0a4 # v1.6.0
with:
registry-type: public
- name: Setup Crane
uses: imjasonh/setup-crane@00c9e93efa4e1138c9a7a5c594acd6c75a2fbf0c # v0.3
with:
version: v0.15.1
# We're pushing the arch-specific manifests to Docker Hub so that we'll be able to easily create the index/multiarch later
- name: Push arch-specific images to Docker Hub
run: |
docker push docker.io/falcosecurity/falco:aarch64-${{ inputs.tag }}
docker push docker.io/falcosecurity/falco:x86_64-${{ inputs.tag }}
docker push docker.io/falcosecurity/falco:aarch64-${{ inputs.tag }}-debian
docker push docker.io/falcosecurity/falco:x86_64-${{ inputs.tag }}-debian
docker push docker.io/falcosecurity/falco-driver-loader:aarch64-${{ inputs.tag }}
docker push docker.io/falcosecurity/falco-driver-loader:x86_64-${{ inputs.tag }}
docker push docker.io/falcosecurity/falco-driver-loader:aarch64-${{ inputs.tag }}-buster
docker push docker.io/falcosecurity/falco-driver-loader:x86_64-${{ inputs.tag }}-buster
- name: Create Falco manifest on Docker Hub
uses: Noelware/docker-manifest-action@8e337e3cb9656abfcf20146b99706fd88716e942 # v0.4.0
with:
inputs: docker.io/falcosecurity/falco:${{ inputs.tag }}
images: docker.io/falcosecurity/falco:aarch64-${{ inputs.tag }},docker.io/falcosecurity/falco:x86_64-${{ inputs.tag }}
push: true
- name: Create falco-debian manifest on Docker Hub
uses: Noelware/docker-manifest-action@8e337e3cb9656abfcf20146b99706fd88716e942 # v0.4.0
with:
inputs: docker.io/falcosecurity/falco:${{ inputs.tag }}-debian
images: docker.io/falcosecurity/falco:aarch64-${{ inputs.tag }}-debian,docker.io/falcosecurity/falco:x86_64-${{ inputs.tag }}-debian
push: true
- name: Create falco-driver-loader manifest on Docker Hub
uses: Noelware/docker-manifest-action@8e337e3cb9656abfcf20146b99706fd88716e942 # v0.4.0
with:
inputs: docker.io/falcosecurity/falco-driver-loader:${{ inputs.tag }}
images: docker.io/falcosecurity/falco-driver-loader:aarch64-${{ inputs.tag }},docker.io/falcosecurity/falco-driver-loader:x86_64-${{ inputs.tag }}
push: true
- name: Create falco-driver-loader-buster manifest on Docker Hub
uses: Noelware/docker-manifest-action@8e337e3cb9656abfcf20146b99706fd88716e942 # v0.4.0
with:
inputs: docker.io/falcosecurity/falco-driver-loader:${{ inputs.tag }}-buster
images: docker.io/falcosecurity/falco-driver-loader:aarch64-${{ inputs.tag }}-buster,docker.io/falcosecurity/falco-driver-loader:x86_64-${{ inputs.tag }}-buster
push: true
- name: Get Digests for images
id: digests
# We could probably use the docker-manifest-action output instead of recomputing those with crane
run: |
echo "falco=$(crane digest docker.io/falcosecurity/falco:${{ inputs.tag }})" >> $GITHUB_OUTPUT
echo "falco-debian=$(crane digest docker.io/falcosecurity/falco:${{ inputs.tag }}-debian)" >> $GITHUB_OUTPUT
echo "falco-driver-loader=$(crane digest docker.io/falcosecurity/falco-driver-loader:${{ inputs.tag }})" >> $GITHUB_OUTPUT
echo "falco-driver-loader-buster=$(crane digest docker.io/falcosecurity/falco-driver-loader:${{ inputs.tag }}-buster)" >> $GITHUB_OUTPUT
- name: Publish images to ECR
run: |
crane copy docker.io/falcosecurity/falco:${{ inputs.tag }} public.ecr.aws/falcosecurity/falco:${{ inputs.tag }}
crane copy docker.io/falcosecurity/falco:${{ inputs.tag }}-debian public.ecr.aws/falcosecurity/falco:${{ inputs.tag }}-debian
crane copy docker.io/falcosecurity/falco-driver-loader:${{ inputs.tag }} public.ecr.aws/falcosecurity/falco-driver-loader:${{ inputs.tag }}
crane copy docker.io/falcosecurity/falco-driver-loader:${{ inputs.tag }}-buster public.ecr.aws/falcosecurity/falco-driver-loader:${{ inputs.tag }}-buster
- name: Tag latest on Docker Hub and ECR
if: inputs.is_latest
run: |
crane tag docker.io/falcosecurity/falco:${{ inputs.tag }} latest
crane tag docker.io/falcosecurity/falco:${{ inputs.tag }}-debian latest-debian
crane tag docker.io/falcosecurity/falco-driver-loader:${{ inputs.tag }} latest
crane tag docker.io/falcosecurity/falco-driver-loader:${{ inputs.tag }}-buster latest-buster
crane tag public.ecr.aws/falcosecurity/falco:${{ inputs.tag }} latest
crane tag public.ecr.aws/falcosecurity/falco:${{ inputs.tag }}-debian latest-debian
crane tag public.ecr.aws/falcosecurity/falco-driver-loader:${{ inputs.tag }} latest
crane tag public.ecr.aws/falcosecurity/falco-driver-loader:${{ inputs.tag }}-buster latest-buster
- name: Setup Cosign
if: inputs.sign
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0
- name: Sign images with cosign
if: inputs.sign
env:
COSIGN_EXPERIMENTAL: "true"
COSIGN_YES: "true"
run: |
cosign sign docker.io/falcosecurity/falco:latest@${{ steps.digests.outputs.falco }}
cosign sign docker.io/falcosecurity/falco:latest-debian@${{ steps.digests.outputs.falco-debian }}
cosign sign docker.io/falcosecurity/falco-driver-loader:latest@${{ steps.digests.outputs.falco-driver-loader }}
cosign sign docker.io/falcosecurity/falco-driver-loader:latest-buster@${{ steps.digests.outputs.falco-driver-loader-buster }}
cosign sign public.ecr.aws/falcosecurity/falco:latest@${{ steps.digests.outputs.falco }}
cosign sign public.ecr.aws/falcosecurity/falco:latest-debian@${{ steps.digests.outputs.falco-debian }}
cosign sign public.ecr.aws/falcosecurity/falco-driver-loader:latest@${{ steps.digests.outputs.falco-driver-loader }}
cosign sign public.ecr.aws/falcosecurity/falco-driver-loader:latest-buster@${{ steps.digests.outputs.falco-driver-loader-buster }}
- uses: actions/attest-build-provenance@173725a1209d09b31f9d30a3890cf2757ebbff0d # v1.1.2
with:
subject-name: docker.io/falcosecurity/falco
subject-digest: ${{ steps.digests.outputs.falco }}
push-to-registry: true
- uses: actions/attest-build-provenance@173725a1209d09b31f9d30a3890cf2757ebbff0d # v1.1.2
with:
subject-name: docker.io/falcosecurity/falco-driver-loader
subject-digest: ${{ steps.digests.outputs.falco-driver-loader }}
push-to-registry: true

View File

@ -0,0 +1,146 @@
# This is a reusable workflow used by master and release CI
on:
workflow_call:
inputs:
version:
description: The Falco version to use when publishing packages
required: true
type: string
bucket_suffix:
description: bucket suffix for packages
required: false
default: ''
type: string
permissions:
id-token: write
contents: read
env:
AWS_S3_REGION: eu-west-1
AWS_CLOUDFRONT_DIST_ID: E1CQNPFWRXLGQD
jobs:
publish-packages:
runs-on: ubuntu-latest
container: docker.io/library/fedora:38
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Install dependencies
run: |
dnf install rpm-sign expect which createrepo gpg python python-pip -y
pip install awscli==1.29.60
# Configure AWS role; see https://github.com/falcosecurity/test-infra/pull/1102
# Note: master CI can only push dev packages as we have 2 different roles for master and release.
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1
with:
role-to-assume: "arn:aws:iam::292999226676:role/github_actions-falco${{ inputs.bucket_suffix }}-s3"
aws-region: ${{ env.AWS_S3_REGION }}
- name: Download RPM x86_64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: falco-${{ inputs.version }}-x86_64.rpm
path: /tmp/falco-build-rpm
- name: Download RPM aarch64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: falco-${{ inputs.version }}-aarch64.rpm
path: /tmp/falco-build-rpm
- name: Download binary x86_64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: falco-${{ inputs.version }}-x86_64.tar.gz
path: /tmp/falco-build-bin
- name: Download binary aarch64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: falco-${{ inputs.version }}-aarch64.tar.gz
path: /tmp/falco-build-bin
- name: Download static binary x86_64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: falco-${{ inputs.version }}-static-x86_64.tar.gz
path: /tmp/falco-build-bin-static
- name: Download WASM package
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: falco-${{ inputs.version }}-wasm.tar.gz
path: /tmp/falco-wasm
- name: Import gpg key
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
run: printenv GPG_KEY | gpg --import -
- name: Sign rpms
run: |
rpmsign --define '_gpg_name Falcosecurity Package Signing' --addsign /tmp/falco-build-rpm/falco-*.rpm
rpm -qp --qf '%|DSAHEADER?{%{DSAHEADER:pgpsig}}:{%|RSAHEADER?{%{RSAHEADER:pgpsig}}:{(none)}|}|\n' /tmp/falco-build-rpm/falco-*.rpm
- name: Publish wasm
run: |
./scripts/publish-wasm -f /tmp/falco-wasm/falco-${{ inputs.version }}-wasm.tar.gz
- name: Publish rpm
run: |
./scripts/publish-rpm -f /tmp/falco-build-rpm/falco-${{ inputs.version }}-x86_64.rpm -f /tmp/falco-build-rpm/falco-${{ inputs.version }}-aarch64.rpm -r rpm${{ inputs.bucket_suffix }}
- name: Publish bin
run: |
./scripts/publish-bin -f /tmp/falco-build-bin/falco-${{ inputs.version }}-x86_64.tar.gz -r bin${{ inputs.bucket_suffix }} -a x86_64
./scripts/publish-bin -f /tmp/falco-build-bin/falco-${{ inputs.version }}-aarch64.tar.gz -r bin${{ inputs.bucket_suffix }} -a aarch64
- name: Publish static
run: |
./scripts/publish-bin -f /tmp/falco-build-bin-static/falco-${{ inputs.version }}-static-x86_64.tar.gz -r bin${{ inputs.bucket_suffix }} -a x86_64
publish-packages-deb:
runs-on: ubuntu-latest
container: docker.io/debian:stable
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Install dependencies
run: |
apt update -y
apt-get install apt-utils bzip2 gpg awscli -y
# Configure AWS role; see https://github.com/falcosecurity/test-infra/pull/1102
# Note: master CI can only push dev packages as we have 2 different roles for master and release.
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1
with:
role-to-assume: "arn:aws:iam::292999226676:role/github_actions-falco${{ inputs.bucket_suffix }}-s3"
aws-region: ${{ env.AWS_S3_REGION }}
- name: Download deb x86_64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: falco-${{ inputs.version }}-x86_64.deb
path: /tmp/falco-build-deb
- name: Download deb aarch64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: falco-${{ inputs.version }}-aarch64.deb
path: /tmp/falco-build-deb
- name: Import gpg key
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
run: printenv GPG_KEY | gpg --import -
- name: Publish deb
run: |
./scripts/publish-deb -f /tmp/falco-build-deb/falco-${{ inputs.version }}-x86_64.deb -f /tmp/falco-build-deb/falco-${{ inputs.version }}-aarch64.deb -r deb${{ inputs.bucket_suffix }}

View File

@ -0,0 +1,68 @@
# This is a reusable workflow used by master and release CI
on:
workflow_call:
inputs:
arch:
description: x86_64 or aarch64
required: true
type: string
static:
description: Falco packages use a static build
required: false
type: boolean
default: false
version:
description: The Falco version to use when testing packages
required: true
type: string
sanitizers:
description: Use sanitizer enabled build
required: false
default: false
type: boolean
permissions:
contents: read
jobs:
test-packages:
# See https://github.com/actions/runner/issues/409#issuecomment-1158849936
runs-on: ${{ (inputs.arch == 'aarch64' && 'ubuntu-22.04-arm') || 'ubuntu-latest' }}
steps:
- name: Download binary
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: falco-${{ inputs.version }}${{ inputs.static && '-static' || '' }}-${{ inputs.arch }}${{ inputs.sanitizers == true && '-sanitizers' || '' }}.tar.gz
- name: Install Falco package
run: |
ls falco-*.tar.gz
tar -xvf $(ls falco-*.tar.gz)
cd falco-${{ inputs.version }}-${{ inputs.arch }}
sudo cp -r * /
- name: Install kernel headers for falco-driver-loader tests
run: |
sudo apt update -y
sudo apt install -y --no-install-recommends linux-headers-$(uname -r)
# Some builds use sanitizers, we always install support for them so they can run
- name: Install sanitizer support
if: inputs.sanitizers
run: |
sudo apt update -y
sudo apt install -y libasan5 libubsan1
- name: Run tests
env:
LSAN_OPTIONS: "intercept_tls_get_addr=0"
uses: falcosecurity/testing@main
with:
test-falco: 'true'
test-falcoctl: 'true'
test-k8saudit: 'true'
test-dummy: 'true'
static: ${{ inputs.static && 'true' || 'false' }}
test-drivers: 'true'
show-all: 'true'
report-name-suffix: ${{ inputs.static && '-static' || '' }}${{ inputs.sanitizers && '-sanitizers' || '' }}

79
.github/workflows/scorecard.yaml vendored Normal file
View File

@ -0,0 +1,79 @@
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.
name: Scorecard supply-chain security
on:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
# Weekly on Mondays at 00:00.
- cron: '0 0 * * 1'
# The OSSF recommendation encourages to enable branch protection rules trigger
# to update the scorecard
# (https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection)
# but due to our GitHub org management this check is triggered too often and is
# therefore disabled.
# branch_protection_rule:
push:
branches: [ "master" ]
# Declare default permissions as read only.
permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read
steps:
- name: "Checkout code"
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecard on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
with:
sarif_file: results.sarif

35
.github/workflows/staticanalysis.yaml vendored Normal file
View File

@ -0,0 +1,35 @@
name: StaticAnalysis
on:
pull_request:
permissions:
contents: read
jobs:
staticanalysis:
runs-on: ubuntu-22.04
steps:
- name: Checkout ⤵️
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Install build dependencies ⛓️
run: |
sudo apt update -y
sudo apt install build-essential git cppcheck cmake -y
- name: Build and run cppcheck 🏎️
run: |
cmake -B build -S . \
-DCMAKE_BUILD_TYPE="release" \
-DUSE_BUNDLED_DEPS=On -DUSE_DYNAMIC_LIBELF=Off -DBUILD_WARNINGS_AS_ERRORS=ON -DCREATE_TEST_TARGETS=Off -DBUILD_BPF=Off -DBUILD_DRIVER=Off
cmake --build build -j4 --target cppcheck
cmake --build build -j4 --target cppcheck_htmlreport
- name: Upload reports ⬆️
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: static-analysis-reports
path: ./build/static-analysis-reports

16
.gitignore vendored
View File

@ -2,19 +2,7 @@
*~
*.pyc
test/traces-negative
test/traces-positive
test/traces-info
test/job-results
test/.phoronix-test-suite
test/results*.json.*
test/build
userspace/engine/lua/lyaml
userspace/engine/lua/lyaml.lua
.vscode/*
.luacheckcache
*.idea*
*.idea*
CMakeUserPresets.json

4
.gitmodules vendored Normal file
View File

@ -0,0 +1,4 @@
[submodule "submodules/falcosecurity-rules"]
path = submodules/falcosecurity-rules
url = https://github.com/falcosecurity/rules.git
branch = main

View File

@ -1,8 +0,0 @@
std = "min"
cache = true
include_files = {
"userspace/engine/lua/*.lua",
"userspace/engine/lua/lyaml/*.lua",
"*.luacheckrc"
}
exclude_files = {"build"}

23
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,23 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
fail_fast: false
minimum_pre_commit_version: '0'
repos:
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
stages: [commit]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
hooks:
- id: clang-format
types_or: [c++, c]
stages: [commit]
- repo: local
hooks:
- id: dco-hook-local
name: DCO hook local
entry: ./tools/local_hooks/dco-pre-commit-msg.sh
language: script
stages: [prepare-commit-msg]

View File

@ -1,5 +1,21 @@
# Adopters
Known end users with notable contributions to the project include:
* AWS
* IBM
* Red Hat
Falco is being used by numerous other companies, both large and small, to build higher layer products and services. The list includes but is not limited to:
* Equinix Metal
* IEEE
* Lowes
* Reckrut
* Yellow Pepper
* CTx
* Utikal
* Discrete Events
* Agritech Infra
This is a list of production adopters of Falco (in alphabetical order):
* [ASAPP](https://www.asapp.com/) - ASAPP is a pushing the boundaries of fundamental artificial intelligence research. We apply our research into AI-Native® products that make organizations, in the customer experience industry, highly productive, efficient, and effective—by augmenting human activity and automating workflows. We constantly monitor our workloads against different hazards and FALCO helps us extend our threat monitoring boundaries.
@ -8,22 +24,44 @@ This is a list of production adopters of Falco (in alphabetical order):
* [Coveo](https://www.coveo.com/) - Coveo stitches together content and data, learning from every interaction, to tailor every experience using AI to drive growth, satisfy customers and develop employee proficiency. All Falco events are centralized in our SIEM for analysis. Understanding what is running on production servers, and the context around why things are running is even more tricky now that we have further abstractions with containers and orchestration systems. Falco is giving us a good visibility inside containers and complement other Host and Network Intrusion Detection Systems. In a near future, we expect to deploy serverless functions to take action when Falco identifies patterns worth taking action for.
* [Deckhouse](https://deckhouse.io/) - Deckhouse Platform presents to you the opportunity to create homogeneous Kubernetes clusters anywhere and handles comprehensive, automagical management for them. It supplies all the add-ons you need for auto-scaling, observability, security, and service mesh. Falco is used as a part of the [runtime-audit-engine](https://deckhouse.io/documentation/latest/modules/650-runtime-audit-engine/) module to provide threats detection and enforce security compliance out of the box. By pairing with [shell-operator](https://github.com/flant/shell-operator) Falco can be configured by Kubernetes Custom Resources.
* [Fairwinds](https://fairwinds.com/) - [Fairwinds Insights](https://fairwinds.com/insights), Kubernetes governance software, integrates Falco to offer a single pane of glass view into potential security incidents. Insights adds out-of-the-box integrations and rules filter to reduce alert fatigue and improve security response. The platform adds security prevention, detection, and response capabilities to your existing Kubernetes infrastructure. Security and DevOps teams benefit from a centralized view of container security vulnerability scanning and runtime container security.
* [Frame.io](https://frame.io/) - Frame.io is a cloud-based (SaaS) video review and collaboration platform that enables users to securely upload source media, work-in-progress edits, dailies, and more into private workspaces where they can invite their team and clients to collaborate on projects. Understanding what is running on production servers, and the context around why things are running is even more tricky now that we have further abstractions like Docker and Kubernetes. To get this needed visibility into our system, we rely on Falco. Falco's ability to collect raw system calls such as open, connect, exec, along with their arguments offer key insights on what is happening on the production system and became the foundation of our intrusion detection and alerting system.
* [Giant Swarm](https://www.giantswarm.io/) - Giant Swarm manages Kubernetes clusters and infrastructure for enterprises across multiple cloud providers as well as several flavors of on-premises data centers. Our platform provisions and monitors pure "vanilla" Kubernetes clusters which can be augmented with managed solutions to many common Kubernetes challenges, including security. We use Falco for anomaly detection as part of our collection of entirely open-source tools for securing our own clusters, and offer the same capabilities to our customers as part of our [managed security offering](https://docs.giantswarm.io/app-platform/apps/security/).
* [GitLab](https://about.gitlab.com/direction/defend/container_host_security/) - GitLab is a complete DevOps platform, delivered as a single application, fundamentally changing the way Development, Security, and Ops teams collaborate. GitLab Ultimate provides the single tool teams need to find, triage, and fix vulnerabilities in applications, services, and cloud-native environments enabling them to manage their risk. This provides them with repeatable, defensible processes that automate security and compliance policies. GitLab includes a tight integration with Falco, allowing users to defend their containerized applications from attacks while running in production.
* [gVisor](https://gvisor.dev/) - gVisor secures Kubernetes, containers, and workloads via an alternate execution environment that handles system calls in user space, blocking security issues before they reach the underlying host. gVisor provides defense-in-depth, protection against untrusted code execution, and a secure-by-default Kubernetes experience where containers are a security boundary. Falco can be used with gVisor to detect unusual or suspicious activity using its threat detection engine on top of gVisor runtime execution information.
* [League](https://league.com/ca/) - League provides health benefits management services to help employees understand and get the most from their benefits, and employers to provide effective, efficient plans. Falco is used to monitor our deployed services on Kubernetes, protecting against malicious access to containers which could lead to leaks of PHI or other sensitive data. The Falco alerts are logged in Stackdriver for grouping and further analysis. In the future, we're hoping for integrations with Prometheus and AlertManager as well.
* [Logz.io](https://logz.io/) - Logz.io is a cloud observability platform for modern engineering teams. The Logz.io platform consists of three products — Log Management, Infrastructure Monitoring, and Cloud SIEM — that work together to unify the jobs of monitoring, troubleshooting, and security. We empower engineers to deliver better software by offering the world's most popular open source observability tools — the ELK Stack, Grafana, and Jaeger — in a single, easy to use, and powerful platform purpose-built for monitoring distributed cloud environments. Cloud SIEM supports data from multiple sources, including Falco's alerts, and offers useful rules and dashboards content to visualize and manage incidents across your systems in a unified UI.
* https://logz.io/blog/k8s-security-with-falco-and-cloud-siem/
* [MathWorks](https://mathworks.com) - MathWorks develops mathematical computing software for engineers and scientists. MathWorks uses Falco for Kubernetes threat detection, unexpected application behavior, and maps Falco rules to their cloud infrastructure's security kill chain model. MathWorks presented their Falco use case at [KubeCon + CloudNativeCon North America 2020](https://www.youtube.com/watch?v=L-5RYBTV010).
* [NETWAYS Web Services](https://nws.netways.de/en/) - NETWAYS Web Services provides cloud and managed services tailored to their customers needs. From VPCs to managed databases and Kubernetes clusters, NETWAYS Web Services enables their customers to run infrastructure and applications without worries. Falco plays its part for NETWAYS Managed Services to ensure their platform conforms to ISO 27001 at all times and that their clients' workloads behave as expected by detecting anomalies in real-time.
* [Pocteo](https://pocteo.co) - Pocteo helps with Kubernetes adoption in enterprises by providing a variety of services such as training, consulting, auditing and mentoring. We build CI/CD pipelines the GitOps way, as well as design and run k8s clusters. Pocteo uses Falco as a runtime monitoring system to secure clients' workloads against suspicious behavior and ensure k8s pods immutability. We also use Falco to collect, process and act on security events through a response engine and serverless functions.
* [Preferral](https://www.preferral.com) - Preferral is a HIPAA-compliant platform for Referral Management and Online Referral Forms. Preferral streamlines the referral process for patients, specialists and their referral partners. By automating the referral process, referring practices spend less time on the phone, manual efforts are eliminated, and patients get the right care from the right specialist. Preferral leverages Falco to provide a Host Intrusion Detection System to meet their HIPPA compliance requirements.
* [Preferral](https://www.preferral.com) - Preferral is a HIPAA-compliant platform for Referral Management and Online Referral Forms. Preferral streamlines the referral process for patients, specialists and their referral partners. By automating the referral process, referring practices spend less time on the phone, manual efforts are eliminated, and patients get the right care from the right specialist. Preferral leverages Falco to provide a Host Intrusion Detection System to meet their HIPAA compliance requirements.
* https://hipaa.preferral.com/01-preferral_hipaa_compliance/
* [Qonto](https://qonto.com) - Qonto is a modern banking for SMEs and freelancers. Qonto provides a fully featured business account with a simplified accounting flow. Falco is used by our SecOps team to detect suspicious behaviors in our clusters.
* [Raft](https://goraft.tech) - Raft is a government contractor that offers cloud-native solutions across many different agencies including DoD (Department of Defense), HHS (Health and Human Services), as well as within CFPB (Consumer Finance Protection Bureau). Raft leverages Falco to detect threats in our client's Kubernetes clusters and as a Host Intrusion Detection System. Raft proudly recommends Falco across all our different projects.
* [Replicated](https://www.replicated.com/) - Replicated is the modern way to ship on-prem software. Replicated gives software vendors a container-based platform for easily deploying cloud native applications inside customers' environments to provide greater security and control. Replicated uses Falco as runtime security to detect threats in the Kubernetes clusters which host our critical SaaS services.
* [Secureworks](https://www.secureworks.com/) - Secureworks is a leading worldwide cybersecurity company with a cloud-native security product that combines the power of human intellect with security analytics to unify detection and response across cloud, network, and endpoint environments for improved security operations and outcomes. Our Taegis XDR platform and detection system processes petabytes of security relevant data to expose active threats amongst the billions of daily events from our customers. We are proud to protect our platforms Kubernetes deployments, as well as help our customers protect their own Linux and container environments, using Falco.
* [Shopify](https://www.shopify.com) - Shopify is the leading multi-channel commerce platform. Merchants use Shopify to design, set up, and manage their stores across multiple sales channels, including mobile, web, social media, marketplaces, brick-and-mortar locations, and pop-up shops. The platform also provides merchants with a powerful back-office and a single view of their business, from payments to shipping. The Shopify platform was engineered for reliability and scale, making enterprise-level technology available to businesses of all sizes. Shopify uses Falco to complement its Host and Network Intrusion Detection Systems.
* [SafeDep](https://safedep.io/) - SafeDep is a open source software supply chain security platform that helps organizations identify and mitigate risks in their dependencies. At its core, SafeDep offers [`vet`](https://github.com/safedep/vet) a free and open source tool for detecting vulnerabilities, malicious code, and quality issues in open source components, while the enterprise offering, SafeDep Cloud, provides centralized control, data aggregation, and advanced features like malware analysis for large-scale deployments across thousands of repositories.
* [Sight Machine](https://www.sightmachine.com) - Sight Machine is the category leader for manufacturing analytics and used by Global 500 companies to make better, faster decisions about their operations. Sight Machine uses Falco to help enforce SOC2 compliance as well as a tool for real time security monitoring and alerting in Kubernetes.
* [Skyscanner](https://www.skyscanner.net) - Skyscanner is the world's travel search engine for flights, hotels and car rentals. Most of our infrastructure is based on Kubernetes, and our Security team is using Falco to monitor anomalies at runtime, integrating Falco's findings with our internal ChatOps tooling to provide insight on the behavior of our machines in production. We also postprocess and store Falco's results to generate dashboards for auditing purposes.
@ -32,6 +70,32 @@ This is a list of production adopters of Falco (in alphabetical order):
* [Swissblock Technologies](https://swissblock.net/) At Swissblock we connect the dots by combining cutting-edge algorithmic trading strategies with in-depth market analysis. We route all Falco events to our control systems, both monitoring and logging. Being able to deeply analyse alerts, we can understand what is running on our Kubernetes clusters and check against security policies, specifically defined for each workload. A set of alarms notifies us in case of critical events, letting us react fast. In the near future we plan to build a little application to route Kubernetes internal events directly to Falco, fully leveraging Falco PodSecurityPolicies analyses.
* [Shapesecurity/F5] (https://www.shapesecurity.com/) Shapesecurity defends against application fraud attacks like Account Take Over, Credential Stuffing, Fake Accounts, etc. Required by FedRamp certification, we needed to find a FIM solution to help monitor and protect our Kubernetes clusters. Traditional FIM solutions were not scalable and not working for our environment, but with Falco we found the solution we needed. Falco's detection capabilities have helped us identify anomalous behaviour within our clusters. We leverage Sidekick (https://github.com/falcosecurity/charts/tree/master/falcosidekick) to send Falco alerts to a PubSub which in turn publishes those alerts to our SIEM (SumoLogic)
* [Shapesecurity/F5](https://www.shapesecurity.com/) Shapesecurity defends against application fraud attacks like Account Take Over, Credential Stuffing, Fake Accounts, etc. Required by FedRamp certification, we needed to find a FIM solution to help monitor and protect our Kubernetes clusters. Traditional FIM solutions were not scalable and not working for our environment, but with Falco we found the solution we needed. Falco's detection capabilities have helped us identify anomalous behaviour within our clusters. We leverage Sidekick (https://github.com/falcosecurity/charts/tree/master/falcosidekick) to send Falco alerts to a PubSub which in turn publishes those alerts to our SIEM (SumoLogic)
* [Sysdig](https://www.sysdig.com/) Sysdig originally created Falco in 2016 to detect unexpected or suspicious activity using a rules engine on top of the data that comes from the sysdig kernel system call probe. Sysdig provides tooling to help with vulnerability management, compliance, detection, incident response and forensics in Cloud-native environments. Sysdig Secure has extended Falco to include: a rule library, the ability to update macros, lists & rules via the user interface and API, automated tuning of rules, and rule creation based on profiling known system behavior. On top of the basic Falco rules, Sysdig Secure implements the concept of a "Security policy" that can comprise several rules which are evaluated for a user-defined infrastructure scope like Kubernetes namespaces, OpenShift clusters, deployment workload, cloud regions etc.
* [Sysdig](https://www.sysdig.com/) Sysdig originally created Falco in 2016 to detect unexpected or suspicious activity using a rules engine on top of the data that comes from the sysdig kernel system call driver. Sysdig provides tooling to help with vulnerability management, compliance, detection, incident response and forensics in Cloud-native environments. Sysdig Secure has extended Falco to include: a rule library, the ability to update macros, lists & rules via the user interface and API, automated tuning of rules, and rule creation based on profiling known system behavior. On top of the basic Falco rules, Sysdig Secure implements the concept of a "Security policy" that can comprise several rules which are evaluated for a user-defined infrastructure scope like Kubernetes namespaces, OpenShift clusters, deployment workload, cloud regions etc.
* [Thales Group](https://www.thalesgroup.com) Thales is a global technology leader with more than 81,000 employees on five continents. The Thales Group is investing in digital and “deep tech” innovations Big Data, artificial intelligence, connectivity, cybersecurity and quantum technology to build a future we can all trust. In the past few years, the Cloud-Native paradigms and its frameworks and tools have challenged the way applications and services are developed, delivered, and instantiated. All sorts of services are container-based workloads managed by higher level layers of orchestration such as the Kubernetes environment. Thales is committed to develop Cloud-Native services and to provide its customers with security features that ensure their applications and services are protected against cyber threats. Falco is a framework that can help Thales' products and services reach the level of trust, security and safety our clients need.
* [Thought Machine](https://www.thoughtmachine.net) Thought Machine builds Vault Core and Vault Payments: cloud-native core and payments technology enabling banks and fintechs to remain competitive and flourish into the future. Vault Core and Vault Payments are the foundation layer of a bank's technology stack. They can run any bank, any product, and any payment set. Thought Machine uses Falco to perform cloud agnostic real time detections of suspicious container behaviour.
* [Tulip Retail](https://tulip.com) Tulip Retail uses Falco to monitor container activity in our environments. It's numerous integration points, easy deployment and easily customizable rules were the main reasons we chose Falco.
* [Vinted](https://vinted.com/) Vinted uses Falco to continuously monitor container activities, identifying security threats, and ensuring compliance. The container-native approach, rule-based real-time threat detection, community support, extensibility, and compliance capabilities are the main factors why we chose it to enhance Vinted Kubernetes security. Falco Sidekick is used to send critical and warning severity alerts to our incident management solution (RTIR).
* [Xenit AB](https://xenit.se/contact/) Xenit is a growth company with services within cloud and digital transformation. We provide an open-source Kubernetes framework that we leverage to help our customers get their applications to production as quickly and as securely as possible. We use Falco's detection capabilities to identify anomalous behaviour within our clusters in both Azure and AWS.
* [Yahoo! JAPAN](https://www.yahoo.co.jp/) Yahoo! JAPAN is a leading company of internet in Japan. We build an AI Platform in our private cloud and provide it to scientists in our company. AI Platform is a multi-tenant Kubernetes environment and more flexible, faster, more efficient Machine Learning environment. Falco is used to detect unauthorized commands and malicious access and our AI Platform is monitored and alerted by Falco.
## Projects that use Falco libs
* [R6/Phoenix](https://r6security.com/) is an attack surface protection company that uses moving target defense to provide fully automated, proactive and devops friendly security to its customers. There are a set of policies you can add to enable the moving target defense capabilities. Some of them are triggered by a combination of Falco's findings. You can kill, restart and rename pods according to the ever changing policies.
* [SysFlow](https://sysflow.io) SysFlow is a cloud-native system telemetry framework that focuses on data abstraction, behavioral analytics, and noise reduction. At its core, SysFlow exposes a compact open telemetry format that records workload behaviors by connecting event and flow representations of process control flows, file interactions, and network communications. The resulting abstraction encodes a graph structure that enables provenance reasoning on host and container environments, and fast retrieval of security-relevant information.
* [StackRox](https://stackrox.io) is the industrys first Kubernetes-native security platform enabling organizations to build, deploy, and run cloud-native applications securely. The platform works with Kubernetes environments and integrates with DevOps and security tools, enabling teams to operationalize and secure their supply chain, infrastructure, and workloads. StackRox aims to harness containerized applications development speed while giving operations and security teams greater context and risk profiling. StackRox leverages cloud-native principles and declarative artifacts to automate DevSecOps best practices.
* [Wireshark](https://www.wireshark.org) is the world's most powerful and popular network protocol analyzer. The Wireshark team is combining Wireshark's features and Falco libs to create Logray, a cloud and system log analyzer with advanced filtering, capture, and scripting capabilities.
## Adding a name
If you would like to add your name to this file, submit a pull request with your change.

File diff suppressed because it is too large Load Diff

View File

@ -1,41 +1,112 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2019 The Falco Authors.
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
cmake_minimum_required(VERSION 3.5.1)
project(falco)
option(USE_BUNDLED_DEPS "Bundle hard to find dependencies into the Falco binary" OFF)
option(USE_BUNDLED_DEPS "Bundle hard to find dependencies into the Falco binary" ON)
option(USE_DYNAMIC_LIBELF "Dynamically link libelf" OFF)
option(BUILD_WARNINGS_AS_ERRORS "Enable building with -Wextra -Werror flags" OFF)
option(MINIMAL_BUILD "Build a minimal version of Falco, containing only the engine and basic input/output (EXPERIMENTAL)" OFF)
option(
MINIMAL_BUILD
"Build a minimal version of Falco, containing only the engine and basic input/output (EXPERIMENTAL)"
OFF
)
option(MUSL_OPTIMIZED_BUILD "Enable if you want a musl optimized build" OFF)
option(BUILD_FALCO_UNIT_TESTS "Build falco unit tests" OFF)
option(USE_ASAN "Build with AddressSanitizer" OFF)
option(USE_UBSAN "Build with UndefinedBehaviorSanitizer" OFF)
option(UBSAN_HALT_ON_ERROR "Halt on error when building with UBSan" ON)
# Mem allocators - linux only for now
if(NOT WIN32
AND NOT APPLE
AND NOT MINIMAL_BUILD
AND NOT EMSCRIPTEN
)
# If one enables multiple allocators, cmake will fail since all of the allocators cmake modules
# create a `malloc` target.
option(USE_JEMALLOC "Use jemalloc allocator, linux only" OFF)
option(USE_MIMALLOC "Use mimalloc (microsoft) allocator, linux only" OFF)
endif()
if(WIN32)
if(POLICY CMP0091)
# Needed for CMAKE_MSVC_RUNTIME_LIBRARY
# https://cmake.org/cmake/help/latest/policy/CMP0091.html
cmake_policy(SET CMP0091 NEW)
endif()
set(CPACK_GENERATOR "NSIS") # this needs NSIS installed, and available
elseif(APPLE)
set(CPACK_GENERATOR "DragNDrop")
elseif(EMSCRIPTEN)
set(USE_BUNDLED_DEPS
ON
CACHE BOOL "" FORCE
)
set(BUILD_DRIVER
OFF
CACHE BOOL "" FORCE
)
set(ENABLE_DKMS
OFF
CACHE BOOL "" FORCE
)
set(BUILD_BPF
OFF
CACHE BOOL "" FORCE
)
set(CPACK_GENERATOR
TGZ
CACHE BOOL "" FORCE
)
endif()
# gVisor is currently only supported on Linux x86_64
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64"
AND CMAKE_SYSTEM_NAME MATCHES "Linux"
AND NOT MINIMAL_BUILD
)
option(BUILD_FALCO_GVISOR "Build gVisor support for Falco" ON)
if(BUILD_FALCO_GVISOR)
add_definitions(-DHAS_GVISOR)
endif()
endif()
# Modern BPF is not supported on not Linux systems and in MINIMAL_BUILD
if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT MINIMAL_BUILD)
option(BUILD_FALCO_MODERN_BPF "Build modern BPF support for Falco" ON)
if(BUILD_FALCO_MODERN_BPF)
add_definitions(-DHAS_MODERN_BPF)
endif()
endif()
# We shouldn't need to set this, see https://gitlab.kitware.com/cmake/cmake/-/issues/16419
option(EP_UPDATE_DISCONNECTED "ExternalProject update disconnected" OFF)
if (${EP_UPDATE_DISCONNECTED})
set_property(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
PROPERTY EP_UPDATE_DISCONNECTED TRUE)
if(${EP_UPDATE_DISCONNECTED})
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY EP_UPDATE_DISCONNECTED TRUE)
endif()
# Elapsed time
# set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CMAKE_COMMAND} -E time") # TODO(fntlnz, leodido): add a flag to enable this
# Elapsed time set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CMAKE_COMMAND} -E time") #
# TODO(fntlnz, leodido): add a flag to enable this
# Make flag for parallel processing
include(ProcessorCount)
processorcount(PROCESSOR_COUNT)
ProcessorCount(PROCESSOR_COUNT)
if(NOT PROCESSOR_COUNT EQUAL 0)
set(PROCESSOUR_COUNT_MAKE_FLAG -j${PROCESSOR_COUNT})
set(PROCESSOUR_COUNT_MAKE_FLAG -j${PROCESSOR_COUNT})
endif()
# Custom CMake modules
@ -45,182 +116,164 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
include(GNUInstallDirs)
if(NOT DEFINED FALCO_ETC_DIR)
set(FALCO_ETC_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/falco")
set(FALCO_ETC_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/falco")
endif()
if(NOT DRAIOS_DEBUG_FLAGS)
set(DRAIOS_DEBUG_FLAGS "-D_DEBUG")
endif()
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE)
if(CMAKE_BUILD_TYPE STREQUAL "debug")
set(KBUILD_FLAGS "${DRAIOS_DEBUG_FLAGS} ${DRAIOS_FEATURE_FLAGS}")
# This will be used to print the architecture for which Falco is compiled.
if(EMSCRIPTEN)
set(FALCO_TARGET_ARCH "wasm")
else()
set(CMAKE_BUILD_TYPE "release")
set(KBUILD_FLAGS "${DRAIOS_FEATURE_FLAGS}")
endif()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
if(MINIMAL_BUILD)
set(MINIMAL_BUILD_FLAGS "-DMINIMAL_BUILD")
set(FALCO_TARGET_ARCH ${CMAKE_SYSTEM_PROCESSOR})
endif()
if(MUSL_OPTIMIZED_BUILD)
set(MUSL_FLAGS "-static -Os")
endif()
set(CMAKE_COMMON_FLAGS "-Wall -ggdb ${DRAIOS_FEATURE_FLAGS} ${MINIMAL_BUILD_FLAGS} ${MUSL_FLAGS}")
if(BUILD_WARNINGS_AS_ERRORS)
set(CMAKE_SUPPRESSED_WARNINGS
"-Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable -Wno-missing-field-initializers -Wno-sign-compare -Wno-type-limits -Wno-implicit-fallthrough -Wno-format-truncation -Wno-stringop-truncation -Wno-stringop-overflow -Wno-restrict"
)
set(CMAKE_COMMON_FLAGS "${CMAKE_COMMON_FLAGS} -Wextra -Werror ${CMAKE_SUPPRESSED_WARNINGS}")
endif()
set(CMAKE_C_FLAGS "${CMAKE_COMMON_FLAGS}")
set(CMAKE_CXX_FLAGS "--std=c++0x ${CMAKE_COMMON_FLAGS} -Wno-class-memaccess")
set(CMAKE_C_FLAGS_DEBUG "${DRAIOS_DEBUG_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${DRAIOS_DEBUG_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "-O3 -fno-strict-aliasing -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fno-strict-aliasing -DNDEBUG")
include(GetFalcoVersion)
include(CompilerFlags)
set(PACKAGE_NAME "falco")
set(PROBE_NAME "falco")
set(PROBE_DEVICE_NAME "falco")
set(DRIVER_NAME "falco")
set(DRIVER_DEVICE_NAME "falco")
set(DRIVERS_REPO "https://download.falco.org/driver")
# If no path is provided, try to search the BPF probe in: `home/.falco/falco-bpf.o` This is the same
# fallback that we had in the libraries: `SCAP_PROBE_BPF_FILEPATH`.
set(FALCO_PROBE_BPF_FILEPATH ".${DRIVER_NAME}/${DRIVER_NAME}-bpf.o")
add_definitions(-DFALCO_PROBE_BPF_FILEPATH="${FALCO_PROBE_BPF_FILEPATH}")
if(NOT DEFINED FALCO_COMPONENT_NAME)
set(FALCO_COMPONENT_NAME "${CMAKE_PROJECT_NAME}")
endif()
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX
/usr
CACHE PATH "Default install path" FORCE)
set(CMAKE_INSTALL_PREFIX
/usr
CACHE PATH "Default install path" FORCE
)
endif()
set(CMD_MAKE make)
include(ExternalProject)
# jq
include(jq)
# libs
include(falcosecurity-libs)
# compute FALCO_VERSION (depends on libs)
include(falco-version)
# Mem allocators - linux only for now
if(NOT WIN32
AND NOT APPLE
AND NOT MINIMAL_BUILD
AND NOT EMSCRIPTEN
)
if(USE_JEMALLOC)
include(jemalloc)
endif()
if(USE_MIMALLOC)
include(mimalloc)
endif()
message(STATUS "Will use mem allocator library: ${MALLOC_LIB}")
endif()
# nlohmann-json
set(NJSON_SRC "${PROJECT_BINARY_DIR}/njson-prefix/src/njson")
message(STATUS "Using bundled nlohmann-json in '${NJSON_SRC}'")
set(NJSON_INCLUDE "${NJSON_SRC}/single_include")
ExternalProject_Add(
njson
URL "https://github.com/nlohmann/json/archive/v3.3.0.tar.gz"
URL_HASH "SHA256=2fd1d207b4669a7843296c41d3b6ac5b23d00dec48dba507ba051d14564aa801"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND "")
# curses
# We pull this in because libsinsp won't build without it
set(CURSES_NEED_NCURSES TRUE)
find_package(Curses REQUIRED)
message(STATUS "Found ncurses: include: ${CURSES_INCLUDE_DIR}, lib: ${CURSES_LIBRARIES}")
# b64
include(b64)
include(njson)
# yaml-cpp
include(yaml-cpp)
if(NOT MINIMAL_BUILD)
# OpenSSL
include(OpenSSL)
if(NOT WIN32
AND NOT APPLE
AND NOT MINIMAL_BUILD
AND NOT EMSCRIPTEN
)
# OpenSSL
include(openssl)
# libcurl
include(cURL)
# libcurl
include(curl)
# todo(jasondellaluce,rohith-raju): support webserver for non-linux builds too cpp-httlib
include(cpp-httplib)
endif()
# LuaJIT
include(luajit)
# Lpeg
include(lpeg)
# libyaml
include(libyaml)
# lyaml
include(lyaml)
include(cxxopts)
# One TBB
set(TBB_SRC "${PROJECT_BINARY_DIR}/tbb-prefix/src/tbb")
message(STATUS "Using bundled tbb in '${TBB_SRC}'")
set(TBB_INCLUDE_DIR "${TBB_SRC}/include/")
set(TBB_LIB "${TBB_SRC}/build/lib_release/libtbb.a")
ExternalProject_Add(
tbb
URL "https://github.com/oneapi-src/oneTBB/archive/2018_U5.tar.gz"
URL_HASH "SHA256=b8dbab5aea2b70cf07844f86fa413e549e099aa3205b6a04059ca92ead93a372"
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMD_MAKE} tbb_build_dir=${TBB_SRC}/build tbb_build_prefix=lib extra_inc=big_iron.inc
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${TBB_LIB}
INSTALL_COMMAND "")
if(NOT MINIMAL_BUILD)
# civetweb
set(CIVETWEB_SRC "${PROJECT_BINARY_DIR}/civetweb-prefix/src/civetweb/")
set(CIVETWEB_LIB "${CIVETWEB_SRC}/install/lib/libcivetweb.a")
set(CIVETWEB_INCLUDE_DIR "${CIVETWEB_SRC}/install/include")
message(STATUS "Using bundled civetweb in '${CIVETWEB_SRC}'")
ExternalProject_Add(
civetweb
URL "https://github.com/civetweb/civetweb/archive/v1.11.tar.gz"
URL_HASH "SHA256=de7d5e7a2d9551d325898c71e41d437d5f7b51e754b242af897f7be96e713a42"
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E make_directory ${CIVETWEB_SRC}/install/lib
COMMAND ${CMAKE_COMMAND} -E make_directory ${CIVETWEB_SRC}/install/include
BUILD_IN_SOURCE 1
BUILD_COMMAND ${CMD_MAKE} COPT="-DNO_FILES" WITH_CPP=1
BUILD_BYPRODUCTS ${CIVETWEB_LIB}
INSTALL_COMMAND ${CMD_MAKE} COPT="-DNO_FILES" install-lib install-headers PREFIX=${CIVETWEB_SRC}/install "WITH_CPP=1")
if(NOT EMSCRIPTEN)
include(tbb)
endif()
#string-view-lite
include(DownloadStringViewLite)
include(zlib)
include(valijson)
if(NOT MINIMAL_BUILD)
# gRPC
include(gRPC)
if(NOT WIN32
AND NOT APPLE
AND NOT EMSCRIPTEN
)
include(cares)
include(protobuf)
# gRPC
include(grpc)
endif()
endif()
# sysdig
include(sysdig)
# Installation
install(FILES falco.yaml DESTINATION "${FALCO_ETC_DIR}")
if(WIN32)
set(FALCO_INSTALL_CONF_FILE
"%PROGRAMFILES%/${PACKAGE_NAME}-${FALCO_VERSION}/etc/falco/falco.yaml"
)
install(
FILES falco.yaml
DESTINATION etc/falco/
COMPONENT "${FALCO_COMPONENT_NAME}"
)
install(
DIRECTORY
DESTINATION etc/falco/config.d
COMPONENT "${FALCO_COMPONENT_NAME}"
)
elseif(APPLE)
set(FALCO_INSTALL_CONF_FILE "/etc/falco/falco.yaml")
install(
FILES falco.yaml
DESTINATION etc/falco/
COMPONENT "${FALCO_COMPONENT_NAME}"
)
install(
DIRECTORY
DESTINATION etc/falco/config.d
COMPONENT "${FALCO_COMPONENT_NAME}"
)
else()
set(FALCO_INSTALL_CONF_FILE "/etc/falco/falco.yaml")
install(
FILES falco.yaml
DESTINATION "${FALCO_ETC_DIR}"
COMPONENT "${FALCO_COMPONENT_NAME}"
)
install(
DIRECTORY
DESTINATION "${FALCO_ETC_DIR}/config.d"
COMPONENT "${FALCO_COMPONENT_NAME}"
)
endif()
if(NOT MINIMAL_BUILD)
# Coverage
include(Coverage)
# Tests
add_subdirectory(test)
# Coverage
include(Coverage)
endif()
# Rules
add_subdirectory(rules)
include(rules)
# Dockerfiles
add_subdirectory(docker)
# Clang format
# add_custom_target(format COMMAND clang-format --style=file -i $<TARGET_PROPERTY:falco,SOURCES> COMMENT "Formatting ..." VERBATIM)
# Clang format add_custom_target(format COMMAND clang-format --style=file -i
# $<TARGET_PROPERTY:falco,SOURCES> COMMENT "Formatting ..." VERBATIM)
# Static analysis
include(static-analysis)
# Shared build variables
set(FALCO_SINSP_LIBRARY sinsp)
set(FALCO_SHARE_DIR share/falco)
set(FALCO_ABSOLUTE_SHARE_DIR "${CMAKE_INSTALL_PREFIX}/${FALCO_SHARE_DIR}")
set(FALCO_BIN_DIR bin)
@ -228,7 +281,47 @@ set(FALCO_BIN_DIR bin)
add_subdirectory(scripts)
add_subdirectory(userspace/engine)
add_subdirectory(userspace/falco)
add_subdirectory(tests)
if(NOT WIN32
AND NOT APPLE
AND NOT EMSCRIPTEN
AND NOT MUSL_OPTIMIZED_BUILD
)
include(falcoctl)
include(container_plugin)
# Generate a binary_dir/falco.yaml that automatically enables the plugin to be used for local
# testing.
configure_file(${CMAKE_SOURCE_DIR}/falco.yaml ${CMAKE_BINARY_DIR} COPYONLY)
# The custom target configures the plugin and set its path
add_custom_target(
container
COMMAND sed -i 's,^load_plugins: .*,load_plugins: [container],g'
${CMAKE_BINARY_DIR}/falco.yaml
COMMAND sed -i 's,library_path: libcontainer.so,library_path: ${CONTAINER_LIBRARY},g'
${CMAKE_BINARY_DIR}/falco.yaml
DEPENDS container_plugin
)
# Let `make falco` also download container plugin
add_dependencies(falco container)
# Install the plugin
install(
FILES "${CONTAINER_LIBRARY}"
DESTINATION "${FALCO_ABSOLUTE_SHARE_DIR}/plugins"
COMPONENT "${FALCO_COMPONENT_NAME}"
)
# Install additional config override file to enable the container plugin
install(
FILES "${PROJECT_SOURCE_DIR}/config/falco.container_plugin.yaml"
DESTINATION "${FALCO_ETC_DIR}/config.d"
COMPONENT "${FALCO_COMPONENT_NAME}"
)
endif()
# Packages configuration
include(CPackConfig)
if(BUILD_FALCO_UNIT_TESTS)
add_subdirectory(unit_tests)
endif()

207
Contributing.md Normal file
View File

@ -0,0 +1,207 @@
# How to contribute
## Enforce coding style 💻
### Introduction
This document introduces the coding style that will be applied in this repository.
This coding style involves all the following files: `.c`, `.h`, `.cpp`, `.cmake`, `CMakeLists.txt`. To enforce it we rely on two main tools:
1. `clang-format` version `18.1.8`.
2. `cmake-format` version `0.6.13`.
> __Please note__: tools versions are important! Different versions will enforce slightly different changes on the code. For example `clang-format-18` will produce a slightly different output respect to `clang-format-17` always respecting the imposed style.
The coding style is expressed through the 2 configuration file that you find in this repo: `.clang-format`, `.cmake-format.json`.
### Enforce the style locally
There are many ways to enforce the style locally, here we will describe two of them:
1. Use `pre-commit` framework.
2. Use the repo `Makefile`.
#### 1.Pre-commit framework (suggested if you don't have the 2 tools already installed on your machine)
The `pre-commit` framework allows you to automatically install different `git-hooks` that will run at every new commit. More precisely, if you use the `.pre-commit-config.yaml` in this repo you will install 3 different hooks:
1. The `clang-format` hook: this is a `pre-commit` git hook that runs `clang-format` on your staged changes.
2. The `cmake-format` hook: this is a `pre-commit` git hook that runs `cmake-format` on your staged changes.
3. The `DCO signed-off` hook: this is a `pre-commit-msg` git hook that adds the `DCO` on your commit if not present. This hook is not strictly related to the coding style so we will talk about it in a separate section: [Add DCO signed-off to your commits](#add-dco-signed-off-to-your-commits).
Now let's see what we need to use `pre-commit` framework.
##### Step 1
Install `pre-commit` framework following the [official documentation](https://pre-commit.com/#installation).
> __Please note__: you have to follow only the "Installation" section.
##### Step 2
Once you have installed `pre-commit`, you don't need to install anything else! This is the good point of using a framework like `pre-commit`, all the tools necessary to format your code will be directly managed by the framework. But in order to be ready, you need to install the git hooks in your local repo.
This simple command allows you to install the two `pre-commit` git hooks, `clang-format` and `cmake-format`.
```bash
pre-commit install --install-hooks --hook-type pre-commit --overwrite
```
If you want to install also the `pre-commit-msg` git hook for the DCO you have to type the following command, but be sure to have configured all you need as said in the [dedicated section]((#add-dco-signed-off-to-your-commits))
```bash
pre-commit install --install-hooks --hook-type prepare-commit-msg --overwrite
```
You have done, at every new commit, this hook will check that your patch respects the coding style of this repo!
If you want to detach the git hooks, you can simply type:
```bash
pre-commit uninstall --hook-type prepare-commit-msg
pre-commit uninstall --hook-type pre-commit
```
#### 2.Makefile
##### Step 1
In order to use the repo `Makefile`, you need to install on your local machine the two aforementioned tools:
__clang-format v18.1.8__
One of the easiest ways to install `clang-format` could be directly downloading its static binary from [here](https://github.com/muttleyxd/clang-tools-static-binaries).
There are other ways for example you can download the package for your distro or you can also build it from sources.
__cmake-format v0.6.13__
To install `cmake-format` you can follow the official documentation [here](https://cmake-format.readthedocs.io/en/latest/installation.html).
> __NOTE__: Please check the versions of the two tool with `clang-format --version` and `cmake-format --version`.
##### Step 2
Once you have installed the __right__ versions of the 2 tools, you can simply type `make format-all` from the root directory of the project (`/libs`) to format all your code according to the coding style.
Remember to do that before submitting a new patch upstream! 😁
#### Other solutions
Obviously, you can also install the 2 tools locally and enable some extension of your favorite IDE (like `VScode`) to format your code every time you save your files!
## Add DCO signed-off to your commits 🔏
### Introduction
Another requirement for contributing to the `libs` repository, is applying the [DCO](https://cert-manager.io/docs/contributing/sign-off/) to every commit you want to push upstream.
Before doing this you have to configure your git user `name` and `email` if you haven't already done it. To check your actual `name` and `email` type:
```bash
git config --get user.name
git config --get user.email
```
If they are correct you have done, otherwise, you have to set them:
```bash
git config user.name <full-name>
git config user.email <mail-used_with-GitHub-profile>
```
>__Please note__: If you have problems in doing this you can read the full documentation [here](https://docs.github.com/en/get-started/getting-started-with-git/setting-your-username-in-git).
### Enforce the DCO locally
Now you are ready to sign your commits! You have two main ways to do this:
1. Manually with `git` tool.
2. Use the `pre-commit-msg` hook quoted before.
### Manually
To do this you just need to remember the `-s` while performing your commits:
```bash
git commit -s
```
or with the inline message:
```bash
git commit -s -m "my first commit"
```
### Use `pre-commit` hook
Here if you have already added the hook in the [previous section](#step-2), you have to do nothing otherwise you have to simply install the DCO hook with:
```bash
pre-commit install --install-hooks --hook-type prepare-commit-msg --overwrite
```
And you have done! Now you don't have to remember the `-s` option every time you commit something, the DCO hook will automatically add the DCO if you forget it! 😄
## Some best practices 📏
### Class variables
To know whether a variable belongs to a `class` or a `function`, we start member variables with `m_`.
Example:
```c
public int32_t m_counter;
```
### Global variables
To know whether the variable is global or not, we start globals with `g_`.
Example:
```c
int g_nplugins;
```
### Capitalization
The naming convention is camel-cased "Unix" style, i.e. always lower case. Words are separated by underscores.
Example:
```c
int32_t g_global_bean_counter;
int32_t count_beans();
```
and not,
```c
int32_t GlobalBeanCounter;
int32_t CountBeans();
```
### Packed Structures
Packed structures should use the GCC and MSVC-style supported `pragma`:
Example:
```c
#pragma pack(push,1)
struct frame_control
{
struct fields....
};
#pragma pack(pop)
```
### 64-bit constants
Put an `LL` at the end of your `64-bit` constants. Without the `LL`, some platform compilers try to interpret the constant on the right-hand side as a `long integer` instead of a `long long` and this could lead to an error at building time.
Example:
```c
x=0X00FF00000000000LL
```

202
LICENSE Normal file
View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2019 The Falco Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

81
Makefile Normal file
View File

@ -0,0 +1,81 @@
#
# Copyright (C) 2024 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# mofidy the following variables to match your paths
CLANG_FORMAT_EXE ?= clang-format
CLANG_FORMAT_VERSION = "$(shell ${CLANG_FORMAT_EXE} --version | grep -o '[0-9]*\.[0-9]*\.[0-9]*')"
CLANG_FORMAT_DESIRED_VERSION ="18.1.8"
CMAKE_FORMAT_EXE ?= cmake-format
CMAKE_FORMAT_VERSION = "$(shell ${CMAKE_FORMAT_EXE} --version | grep -o '[0-9]*\.[0-9]*\.[0-9]*')"
CMAKE_FORMAT_DESIRED_VERSION = "0.6.13"
PROJECT_ROOT_DIR = $(shell git rev-parse --show-toplevel)
######################
# Clang-format #
######################
.PHONY: clang-format-install
clang-format-install:
ifeq (, $(shell ${CLANG_FORMAT_EXE} --version))
@echo "${CLANG_FORMAT_EXE} is not installed. Please read the 'coding style' doc to get more info."
@exit 1
endif
ifneq ($(CLANG_FORMAT_VERSION), $(CLANG_FORMAT_DESIRED_VERSION))
@echo "${CLANG_FORMAT_EXE} version is not '${CLANG_FORMAT_DESIRED_VERSION}'. Actual version is '${CLANG_FORMAT_VERSION}'"
@exit 1
endif
.PHONY: format-clang
format-clang: clang-format-install
git ls-files --directory ${PROJECT_ROOT_DIR} | grep -E '\.(cpp|h|c)$$' | xargs ${CLANG_FORMAT_EXE} -Werror --style=file:${PROJECT_ROOT_DIR}/.clang-format -i
.PHONY: check-clang
check-clang: clang-format-install
git ls-files --directory ${PROJECT_ROOT_DIR} | grep -E '\.(cpp|h|c)$$' | xargs ${CLANG_FORMAT_EXE} -Werror --style=file:${PROJECT_ROOT_DIR}/.clang-format -n
######################
# Cmake-format #
######################
.PHONY: cmake-format-install
cmake-format-install:
ifeq (, $(shell ${CMAKE_FORMAT_EXE} --version))
@echo "${CMAKE_FORMAT_EXE} is not installed. Please read the 'coding style' doc to get more info."
@exit 1
endif
ifneq ($(CMAKE_FORMAT_VERSION), $(CMAKE_FORMAT_DESIRED_VERSION))
@echo "${CMAKE_FORMAT_EXE} version is not '${CMAKE_FORMAT_DESIRED_VERSION}'. Actual version is '${CMAKE_FORMAT_VERSION}'"
@exit 1
endif
.PHONY: format-cmake
format-cmake: cmake-format-install
git ls-files --directory ${PROJECT_ROOT_DIR} | grep -E '\.(cmake)$$|CMakeLists.txt$$' | xargs ${CMAKE_FORMAT_EXE} --config-files ${PROJECT_ROOT_DIR}/.cmake-format.json -i
.PHONY: check-cmake
check-cmake: cmake-format-install
git ls-files --directory ${PROJECT_ROOT_DIR} | grep -E '\.(cmake)$$|CMakeLists.txt$$' | xargs ${CMAKE_FORMAT_EXE} --config-files ${PROJECT_ROOT_DIR}/.cmake-format.json --check
# Add new formatters here...
.PHONY: format-all
format-all: format-clang format-cmake
.PHONY: check-all
check-all: check-clang check-cmake

15
OWNERS
View File

@ -1,14 +1,15 @@
approvers:
- fntlnz
- kris-nova
- leodido
- mstemm
- leogr
- jasondellaluce
- fededp
- andreagit97
- LucaGuerra
- sgaist
reviewers:
- fntlnz
- kaizhe
emeritus_approvers:
- fntlnz
- kris-nova
- leodido
- mfdii
- mstemm
- leogr
- incertum

222
README.md
View File

@ -1,145 +1,147 @@
<p align="center"><img src="https://raw.githubusercontent.com/falcosecurity/community/master/logo/primary-logo.png" width="360"></p>
<p align="center"><b>Cloud Native Runtime Security.</b></p>
# Falco
<hr>
[![Latest release](https://img.shields.io/github/v/release/falcosecurity/falco?style=for-the-badge)](https://github.com/falcosecurity/falco/releases/latest) [![Supported Architectures](https://img.shields.io/badge/ARCHS-x86__64%7Caarch64-blueviolet?style=for-the-badge)](https://github.com/falcosecurity/falco/releases/latest) [![License](https://img.shields.io/github/license/falcosecurity/falco?style=for-the-badge)](COPYING) [![Docs](https://img.shields.io/badge/docs-latest-green.svg?style=for-the-badge)](https://falco.org/docs)
[![Build Status](https://img.shields.io/circleci/build/github/falcosecurity/falco/master?style=for-the-badge)](https://circleci.com/gh/falcosecurity/falco) [![CII Best Practices Summary](https://img.shields.io/cii/summary/2317?label=CCI%20Best%20Practices&style=for-the-badge)](https://bestpractices.coreinfrastructure.org/projects/2317) [![GitHub](https://img.shields.io/github/license/falcosecurity/falco?style=for-the-badge)](COPYING)
[![Falco Core Repository](https://github.com/falcosecurity/evolution/blob/main/repos/badges/falco-core-blue.svg)](https://github.com/falcosecurity/evolution/blob/main/REPOSITORIES.md#core-scope) [![Stable](https://img.shields.io/badge/status-stable-brightgreen?style=for-the-badge)](https://github.com/falcosecurity/evolution/blob/main/REPOSITORIES.md#stable) [![OpenSSF Scorecard](https://img.shields.io/ossf-scorecard/github.com/falcosecurity/falco?label=openssf%20scorecard&style=for-the-badge)](https://scorecard.dev/viewer/?uri=github.com/falcosecurity/falco) [![OpenSSF Best Practices](https://img.shields.io/cii/summary/2317?label=OpenSSF%20Best%20Practices&style=for-the-badge)](https://bestpractices.coreinfrastructure.org/projects/2317)
Want to talk? Join us on the [#falco](https://kubernetes.slack.com/archives/CMWH3EH32) channel in the [Kubernetes Slack](https://slack.k8s.io).
[![Falco](https://falco.org/img/brand/falco-horizontal-color.svg)](https://falco.org)
### Latest releases
[Falco](https://falco.org/) is a cloud native runtime security tool for Linux operating systems. It is designed to detect and alert on abnormal behavior and potential security threats in real-time.
Read the [change log](CHANGELOG.md).
At its core, Falco is a kernel monitoring and detection agent that observes events, such as syscalls, based on custom rules. Falco can enhance these events by integrating metadata from the container runtime and Kubernetes. The collected events can be analyzed off-host in SIEM or data lake systems.
<!--
Badges in the following table are constructed by using the
https://img.shields.io/badge/dynamic/xml endpoint.
Falco, originally created by [Sysdig](https://sysdig.com), is a **graduated project** under the [Cloud Native Computing Foundation](https://cncf.io) (CNCF) used in production by various [organisations](https://github.com/falcosecurity/falco/blob/master/ADOPTERS.md).
Parameters are configured for fetching packages from S3 before
(filtered by prefix, sorted in ascending order) and for picking
the latest package by using an XPath selector after.
For detailed technical information and insights into the cyber threats that Falco can detect, visit the official [Falco](https://falco.org/) website.
- Common query parameters:
For comprehensive information on the latest updates and changes to the project, please refer to the [Change Log](CHANGELOG.md).
color=#300aec7
style=flat-square
label=Falco
## The Falco Project
- DEB packages parameters:
The Falco Project codebase is maintained under the [falcosecurity GitHub organization](https://github.com/falcosecurity). The primary repository, [falcosecurity/falco](https://github.com/falcosecurity/falco), holds the source code for the Falco binary, while other sub-projects are hosted in dedicated repositories. This approach of isolating components into specialized repositories enhances modularity and focused development. Notable [core repositories](https://github.com/falcosecurity/evolution?tab=readme-ov-file#core) include:
url=https://falco-distribution.s3-eu-west-1.amazonaws.com/?prefix=packages/deb/stable/falco-
query=substring-before(substring-after((/*[name()='ListBucketResult']/*[name()='Contents'])[last()]/*[name()='Key'],"falco-"),".asc")
- [falcosecurity/libs](https://github.com/falcosecurity/libs): This repository hosts Falco's core libraries, which constitute the majority of the binarys source code and provide essential features, such as kernel drivers.
- [falcosecurity/rules](https://github.com/falcosecurity/rules): It contains the official ruleset for Falco, offering pre-defined detection rules for various security threats and abnormal behaviors.
- [falcosecurity/plugins](https://github.com/falcosecurity/plugins): This repository supports integration with external services through plugins that extend Falco's capabilities beyond syscalls and container events, with plans for evolving specialized functionalities in future releases.
- [falcosecurity/falcoctl](https://github.com/falcosecurity/falcoctl): A command-line utility designed for managing and interacting with Falco.
- [falcosecurity/charts](https://github.com/falcosecurity/charts): This repository provides Helm charts for deploying Falco and its ecosystem, simplifying the installation and management process.
- RPM packages parameters:
For further insights into our repositories and additional details about our governance model, please visit the official hub of The Falco Project: [falcosecurity/evolution](https://github.com/falcosecurity/evolution).
url=https://falco-distribution.s3-eu-west-1.amazonaws.com/?prefix=packages/rpm/falco-
query=substring-before(substring-after((/*[name()='ListBucketResult']/*[name()='Contents'])[last()]/*[name()='Key'],"falco-"),".asc")
## Getting Started with Falco
- BIN packages parameters:
If you're new to Falco, begin your journey with our [Getting Started](https://falco.org/docs/getting-started/) guide. For production deployments, please refer to our comprehensive [Setup](https://falco.org/docs/setup/) documentation.
url=https://falco-distribution.s3-eu-west-1.amazonaws.com/?prefix=packages/bin/x86_64/falco-
query=substring-after((/*[name()='ListBucketResult']/*[name()='Contents'])[last()]/*[name()='Key'], "falco-")
As final recommendations before deploying Falco, verify environment compatibility, define your detection goals, optimize performance, choose the appropriate build, and plan for SIEM or data lake integration to ensure effective incident response.
Notes:
- if more than 1000 items are present under as S3 prefix,
the actual latest package will be not picked;
see https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html
- for `-dev` packages, the S3 prefix is modified accordingly
- finally, all parameters are URL encoded and appended to the badge endpoint
### Demo Environment
-->
A demo environment is provided via a docker-compose file that can be started on a docker host which includes falco, falcosidekick, falcosidekick-ui and its required redis database. For more information see the [docker-compose section](docker/docker-compose/)
| | development | stable |
|--------|-----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| rpm | [![rpm-dev](https://img.shields.io/badge/dynamic/xml?color=%2300aec7&style=flat-square&label=Falco&query=substring-before%28substring-after%28%28%2F%2A%5Bname%28%29%3D%27ListBucketResult%27%5D%2F%2A%5Bname%28%29%3D%27Contents%27%5D%29%5Blast%28%29%5D%2F%2A%5Bname%28%29%3D%27Key%27%5D%2C%22falco-%22%29%2C%22.asc%22%29&url=https%3A%2F%2Ffalco-distribution.s3-eu-west-1.amazonaws.com%2F%3Fprefix%3Dpackages%2Frpm-dev%2Ffalco-)][1] | [![rpm](https://img.shields.io/badge/dynamic/xml?color=%2300aec7&style=flat-square&label=Falco&query=substring-before%28substring-after%28%28%2F%2A%5Bname%28%29%3D%27ListBucketResult%27%5D%2F%2A%5Bname%28%29%3D%27Contents%27%5D%29%5Blast%28%29%5D%2F%2A%5Bname%28%29%3D%27Key%27%5D%2C%22falco-%22%29%2C%22.asc%22%29&url=https%3A%2F%2Ffalco-distribution.s3-eu-west-1.amazonaws.com%2F%3Fprefix%3Dpackages%2Frpm%2Ffalco-)][2] |
| deb | [![deb-dev](https://img.shields.io/badge/dynamic/xml?color=%2300aec7&style=flat-square&label=Falco&query=substring-before%28substring-after%28%28%2F%2A%5Bname%28%29%3D%27ListBucketResult%27%5D%2F%2A%5Bname%28%29%3D%27Contents%27%5D%29%5Blast%28%29%5D%2F%2A%5Bname%28%29%3D%27Key%27%5D%2C%22falco-%22%29%2C%22.asc%22%29&url=https%3A%2F%2Ffalco-distribution.s3-eu-west-1.amazonaws.com%2F%3Fprefix%3Dpackages%2Fdeb-dev%2Fstable%2Ffalco-)][3] | [![deb](https://img.shields.io/badge/dynamic/xml?color=%2300aec7&style=flat-square&label=Falco&query=substring-before%28substring-after%28%28%2F%2A%5Bname%28%29%3D%27ListBucketResult%27%5D%2F%2A%5Bname%28%29%3D%27Contents%27%5D%29%5Blast%28%29%5D%2F%2A%5Bname%28%29%3D%27Key%27%5D%2C%22falco-%22%29%2C%22.asc%22%29&url=https%3A%2F%2Ffalco-distribution.s3-eu-west-1.amazonaws.com%2F%3Fprefix%3Dpackages%2Fdeb%2Fstable%2Ffalco-)][4] |
| binary | [![bin-dev](https://img.shields.io/badge/dynamic/xml?color=%2300aec7&style=flat-square&label=Falco&query=substring-after%28%28%2F%2A%5Bname%28%29%3D%27ListBucketResult%27%5D%2F%2A%5Bname%28%29%3D%27Contents%27%5D%29%5Blast%28%29%5D%2F%2A%5Bname%28%29%3D%27Key%27%5D%2C%20%22falco-%22%29&url=https%3A%2F%2Ffalco-distribution.s3-eu-west-1.amazonaws.com%2F%3Fprefix%3Dpackages%2Fbin-dev%2Fx86_64%2Ffalco-)][5] | [![bin](https://img.shields.io/badge/dynamic/xml?color=%2300aec7&style=flat-square&label=Falco&query=substring-after%28%28%2F%2A%5Bname%28%29%3D%27ListBucketResult%27%5D%2F%2A%5Bname%28%29%3D%27Contents%27%5D%29%5Blast%28%29%5D%2F%2A%5Bname%28%29%3D%27Key%27%5D%2C%20%22falco-%22%29&url=https%3A%2F%2Ffalco-distribution.s3-eu-west-1.amazonaws.com%2F%3Fprefix%3Dpackages%2Fbin%2Fx86_64%2Ffalco-)][6] |
## Join the Community
---
To get involved with the Falco Project please visit the [Community](https://github.com/falcosecurity/community) repository to find more information and ways to get involved.
The Falco Project, originally created by [Sysdig](https://sysdig.com), is an incubating [CNCF](https://cncf.io) open source cloud native runtime security tool.
Falco makes it easy to consume kernel events, and enrich those events with information from Kubernetes and the rest of the cloud native stack.
Falco has a rich set of security rules specifically built for Kubernetes, Linux, and cloud-native.
If a rule is violated in a system, Falco will send an alert notifying the user of the violation and its severity.
### Installing Falco
If you would like to run Falco in **production** please adhere to the [official installation guide](https://falco.org/docs/getting-started/installation/).
##### Kubernetes
| Tool | Link | Note |
|----------|--------------------------------------------------------------------------------------------|--------------------------------------------------------------------|
| Helm | [Chart Repository](https://github.com/falcosecurity/charts/tree/master/falco#introduction) | The Falco community offers regular helm chart releases. |
| Minikube | [Tutorial](https://falco.org/docs/getting-started/third-party/#minikube) | The Falco driver has been baked into minikube for easy deployment. |
| Kind | [Tutorial](https://falco.org/docs/getting-started/third-party/#kind) | Running Falco with kind requires a driver on the host system. |
| GKE | [Tutorial](https://falco.org/docs/getting-started/third-party/#gke) | We suggest using the eBPF driver for running Falco on GKE. |
### Developing
Falco is designed to be extensible such that it can be built into cloud-native applications and infrastructure.
Falco has a [gRPC](https://falco.org/docs/grpc/) endpoint and an API defined in [protobuf](https://github.com/falcosecurity/falco/blob/master/userspace/falco/outputs.proto).
The Falco Project supports various SDKs for this endpoint.
##### SDKs
| Language | Repository |
|----------|---------------------------------------------------------|
| Go | [client-go](https://github.com/falcosecurity/client-go) |
| Rust | [client-rs](https://github.com/falcosecurity/client-rs) |
| Python | [client-py](https://github.com/falcosecurity/client-py) |
### What can Falco detect?
Falco can detect and alert on any behavior that involves making Linux system calls.
Falco alerts can be triggered by the use of specific system calls, their arguments, and by properties of the calling process.
For example, Falco can easily detect incidents including but not limited to:
- A shell is running inside a container or pod in Kubernetes.
- A container is running in privileged mode, or is mounting a sensitive path, such as `/proc`, from the host.
- A server process is spawning a child process of an unexpected type.
- Unexpected read of a sensitive file, such as `/etc/shadow`.
- A non-device file is written to `/dev`.
- A standard system binary, such as `ls`, is making an outbound network connection.
- A privileged pod is started in a Kubernetes cluster.
### Documentation
The [Official Documentation](https://falco.org/docs/) is the best resource to learn about Falco.
### Join the Community
To get involved with The Falco Project please visit [the community repository](https://github.com/falcosecurity/community) to find more.
If you have any questions about Falco or contributing, do not hesitate to file an issue or contact the Falco maintainers and community members for assistance.
How to reach out?
- Join the #falco channel on the [Kubernetes Slack](https://slack.k8s.io)
- [Join the Falco mailing list](https://lists.cncf.io/g/cncf-falco-dev)
- [Read the Falco documentation](https://falco.org/docs/)
- Join the [#falco](https://kubernetes.slack.com/messages/falco) channel on the [Kubernetes Slack](https://slack.k8s.io).
- Join the [Falco mailing list](https://lists.cncf.io/g/cncf-falco-dev).
- File an [issue](https://github.com/falcosecurity/falco/issues) or make feature requests.
## Commitment to Falco's Own Security
Full reports of various security audits can be found [here](./audits/).
In addition, you can refer to the [falco](https://github.com/falcosecurity/falco/security) and [libs](https://github.com/falcosecurity/libs/security) security sections for detailed updates on security advisories and policies.
To report security vulnerabilities, please follow the community process outlined in the documentation found [here](https://github.com/falcosecurity/.github/blob/main/SECURITY.md).
## Building
For comprehensive, step-by-step instructions on building Falco from source, please refer to the [official documentation](https://falco.org/docs/developer-guide/source/).
## Testing
<details>
<summary>Expand Testing Instructions</summary>
Falco's [Build Falco from source](https://falco.org/docs/developer-guide/source/) is the go-to resource to understand how to build Falco from source. In addition, the [falcosecurity/libs](https://github.com/falcosecurity/libs) repository offers additional valuable information about tests and debugging of Falco's underlying libraries and kernel drivers.
Here's an example of a `cmake` command that will enable everything you need for all unit tests of this repository:
```bash
cmake \
-DUSE_BUNDLED_DEPS=ON \
-DBUILD_LIBSCAP_GVISOR=ON \
-DBUILD_BPF=ON \
-DBUILD_DRIVER=ON \
-DBUILD_FALCO_MODERN_BPF=ON \
-DCREATE_TEST_TARGETS=ON \
-DBUILD_FALCO_UNIT_TESTS=ON ..;
```
Build and run the unit test suite:
```bash
nproc=$(grep processor /proc/cpuinfo | tail -n 1 | awk '{print $3}');
make -j$(($nproc-1)) falco_unit_tests;
# Run the tests
sudo ./unit_tests/falco_unit_tests;
```
Optionally, build the driver of your choice and test run the Falco binary to perform manual tests.
Lastly, The Falco Project has moved its Falco regression tests to [falcosecurity/testing](https://github.com/falcosecurity/testing).
### Contributing
</details>
See the [CONTRIBUTING.md](https://github.com/falcosecurity/.github/blob/master/CONTRIBUTING.md).
</br>
### Security Audit
## How to Contribute
A third party security audit was performed by Cure53, you can see the full report [here](./audits/SECURITY_AUDIT_2019_07.pdf).
Please refer to the [Contributing](https://github.com/falcosecurity/.github/blob/main/CONTRIBUTING.md) guide and the [Code of Conduct](https://github.com/falcosecurity/evolution/blob/main/CODE_OF_CONDUCT.md) for more information on how to contribute.
### Reporting security vulnerabilities
## FAQs
Please report security vulnerabilities following the community process documented [here](https://github.com/falcosecurity/.github/blob/master/SECURITY.md).
### Why is Falco in C++ rather than Go or {language}?
### License Terms
<details>
<summary>Expand Information</summary>
1. The first lines of code at the base of Falco were written some time ago, where Go didn't yet have the same level of maturity and adoption as today.
2. The Falco execution model is sequential and mono-thread due to the statefulness requirements of the tool, and so most of the concurrency-related selling points of the Go runtime would not be leveraged at all.
3. The Falco code deals with very low-level programming in many places (e.g. some headers are shared with the eBPF probe and the Kernel module), and we all know that interfacing Go with C is possible but brings tons of complexity and tradeoffs to the table.
4. As a security tool meant to consume a crazy high throughput of events per second, Falco needs to squeeze performance in all hot paths at runtime and requires deep control on memory allocation, which the Go runtime can't provide (there's also garbage collection involved).
5. Although Go didn't suit the engineering requirements of the core of Falco, we still thought that it could be a good candidate for writing Falco extensions through the plugin system. This is the main reason we gave special attention and high priority to the development of the plugin-sdk-go.
6. Go is not a requirement for having statically-linked binaries. In fact, we provide fully-static Falco builds since few years. The only issue with those is that the plugin system can't be supported with the current dynamic library model we currently have.
7. The plugin system has been envisioned to support multiple languages, so on our end maintaining a C-compatible codebase is the best strategy to ensure maximum cross-language compatibility.
8. In general, plugins have GLIBC requirements/dependencies because they have low-level C bindings required for dynamic loading. A potential solution for the future could be to also support plugin to be statically-linked at compilation time and so released as bundled in the Falco binary. Although no work started yet in this direction, this would solve most issues you reported and would provide a totally-static binary too. Of course, this would not be compatible with dynamic loading anymore, but it may be a viable solution for our static-build flavor of Falco.
9. Memory safety is definitely a concern and we try our best to keep an high level of quality even though C++ is quite error prone. For instance, we try to use smart pointers whenever possible, we build the libraries with an address sanitizer in our CI, we run Falco through Valgrind before each release, and have ways to stress-test it to detect performance regressions or weird memory usage (e.g. https://github.com/falcosecurity/event-generator). On top of that, we also have third parties auditing the codebase by time to time. None of this make a perfect safety standpoint of course, but we try to maximize our odds. Go would definitely make our life easier from this perspective, however the tradeoffs never made it worth it so far due to the points above.
10. The C++ codebase of falcosecurity/libs, which is at the core of Falco, is quite large and complex. Porting all that code to another language would be a major effort requiring lots of development resource and with an high chance of failure and regression. As such, our approach so far has been to choose refactors and code polishing instead, up until we'll reach an optimal level of stability, quality, and modularity, on that portion of code. This would allow further developments to be smoother and more feasibile in the future.
</details>
</br>
### What's next for Falco?
Stay updated with Falco's evolving capabilities by exploring the [Falco Roadmap](https://github.com/orgs/falcosecurity/projects/5), which provides insights into the features currently under development and planned for future releases.
## License
Falco is licensed to you under the [Apache 2.0](./COPYING) open source license.
## Resources
[1]: https://download.falco.org/?prefix=packages/rpm-dev/
[2]: https://download.falco.org/?prefix=packages/rpm/
[3]: https://download.falco.org/?prefix=packages/deb-dev/stable/
[4]: https://download.falco.org/?prefix=packages/deb/stable/
[5]: https://download.falco.org/?prefix=packages/bin-dev/x86_64/
[6]: https://download.falco.org/?prefix=packages/bin/x86_64/
- [Governance](https://github.com/falcosecurity/evolution/blob/main/GOVERNANCE.md)
- [Code Of Conduct](https://github.com/falcosecurity/evolution/blob/main/CODE_OF_CONDUCT.md)
- [Maintainers Guidelines](https://github.com/falcosecurity/evolution/blob/main/MAINTAINERS_GUIDELINES.md)
- [Maintainers List](https://github.com/falcosecurity/evolution/blob/main/MAINTAINERS.md)
- [Repositories Guidelines](https://github.com/falcosecurity/evolution/blob/main/REPOSITORIES.md)
- [Repositories List](https://github.com/falcosecurity/evolution/blob/main/README.md#repositories)
- [Adopters List](https://github.com/falcosecurity/falco/blob/master/ADOPTERS.md)
- [Release Process](RELEASE.md)
- [Setup documentation](https://falco.org/docs/setup/)
- [Troubleshooting](https://falco.org/docs/troubleshooting/)

View File

@ -1,102 +1,168 @@
# Falco Release Process
Our release process is mostly automated, but we still need some manual steps to initiate and complete it.
Changes and new features are grouped in [milestones](https://github.com/falcosecurity/falco/milestones), the milestone with the next version represents what is going to be released.
## Overview
A release happens every two months ([as per community discussion](https://github.com/falcosecurity/community/blob/master/meeting-notes/2020-09-30.md#agenda)), and we need to assign owners for each (usually we pair a new person with an experienced one). Assignees and the due date are proposed during the [weekly community call](https://github.com/falcosecurity/community). Note that hotfix releases can happen as soon as it is needed.
This document provides the process to create a new Falco release. In addition, it provides information about the versioning of the Falco components. At a high level each Falco release consists of the following main components:
Finally, on the proposed due date the assignees for the upcoming release proceed with the processes described below.
- Falco binary (userspace), includes `modern_bpf` driver object code (kernel space) starting with Falco 0.34.x releases
- Falco kernel driver object files, separate artifacts for `kmod` and `bpf` drivers, not applicable for `modern_bpf` driver (kernel space)
- Option 1: Kernel module (`.ko` files)
- Option 2: eBPF (`.o` files)
- Falco config and rules `.yaml` files (userspace)
- Falco plugins (userspace - optional)
> Note: Starting with Falco 0.34.x releases, the Falco userspace binary includes the `modern_bpf` driver object code during the linking process. This integration is made possible by the CO-RE (Compile Once - Run Everywhere) feature of the modern BPF driver. CO-RE allows the driver to function on kernels that have backported BTF (BPF Type Format) support or have a kernel version >= 5.8. For the older `kmod` and `bpf` drivers, separate artifacts are released for the kernel space. This is because these drivers need to be explicitly compiled for the specific kernel release, using the exact kernel headers. This approach ensures that Falco can support a wide range of environments, including multiple kernel versions, distributions, and architectures. (see `libs` [driver - kernel version support matrix](https://github.com/falcosecurity/libs#drivers-officially-supported-architectures)).
The Falco Project manages the release of both the Falco userspace binary and pre-compiled Falco kernel drivers for the most popular kernel versions and distros. The build and publish process is managed by the [test-infra](https://github.com/falcosecurity/test-infra) repo.
The Falco userspace executable includes bundled dependencies, so that it can be run from anywhere.
Falco publishes all sources, enabling users to audit the project's integrity and build kernel drivers for custom or unsupported kernels/distributions, specifically for non-modern BPF drivers (see [driverkit](https://github.com/falcosecurity/driverkit) for more information).
Finally, the release process follows a transparent process described in more detail in the following sections and the official [Falco guide and documentation](https://falco.org/) provide rich information around building, installing and using Falco.
### Falco Binaries, Rules and Sources Artifacts - Quick Links
The Falco project publishes all sources and the Falco userspace binaries as GitHub releases.
- [Falco Releases](https://github.com/falcosecurity/falco/releases)
- `tgz`, `rpm` and `deb` Falco binary packages (contains sources, including driver sources, Falco rules as well as k8saudit and cloudtrail plugins)
- `tgz`, `zip` source code
- [Libs Releases](https://github.com/falcosecurity/libs/releases)
- `tgz`, `zip` source code
- [Driver Releases](https://github.com/falcosecurity/libs/releases), marked with `+driver` [build metadata](https://semver.org/).
- `tgz`, `zip` source code
- [Falco Rules Releases](https://github.com/falcosecurity/rules/releases)
- `tgz`, `zip` source code, each ruleset is tagged separately in a mono-repo fashion, see the [rules release guidelines](https://github.com/falcosecurity/rules/blob/main/RELEASE.md)
Alternatively Falco binaries or plugins can be downloaded from the Falco Artifacts repo.
- [Falco Artifacts Repo Packages Root](https://download.falco.org/?prefix=packages/)
- [Falco Artifacts Repo Plugins Root](https://download.falco.org/?prefix=plugins/)
### Falco Drivers Artifacts Repo - Quick Links
> Note: This section specifically applies to non-modern BPF drivers.
The Falco Project publishes all drivers for each release for popular kernel versions / distros and `x86_64` and `aarch64` architectures to the Falco project's managed Artifacts repo. The Artifacts repo follows standard directory level conventions. The respective driver object file is prefixed by distro and named / versioned by kernel release - `$(uname -r)`. Pre-compiled drivers are released with a [best effort](https://github.com/falcosecurity/falco/blob/master/proposals/20200818-artifacts-storage.md#notice) notice. This is because gcc (`kmod`) and clang (`bpf`) compilers sometimes fail to build the artifacts for a specific kernel version. More details around driver versioning and driver compatibility are provided in the [Falco Components Versioning](#falco-components-versioning) section. Short preview: If you use the standard Falco setup leveraging driver-loader, [driver-loader script](https://github.com/falcosecurity/falco/blob/master/scripts/falco-driver-loader) will fetch the kernel space artifact (object file) corresponding to the default `DRIVER_VERSION` Falco was shipped with.
- [Falco Artifacts Repo Drivers Root](https://download.falco.org/?prefix=driver/)
- Option 1: Kernel module (`.ko` files) - all under same driver version directory
- Option 2: eBPF (`.o` files) - all under same driver version directory
### Timeline
Falco follows a release schedule of three times per year, with releases expected at the end of January, May, and September. Hotfix releases are issued as needed.
Changes and new features are organized into [milestones](https://github.com/falcosecurity/falco/milestones). The milestone corresponding to the next version represents the content that will be included in the upcoming release.
### Procedures
The release process is mostly automated, requiring only a few manual steps to initiate and complete.
Moreover, we assign owners for each release (typically pairing a new person with an experienced one). Assignees and due dates for releases are proposed during the [community call](https://github.com/falcosecurity/community).
At a high level each Falco release needs to follow a pre-determined sequencing of releases and build order:
- [1 - 3] `libs` (+ `driver`) and `plugins` components releases
- [4] Falco driver pre-compiled object files push to Falco's Artifacts repo
- [5] Falco userspace binary release
Assignees are responsible for creating a Falco GitHub issue to track the release tasks and monitor the progress of the release. This issue serves as a central point for communication and provides updates on the release dates. You can refer to the [Falco v0.35 release](https://github.com/falcosecurity/falco/issues/2554) or [Libs Release (0.11.0+5.0.1+driver)](https://github.com/falcosecurity/libs/issues/1092) issues as examples/templates for creating the release issue.
Finally, on the proposed due date, the assignees for the upcoming release proceed with the processes described below.
## Pre-Release Checklist
Before cutting a release we need to do some homework in the Falco repository. This should take 5 minutes using the GitHub UI.
Before proceeding with the release, make sure to complete the following preparatory steps, which can be easily done using the GitHub UI:
### 1. Release notes
- Find the previous release date (`YYYY-MM-DD`) by looking at the [Falco releases](https://github.com/falcosecurity/falco/releases)
- Double-check, by using the following filters, if there is any closed issue/merge PR with no milestone assigned:
- `is:issue state:closed no:milestone closed:>YYYY-MM-DD`
[filter](https://github.com/falcosecurity/falco/issues?q=is%3Aissue%20state%3Aclosed%20no%3Amilestone%20closed%3A%3EYYYY-MM-DD)
- `is:pr state:closed no:milestone closed:>YYYY-MM-DD`
[filter](https://github.com/falcosecurity/falco/pulls?q=is%3Apr+is%3Amerged+no%3Amilestone+closed%3A%3EYYYY-MM-DD)
- Assign any issue/PR identified in the previous point to the milestone corresponding to the currently undergoing release
- Check the release note block of every PR matching the `is:pr is:merged closed:>YYYY-MM-DD` [filter](https://github.com/falcosecurity/falco/pulls?q=is%3Apr+is%3Amerged+closed%3A%3EYYYY-MM-DD)
- Ensure the release note block follows the [commit convention](https://github.com/falcosecurity/falco/blob/master/CONTRIBUTING.md#commit-convention), otherwise fix its content
- Ensure the release note block follows the [commit convention](https://github.com/falcosecurity/.github/blob/master/CONTRIBUTING.md#commit-convention), otherwise fix its content
- If the PR has no milestone, assign it to the milestone currently undergoing release
- Check issues without a milestone (using [is:pr is:merged no:milestone closed:>YYYY-MM-DD](https://github.com/falcosecurity/falco/pulls?q=is%3Apr+is%3Amerged+no%3Amilestone+closed%3A%3EYYYY-MM-DD) filter) and add them to the milestone currently undergoing release
- Double-check that there are no more merged PRs without the target milestone assigned with the `is:pr is:merged no:milestone closed:>YYYY-MM-DD` [filters](https://github.com/falcosecurity/falco/pulls?q=is%3Apr+is%3Amerged+no%3Amilestone+closed%3A%3EYYYY-MM-DD), if any, fix them
### 2. Milestones
- Move the [tasks not completed](https://github.com/falcosecurity/falco/pulls?q=is%3Apr+is%3Aopen) to a new minor milestone
### 3. Release PR
### 3. Release branch
Assuming we are releasing a non-patch version (like: Falco 0.34.0), a new release branch needs to be created.
Its naming will be `release/M.m.x`; for example: `release/0.34.x`.
The same branch will then be used for any eventual cherry pick for patch releases.
For patch releases, instead, the `release/M.m.x` branch should already be in place; no more steps are needed.
Double-check that any PR that should be part of the tag has been cherry-picked from master!
### 4. Release PR
The release PR is meant to be made against the respective `release/M.m.x` branch, **then cherry-picked on master**.
- Double-check if any hard-coded version number is present in the code, it should be not present anywhere:
- If any, manually correct it then open an issue to automate version number bumping later
- Versions table in the `README.md` updates itself automatically
- Generate the change log using [rn2md](https://github.com/leodido/rn2md):
- Execute `rn2md -o falcosecurity -m <version> -r falco`
- Execute `rn2md -r falcosecurity/falco -m M.m.p -b release/M.m.x`
- In case `rn2md` emits error try to generate an GitHub OAuth access token and provide it with the `-t` flag
- Add the latest changes on top the previous `CHANGELOG.md`
- Submit a PR with the above modifications
- Await PR approval
- Close the completed milestone as soon as the PR is merged
- Close the completed milestone as soon as the PR is merged into the release branch
- Cherry pick the PR on master too
## Publishing Pre-Releases (RCs and tagged development versions)
Core maintainers and/or the release manager can decide to publish pre-releases at any time before the final release
is live for development and testing purposes.
The prerelease tag must be formatted as `M.m.p-r` where `r` is the prerelease version information (e.g. `0.35.0-rc1`.)
To do so:
- [Draft a new release](https://github.com/falcosecurity/falco/releases/new)
- Use `M.m.p-r` both as tag version and release title.
- Check the "Set as a pre-release" checkbox and make sure "Set as the latest release" is unchecked
- It is recommended to add a brief description so that other contributors will understand the reason why the prerelease is published
- Publish the prerelease!
- The release pipeline will start automatically. Packages will be uploaded to the `-dev` bucket and container images will be tagged with the specified tag.
In order to check the status of the release pipeline click on the [GitHub Actions tab](https://github.com/falcosecurity/falco/actions?query=event%3Arelease) in the Falco repository and filter by release.
## Release
Now assume `x.y.z` is the new version.
Assume `M.m.p` is the new version.
### 1. Create a tag
- Once the release PR has got merged, and the CI has done its job on the master, git tag the new release
```
git pull
git checkout master
git tag x.y.z
git push origin x.y.z
```
> **N.B.**: do NOT use an annotated tag
- Wait for the CI to complete
### 2. Update the GitHub release
### 1. Create the release with GitHub
- [Draft a new release](https://github.com/falcosecurity/falco/releases/new)
- Use `x.y.z` both as tag version and release title
- Use the following template to fill the release description:
```
<!-- Substitute x.y.z with the current release version -->
- Use `M.m.p` both as tag version and release title
- Do NOT fill body, since it will be autogenerated by the [github release workflow](.github/workflows/release.yaml)
- Publish the release!
- The release pipeline will start automatically upon publication and all packages and container images will be uploaded to the stable repositories.
| Packages | Download |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| rpm | [![rpm](https://img.shields.io/badge/Falco-x.y.z-%2300aec7?style=flat-square)](https://download.falco.org/packages/rpm/falco-x.y.z-x86_64.rpm) |
| deb | [![deb](https://img.shields.io/badge/Falco-x.y.z-%2300aec7?style=flat-square)](https://download.falco.org/packages/deb/stable/falco-x.y.z-x86_64.deb) |
| tgz | [![tgz](https://img.shields.io/badge/Falco-x.y.z-%2300aec7?style=flat-square)](https://download.falco.org/packages/bin/x86_64/falco-x.y.z-x86_64.tar.gz) |
In order to check the status of the release pipeline click on the [GitHub Actions tab](https://github.com/falcosecurity/falco/actions?query=event%3Arelease) in the Falco repository and filter by release.
| Images |
| --------------------------------------------------------------------------- |
| `docker pull docker.io/falcosecurity/falco:x.y.z` |
| `docker pull public.ecr.aws/falcosecurity/falco:x.y.z` |
| `docker pull docker.io/falcosecurity/falco-driver-loader:x.y.z` |
| `docker pull docker.io/falcosecurity/falco-no-driver:x.y.z` |
### Statistics
| Merged PRs | Number |
| --------------- | ------ |
| Not user-facing | x |
| Release note | x |
| Total | x |
<!-- Calculate stats and fill the above table -->
```
- Finally, publish the release!
### 3. Update the meeting notes
### 2. Update the meeting notes
For each release we archive the meeting notes in git for historical purposes.
- The notes from the Falco meetings can be [found here](https://hackmd.io/6sEAlInlSaGnLz2FnFz21A).
- The notes from the Falco meetings can be [found here](https://hackmd.io/3qYPnZPUQLGKCzR14va_qg).
- Note: There may be other notes from working groups that can optionally be added as well as needed.
- Add the entire content of the document to a new file in [github.com/falcosecurity/community/tree/master/meeting-notes](https://github.com/falcosecurity/community/tree/master/meeting-notes) as a new file labeled `release-x.y.z.md`
- Add the entire content of the document to a new file in [github.com/falcosecurity/community/tree/main/meeting-notes](https://github.com/falcosecurity/community/tree/main/meeting-notes) as a new file labeled `release-M.m.p.md`
- Open up a pull request with the new change.
@ -104,5 +170,47 @@ For each release we archive the meeting notes in git for historical purposes.
Announce the new release to the world!
- IFF the ongoing release introduces a **new minor version**, [archive a snapshot of the Falco website](https://github.com/falcosecurity/falco-website/blob/master/release.md#documentation-versioning)
- Publish a blog on [Falco website](https://github.com/falcosecurity/falco-website) ([example](https://github.com/falcosecurity/falco-website/blob/master/content/en/blog/falco-0-28-1.md))
- Send an announcement to cncf-falco-dev@lists.cncf.io (plain text, please)
- Let folks in the slack #falco channel know about a new release came out
## Falco Components Versioning
This section provides more details around the versioning of the components that make up Falco's core. It can also be a useful guide for the uninitiated to be more informed about Falco's source. Because `libs` makes up the greater portion of the source code of the Falco binary and is the home of each of the kernel drivers and engines, the [libs release doc](https://github.com/falcosecurity/libs/blob/master/release.md) is an excellent additional resource. In addition, the [plugins release doc](https://github.com/falcosecurity/plugins/blob/master/release.md) provides similar details around Falco's plugins. `SHA256` checksums are provided throughout Falco's source code to empower the end user to perform integrity checks. All Falco releases also contain the sources as part of the packages.
### Falco repo (this repo)
- Falco version is a git tag (`x.y.z`), see [Procedures](#procedures) section. Note that the Falco version is a sem-ver-like schema, but not fully compatible with sem-ver.
- [FALCO_ENGINE_VERSION](https://github.com/falcosecurity/falco/blob/master/userspace/engine/falco_engine_version.h) is not sem-ver and must be bumped either when a backward incompatible change has been introduced to the rules files syntax and loading logic, and/or when `FALCO_ENGINE_CHECKSUM` has changed. The checksum is computed by considering the available rules fields (see currently supported [Falco fields](https://falco.org/docs/reference/rules/supported-fields/)), the event types (see currently supported [Falco events](https://falco.org/docs/reference/rules/supported-events/)), and the supported driver schema version. A checksum indicates that something was not available in previous engine versions. See the [rules release guidelines](https://github.com/falcosecurity/rules/blob/main/RELEASE.md#versioning-a-ruleset) to understand how this affects the versioning of Falco rules. Breaking changes introduced in the Falco engine are not necessarily tied to the drivers or libs versions. The version number must be incremented every time and only when a single change or an atomic group of changes - which meet the criteria described above - is included in the `master` branch. Thus, a version bump can occur multiple times during the development and testing phases of a given release cycle. A given version bump must not group multiple changes that occurred sporadically during the release cycle.
- During development and release preparation, libs and driver reference commits are often bumped in Falco's cmake setup ([falcosecurity-libs cmake](https://github.com/falcosecurity/falco/blob/master/cmake/modules/falcosecurity-libs.cmake#L30) and [driver cmake](https://github.com/falcosecurity/falco/blob/master/cmake/modules/driver.cmake#L29)) in order to merge new Falco features. In practice, they are mostly bumped at the same time referencing the same `libs` commit. However, for the official Falco build `FALCOSECURITY_LIBS_VERSION` flag that references the stable libs version is used (read below).
- At release time Plugin, Libs and Driver versions are compatible with Falco.
```
Falco version: x.y.z (sem-ver like)
Libs version: x.y.z (sem-ver like)
Plugin API: x.y.z (sem-ver like)
Engine: x
Driver:
API version: x.y.z (sem-ver)
Schema version: x.y.z (sem-ver)
Default driver: x.y.z+driver (sem-ver like, indirectly encodes compatibility range in addition to default version Falco is shipped with)
```
### Libs repo
- Libs version is a git tag (`x.y.z`) and when building Falco the libs version is set via the `FALCOSECURITY_LIBS_VERSION` flag (see above).
- The driver version is not directly linked to the userspace components of the Falco binary. This is because of the clear separation between userspace and kernel space, which adds an additional layer of complexity. To address this, the concept of a `Default driver` has been introduced, allowing for implicit declaration of compatible driver versions. For example, if the default driver version is `5.0.1+driver`, Falco works with all driver versions >= 5.0.1 and < 6.0.0. This is a consequence of how the driver version is constructed starting from the `Driver API version` and `Driver Schema version`. Driver API and Schema versions are explained in the respective [libs driver doc](https://github.com/falcosecurity/libs/blob/master/driver/README.VERSION.md) -> Falco's `driver-loader` will always fetch the default driver, therefore a Falco release is always "shipped" with the driver version corresponding to the default driver.
- See [libs release doc](https://github.com/falcosecurity/libs/blob/master/release.md) for more information.
### Plugins repo
- Plugins version is a git tag (`x.y.z`)
- See [plugins release doc](https://github.com/falcosecurity/plugins/blob/master/release.md) for more information.
### Rules repo
- Rulesets are versioned individually through git tags
- See [rules release doc](https://github.com/falcosecurity/rules/blob/main/RELEASE.md) for more information.
- See [plugins release doc](https://github.com/falcosecurity/plugins/blob/master/release.md) for more information about plugins rulesets.

Binary file not shown.

View File

@ -3,15 +3,13 @@
# Falco Branding Guidelines
This document describes The Falco Project's branding guidelines, language, and message.
Content in this document can be used to publically share about Falco.
Falco is an open source security project whose brand and identity are governed by the [Cloud Native Computing Foundation](https://www.linuxfoundation.org/legal/trademark-usage).
This document describes the official branding guidelines of The Falco Project. Please see the [Falco Branding](https://falco.org/community/falco-brand/) page on our website for further details.
### Logo
There are 3 logos available for use in this directory. Use the primary logo unless required otherwise due to background issues, or printing.
There are 3 logos available for use in this directory. Use the primary logo unless required otherwise due to background issues or printing.
The Falco logo is Apache 2 licensed and free to use in media and publication for the CNCF Falco project.
@ -34,55 +32,6 @@ The primary colors are those in the first two rows.
> Cloud Native Runtime Security
### What is Falco?
Falco is a runtime security project originally created by Sysdig, Inc.
Falco was contributed to the CNCF in October 2018.
The CNCF now owns The Falco Project.
### What is Runtime Security?
Runtime security refers to an approach to preventing unwanted activity on a computer system.
With runtime security, an operator deploys **both** prevention tooling (access control, policy enforcement, etc) along side detection tooling (systems observability, anomaly detection, etc).
Runtime security is the practice of using detection tooling to detect unwanted behavior, such that it can then be prevented using prevention techniques.
Runtime security is a holistic approach to defense, and useful in scenarios where prevention tooling either was unaware of an exploit or attack vector, or when defective applications are ran in even the most secure environment.
### What does Falco do?
Falco consumes signals from the Linux kernel, and container management tools such as Docker and Kubernetes.
Falco parses the signals and asserts them against security rules.
If a rule has been violated, Falco triggers an alert.
### How does Falco work?
Falco traces kernel events and reports information about the system calls being executed at runtime.
Falco leverages the extended berkley packet filter (eBPF) which is a kernel feature implemented for dynamic crash-resilient and secure code execution in the kernel.
Falco enriches these kernel events with information about containers running on the system.
Falco also can consume signals from other input streams such as the containerd socket, the Kubernetes API server and the Kubernetes audit log.
At runtime, Falco will reason about these events and assert them against configured security rules.
Based on the severity of a violation an alert is triggered.
These alerts are configurable and extensible, for instance sending a notification or [plumbing through to other projects like Prometheus](https://github.com/falcosecurity/falco-exporter).
### Benefits of using Falco
- **Strengthen Security** Create security rules driven by a context-rich and flexible engine to define unexpected application behavior.
- **Reduce Risk** Immediately respond to policy violation alerts by plugging Falco into your current security response workflows and processes.
- **Leverage up-to-date Rules** Alert using community-sourced detections of malicious activity and CVE exploits.
### Falco and securing Kubernetes
Securing Kubernetes requires putting controls in place to detect unexpected behavior that could be malicious or harmful to a cluster or application(s).
Examples of malicious behavior include:
- Exploits of unpatched and new vulnerabilities in applications or Kubernetes itself.
- Insecure configurations in applications or Kubernetes itself.
- Leaked or weak credentials or secret material.
- Insider threats from adjacent applications running at the same layer.
Falco is capable of [consuming the Kubernetes audit logs](https://kubernetes.io/docs/tasks/debug-application-cluster/falco/#use-falco-to-collect-audit-events).
By adding Kubernetes application context, and Kubernetes audit logs teams can understand who did what.
### Writing about Falco
##### Yes
@ -98,60 +47,37 @@ Notice the capitalization of the following terms.
- the falco project
- the Falco project
### Encouraged Phrasing
Below are phrases that the project has reviewed, and found to be effective ways of messaging Falco's value add.
Even when processes are in place for vulnerability scanning and implementing pod security and network policies, not every risk will be addressed. You still need mechanisms to confirm these security barriers are effective, help configure them, and provide with a last line of defense when they fail.
##### Falco as a factory
This term refers to the concept that Falco is a stateless processing engine. A large amount of data comes into the engine, but meticulously crafted security alerts come out.
##### The engine that powers...
Falco ultimately is a security engine. It reasons about signals coming from a system at runtime, and can alert if an anomaly is detected.
##### Anomaly detection
This refers to an event that occurs with something unsual, concerning, or odd occurs.
We can associate anomalies with unwanted behavior, and alert in their presence.
##### Detection tooling
Falco does not prevent unwanted behavior.
Falco however alerts when unusual behavior occurs.
This is commonly referred to as **detection** or **forensics**.
---
# Glossary
# Glossary
#### Probe
This section contains key terms specifically used within the context of The Falco Project. For a more comprehensive list of Falco-related terminology, we invite you to visit the [Glossary](https://falco.org/docs/reference/glossary/) page on our official website.
#### eBPF Probe
Used to describe the `.o` object that would be dynamically loaded into the kernel as a secure and stable (e)BPF probe.
This is one option used to pass kernel events up to userspace for Falco to consume.
Sometimes this word is incorrectly used to refer to a `module`.
#### Module
#### Modern eBPF Probe
More robust [eBPF probe](#ebpf-probe), which brings the CO-RE paradigm, better performances, and maintainability.
Unlike the legacy probe, the modern eBPF probe is not shipped as a separate artifact but bundled into the Falco binary itself.
This is one option used to pass kernel events up to userspace for Falco to consume.
#### Kernel Module
Used to describe the `.ko` object that would be loaded into the kernel as a potentially risky kernel module.
This is one option used to pass kernel events up to userspace for Falco to consume.
Sometimes this word is incorrectly used to refer to a `probe`.
#### Driver
The global term for the software that sends events from the kernel. Such as the eBPF `probe` or the `kernel module`.
The global term for the software that sends events from the kernel. Such as the [eBPF probe](#ebpf-probe), the [Modern eBPF probe](#modern-ebpf-probe), or the [Kernel Module](#kernel-module).
#### Plugin
Used to describe a dynamic shared library (`.so` files in Unix, `.dll` files in Windows) that conforms to a documented API and allows to extend Falco's capabilities.
#### Falco
The name of the project, and also the name of [the main engine](https://github.com/falcosecurity/falco) that the rest of the project is built on.
#### Sysdig, Inc
The name of the company that originally created The Falco Project, and later donated to the CNCF.
#### sysdig
A [CLI tool](https://github.com/draios/sysdig) used to evaluate kernel system events at runtime.
The name of the project and also the name of [the main engine](https://github.com/falcosecurity/falco) that the rest of the project is built on.

View File

@ -1,14 +1,56 @@
if(CPACK_GENERATOR MATCHES "DEB")
list(APPEND CPACK_INSTALL_COMMANDS "mkdir -p _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system")
list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/debian/falco.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system")
endif()
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
if(CPACK_GENERATOR MATCHES "RPM")
list(APPEND CPACK_INSTALL_COMMANDS "mkdir -p _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system")
list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/rpm/falco.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system")
if(CPACK_GENERATOR MATCHES "DEB" OR CPACK_GENERATOR MATCHES "RPM")
list(
APPEND
CPACK_INSTALL_COMMANDS
"mkdir -p _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system"
)
list(
APPEND
CPACK_INSTALL_COMMANDS
"cp scripts/systemd/falco-kmod-inject.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system"
)
list(
APPEND
CPACK_INSTALL_COMMANDS
"cp scripts/systemd/falco-kmod.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system"
)
list(
APPEND
CPACK_INSTALL_COMMANDS
"cp scripts/systemd/falco-bpf.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system"
)
list(
APPEND
CPACK_INSTALL_COMMANDS
"cp scripts/systemd/falco-modern-bpf.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system"
)
list(
APPEND
CPACK_INSTALL_COMMANDS
"cp scripts/systemd/falco-custom.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system"
)
list(
APPEND
CPACK_INSTALL_COMMANDS
"cp scripts/systemd/falcoctl-artifact-follow.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system"
)
endif()
if(CPACK_GENERATOR MATCHES "TGZ")
set(CPACK_SET_DESTDIR "ON")
set(CPACK_STRIP_FILES "OFF")
endif()

View File

@ -1,4 +1,3 @@
/etc/falco/falco.yaml
/etc/falco/falco_rules.yaml
/etc/falco/rules.available/application_rules.yaml
/etc/falco/falcoctl.yaml
/etc/falco/falco_rules.local.yaml

View File

@ -1,32 +1,64 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2021 The Falco Authors.
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
set(CPACK_PACKAGE_NAME "${PACKAGE_NAME}")
set(CPACK_PACKAGE_VENDOR "Cloud Native Computing Foundation (CNCF) cncf.io.")
set(CPACK_PACKAGE_CONTACT "cncf-falco-dev@lists.cncf.io") # todo: change this once we've got @falco.org addresses
set(CPACK_PACKAGE_CONTACT "cncf-falco-dev@lists.cncf.io") # todo: change this once we've got
# @falco.org addresses
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Falco - Container Native Runtime Security")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/scripts/description.txt")
set(CPACK_PACKAGE_VERSION "${FALCO_VERSION}")
set(CPACK_PACKAGE_VERSION_MAJOR "${FALCO_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${FALCO_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${FALCO_VERSION_PATCH}")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_PROJECT_CONFIG_FILE "${PROJECT_SOURCE_DIR}/cmake/cpack/CMakeCPackOptions.cmake")
set(CPACK_STRIP_FILES "ON")
if(CMAKE_BUILD_TYPE STREQUAL "debug")
set(CPACK_STRIP_FILES "OFF")
else()
set(CPACK_STRIP_FILES "ON")
endif()
set(CPACK_PACKAGE_RELOCATABLE "OFF")
if(EMSCRIPTEN)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-wasm")
else()
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_PROCESSOR}"
)
endif()
if(WIN32)
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
endif()
# Built packages will include only the following components
set(CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_CURRENT_BINARY_DIR};${FALCO_COMPONENT_NAME};${FALCO_COMPONENT_NAME};/"
)
if(CMAKE_SYSTEM_NAME MATCHES "Linux") # only Linux has drivers
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_CURRENT_BINARY_DIR};${DRIVER_COMPONENT_NAME};${DRIVER_COMPONENT_NAME};/"
)
endif()
if(NOT CPACK_GENERATOR)
set(CPACK_GENERATOR DEB RPM TGZ)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(CPACK_GENERATOR DEB RPM TGZ)
else()
set(CPACK_GENERATOR TGZ)
endif()
endif()
message(STATUS "Using package generators: ${CPACK_GENERATOR}")
@ -34,33 +66,35 @@ message(STATUS "Package architecture: ${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_DEBIAN_PACKAGE_SECTION "utils")
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
endif()
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
endif()
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.falco.org")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "dkms (>= 2.1.0.0)")
set(CPACK_DEBIAN_PACKAGE_SUGGESTS "dkms (>= 2.1.0.0)")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${CMAKE_BINARY_DIR}/scripts/debian/postinst;${CMAKE_BINARY_DIR}/scripts/debian/prerm;${CMAKE_BINARY_DIR}/scripts/debian/postrm;${PROJECT_SOURCE_DIR}/cmake/cpack/debian/conffiles"
"${CMAKE_BINARY_DIR}/scripts/debian/postinst;${CMAKE_BINARY_DIR}/scripts/debian/prerm;${CMAKE_BINARY_DIR}/scripts/debian/postrm;${PROJECT_SOURCE_DIR}/cmake/cpack/debian/conffiles"
)
set(CPACK_RPM_PACKAGE_LICENSE "Apache v2.0")
set(CPACK_RPM_PACKAGE_ARCHITECTURE, "amd64")
set(CPACK_RPM_PACKAGE_URL "https://www.falco.org")
set(CPACK_RPM_PACKAGE_REQUIRES "dkms, kernel-devel, ncurses, systemd")
set(CPACK_RPM_PACKAGE_REQUIRES "systemd")
set(CPACK_RPM_PACKAGE_SUGGESTS "dkms, kernel-devel")
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_BINARY_DIR}/scripts/rpm/postinstall")
set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_BINARY_DIR}/scripts/rpm/preuninstall")
set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_BINARY_DIR}/scripts/rpm/postuninstall")
set(CPACK_RPM_PACKAGE_VERSION "${FALCO_VERSION}")
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
/usr/src
/usr/share/man
/usr/share/man/man8
/etc
/usr
/usr/bin
/usr/share)
/usr/src
/usr/share/man
/usr/share/man/man8
/etc
/usr
/usr/bin
/usr/share
)
set(CPACK_RPM_PACKAGE_RELOCATABLE "OFF")
include(CPack)

View File

@ -1,159 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or
# https://cmake.org/licensing for details.
#[=======================================================================[.rst:
Catch
-----
This module defines a function to help use the Catch test framework.
The :command:`catch_discover_tests` discovers tests by asking the compiled test
executable to enumerate its tests. This does not require CMake to be re-run
when tests change. However, it may not work in a cross-compiling environment,
and setting test properties is less convenient.
This command is intended to replace use of :command:`add_test` to register
tests, and will create a separate CTest test for each Catch test case. Note
that this is in some cases less efficient, as common set-up and tear-down logic
cannot be shared by multiple test cases executing in the same instance.
However, it provides more fine-grained pass/fail information to CTest, which is
usually considered as more beneficial. By default, the CTest test name is the
same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
.. command:: catch_discover_tests
Automatically add tests with CTest by querying the compiled test executable
for available tests::
catch_discover_tests(target
[TEST_SPEC arg1...]
[EXTRA_ARGS arg1...]
[WORKING_DIRECTORY dir]
[TEST_PREFIX prefix]
[TEST_SUFFIX suffix]
[PROPERTIES name1 value1...]
[TEST_LIST var]
)
``catch_discover_tests`` sets up a post-build command on the test executable
that generates the list of tests by parsing the output from running the test
with the ``--list-test-names-only`` argument. This ensures that the full
list of tests is obtained. Since test discovery occurs at build time, it is
not necessary to re-run CMake when the list of tests changes.
However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set
in order to function in a cross-compiling environment.
Additionally, setting properties on tests is somewhat less convenient, since
the tests are not available at CMake time. Additional test properties may be
assigned to the set of tests as a whole using the ``PROPERTIES`` option. If
more fine-grained test control is needed, custom content may be provided
through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES`
directory property. The set of discovered tests is made accessible to such a
script via the ``<target>_TESTS`` variable.
The options are:
``target``
Specifies the Catch executable, which must be a known CMake executable
target. CMake will substitute the location of the built executable when
running the test.
``TEST_SPEC arg1...``
Specifies test cases, wildcarded test cases, tags and tag expressions to
pass to the Catch executable with the ``--list-test-names-only`` argument.
``EXTRA_ARGS arg1...``
Any extra arguments to pass on the command line to each test case.
``WORKING_DIRECTORY dir``
Specifies the directory in which to run the discovered test cases. If this
option is not provided, the current binary directory is used.
``TEST_PREFIX prefix``
Specifies a ``prefix`` to be prepended to the name of each discovered test
case. This can be useful when the same test executable is being used in
multiple calls to ``catch_discover_tests()`` but with different
``TEST_SPEC`` or ``EXTRA_ARGS``.
``TEST_SUFFIX suffix``
Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
be specified.
``PROPERTIES name1 value1...``
Specifies additional properties to be set on all tests discovered by this
invocation of ``catch_discover_tests``.
``TEST_LIST var``
Make the list of tests available in the variable ``var``, rather than the
default ``<target>_TESTS``. This can be useful when the same test
executable is being used in multiple calls to ``catch_discover_tests()``.
Note that this variable is only available in CTest.
#]=======================================================================]
# ------------------------------------------------------------------------------
function(catch_discover_tests TARGET)
cmake_parse_arguments("" "" "TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST" "TEST_SPEC;EXTRA_ARGS;PROPERTIES"
${ARGN})
if(NOT _WORKING_DIRECTORY)
set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endif()
if(NOT _TEST_LIST)
set(_TEST_LIST ${TARGET}_TESTS)
endif()
# Generate a unique name based on the extra arguments
string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS}")
string(SUBSTRING ${args_hash} 0 7 args_hash)
# Define rule to generate test list for aforementioned test executable
set(ctest_include_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_include-${args_hash}.cmake")
set(ctest_tests_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_tests-${args_hash}.cmake")
get_property(
crosscompiling_emulator
TARGET ${TARGET}
PROPERTY CROSSCOMPILING_EMULATOR)
add_custom_command(
TARGET ${TARGET}
POST_BUILD
BYPRODUCTS "${ctest_tests_file}"
COMMAND
"${CMAKE_COMMAND}" -D "TEST_TARGET=${TARGET}" -D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>" -D
"TEST_EXECUTOR=${crosscompiling_emulator}" -D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}" -D
"TEST_SPEC=${_TEST_SPEC}" -D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}" -D "TEST_PROPERTIES=${_PROPERTIES}" -D
"TEST_PREFIX=${_TEST_PREFIX}" -D "TEST_SUFFIX=${_TEST_SUFFIX}" -D "TEST_LIST=${_TEST_LIST}" -D
"CTEST_FILE=${ctest_tests_file}" -P "${_CATCH_DISCOVER_TESTS_SCRIPT}"
VERBATIM)
file(
WRITE "${ctest_include_file}"
"if(EXISTS \"${ctest_tests_file}\")\n" " include(\"${ctest_tests_file}\")\n" "else()\n"
" add_test(${TARGET}_NOT_BUILT-${args_hash} ${TARGET}_NOT_BUILT-${args_hash})\n" "endif()\n")
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0")
# Add discovered tests to directory TEST_INCLUDE_FILES
set_property(
DIRECTORY
APPEND
PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}")
else()
# Add discovered tests as directory TEST_INCLUDE_FILE if possible
get_property(
test_include_file_set
DIRECTORY
PROPERTY TEST_INCLUDE_FILE
SET)
if(NOT ${test_include_file_set})
set_property(DIRECTORY PROPERTY TEST_INCLUDE_FILE "${ctest_include_file}")
else()
message(FATAL_ERROR "Cannot set more than one TEST_INCLUDE_FILE")
endif()
endif()
endfunction()
# ######################################################################################################################
set(_CATCH_DISCOVER_TESTS_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/CatchAddTests.cmake)

View File

@ -1,61 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or
# https://cmake.org/licensing for details.
set(prefix "${TEST_PREFIX}")
set(suffix "${TEST_SUFFIX}")
set(spec ${TEST_SPEC})
set(extra_args ${TEST_EXTRA_ARGS})
set(properties ${TEST_PROPERTIES})
set(script)
set(suite)
set(tests)
function(add_command NAME)
set(_args "")
foreach(_arg ${ARGN})
if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
set(_args "${_args} [==[${_arg}]==]") # form a bracket_argument
else()
set(_args "${_args} ${_arg}")
endif()
endforeach()
set(script
"${script}${NAME}(${_args})\n"
PARENT_SCOPE)
endfunction()
# Run test executable to get list of available tests
if(NOT EXISTS "${TEST_EXECUTABLE}")
message(FATAL_ERROR "Specified test executable '${TEST_EXECUTABLE}' does not exist")
endif()
execute_process(
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-test-names-only
OUTPUT_VARIABLE output
RESULT_VARIABLE result)
# Catch --list-test-names-only reports the number of tests, so 0 is... surprising
if(${result} EQUAL 0)
message(WARNING "Test executable '${TEST_EXECUTABLE}' contains no tests!\n")
elseif(${result} LESS 0)
message(FATAL_ERROR "Error running test executable '${TEST_EXECUTABLE}':\n" " Result: ${result}\n"
" Output: ${output}\n")
endif()
string(REPLACE "\n" ";" output "${output}")
# Parse output
foreach(line ${output})
set(test ${line})
# use escape commas to handle properly test cases with commans inside the name
string(REPLACE "," "\\," test_name ${test})
# ...and add to script
add_command(add_test "${prefix}${test}${suffix}" ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" "${test_name}" ${extra_args})
add_command(set_tests_properties "${prefix}${test}${suffix}" PROPERTIES WORKING_DIRECTORY "${TEST_WORKING_DIR}"
${properties})
list(APPEND tests "${prefix}${test}${suffix}")
endforeach()
# Create a list of all discovered tests, which users may use to e.g. set properties on the tests
add_command(set ${TEST_LIST} ${tests})
# Write CTest script
file(WRITE "${CTEST_FILE}" "${script}")

View File

@ -0,0 +1,136 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
if(NOT FALCO_EXTRA_DEBUG_FLAGS)
set(FALCO_EXTRA_DEBUG_FLAGS "-D_DEBUG")
endif()
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE)
if(CMAKE_BUILD_TYPE STREQUAL "debug")
set(KBUILD_FLAGS "${FALCO_EXTRA_DEBUG_FLAGS} ${FALCO_EXTRA_FEATURE_FLAGS}")
elseif(CMAKE_BUILD_TYPE STREQUAL "relwithdebinfo")
set(KBUILD_FLAGS "${FALCO_EXTRA_FEATURE_FLAGS}")
add_definitions(-DBUILD_TYPE_RELWITHDEBINFO)
else()
set(CMAKE_BUILD_TYPE "release")
set(KBUILD_FLAGS "${FALCO_EXTRA_FEATURE_FLAGS}")
add_definitions(-DBUILD_TYPE_RELEASE)
endif()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
if(MINIMAL_BUILD)
set(MINIMAL_BUILD_FLAGS "-DMINIMAL_BUILD")
endif()
if(MUSL_OPTIMIZED_BUILD)
set(MUSL_FLAGS "-static -Os -fPIE -pie")
add_definitions(-DMUSL_OPTIMIZED)
endif()
# explicitly set hardening flags
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(FALCO_SECURITY_FLAGS "")
if(LINUX)
set(FALCO_SECURITY_FLAGS "${FALCO_SECURITY_FLAGS} -fstack-protector-strong")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro,-z,now")
endif()
if(NOT MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "release")
set(FALCO_SECURITY_FLAGS "${FALCO_SECURITY_FLAGS} -D_FORTIFY_SOURCE=2")
endif()
if(USE_ASAN)
set(FALCO_SECURITY_FLAGS "${FALCO_SECURITY_FLAGS} -fsanitize=address")
endif()
if(USE_UBSAN)
set(FALCO_SECURITY_FLAGS "${FALCO_SECURITY_FLAGS} -fsanitize=undefined")
if(UBSAN_HALT_ON_ERROR)
set(FALCO_SECURITY_FLAGS "${FALCO_SECURITY_FLAGS} -fno-sanitize-recover=undefined")
endif()
endif()
set(CMAKE_COMMON_FLAGS
"${FALCO_SECURITY_FLAGS} -Wall -ggdb ${FALCO_EXTRA_FEATURE_FLAGS} ${MINIMAL_BUILD_FLAGS} ${MUSL_FLAGS}"
)
if(BUILD_WARNINGS_AS_ERRORS)
set(CMAKE_SUPPRESSED_WARNINGS
"-Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable -Wno-missing-field-initializers -Wno-sign-compare -Wno-type-limits -Wno-implicit-fallthrough -Wno-format-truncation -Wno-stringop-truncation -Wno-stringop-overflow -Wno-restrict -Wno-deprecated-declarations"
)
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
set(CMAKE_COMMON_FLAGS "${CMAKE_COMMON_FLAGS} -Wextra ${CMAKE_SUPPRESSED_WARNINGS}")
endif()
set(CMAKE_C_FLAGS "${CMAKE_COMMON_FLAGS}")
set(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_COMMON_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG "${FALCO_EXTRA_DEBUG_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${FALCO_EXTRA_DEBUG_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "-O3 -fno-strict-aliasing -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fno-strict-aliasing -DNDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} -g")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -g")
# Add linker flags to generate separate debug files
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
"${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} -Wl,--build-id"
)
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
"${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} -Wl,--build-id"
)
else() # MSVC
set(MINIMAL_BUILD ON)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
# The WIN32_LEAN_AND_MEAN define avoids possible macro pollution when a libsinsp consumer
# includes the windows.h header: https://stackoverflow.com/a/28380820 Same goes for NOMINMAX:
# https://stackoverflow.com/questions/5004858/why-is-stdmin-failing-when-windows-h-is-included
add_compile_definitions(
_HAS_STD_BYTE=0 _CRT_SECURE_NO_WARNINGS WIN32 MINIMAL_BUILD WIN32_LEAN_AND_MEAN NOMINMAX
)
set(FALCOSECURITY_LIBS_COMMON_FLAGS "/EHsc /W3 /Zi /std:c++17")
set(FALCOSECURITY_LIBS_DEBUG_FLAGS "/MTd /Od")
set(FALCOSECURITY_LIBS_RELEASE_FLAGS "/MT")
set(FALCOSECURITY_LIBS_RELWITHDEBINFO_FLAGS "/MT /Zi")
# Ensure linker generates PDB files for MSVC
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
"${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG"
)
set(CMAKE_C_FLAGS "${FALCOSECURITY_LIBS_COMMON_FLAGS}")
set(CMAKE_CXX_FLAGS "${FALCOSECURITY_LIBS_COMMON_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG "${FALCOSECURITY_LIBS_DEBUG_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${FALCOSECURITY_LIBS_DEBUG_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "${FALCOSECURITY_LIBS_RELEASE_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${FALCOSECURITY_LIBS_RELEASE_FLAGS}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${FALCOSECURITY_LIBS_RELWITHDEBINFO_FLAGS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${FALCOSECURITY_LIBS_RELWITHDEBINFO_FLAGS}")
endif()

View File

@ -1,25 +1,29 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2020 The Falco Authors.
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
# Tests coverage
option(FALCO_COVERAGE "Build test suite with coverage information" OFF)
if(FALCO_COVERAGE)
if(NOT (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")))
message(FATAL_ERROR "FALCO_COVERAGE requires GCC or Clang.")
endif()
if(NOT (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES
"Clang"))
)
message(FATAL_ERROR "FALCO_COVERAGE requires GCC or Clang.")
endif()
message(STATUS "Building with coverage information")
add_compile_options(-g --coverage)
set(CMAKE_SHARED_LINKER_FLAGS "--coverage ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "--coverage ${CMAKE_EXE_LINKER_FLAGS}")
message(STATUS "Building with coverage information")
add_compile_options(-g --coverage)
set(CMAKE_SHARED_LINKER_FLAGS "--coverage ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "--coverage ${CMAKE_EXE_LINKER_FLAGS}")
endif()

View File

@ -1,27 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
include(ExternalProject)
set(CATCH2_INCLUDE ${CMAKE_BINARY_DIR}/catch2-prefix/include)
set(CATCH_EXTERNAL_URL URL https://github.com/catchorg/catch2/archive/v2.12.1.tar.gz URL_HASH
SHA256=e5635c082282ea518a8dd7ee89796c8026af8ea9068cd7402fb1615deacd91c3)
ExternalProject_Add(
catch2
PREFIX ${CMAKE_BINARY_DIR}/catch2-prefix
${CATCH_EXTERNAL_URL}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/catch2-prefix/src/catch2/single_include/catch2/catch.hpp
${CATCH2_INCLUDE}/catch.hpp)

View File

@ -1,28 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
include(ExternalProject)
set(FAKEIT_INCLUDE ${CMAKE_BINARY_DIR}/fakeit-prefix/include)
set(FAKEIT_EXTERNAL_URL URL https://github.com/eranpeer/fakeit/archive/2.0.5.tar.gz URL_HASH
SHA256=298539c773baca6ecbc28914306bba19d1008e098f8adc3ad3bb00e993ecdf15)
ExternalProject_Add(
fakeit-external
PREFIX ${CMAKE_BINARY_DIR}/fakeit-prefix
${FAKEIT_EXTERNAL_URL}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND
${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/fakeit-prefix/src/fakeit-external/single_header/catch/fakeit.hpp
${FAKEIT_INCLUDE}/fakeit.hpp)

View File

@ -1,29 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
include(ExternalProject)
set(STRING_VIEW_LITE_PREFIX ${CMAKE_BINARY_DIR}/string-view-lite-prefix)
set(STRING_VIEW_LITE_INCLUDE ${STRING_VIEW_LITE_PREFIX}/include)
message(STATUS "Using bundled string-view-lite in ${STRING_VIEW_LITE_INCLUDE}")
ExternalProject_Add(
string-view-lite
PREFIX ${STRING_VIEW_LITE_PREFIX}
GIT_REPOSITORY "https://github.com/martinmoene/string-view-lite.git"
GIT_TAG "v1.4.0"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND
${CMAKE_COMMAND} -E copy ${STRING_VIEW_LITE_PREFIX}/src/string-view-lite/include/nonstd/string_view.hpp
${STRING_VIEW_LITE_INCLUDE}/nonstd/string_view.hpp)

View File

@ -1,31 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
# This module is used to understand where the makedev function is defined in the glibc in use. see 'man 3 makedev'
# Usage: In your CMakeLists.txt include(FindMakedev)
#
# In your source code:
#
# #if HAVE_SYS_MKDEV_H #include <sys/mkdev.h> #endif #ifdef HAVE_SYS_SYSMACROS_H #include <sys/sysmacros.h> #endif
#
include(${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
check_include_file("sys/mkdev.h" HAVE_SYS_MKDEV_H)
check_include_file("sys/sysmacros.h" HAVE_SYS_SYSMACROS_H)
if(HAVE_SYS_MKDEV_H)
add_definitions(-DHAVE_SYS_MKDEV_H)
endif()
if(HAVE_SYS_SYSMACROS_H)
add_definitions(-DHAVE_SYS_SYSMACROS_H)
endif()

View File

@ -1,59 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
# Retrieve git ref and commit hash
include(GetGitRevisionDescription)
# Create the falco version variable according to git index
if(NOT FALCO_VERSION)
string(STRIP "${FALCO_HASH}" FALCO_HASH)
# Try to obtain the exact git tag
git_get_exact_tag(FALCO_TAG)
if(NOT FALCO_TAG)
# Obtain the closest tag
git_describe(FALCO_VERSION "--always" "--tags")
# Fallback version
if(FALCO_VERSION MATCHES "NOTFOUND$")
set(FALCO_VERSION "0.0.0")
endif()
# Format FALCO_VERSION to be semver with prerelease and build part
string(REPLACE "-g" "+" FALCO_VERSION "${FALCO_VERSION}")
else()
# A tag has been found: use it as the Falco version
set(FALCO_VERSION "${FALCO_TAG}")
# Remove the starting "v" in case there is one
string(REGEX REPLACE "^v(.*)" "\\1" FALCO_VERSION "${FALCO_TAG}")
endif()
# TODO(leodido) > ensure Falco version is semver before extracting parts Populate partial version variables
string(REGEX MATCH "^(0|[1-9][0-9]*)" FALCO_VERSION_MAJOR "${FALCO_VERSION}")
string(REGEX REPLACE "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\..*" "\\2" FALCO_VERSION_MINOR "${FALCO_VERSION}")
string(REGEX REPLACE "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*).*" "\\3" FALCO_VERSION_PATCH
"${FALCO_VERSION}")
string(
REGEX
REPLACE
"^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*).*"
"\\5"
FALCO_VERSION_PRERELEASE
"${FALCO_VERSION}")
if(FALCO_VERSION_PRERELEASE STREQUAL "${FALCO_VERSION}")
set(FALCO_VERSION_PRERELEASE "")
endif()
if(NOT FALCO_VERSION_BUILD)
string(REGEX REPLACE ".*\\+([0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*)" "\\1" FALCO_VERSION_BUILD "${FALCO_VERSION}")
endif()
if(FALCO_VERSION_BUILD STREQUAL "${FALCO_VERSION}")
set(FALCO_VERSION_BUILD "")
endif()
endif()
message(STATUS "Falco version: ${FALCO_VERSION}")

View File

@ -1,169 +0,0 @@
# * Returns a version string from Git
#
# These functions force a re-configure on each git commit so that you can trust the values of the variables in your
# build system.
#
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
#
# Returns the refspec and sha hash of the current head revision
#
# git_describe(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe on the source tree, and adjusting the output so that it tests false if an error
# occurs.
#
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe --exact-match on the source tree, and adjusting the output so that it tests false
# if there was no exact matching tag.
#
# git_local_changes(<var>)
#
# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes. Uses the return code of "git diff-index --quiet
# HEAD --". Does not regard untracked files.
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author: 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010. Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
if(__get_git_revision_description)
return()
endif()
set(__get_git_revision_description YES)
# We must run the following at "include" time, not at function call time, to find the path to this module rather than
# the path to a calling list file
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
function(get_git_head_revision _refspecvar _hashvar)
set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
# We have reached the root directory, we are not in git
set(${_refspecvar}
"GITDIR-NOTFOUND"
PARENT_SCOPE)
set(${_hashvar}
"GITDIR-NOTFOUND"
PARENT_SCOPE)
return()
endif()
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
endwhile()
# check if this is a submodule
if(NOT IS_DIRECTORY ${GIT_DIR})
file(READ ${GIT_DIR} submodule)
string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule})
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)
endif()
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
if(NOT EXISTS "${GIT_DATA}")
file(MAKE_DIRECTORY "${GIT_DATA}")
endif()
if(NOT EXISTS "${GIT_DIR}/HEAD")
return()
endif()
set(HEAD_FILE "${GIT_DATA}/HEAD")
configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" "${GIT_DATA}/grabRef.cmake" @ONLY)
include("${GIT_DATA}/grabRef.cmake")
set(${_refspecvar}
"${HEAD_REF}"
PARENT_SCOPE)
set(${_hashvar}
"${HEAD_HASH}"
PARENT_SCOPE)
endfunction()
function(git_describe _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var}
"GIT-NOTFOUND"
PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var}
"HEAD-HASH-NOTFOUND"
PARENT_SCOPE)
return()
endif()
execute_process(COMMAND
"${GIT_EXECUTABLE}"
describe
${hash}
${ARGN}
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE
res
OUTPUT_VARIABLE
out
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(out "${out}-${res}-NOTFOUND")
endif()
set(${_var}
"${out}"
PARENT_SCOPE)
endfunction()
function(git_get_exact_tag _var)
git_describe(out --exact-match ${ARGN})
set(${_var}
"${out}"
PARENT_SCOPE)
endfunction()
function(git_local_changes _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var}
"GIT-NOTFOUND"
PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var}
"HEAD-HASH-NOTFOUND"
PARENT_SCOPE)
return()
endif()
execute_process(
COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD --
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE res
OUTPUT_VARIABLE out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(res EQUAL 0)
set(${_var}
"CLEAN"
PARENT_SCOPE)
else()
set(${_var}
"DIRTY"
PARENT_SCOPE)
endif()
endfunction()

View File

@ -1,41 +0,0 @@
#
# Internal file for GetGitRevisionDescription.cmake
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(HEAD_HASH)
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
if(HEAD_CONTENTS MATCHES "ref")
# named branch
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
else()
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
set(HEAD_HASH "${CMAKE_MATCH_1}")
endif()
endif()
else()
# detached HEAD
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
endif()
if(NOT HEAD_HASH)
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
string(STRIP "${HEAD_HASH}" HEAD_HASH)
endif()

View File

@ -1,45 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
mark_as_advanced(OPENSSL_BINARY)
if(NOT USE_BUNDLED_DEPS)
find_package(OpenSSL REQUIRED)
message(STATUS "Found openssl: include: ${OPENSSL_INCLUDE_DIR}, lib: ${OPENSSL_LIBRARIES}")
find_program(OPENSSL_BINARY openssl)
if(NOT OPENSSL_BINARY)
message(FATAL_ERROR "Couldn't find the openssl command line in PATH")
else()
message(STATUS "Found openssl: binary: ${OPENSSL_BINARY}")
endif()
else()
mark_as_advanced(OPENSSL_BUNDLE_DIR OPENSSL_INSTALL_DIR OPENSSL_INCLUDE_DIR
OPENSSL_LIBRARY_SSL OPENSSL_LIBRARY_CRYPTO)
set(OPENSSL_BUNDLE_DIR "${PROJECT_BINARY_DIR}/openssl-prefix/src/openssl")
set(OPENSSL_INSTALL_DIR "${OPENSSL_BUNDLE_DIR}/target")
set(OPENSSL_INCLUDE_DIR "${PROJECT_BINARY_DIR}/openssl-prefix/src/openssl/include")
set(OPENSSL_LIBRARY_SSL "${OPENSSL_INSTALL_DIR}/lib/libssl.a")
set(OPENSSL_LIBRARY_CRYPTO "${OPENSSL_INSTALL_DIR}/lib/libcrypto.a")
set(OPENSSL_BINARY "${OPENSSL_INSTALL_DIR}/bin/openssl")
message(STATUS "Using bundled openssl in '${OPENSSL_BUNDLE_DIR}'")
ExternalProject_Add(
openssl
# START CHANGE for CVE-2017-3735, CVE-2017-3731, CVE-2017-3737, CVE-2017-3738, CVE-2017-3736
URL "https://github.com/openssl/openssl/archive/OpenSSL_1_0_2n.tar.gz"
URL_HASH "SHA256=4f4bc907caff1fee6ff8593729e5729891adcee412049153a3bb4db7625e8364"
# END CHANGE for CVE-2017-3735, CVE-2017-3731, CVE-2017-3737, CVE-2017-3738, CVE-2017-3736
CONFIGURE_COMMAND ./config no-shared --prefix=${OPENSSL_INSTALL_DIR}
BUILD_COMMAND ${CMD_MAKE}
BUILD_IN_SOURCE 1
INSTALL_COMMAND ${CMD_MAKE} install)
endif()

View File

@ -1,27 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
set(B64_SRC "${PROJECT_BINARY_DIR}/b64-prefix/src/b64")
message(STATUS "Using bundled b64 in '${B64_SRC}'")
set(B64_INCLUDE "${B64_SRC}/include")
set(B64_LIB "${B64_SRC}/src/libb64.a")
externalproject_add(
b64
URL "https://github.com/libb64/libb64/archive/ce864b17ea0e24a91e77c7dd3eb2d1ac4175b3f0.tar.gz"
URL_HASH "SHA256=d07173e66f435e5c77dbf81bd9313f8d0e4a3b4edd4105a62f4f8132ba932811"
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMD_MAKE}
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${B64_LIB}
INSTALL_COMMAND ""
)

View File

@ -1,76 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
if(NOT USE_BUNDLED_DEPS)
find_package(CURL REQUIRED)
message(STATUS "Found CURL: include: ${CURL_INCLUDE_DIR}, lib: ${CURL_LIBRARIES}")
else()
set(CURL_BUNDLE_DIR "${PROJECT_BINARY_DIR}/curl-prefix/src/curl")
set(CURL_INCLUDE_DIR "${CURL_BUNDLE_DIR}/include/")
set(CURL_LIBRARIES "${CURL_BUNDLE_DIR}/lib/.libs/libcurl.a")
set(CURL_SSL_OPTION "--with-ssl=${OPENSSL_INSTALL_DIR}")
message(STATUS "Using bundled curl in '${CURL_BUNDLE_DIR}'")
message(STATUS "Using SSL for curl in '${CURL_SSL_OPTION}'")
externalproject_add(
curl
DEPENDS openssl
# START CHANGE for CVE-2017-8816, CVE-2017-8817, CVE-2017-8818, CVE-2018-1000007
URL "https://github.com/curl/curl/releases/download/curl-7_61_0/curl-7.61.0.tar.bz2"
URL_HASH "SHA256=5f6f336921cf5b84de56afbd08dfb70adeef2303751ffb3e570c936c6d656c9c"
# END CHANGE for CVE-2017-8816, CVE-2017-8817, CVE-2017-8818, CVE-2018-1000007
CONFIGURE_COMMAND
./configure
${CURL_SSL_OPTION}
--disable-shared
--enable-optimize
--disable-curldebug
--disable-rt
--enable-http
--disable-ftp
--disable-file
--disable-ldap
--disable-ldaps
--disable-rtsp
--disable-telnet
--disable-tftp
--disable-pop3
--disable-imap
--disable-smb
--disable-smtp
--disable-gopher
--disable-sspi
--disable-ntlm-wb
--disable-tls-srp
--without-winssl
--without-darwinssl
--without-polarssl
--without-cyassl
--without-nss
--without-axtls
--without-ca-path
--without-ca-bundle
--without-libmetalink
--without-librtmp
--without-winidn
--without-libidn2
--without-libpsl
--without-nghttp2
--without-libssh2
--disable-threaded-resolver
--without-brotli
BUILD_COMMAND ${CMD_MAKE}
BUILD_IN_SOURCE 1
INSTALL_COMMAND "")
endif()

78
cmake/modules/cares.cmake Normal file
View File

@ -0,0 +1,78 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
option(USE_BUNDLED_CARES "Enable building of the bundled c-ares" ${USE_BUNDLED_DEPS})
if(CARES_INCLUDE)
# we already have c-ares
elseif(NOT USE_BUNDLED_CARES)
find_path(CARES_INCLUDE NAMES cares/ares.h ares.h)
find_library(CARES_LIB NAMES cares)
if(CARES_INCLUDE AND CARES_LIB)
message(STATUS "Found c-ares: include: ${CARES_INCLUDE}, lib: ${CARES_LIB}")
else()
message(FATAL_ERROR "Couldn't find system c-ares")
endif()
else()
if(BUILD_SHARED_LIBS)
set(CARES_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
set(CARES_STATIC_OPTION "Off")
else()
set(CARES_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
set(CARES_STATIC_OPTION "On")
endif()
set(CARES_SRC "${PROJECT_BINARY_DIR}/c-ares-prefix/src/c-ares")
set(CARES_INCLUDE "${CARES_SRC}/include/")
set(CARES_LIB "${CARES_SRC}/lib/libcares${CARES_LIB_SUFFIX}")
if(NOT TARGET c-ares)
message(STATUS "Using bundled c-ares in '${CARES_SRC}'")
ExternalProject_Add(
c-ares
PREFIX "${PROJECT_BINARY_DIR}/c-ares-prefix"
URL "https://github.com/c-ares/c-ares/releases/download/v1.33.1/c-ares-1.33.1.tar.gz"
URL_HASH "SHA256=06869824094745872fa26efd4c48e622b9bd82a89ef0ce693dc682a23604f415"
BUILD_IN_SOURCE 1
CMAKE_ARGS -DCMAKE_POLICY_DEFAULT_CMP0091:STRING=NEW
-DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY}
-DCMAKE_INSTALL_LIBDIR=lib
-DCARES_SHARED=${BUILD_SHARED_LIBS}
-DCARES_STATIC=${CARES_STATIC_OPTION}
-DCARES_STATIC_PIC=${ENABLE_PIC}
-DCARES_BUILD_TOOLS=Off
-DCARES_INSTALL=Off
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
BUILD_BYPRODUCTS ${CARES_INCLUDE} ${CARES_LIB}
INSTALL_COMMAND ""
)
install(
FILES "${CARES_LIB}"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps"
)
install(
DIRECTORY "${CARES_INCLUDE}"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps"
)
endif()
endif()
if(NOT TARGET c-ares)
add_custom_target(c-ares)
endif()
include_directories("${CARES_INCLUDE}")

View File

@ -0,0 +1,33 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
function(copy_files_to_build_dir source_files targetsuffix)
set(build_files)
foreach(file_path ${source_files})
get_filename_component(trace_file ${file_path} NAME)
list(APPEND build_files ${CMAKE_CURRENT_BINARY_DIR}/${trace_file})
endforeach()
add_custom_target(copy-files-${targetsuffix} ALL DEPENDS ${build_files})
add_custom_command(
OUTPUT ${build_files}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${source_files} ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${source_files}
)
endfunction()

View File

@ -0,0 +1,35 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
option(USE_BUNDLED_CPPHTTPLIB "Enable building of the bundled cpp-httplib" ${USE_BUNDLED_DEPS})
if(USE_BUNDLED_CPPHTTPLIB)
set(HTTPLIB_USE_BROTLI_IF_AVAILABLE OFF)
set(HTTPLIB_REQUIRE_BROTLI OFF)
set(HTTPLIB_USE_ZLIB_IF_AVAILABLE OFF)
set(HTTPLIB_REQUIRE_ZLIB OFF)
set(HTTPLIB_USE_ZSTD_IF_AVAILABLE OFF)
set(HTTPLIB_REQUIRE_ZSTD OFF)
set(HTTPLIB_USE_NON_BLOCKING_GETADDRINFO OFF)
include(FetchContent)
FetchContent_Declare(
cpp-httplib
URL https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.23.1.tar.gz
URL_HASH SHA256=410a1347ed6bcbcc4a19af8ed8ad3873fe9fa97731d52db845c4c78f3f9c31e6
)
FetchContent_MakeAvailable(cpp-httplib)
else()
find_package(httplib CONFIG REQUIRED)
endif()

100
cmake/modules/curl.cmake Normal file
View File

@ -0,0 +1,100 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
option(USE_BUNDLED_CURL "Enable building of the bundled curl" ${USE_BUNDLED_DEPS})
include(openssl)
include(zlib)
if(CURL_INCLUDE_DIRS)
# we already have curl
elseif(NOT USE_BUNDLED_CURL)
find_package(CURL REQUIRED)
message(STATUS "Found CURL: include: ${CURL_INCLUDE_DIRS}, lib: ${CURL_LIBRARIES}")
else()
if(BUILD_SHARED_LIBS)
set(CURL_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
set(CURL_STATIC_OPTION)
else()
set(CURL_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
set(CURL_STATIC_OPTION --disable-shared)
endif()
set(CURL_BUNDLE_DIR "${PROJECT_BINARY_DIR}/curl-prefix/src/curl")
set(CURL_INCLUDE_DIRS "${CURL_BUNDLE_DIR}/include/")
set(CURL_LIBRARIES "${CURL_BUNDLE_DIR}/lib/.libs/libcurl${CURL_LIB_SUFFIX}")
if(NOT USE_BUNDLED_OPENSSL)
set(CURL_SSL_OPTION "--with-ssl")
else()
set(CURL_SSL_OPTION "--with-ssl=${OPENSSL_INSTALL_DIR}")
message(STATUS "Using SSL for curl in '${OPENSSL_INSTALL_DIR}'")
endif()
if(NOT USE_BUNDLED_ZLIB)
set(CURL_ZLIB_OPTION "--with-zlib")
else()
set(CURL_ZLIB_OPTION "--with-zlib=${ZLIB_SRC}")
message(STATUS "Using zlib for curl in '${ZLIB_SRC}'")
endif()
message(STATUS "Using bundled curl in '${CURL_BUNDLE_DIR}'")
if(NOT ENABLE_PIC)
set(CURL_PIC_OPTION)
else()
set(CURL_PIC_OPTION "--with-pic")
endif()
if(NOT TARGET curl)
ExternalProject_Add(
curl
PREFIX "${PROJECT_BINARY_DIR}/curl-prefix"
DEPENDS openssl zlib
URL "https://github.com/curl/curl/releases/download/curl-8_7_1/curl-8.7.1.tar.bz2"
URL_HASH "SHA256=05bbd2b698e9cfbab477c33aa5e99b4975501835a41b7ca6ca71de03d8849e76"
CONFIGURE_COMMAND
./configure ${CURL_SSL_OPTION} ${CURL_ZLIB_OPTION} ${CURL_STATIC_OPTION}
${CURL_PIC_OPTION} --enable-optimize --disable-curldebug --disable-rt --enable-http
--disable-ftp --disable-file --disable-ldap --disable-ldaps --disable-rtsp
--disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb
--disable-smtp --disable-gopher --disable-sspi --disable-ntlm-wb --disable-tls-srp
--without-winssl --without-polarssl --without-cyassl --without-nss --without-axtls
--without-librtmp --without-winidn --without-libidn2 --without-libpsl
--without-nghttp2 --without-libssh2 --with-ca-path=/etc/ssl/certs/
--disable-threaded-resolver --without-brotli --without-zstd
BUILD_COMMAND make
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${CURL_LIBRARIES}
INSTALL_COMMAND ""
)
install(
FILES "${CURL_LIBRARIES}"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps"
)
install(
DIRECTORY "${CURL_INCLUDE_DIRS}curl"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps"
FILES_MATCHING
PATTERN "*.h"
)
endif()
endif()
if(NOT TARGET curl)
add_custom_target(curl)
endif()
include_directories("${CURL_INCLUDE_DIRS}")

View File

@ -0,0 +1,45 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
#
# cxxopts (https://github.com/jarro2783/cxxopts)
#
option(USE_BUNDLED_CXXOPTS "Enable building of the bundled cxxopts" ${USE_BUNDLED_DEPS})
if(CXXOPTS_INCLUDE_DIR)
# we already have cxxopts
elseif(NOT USE_BUNDLED_CXXOPTS)
find_package(cxxopts CONFIG REQUIRED)
get_target_property(CXXOPTS_INCLUDE_DIR cxxopts::cxxopts INTERFACE_INCLUDE_DIRECTORIES)
else()
set(CXXOPTS_SRC "${PROJECT_BINARY_DIR}/cxxopts-prefix/src/cxxopts/")
set(CXXOPTS_INCLUDE_DIR "${CXXOPTS_SRC}/include")
message(STATUS "Using bundled cxxopts in ${CXXOPTS_SRC}")
ExternalProject_Add(
cxxopts
URL "https://github.com/jarro2783/cxxopts/archive/refs/tags/v3.0.0.tar.gz"
URL_HASH "SHA256=36f41fa2a46b3c1466613b63f3fa73dc24d912bc90d667147f1e43215a8c6d00"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
endif()
if(NOT TARGET cxxopts)
add_custom_target(cxxopts)
endif()

View File

@ -0,0 +1,32 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
cmake_minimum_required(VERSION 3.5.1)
project(driver-repo NONE)
include(ExternalProject)
message(STATUS "Driver repository: ${DRIVER_REPO}")
message(STATUS "Driver version: ${DRIVER_VERSION}")
ExternalProject_Add(
driver
URL "https://github.com/${DRIVER_REPO}/archive/${DRIVER_VERSION}.tar.gz"
URL_HASH "${DRIVER_CHECKSUM}"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
PATCH_COMMAND sh -c "mv ./driver ../driver.tmp && rm -rf ./* && mv ../driver.tmp/* ."
)

View File

@ -0,0 +1,66 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
set(DRIVER_CMAKE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/driver-repo")
set(DRIVER_CMAKE_WORKING_DIR "${CMAKE_BINARY_DIR}/driver-repo")
file(MAKE_DIRECTORY ${DRIVER_CMAKE_WORKING_DIR})
if(DRIVER_SOURCE_DIR)
set(DRIVER_VERSION "0.0.0-local")
message(STATUS "Using local version for driver: '${DRIVER_SOURCE_DIR}'")
else()
# DRIVER_REPO accepts a repository name (<org name>/<repo name>) alternative to the
# falcosecurity/libs repository. In case you want to test against a fork of falcosecurity/libs
# just pass the variable - ie., `cmake -DDRIVER_REPO=<your-gh-handle>/libs ..`
if(NOT DRIVER_REPO)
set(DRIVER_REPO "falcosecurity/libs")
endif()
# DRIVER_VERSION accepts a git reference (branch name, commit hash, or tag) to the
# falcosecurity/libs repository which contains the driver source code under the `/driver`
# directory. The chosen driver version must be compatible with the given
# FALCOSECURITY_LIBS_VERSION. In case you want to test against another driver version (or
# branch, or commit) just pass the variable - ie., `cmake -DDRIVER_VERSION=dev ..`
if(NOT DRIVER_VERSION)
set(DRIVER_VERSION "8cd5fbf687020039e115e1aadcffb510b993a67b")
set(DRIVER_CHECKSUM
"SHA256=517f5a405540b16b175ff420b469dd324ad2e4ae874c91b912d4613036494a6f"
)
endif()
# cd /path/to/build && cmake /path/to/source
execute_process(
COMMAND
"${CMAKE_COMMAND}" -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" -DDRIVER_REPO=${DRIVER_REPO}
-DDRIVER_VERSION=${DRIVER_VERSION} -DDRIVER_CHECKSUM=${DRIVER_CHECKSUM}
${DRIVER_CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${DRIVER_CMAKE_WORKING_DIR}
)
# cmake --build .
execute_process(
COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${DRIVER_CMAKE_WORKING_DIR}"
)
set(DRIVER_SOURCE_DIR "${DRIVER_CMAKE_WORKING_DIR}/driver-prefix/src/driver")
endif()
add_definitions(-D_GNU_SOURCE)
set(DRIVER_NAME "falco")
set(DRIVER_PACKAGE_NAME "falco")
set(DRIVER_COMPONENT_NAME "falco-driver")
add_subdirectory(${DRIVER_SOURCE_DIR} ${PROJECT_BINARY_DIR}/driver)

View File

@ -0,0 +1,56 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
# Retrieve git ref and commit hash
include(GetVersionFromGit)
# Get Falco version variable according to git index
if(NOT FALCO_VERSION)
set(FALCO_VERSION "0.0.0")
get_version_from_git(FALCO_VERSION "" "")
endif()
# Remove the starting "v" in case there is one
string(REGEX REPLACE "^v(.*)" "\\1" FALCO_VERSION "${FALCO_VERSION}")
string(REGEX MATCH "^(0|[1-9][0-9]*)" FALCO_VERSION_MAJOR "${FALCO_VERSION}")
string(REGEX REPLACE "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\..*" "\\2" FALCO_VERSION_MINOR
"${FALCO_VERSION}"
)
string(REGEX REPLACE "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*).*" "\\3"
FALCO_VERSION_PATCH "${FALCO_VERSION}"
)
string(
REGEX
REPLACE
"^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*).*"
"\\5"
FALCO_VERSION_PRERELEASE
"${FALCO_VERSION}"
)
if(FALCO_VERSION_PRERELEASE STREQUAL "${FALCO_VERSION}")
set(FALCO_VERSION_PRERELEASE "")
endif()
if(NOT FALCO_VERSION_BUILD)
string(REGEX REPLACE ".*\\+([0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*)" "\\1" FALCO_VERSION_BUILD
"${FALCO_VERSION}"
)
endif()
if(FALCO_VERSION_BUILD STREQUAL "${FALCO_VERSION}")
set(FALCO_VERSION_BUILD "")
endif()
message(STATUS "Falco version: ${FALCO_VERSION}")

View File

@ -0,0 +1,56 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
include(ExternalProject)
option(ADD_FALCOCTL_DEPENDENCY "Add falcoctl dependency while building falco" ON)
if(ADD_FALCOCTL_DEPENDENCY)
string(TOLOWER ${CMAKE_HOST_SYSTEM_NAME} FALCOCTL_SYSTEM_NAME)
set(FALCOCTL_VERSION "0.11.2")
message(STATUS "Building with falcoctl: ${FALCOCTL_VERSION}")
if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set(FALCOCTL_SYSTEM_PROC_GO "amd64")
set(FALCOCTL_HASH "8d55818987c90e54f7406e1c1441a18df1f485db858bb0b3efda5db217be3b48")
else() # aarch64
set(FALCOCTL_SYSTEM_PROC_GO "arm64")
set(FALCOCTL_HASH "7c36404b5b7a515df25e7dc6d827a74ebc8526b1b49850954bbdd40860961bc2")
endif()
ExternalProject_Add(
falcoctl
URL "https://github.com/falcosecurity/falcoctl/releases/download/v${FALCOCTL_VERSION}/falcoctl_${FALCOCTL_VERSION}_${FALCOCTL_SYSTEM_NAME}_${FALCOCTL_SYSTEM_PROC_GO}.tar.gz"
URL_HASH "SHA256=${FALCOCTL_HASH}"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
install(
PROGRAMS "${PROJECT_BINARY_DIR}/falcoctl-prefix/src/falcoctl/falcoctl"
DESTINATION "${FALCO_BIN_DIR}"
COMPONENT "${FALCO_COMPONENT_NAME}"
)
install(
DIRECTORY
DESTINATION "${FALCO_ABSOLUTE_SHARE_DIR}/plugins"
COMPONENT "${FALCO_COMPONENT_NAME}"
)
else()
message(STATUS "Won't build with falcoctl")
endif()

View File

@ -0,0 +1,31 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
cmake_minimum_required(VERSION 3.5.1)
project(falcosecurity-libs-repo NONE)
include(ExternalProject)
message(STATUS "Libs repository: ${FALCOSECURITY_LIBS_REPO}")
message(STATUS "Libs version: ${FALCOSECURITY_LIBS_VERSION}")
ExternalProject_Add(
falcosecurity-libs
URL "https://github.com/${FALCOSECURITY_LIBS_REPO}/archive/${FALCOSECURITY_LIBS_VERSION}.tar.gz"
URL_HASH "${FALCOSECURITY_LIBS_CHECKSUM}"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)

View File

@ -0,0 +1,163 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
set(FALCOSECURITY_LIBS_CMAKE_SOURCE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/falcosecurity-libs-repo"
)
set(FALCOSECURITY_LIBS_CMAKE_WORKING_DIR "${CMAKE_BINARY_DIR}/falcosecurity-libs-repo")
file(MAKE_DIRECTORY ${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR})
# explicitly disable the bundled driver, since we pull it separately
set(USE_BUNDLED_DRIVER
OFF
CACHE BOOL ""
)
if(FALCOSECURITY_LIBS_SOURCE_DIR)
set(FALCOSECURITY_LIBS_VERSION "0.0.0-local")
message(STATUS "Using local version of falcosecurity/libs: '${FALCOSECURITY_LIBS_SOURCE_DIR}'")
else()
# FALCOSECURITY_LIBS_REPO accepts a repository name (<org name>/<repo name>) alternative to the
# falcosecurity/libs repository. In case you want to test against a fork of falcosecurity/libs
# just pass the variable - ie., `cmake -DFALCOSECURITY_LIBS_REPO=<your-gh-handle>/libs ..`
if(NOT FALCOSECURITY_LIBS_REPO)
set(FALCOSECURITY_LIBS_REPO "falcosecurity/libs")
endif()
# FALCOSECURITY_LIBS_VERSION accepts a git reference (branch name, commit hash, or tag) to the
# falcosecurity/libs repository. In case you want to test against another falcosecurity/libs
# version (or branch, or commit) just pass the variable - ie., `cmake
# -DFALCOSECURITY_LIBS_VERSION=dev ..`
if(NOT FALCOSECURITY_LIBS_VERSION)
set(FALCOSECURITY_LIBS_VERSION "8cd5fbf687020039e115e1aadcffb510b993a67b")
set(FALCOSECURITY_LIBS_CHECKSUM
"SHA256=517f5a405540b16b175ff420b469dd324ad2e4ae874c91b912d4613036494a6f"
)
endif()
# cd /path/to/build && cmake /path/to/source
execute_process(
COMMAND
"${CMAKE_COMMAND}" -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}"
-DFALCOSECURITY_LIBS_REPO=${FALCOSECURITY_LIBS_REPO}
-DFALCOSECURITY_LIBS_VERSION=${FALCOSECURITY_LIBS_VERSION}
-DFALCOSECURITY_LIBS_CHECKSUM=${FALCOSECURITY_LIBS_CHECKSUM}
${FALCOSECURITY_LIBS_CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR}
)
# cmake --build .
execute_process(
COMMAND "${CMAKE_COMMAND}" --build .
WORKING_DIRECTORY "${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR}"
)
set(FALCOSECURITY_LIBS_SOURCE_DIR
"${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR}/falcosecurity-libs-prefix/src/falcosecurity-libs"
)
endif()
set(LIBS_PACKAGE_NAME "falcosecurity")
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
add_definitions(-D_GNU_SOURCE)
endif()
if(MUSL_OPTIMIZED_BUILD)
add_definitions(-DMUSL_OPTIMIZED)
endif()
set(SCAP_HOST_ROOT_ENV_VAR_NAME "HOST_ROOT")
set(SCAP_HOSTNAME_ENV_VAR "FALCO_HOSTNAME")
set(SINSP_AGENT_CGROUP_MEM_PATH_ENV_VAR "FALCO_CGROUP_MEM_PATH")
if(NOT LIBS_DIR)
set(LIBS_DIR "${FALCOSECURITY_LIBS_SOURCE_DIR}")
endif()
# configure gVisor support
set(BUILD_LIBSCAP_GVISOR
${BUILD_FALCO_GVISOR}
CACHE BOOL ""
)
# configure modern BPF support
set(BUILD_LIBSCAP_MODERN_BPF
${BUILD_FALCO_MODERN_BPF}
CACHE BOOL ""
)
# explicitly disable the tests/examples of this dependency
set(CREATE_TEST_TARGETS
OFF
CACHE BOOL ""
)
set(BUILD_LIBSCAP_EXAMPLES
OFF
CACHE BOOL ""
)
set(USE_BUNDLED_TBB
ON
CACHE BOOL ""
)
set(USE_BUNDLED_JSONCPP
ON
CACHE BOOL ""
)
set(USE_BUNDLED_VALIJSON
ON
CACHE BOOL ""
)
set(USE_BUNDLED_RE2
ON
CACHE BOOL ""
)
set(USE_BUNDLED_UTHASH
ON
CACHE BOOL ""
)
if(USE_DYNAMIC_LIBELF)
set(USE_BUNDLED_LIBELF
OFF
CACHE BOOL ""
)
set(USE_SHARED_LIBELF
ON
CACHE BOOL ""
)
endif()
list(APPEND CMAKE_MODULE_PATH "${FALCOSECURITY_LIBS_SOURCE_DIR}/cmake/modules")
include(CheckSymbolExists)
check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY)
if(HAVE_STRLCPY)
message(
STATUS
"Existing strlcpy and strlcat found, will *not* use local definition by setting -DHAVE_STRLCPY and -DHAVE_STRLCAT."
)
add_definitions(-DHAVE_STRLCPY)
add_definitions(-DHAVE_STRLCAT)
else()
message(STATUS "No strlcpy and strlcat found, will use local definition")
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
include(driver)
endif()
include(libscap)
include(libsinsp)

View File

@ -1,145 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
if(NOT USE_BUNDLED_DEPS)
# zlib
include(FindZLIB)
set(ZLIB_INCLUDE "${ZLIB_INCLUDE_DIRS}")
set(ZLIB_LIB "${ZLIB_LIBRARIES}")
if(ZLIB_INCLUDE AND ZLIB_LIB)
message(STATUS "Found zlib: include: ${ZLIB_INCLUDE}, lib: ${ZLIB_LIB}")
endif()
# c-ares
mark_as_advanced(CARES_INCLUDE CARES_LIB)
find_path(CARES_INCLUDE NAMES ares.h)
find_library(CARES_LIB NAMES libcares.so)
if(CARES_INCLUDE AND CARES_LIB)
message(STATUS "Found c-ares: include: ${CARES_INCLUDE}, lib: ${CARES_LIB}")
else()
message(FATAL_ERROR "Couldn't find system c-ares")
endif()
# protobuf
mark_as_advanced(PROTOC PROTOBUF_INCLUDE PROTOBUF_LIB)
find_program(PROTOC NAMES protoc)
find_path(PROTOBUF_INCLUDE NAMES google/protobuf/message.h)
find_library(PROTOBUF_LIB NAMES libprotobuf.so)
if(PROTOC
AND PROTOBUF_INCLUDE
AND PROTOBUF_LIB)
message(STATUS "Found protobuf: compiler: ${PROTOC}, include: ${PROTOBUF_INCLUDE}, lib: ${PROTOBUF_LIB}")
else()
message(FATAL_ERROR "Couldn't find system protobuf")
endif()
# gpr
mark_as_advanced(GPR_LIB)
find_library(GPR_LIB NAMES gpr)
if(GPR_LIB)
message(STATUS "Found gpr lib: ${GPR_LIB}")
else()
message(FATAL_ERROR "Couldn't find system gpr")
endif()
# gRPC todo(fntlnz, leodido): check that gRPC version is greater or equal than 1.8.0
mark_as_advanced(GRPC_INCLUDE GRPC_SRC
GRPC_LIB GRPC_LIBS_ABSOLUTE GRPCPP_LIB GRPC_CPP_PLUGIN)
find_path(GRPCXX_INCLUDE NAMES grpc++/grpc++.h)
if(GRPCXX_INCLUDE)
set(GRPC_INCLUDE ${GRPCXX_INCLUDE})
unset(GRPCXX_INCLUDE CACHE)
else()
find_path(GRPCPP_INCLUDE NAMES grpcpp/grpcpp.h)
set(GRPC_INCLUDE ${GRPCPP_INCLUDE})
unset(GRPCPP_INCLUDE CACHE)
add_definitions(-DGRPC_INCLUDE_IS_GRPCPP=1)
endif()
find_library(GRPC_LIB NAMES grpc)
find_library(GRPCPP_LIB NAMES grpc++)
if(GRPC_INCLUDE
AND GRPC_LIB
AND GRPCPP_LIB)
message(STATUS "Found grpc: include: ${GRPC_INCLUDE}, C lib: ${GRPC_LIB}, C++ lib: ${GRPCPP_LIB}")
else()
message(FATAL_ERROR "Couldn't find system grpc")
endif()
find_program(GRPC_CPP_PLUGIN grpc_cpp_plugin)
if(NOT GRPC_CPP_PLUGIN)
message(FATAL_ERROR "System grpc_cpp_plugin not found")
endif()
else()
find_package(PkgConfig)
if(NOT PKG_CONFIG_FOUND)
message(FATAL_ERROR "pkg-config binary not found")
endif()
message(STATUS "Found pkg-config executable: ${PKG_CONFIG_EXECUTABLE}")
set(GRPC_SRC "${PROJECT_BINARY_DIR}/grpc-prefix/src/grpc")
set(GRPC_INCLUDE "${GRPC_SRC}/include")
set(GRPC_LIBS_ABSOLUTE "${GRPC_SRC}/libs/opt")
set(GRPC_LIB "${GRPC_LIBS_ABSOLUTE}/libgrpc.a")
set(GRPCPP_LIB "${GRPC_LIBS_ABSOLUTE}/libgrpc++.a")
set(GRPC_CPP_PLUGIN "${GRPC_SRC}/bins/opt/grpc_cpp_plugin")
# we tell gRPC to compile protobuf for us because when a gRPC package is not available, like on CentOS, it's very
# likely that protobuf will be very outdated
set(PROTOBUF_INCLUDE "${GRPC_SRC}/third_party/protobuf/src")
set(PROTOC "${PROTOBUF_INCLUDE}/protoc")
set(PROTOBUF_LIB "${GRPC_LIBS_ABSOLUTE}/protobuf/libprotobuf.a")
# we tell gRPC to compile zlib for us because when a gRPC package is not available, like on CentOS, it's very likely
# that zlib will be very outdated
set(ZLIB_INCLUDE "${GRPC_SRC}/third_party/zlib")
set(ZLIB_LIB "${GRPC_LIBS_ABSOLUTE}/libz.a")
# we tell gRPC to compile c-ares for us because when a gRPC package is not available, like on CentOS, it's very likely
# that c-ares will be very outdated
set(CARES_INCLUDE "${GRPC_SRC}/third_party/cares" "${GRPC_SRC}/third_party/cares/cares")
set(CARES_LIB "${GRPC_LIBS_ABSOLUTE}/libares.a")
message(STATUS "Using bundled gRPC in '${GRPC_SRC}'")
message(
STATUS
"Bundled gRPC comes with protobuf: compiler: ${PROTOC}, include: ${PROTOBUF_INCLUDE}, lib: ${PROTOBUF_LIB}")
message(STATUS "Bundled gRPC comes with zlib: include: ${ZLIB_INCLUDE}, lib: ${ZLIB_LIB}}")
message(STATUS "Bundled gRPC comes with cares: include: ${CARES_INCLUDE}, lib: ${CARES_LIB}}")
message(STATUS "Bundled gRPC comes with gRPC C++ plugin: include: ${GRPC_CPP_PLUGIN}")
get_filename_component(PROTOC_DIR ${PROTOC} PATH)
ExternalProject_Add(
grpc
DEPENDS openssl
GIT_REPOSITORY https://github.com/grpc/grpc.git
GIT_TAG v1.32.0
GIT_SUBMODULES "third_party/protobuf third_party/zlib third_party/cares/cares third_party/abseil-cpp third_party/re2"
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${GRPC_LIB} ${GRPCPP_LIB}
INSTALL_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND
CFLAGS=-Wno-implicit-fallthrough
HAS_SYSTEM_ZLIB=false
HAS_SYSTEM_PROTOBUF=false
HAS_SYSTEM_CARES=false
HAS_EMBEDDED_OPENSSL_ALPN=false
HAS_SYSTEM_OPENSSL_ALPN=true
PKG_CONFIG_PATH=${OPENSSL_BUNDLE_DIR}
PKG_CONFIG=${PKG_CONFIG_EXECUTABLE}
PATH=${PROTOC_DIR}:$ENV{PATH}
make
static_cxx
static_c
grpc_cpp_plugin)
endif()

278
cmake/modules/grpc.cmake Normal file
View File

@ -0,0 +1,278 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
option(USE_BUNDLED_GRPC "Enable building of the bundled grpc" ${USE_BUNDLED_DEPS})
if(GRPC_INCLUDE)
# we already have grpc
elseif(NOT USE_BUNDLED_GRPC)
# gRPC
find_package(gRPC CONFIG)
if(gRPC_FOUND)
message(STATUS "Using gRPC ${gRPC_VERSION}")
set(GPR_LIB gRPC::gpr)
set(GRPC_LIB gRPC::grpc)
set(GRPCPP_LIB gRPC::grpc++)
# gRPC C++ plugin
get_target_property(GRPC_CPP_PLUGIN gRPC::grpc_cpp_plugin LOCATION)
if(NOT GRPC_CPP_PLUGIN)
message(FATAL_ERROR "System grpc_cpp_plugin not found")
endif()
# gRPC include dir + properly handle grpc{++,pp}
get_target_property(GRPC_INCLUDE gRPC::grpc++ INTERFACE_INCLUDE_DIRECTORIES)
find_path(
GRPCXX_INCLUDE
NAMES grpc++/grpc++.h
PATHS ${GRPC_INCLUDE}
)
if(NOT GRPCXX_INCLUDE)
find_path(
GRPCPP_INCLUDE
NAMES grpcpp/grpcpp.h
PATHS ${GRPC_INCLUDE}
)
add_definitions(-DGRPC_INCLUDE_IS_GRPCPP=1)
endif()
else()
# Fallback to manually find libraries; Some distro, namely Ubuntu focal, do not install gRPC
# config cmake module
find_library(GPR_LIB NAMES gpr)
if(GPR_LIB)
message(STATUS "Found gpr lib: ${GPR_LIB}")
else()
message(FATAL_ERROR "Couldn't find system gpr")
endif()
find_path(GRPCXX_INCLUDE NAMES grpc++/grpc++.h)
if(GRPCXX_INCLUDE)
set(GRPC_INCLUDE ${GRPCXX_INCLUDE})
else()
find_path(GRPCPP_INCLUDE NAMES grpcpp/grpcpp.h)
set(GRPC_INCLUDE ${GRPCPP_INCLUDE})
add_definitions(-DGRPC_INCLUDE_IS_GRPCPP=1)
endif()
find_library(GRPC_LIB NAMES grpc)
find_library(GRPCPP_LIB NAMES grpc++)
if(GRPC_INCLUDE
AND GRPC_LIB
AND GRPCPP_LIB
)
message(
STATUS
"Found grpc: include: ${GRPC_INCLUDE}, C lib: ${GRPC_LIB}, C++ lib: ${GRPCPP_LIB}"
)
else()
message(FATAL_ERROR "Couldn't find system grpc")
endif()
find_program(GRPC_CPP_PLUGIN grpc_cpp_plugin)
if(NOT GRPC_CPP_PLUGIN)
message(FATAL_ERROR "System grpc_cpp_plugin not found")
endif()
endif()
else()
include(cares)
include(protobuf)
include(zlib)
include(openssl)
if(BUILD_SHARED_LIBS)
set(GRPC_OPENSSL_STATIC_LIBS_OPTION FALSE)
else()
set(GRPC_OPENSSL_STATIC_LIBS_OPTION TRUE)
endif()
include(re2)
set(GRPC_SRC "${PROJECT_BINARY_DIR}/grpc-prefix/src/grpc")
set(GRPC_INSTALL_DIR "${GRPC_SRC}/target")
set(GRPC_INCLUDE "${GRPC_INSTALL_DIR}/include" "${GRPC_SRC}/third_party/abseil-cpp")
set(GPR_LIB "${GRPC_SRC}/libgpr.a")
set(GRPC_LIB "${GRPC_SRC}/libgrpc.a")
set(GRPCPP_LIB "${GRPC_SRC}/libgrpc++.a")
set(GRPC_CPP_PLUGIN "${GRPC_SRC}/grpc_cpp_plugin")
set(GRPC_MAIN_LIBS "")
list(
APPEND
GRPC_MAIN_LIBS
"${GPR_LIB}"
"${GRPC_LIB}"
"${GRPCPP_LIB}"
"${GRPC_SRC}/libgrpc++_alts.a"
"${GRPC_SRC}/libgrpc++_error_details.a"
"${GRPC_SRC}/libgrpc++_reflection.a"
"${GRPC_SRC}/libgrpc++_unsecure.a"
"${GRPC_SRC}/libgrpc_plugin_support.a"
"${GRPC_SRC}/libgrpc_unsecure.a"
"${GRPC_SRC}/libgrpcpp_channelz.a"
)
get_filename_component(PROTOC_DIR ${PROTOC} PATH)
if(NOT TARGET grpc)
message(STATUS "Using bundled grpc in '${GRPC_SRC}'")
# fixme(leogr): this workaround is required to inject the missing deps (built by gRCP
# cmakefiles) into target_link_libraries later note: the list below is manually generated
# starting from the output of pkg-config --libs grpc++
set(GRPC_LIBRARIES "")
list(
APPEND
GRPC_LIBRARIES
"${GRPC_SRC}/libaddress_sorting.a"
"${GRPC_SRC}/libupb.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/hash/libabsl_hash.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/hash/libabsl_city.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/hash/libabsl_low_level_hash.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/container/libabsl_raw_hash_set.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/container/libabsl_hashtablez_sampler.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/status/libabsl_statusor.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/status/libabsl_status.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/strings/libabsl_cord.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/strings/libabsl_cordz_functions.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/profiling/libabsl_exponential_biased.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/types/libabsl_bad_optional_access.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/types/libabsl_bad_variant_access.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/strings/libabsl_str_format_internal.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/synchronization/libabsl_synchronization.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/synchronization/libabsl_graphcycles_internal.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/debugging/libabsl_stacktrace.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/debugging/libabsl_symbolize.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/debugging/libabsl_debugging_internal.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/debugging/libabsl_demangle_internal.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/base/libabsl_malloc_internal.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/time/libabsl_time.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/time/libabsl_civil_time.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/strings/libabsl_strings.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/strings/libabsl_strings_internal.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/base/libabsl_base.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/base/libabsl_spinlock_wait.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/numeric/libabsl_int128.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/base/libabsl_throw_delegate.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/base/libabsl_raw_logging_internal.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/base/libabsl_log_severity.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/time/libabsl_time_zone.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/strings/libabsl_cord_internal.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/strings/libabsl_cordz_info.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/strings/libabsl_cordz_handle.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/random/libabsl_random_internal_pool_urbg.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/random/libabsl_random_internal_randen.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/random/libabsl_random_internal_randen_hwaes.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/random/libabsl_random_internal_randen_hwaes_impl.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/random/libabsl_random_internal_randen_slow.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/random/libabsl_random_internal_seed_material.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/random/libabsl_random_internal_platform.a"
"${GRPC_SRC}/third_party/abseil-cpp/absl/random/libabsl_random_seed_gen_exception.a"
)
# Make abseil-cpp build compatible with gcc-13 See
# https://patchwork.yoctoproject.org/project/oe/patch/20230518093301.2938164-1-Martin.Jansa@gmail.com/
# TO BE DROPPED once we finally upgrade grpc...
set(GRPC_PATCH_CMD
sh
-c
"sed -i '20s/^/#include <cstdint>/' ${GRPC_SRC}/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h"
&&
sh
-c
"sed -i 's|off64_t|off_t|g' ${GRPC_SRC}/third_party/abseil-cpp/absl/base/internal/direct_mmap.h"
)
# Zig workaround: Add a PATCH_COMMAND to grpc cmake to fixup emitted -march by abseil-cpp
# cmake module, making it use a name understood by zig for arm64. See
# https://github.com/abseil/abseil-cpp/blob/master/absl/copts/GENERATED_AbseilCopts.cmake#L226.
if(CMAKE_C_COMPILER MATCHES "zig")
message(STATUS "Enabling zig workaround for abseil-cpp")
set(GRPC_PATCH_CMD
${GRPC_PATCH_CMD}
&&
sh
-c
"sed -i 's/armv8-a/cortex_a57/g' ${GRPC_SRC}/third_party/abseil-cpp/absl/copts/GENERATED_AbseilCopts.cmake"
)
endif()
ExternalProject_Add(
grpc
PREFIX "${PROJECT_BINARY_DIR}/grpc-prefix"
DEPENDS openssl protobuf c-ares zlib re2
GIT_REPOSITORY https://github.com/grpc/grpc.git
GIT_TAG v1.44.0
GIT_SUBMODULES "third_party/abseil-cpp"
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=${GRPC_INSTALL_DIR}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=${ENABLE_PIC}
-DgRPC_INSTALL:BOOL=OFF
# disable unused stuff
-DgRPC_BUILD_TESTS:BOOL=OFF
-DgRPC_BUILD_CSHARP_EXT:BOOL=OFF
-DgRPC_BUILD_GRPC_CSHARP_PLUGIN:BOOL=OFF
-DgRPC_BUILD_GRPC_NODE_PLUGIN:BOOL=OFF
-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN:BOOL=OFF
-DgRPC_BUILD_GRPC_PHP_PLUGIN:BOOL=OFF
-DgRPC_BUILD_GRPC_PYTHON_PLUGIN:BOOL=OFF
-DgRPC_BUILD_GRPC_RUBY_PLUGIN:BOOL=OFF
# deps provided by us
# https://github.com/grpc/grpc/blob/v1.32.0/cmake/modules/Findc-ares.cmake
-DgRPC_CARES_PROVIDER:STRING=package
-Dc-ares_DIR:PATH=${CARES_SRC}
-Dc-ares_INCLUDE_DIR:PATH=${CARES_INCLUDE}
-Dc-ares_LIBRARY:PATH=${CARES_LIB}
# https://cmake.org/cmake/help/v3.6/module/FindProtobuf.html
-DgRPC_PROTOBUF_PROVIDER:STRING=package
-DCMAKE_CXX_FLAGS:STRING=-I${PROTOBUF_INCLUDE}
-DProtobuf_INCLUDE_DIR:PATH=${PROTOBUF_INCLUDE}
-DProtobuf_LIBRARY:PATH=${PROTOBUF_LIB}
-DProtobuf_PROTOC_LIBRARY:PATH=${PROTOC_LIB}
-DProtobuf_PROTOC_EXECUTABLE:PATH=${PROTOC}
# https://cmake.org/cmake/help/v3.6/module/FindOpenSSL.html
-DgRPC_SSL_PROVIDER:STRING=package
-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_INSTALL_DIR}
-DOPENSSL_USE_STATIC_LIBS:BOOL=${GRPC_OPENSSL_STATIC_LIBS_OPTION}
# https://cmake.org/cmake/help/v3.6/module/FindZLIB.html
-DgRPC_ZLIB_PROVIDER:STRING=package
-DZLIB_ROOT:STRING=${ZLIB_SRC}
# RE2
-DgRPC_RE2_PROVIDER:STRING=package
-Dre2_DIR:PATH=${RE2_DIR}
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${GRPC_LIB} ${GRPCPP_LIB} ${GPR_LIB} ${GRPC_LIBRARIES}
# Keep installation files into the local ${GRPC_INSTALL_DIR} since here is the case when
# we are embedding gRPC
UPDATE_COMMAND ""
PATCH_COMMAND ${GRPC_PATCH_CMD}
INSTALL_COMMAND DESTDIR= ${CMAKE_MAKE_PROGRAM} install
)
install(
FILES ${GRPC_MAIN_LIBS}
DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps"
)
install(
FILES ${GRPC_LIBRARIES}
DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps"
)
install(
DIRECTORY "${GRPC_SRC}/target/include/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps"
)
endif()
endif()
if(NOT TARGET grpc)
add_custom_target(grpc)
endif()
include_directories("${GRPC_INCLUDE}")

View File

@ -0,0 +1,75 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2025 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
option(USE_BUNDLED_JEMALLOC "Use bundled jemalloc allocator" ${USE_BUNDLED_DEPS})
if(JEMALLOC_INCLUDE)
# we already have JEMALLOC
elseif(NOT USE_BUNDLED_JEMALLOC)
find_path(JEMALLOC_INCLUDE jemalloc/jemalloc.h)
set(JEMALLOC_INCLUDE ${JEMALLOC_INCLUDE}/jemalloc)
if(BUILD_SHARED_LIBS)
set(JEMALLOC_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
else()
set(JEMALLOC_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
endif()
find_library(MALLOC_LIB NAMES libjemalloc${JEMALLOC_LIB_SUFFIX})
if(MALLOC_LIB)
message(STATUS "Found system jemalloc: include: ${JEMALLOC_INCLUDE}, lib: ${MALLOC_LIB}")
else()
message(FATAL_ERROR "Couldn't find system jemalloc")
endif()
else()
if(BUILD_SHARED_LIBS)
set(JEMALLOC_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
else()
set(JEMALLOC_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
endif()
set(JEMALLOC_SRC "${PROJECT_BINARY_DIR}/jemalloc-prefix/src")
set(MALLOC_LIB "${JEMALLOC_SRC}/malloc/lib/libjemalloc${JEMALLOC_LIB_SUFFIX}")
set(JEMALLOC_INCLUDE "${JEMALLOC_SRC}/malloc/include/jemalloc")
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(JEMALLOC_ARCH_SPECIFIC_CONFIGURE_ARGS --with-lg-page=14)
else()
set(JEMALLOC_ARCH_SPECIFIC_CONFIGURE_ARGS "")
endif()
ExternalProject_Add(
malloc
PREFIX "${PROJECT_BINARY_DIR}/jemalloc-prefix"
URL "https://github.com/jemalloc/jemalloc/archive/refs/tags/5.3.0.tar.gz"
URL_HASH "SHA256=ef6f74fd45e95ee4ef7f9e19ebe5b075ca6b7fbe0140612b2a161abafb7ee179"
CONFIGURE_COMMAND ./autogen.sh --enable-prof --disable-libdl
${JEMALLOC_ARCH_SPECIFIC_CONFIGURE_ARGS}
BUILD_IN_SOURCE 1
BUILD_COMMAND make build_lib_static
INSTALL_COMMAND ""
UPDATE_COMMAND ""
BUILD_BYPRODUCTS ${MALLOC_LIB}
)
install(
FILES "${MALLOC_LIB}"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps"
)
endif()
# We add a custom target, in this way we can always depend on `jemalloc` without distinguishing
# between "bundled" and "not-bundled" case
if(NOT TARGET malloc)
add_custom_target(malloc)
endif()
include_directories(${JEMALLOC_INCLUDE})
add_compile_definitions(HAS_JEMALLOC)

View File

@ -1,54 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
mark_as_advanced(JQ_INCLUDE JQ_LIB)
if (NOT USE_BUNDLED_DEPS)
find_path(JQ_INCLUDE jq.h PATH_SUFFIXES jq)
find_library(JQ_LIB NAMES jq)
if (JQ_INCLUDE AND JQ_LIB)
message(STATUS "Found jq: include: ${JQ_INCLUDE}, lib: ${JQ_LIB}")
else ()
message(FATAL_ERROR "Couldn't find system jq")
endif ()
else ()
set(JQ_SRC "${PROJECT_BINARY_DIR}/jq-prefix/src/jq")
message(STATUS "Using bundled jq in '${JQ_SRC}'")
set(JQ_INCLUDE "${JQ_SRC}/target/include")
set(JQ_INSTALL_DIR "${JQ_SRC}/target")
set(JQ_LIB "${JQ_INSTALL_DIR}/lib/libjq.a")
set(ONIGURUMA_LIB "${JQ_INSTALL_DIR}/lib/libonig.a")
message(STATUS "Bundled jq: include: ${JQ_INCLUDE}, lib: ${JQ_LIB}")
# Why we mirror jq here?
#
# In their readme, jq claims that you don't have
# to do autoreconf -fi when downloading a released tarball.
#
# However, they forgot to push the released makefiles
# into their release tarbal.
#
# For this reason, we have to mirror their release after
# doing the configuration ourselves.
#
# This is needed because many distros do not ship the right
# version of autoreconf, making virtually impossible to build Falco on them.
# Read more about it here:
# https://github.com/stedolan/jq/issues/2061#issuecomment-593445920
ExternalProject_Add(
jq
URL "https://download.falco.org/dependencies/jq-1.6.tar.gz"
URL_HASH "SHA256=787518068c35e244334cc79b8e56b60dbab352dff175b7f04a94f662b540bfd9"
CONFIGURE_COMMAND ./configure --disable-maintainer-mode --enable-all-static --disable-dependency-tracking --with-oniguruma=builtin --prefix=${JQ_INSTALL_DIR}
BUILD_COMMAND ${CMD_MAKE} LDFLAGS=-all-static
BUILD_IN_SOURCE 1
INSTALL_COMMAND ${CMD_MAKE} install)
endif ()

View File

@ -1,27 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
set(LIBYAML_SRC "${PROJECT_BINARY_DIR}/libyaml-prefix/src/libyaml")
set(LIBYAML_INSTALL_DIR "${LIBYAML_SRC}/target")
message(STATUS "Using bundled libyaml in '${LIBYAML_SRC}'")
set(LIBYAML_LIB "${LIBYAML_SRC}/src/.libs/libyaml.a")
externalproject_add(
libyaml
URL "https://github.com/yaml/libyaml/releases/download/0.2.5/yaml-0.2.5.tar.gz"
URL_HASH "SHA256=c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4"
CONFIGURE_COMMAND ./configure --prefix=${LIBYAML_INSTALL_DIR} CFLAGS=-fPIC CPPFLAGS=-fPIC --enable-static=true --enable-shared=false
BUILD_COMMAND ${CMD_MAKE}
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${LIBYAML_LIB}
INSTALL_COMMAND ${CMD_MAKE} install
)

View File

@ -1,28 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
set(LPEG_SRC "${PROJECT_BINARY_DIR}/lpeg-prefix/src/lpeg")
set(LPEG_LIB "${PROJECT_BINARY_DIR}/lpeg-prefix/src/lpeg/build/lpeg.a")
message(STATUS "Using bundled lpeg in '${LPEG_SRC}'")
set(LPEG_DEPENDENCIES "")
list(APPEND LPEG_DEPENDENCIES "luajit")
ExternalProject_Add(
lpeg
DEPENDS ${LPEG_DEPENDENCIES}
URL "http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.0.2.tar.gz"
URL_HASH "SHA256=48d66576051b6c78388faad09b70493093264588fcd0f258ddaab1cdd4a15ffe"
BUILD_COMMAND LUA_INCLUDE=${LUAJIT_INCLUDE} "${PROJECT_SOURCE_DIR}/scripts/build-lpeg.sh" "${LPEG_SRC}/build"
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${LPEG_LIB}
CONFIGURE_COMMAND ""
INSTALL_COMMAND "")

View File

@ -1,27 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
set(LUAJIT_SRC "${PROJECT_BINARY_DIR}/luajit-prefix/src/luajit/src")
message(STATUS "Using bundled LuaJIT in '${LUAJIT_SRC}'")
set(LUAJIT_INCLUDE "${LUAJIT_SRC}")
set(LUAJIT_LIB "${LUAJIT_SRC}/libluajit.a")
externalproject_add(
luajit
GIT_REPOSITORY "https://github.com/LuaJIT/LuaJIT"
GIT_TAG "1d8b747c161db457e032a023ebbff511f5de5ec2"
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMD_MAKE}
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${LUAJIT_LIB}
INSTALL_COMMAND ""
)

View File

@ -1,28 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
set(LYAML_SRC "${PROJECT_BINARY_DIR}/lyaml-prefix/src/lyaml/ext/yaml")
set(LYAML_LIB "${LYAML_SRC}/.libs/yaml.a")
message(STATUS "Using bundled lyaml in '${LYAML_SRC}'")
externalproject_add(
lyaml
DEPENDS luajit libyaml
URL "https://github.com/gvvaughan/lyaml/archive/release-v6.0.tar.gz"
URL_HASH "SHA256=9d7cf74d776999ff6f758c569d5202ff5da1f303c6f4229d3b41f71cd3a3e7a7"
BUILD_COMMAND ${CMD_MAKE}
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${LYAML_LIB}
CONFIGURE_COMMAND ./configure --enable-static CFLAGS=-I${LIBYAML_INSTALL_DIR}/include CPPFLAGS=-I${LIBYAML_INSTALL_DIR}/include LDFLAGS=-L${LIBYAML_INSTALL_DIR}/lib LIBS=-lyaml LUA=${LUAJIT_SRC}/luajit LUA_INCLUDE=-I${LUAJIT_INCLUDE}
INSTALL_COMMAND sh -c
"cp -R ${PROJECT_BINARY_DIR}/lyaml-prefix/src/lyaml/lib/* ${PROJECT_SOURCE_DIR}/userspace/engine/lua"
)

View File

@ -0,0 +1,92 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2025 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
option(USE_BUNDLED_MIMALLOC "Use bundled mimalloc (microsoft) allocator" ${USE_BUNDLED_DEPS})
if(MIMALLOC_INCLUDE)
# we already have MIMALLOC
elseif(NOT USE_BUNDLED_MIMALLOC)
find_path(MIMALLOC_INCLUDE mimalloc/mimalloc.h)
set(MIMALLOC_INCLUDE ${MIMALLOC_INCLUDE}/mimalloc)
if(BUILD_SHARED_LIBS)
set(MIMALLOC_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
else()
set(MIMALLOC_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
endif()
find_library(MALLOC_LIB NAMES libmimalloc${MIMALLOC_LIB_SUFFIX})
if(MALLOC_LIB)
message(STATUS "Found system mimalloc: include: ${MIMALLOC_INCLUDE}, lib: ${MALLOC_LIB}")
else()
message(FATAL_ERROR "Couldn't find system mimalloc")
endif()
else()
if(BUILD_SHARED_LIBS)
set(BUILD_STATIC Off)
set(MIMALLOC_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
else()
set(BUILD_STATIC On)
set(MIMALLOC_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
endif()
set(MIMALLOC_SRC "${PROJECT_BINARY_DIR}/mimalloc-prefix/src")
string(TOLOWER "${CMAKE_BUILD_TYPE}" _build_type)
if(_build_type STREQUAL "debug")
set(MIMALLOC_LIB_BASENAME "libmimalloc-debug")
else()
set(MIMALLOC_LIB_BASENAME "libmimalloc")
endif()
set(MALLOC_LIB "${MIMALLOC_SRC}/malloc-build/${MIMALLOC_LIB_BASENAME}${MIMALLOC_LIB_SUFFIX}")
set(MIMALLOC_INCLUDE ${MIMALLOC_SRC}/malloc/include/)
# To avoid recent clang versions complaining with "error: expansion of date or time macro is not
# reproducible" while building mimalloc, we force-set both variables.
string(TIMESTAMP DATE "%Y%m%d")
string(TIMESTAMP TIME "%H:%M")
set(MIMALLOC_EXTRA_CPPDEFS __DATE__="${DATE}",__TIME__="${TIME}")
# We disable arch specific optimization because of issues with building with zig. Optimizations
# would be only effective on arm64. See MI_NO_OPT_ARCH=On.
ExternalProject_Add(
malloc
PREFIX "${PROJECT_BINARY_DIR}/mimalloc-prefix"
URL "https://github.com/microsoft/mimalloc/archive/refs/tags/v3.1.5.tar.gz"
URL_HASH "SHA256=1c6949032069d5ebea438ec5cedd602d06f40a92ddf0f0d9dcff0993e5f6635c"
LIST_SEPARATOR "," # to pass MIMALLOC_EXTRA_CPPDEFS as list
CMAKE_ARGS -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DMI_BUILD_SHARED=${BUILD_SHARED_LIBS}
-DMI_BUILD_STATIC=${BUILD_STATIC}
-DMI_BUILD_TESTS=Off
-DMI_BUILD_OBJECT=Off
-DMI_NO_OPT_ARCH=On
-DMI_EXTRA_CPPDEFS=${MIMALLOC_EXTRA_CPPDEFS}
INSTALL_COMMAND ""
UPDATE_COMMAND ""
BUILD_BYPRODUCTS ${MALLOC_LIB}
)
install(
FILES "${MALLOC_LIB}"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps"
)
endif()
# We add a custom target, in this way we can always depend on `mimalloc` without distinguishing
# between "bundled" and "not-bundled" case
if(NOT TARGET malloc)
add_custom_target(malloc)
endif()
include_directories(${MIMALLOC_INCLUDE})
add_compile_definitions(HAS_MIMALLOC)

28
cmake/modules/njson.cmake Normal file
View File

@ -0,0 +1,28 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
option(USE_BUNDLED_NLOHMANN_JSON "Enable building of the bundled nlohmann-json" ${USE_BUNDLED_DEPS})
if(USE_BUNDLED_NLOHMANN_JSON)
include(FetchContent)
FetchContent_Declare(
nlohmann_json
URL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz
URL_HASH SHA256=0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406
)
FetchContent_MakeAvailable(nlohmann_json)
else()
find_package(nlohmann_json CONFIG REQUIRED)
endif()

View File

@ -0,0 +1,81 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
option(USE_BUNDLED_OPENSSL "Enable building of the bundled OpenSSL" ${USE_BUNDLED_DEPS})
if(OPENSSL_INCLUDE_DIR)
# we already have openssl
elseif(NOT USE_BUNDLED_OPENSSL)
find_package(OpenSSL REQUIRED)
message(STATUS "Found OpenSSL: include: ${OPENSSL_INCLUDE_DIR}, lib: ${OPENSSL_LIBRARIES}")
else()
if(BUILD_SHARED_LIBS)
set(OPENSSL_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
set(OPENSSL_SHARED_OPTION shared)
else()
set(OPENSSL_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
set(OPENSSL_SHARED_OPTION no-shared)
endif()
set(OPENSSL_BUNDLE_DIR "${PROJECT_BINARY_DIR}/openssl-prefix/src/openssl")
set(OPENSSL_INSTALL_DIR "${OPENSSL_BUNDLE_DIR}/target")
set(OPENSSL_INCLUDE_DIR "${PROJECT_BINARY_DIR}/openssl-prefix/src/openssl/include/")
set(OPENSSL_LIBRARY_SSL "${OPENSSL_INSTALL_DIR}/lib/libssl${OPENSSL_LIB_SUFFIX}")
set(OPENSSL_LIBRARY_CRYPTO "${OPENSSL_INSTALL_DIR}/lib/libcrypto${OPENSSL_LIB_SUFFIX}")
set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARY_SSL} ${OPENSSL_LIBRARY_CRYPTO})
if(NOT TARGET openssl)
if(NOT ENABLE_PIC)
set(OPENSSL_PIC_OPTION)
else()
set(OPENSSL_PIC_OPTION "-fPIC")
endif()
message(STATUS "Using bundled openssl in '${OPENSSL_BUNDLE_DIR}'")
ExternalProject_Add(
openssl
PREFIX "${PROJECT_BINARY_DIR}/openssl-prefix"
URL "https://github.com/openssl/openssl/releases/download/openssl-3.1.4/openssl-3.1.4.tar.gz"
URL_HASH "SHA256=840af5366ab9b522bde525826be3ef0fb0af81c6a9ebd84caa600fea1731eee3"
CONFIGURE_COMMAND ./config ${OPENSSL_SHARED_OPTION} ${OPENSSL_PIC_OPTION}
--prefix=${OPENSSL_INSTALL_DIR} --libdir=lib
BUILD_COMMAND make
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${OPENSSL_LIBRARY_SSL} ${OPENSSL_LIBRARY_CRYPTO}
INSTALL_COMMAND make install_sw
)
install(
FILES "${OPENSSL_LIBRARY_SSL}"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps"
)
install(
FILES "${OPENSSL_LIBRARY_CRYPTO}"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps"
)
install(
DIRECTORY "${OPENSSL_INCLUDE_DIR}"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${LIBS_PACKAGE_NAME}"
COMPONENT "libs-deps"
)
endif()
endif()
if(NOT TARGET openssl)
add_custom_target(openssl)
endif()
include_directories("${OPENSSL_INCLUDE_DIR}")

95
cmake/modules/rules.cmake Normal file
View File

@ -0,0 +1,95 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2025 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
include(GNUInstallDirs)
include(ExternalProject)
if(NOT DEFINED FALCOSECURITY_RULES_FALCO_PATH)
# falco_rules.yaml
set(FALCOSECURITY_RULES_FALCO_VERSION "falco-rules-4.0.0")
set(FALCOSECURITY_RULES_FALCO_CHECKSUM
"SHA256=132320ddbfa1e2580981ed1bdd3ee3d0128a1e2306b2bee8978d1f0a930d6127"
)
set(FALCOSECURITY_RULES_FALCO_PATH
"${PROJECT_BINARY_DIR}/falcosecurity-rules-falco-prefix/src/falcosecurity-rules-falco/falco_rules.yaml"
)
ExternalProject_Add(
falcosecurity-rules-falco
URL "https://download.falco.org/rules/${FALCOSECURITY_RULES_FALCO_VERSION}.tar.gz"
URL_HASH "${FALCOSECURITY_RULES_FALCO_CHECKSUM}"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
endif()
if(NOT DEFINED FALCOSECURITY_RULES_LOCAL_PATH)
# falco_rules.local.yaml
set(FALCOSECURITY_RULES_LOCAL_PATH
"${PROJECT_BINARY_DIR}/falcosecurity-rules-local-prefix/falco_rules.local.yaml"
)
file(WRITE "${FALCOSECURITY_RULES_LOCAL_PATH}" "# Your custom rules!\n")
endif()
if(NOT DEFINED FALCO_ETC_DIR)
set(FALCO_ETC_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/falco")
endif()
if(WIN32 OR APPLE)
set(FALCO_ETC_DIR "etc/falco")
endif()
if(NOT DEFINED FALCO_RULES_DEST_FILENAME)
set(FALCO_RULES_DEST_FILENAME "falco_rules.yaml")
set(FALCO_LOCAL_RULES_DEST_FILENAME "falco_rules.local.yaml")
endif()
if(DEFINED FALCO_COMPONENT) # Allow a slim version of Falco to be embedded in other projects,
# intentionally *not* installing all rulesets.
install(
FILES "${FALCOSECURITY_RULES_FALCO_PATH}"
COMPONENT "${FALCO_COMPONENT}"
DESTINATION "${FALCO_ETC_DIR}"
RENAME "${FALCO_RULES_DEST_FILENAME}"
)
install(
FILES "${FALCOSECURITY_RULES_LOCAL_PATH}"
COMPONENT "${FALCO_COMPONENT}"
DESTINATION "${FALCO_ETC_DIR}"
RENAME "${FALCO_LOCAL_RULES_DEST_FILENAME}"
)
else() # Default Falco installation
install(
FILES "${FALCOSECURITY_RULES_FALCO_PATH}"
DESTINATION "${FALCO_ETC_DIR}"
RENAME "${FALCO_RULES_DEST_FILENAME}"
COMPONENT "${FALCO_COMPONENT_NAME}"
)
install(
FILES "${FALCOSECURITY_RULES_LOCAL_PATH}"
DESTINATION "${FALCO_ETC_DIR}"
RENAME "${FALCO_LOCAL_RULES_DEST_FILENAME}"
COMPONENT "${FALCO_COMPONENT_NAME}"
)
install(
DIRECTORY
DESTINATION "${FALCO_ETC_DIR}/rules.d"
COMPONENT "${FALCO_COMPONENT_NAME}"
)
endif()

View File

@ -1,3 +1,18 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
# create the reports folder
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/static-analysis-reports)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/static-analysis-reports/cppcheck)
@ -8,36 +23,42 @@ find_program(CPPCHECK cppcheck)
find_program(CPPCHECK_HTMLREPORT cppcheck-htmlreport)
if(NOT CPPCHECK)
message(STATUS "cppcheck command not found, static code analysis using cppcheck will not be available.")
message(
STATUS
"cppcheck command not found, static code analysis using cppcheck will not be available."
)
else()
message(STATUS "cppcheck found at: ${CPPCHECK}")
# we are aware that cppcheck can be run
# along with the software compilation in a single step
# using the CMAKE_CXX_CPPCHECK variables.
# However, for practical needs we want to keep the
# two things separated and have a specific target for it.
# Our cppcheck target reads the compilation database produced by CMake
set(CMAKE_EXPORT_COMPILE_COMMANDS On)
add_custom_target(
cppcheck
COMMAND ${CPPCHECK}
"--enable=all"
"--force"
"--inconclusive"
"--inline-suppr" # allows to specify suppressions directly in source code
"--project=${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json" # use the compilation database as source
"--quiet"
"--xml" # we want to generate a report
"--output-file=${CMAKE_CURRENT_BINARY_DIR}/static-analysis-reports/cppcheck/cppcheck.xml" # generate the report under the reports folder in the build folder
"-i${CMAKE_CURRENT_BINARY_DIR}"# exclude the build folder
)
message(STATUS "cppcheck found at: ${CPPCHECK}")
# we are aware that cppcheck can be run along with the software compilation in a single step
# using the CMAKE_CXX_CPPCHECK variables. However, for practical needs we want to keep the two
# things separated and have a specific target for it. Our cppcheck target reads the compilation
# database produced by CMake
set(CMAKE_EXPORT_COMPILE_COMMANDS On)
add_custom_target(
cppcheck
COMMAND
${CPPCHECK} "--enable=all" "--force" "--inconclusive" "--inline-suppr" # allows to
# specify suppressions directly in source code
"--xml" # we want to generate a report
"--output-file=${CMAKE_CURRENT_BINARY_DIR}/static-analysis-reports/cppcheck/cppcheck.xml" # generate
# the report under the reports folder in the build folder
"-i${CMAKE_CURRENT_BINARY_DIR}" # exclude the build folder
"${CMAKE_SOURCE_DIR}"
)
endif() # CPPCHECK
if(NOT CPPCHECK_HTMLREPORT)
message(STATUS "cppcheck-htmlreport command not found, will not be able to produce html reports for cppcheck results")
message(
STATUS
"cppcheck-htmlreport command not found, will not be able to produce html reports for cppcheck results"
)
else()
message(STATUS "cppcheck-htmlreport found at: ${CPPCHECK_HTMLREPORT}")
add_custom_target(
cppcheck_htmlreport
COMMAND ${CPPCHECK_HTMLREPORT} --title=${CMAKE_PROJECT_NAME} --report-dir=${CMAKE_CURRENT_BINARY_DIR}/static-analysis-reports/cppcheck --file=static-analysis-reports/cppcheck/cppcheck.xml)
message(STATUS "cppcheck-htmlreport found at: ${CPPCHECK_HTMLREPORT}")
add_custom_target(
cppcheck_htmlreport
COMMAND
${CPPCHECK_HTMLREPORT} --title=${CMAKE_PROJECT_NAME}
--report-dir=${CMAKE_CURRENT_BINARY_DIR}/static-analysis-reports/cppcheck
--file=static-analysis-reports/cppcheck/cppcheck.xml
)
endif() # CPPCHECK_HTMLREPORT

View File

@ -1,28 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
cmake_minimum_required(VERSION 3.5.1)
project(sysdig-repo NONE)
include(ExternalProject)
message(STATUS "Driver version: ${SYSDIG_VERSION}")
ExternalProject_Add(
sysdig
URL "https://github.com/draios/sysdig/archive/${SYSDIG_VERSION}.tar.gz"
URL_HASH "${SYSDIG_CHECKSUM}"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
PATCH_COMMAND patch -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/patch/libscap.patch && patch -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/patch/luajit.patch)

View File

@ -1,49 +0,0 @@
diff --git a/userspace/libscap/scap.c b/userspace/libscap/scap.c
index 6f51588e..5f9ea84e 100644
--- a/userspace/libscap/scap.c
+++ b/userspace/libscap/scap.c
@@ -55,7 +55,7 @@ limitations under the License.
//#define NDEBUG
#include <assert.h>
-static const char *SYSDIG_BPF_PROBE_ENV = "SYSDIG_BPF_PROBE";
+static const char *SYSDIG_BPF_PROBE_ENV = "FALCO_BPF_PROBE";
//
// Probe version string size
@@ -114,7 +114,7 @@ scap_t* scap_open_udig_int(char *error, int32_t *rc,
static uint32_t get_max_consumers()
{
uint32_t max;
- FILE *pfile = fopen("/sys/module/" PROBE_DEVICE_NAME "_probe/parameters/max_consumers", "r");
+ FILE *pfile = fopen("/sys/module/" PROBE_DEVICE_NAME "/parameters/max_consumers", "r");
if(pfile != NULL)
{
int w = fscanf(pfile, "%"PRIu32, &max);
@@ -186,7 +186,7 @@ scap_t* scap_open_live_int(char *error, int32_t *rc,
return NULL;
}
- snprintf(buf, sizeof(buf), "%s/.sysdig/%s-bpf.o", home, PROBE_NAME);
+ snprintf(buf, sizeof(buf), "%s/.falco/%s-bpf.o", home, PROBE_NAME);
bpf_probe = buf;
}
}
@@ -344,7 +344,7 @@ scap_t* scap_open_live_int(char *error, int32_t *rc,
else if(errno == EBUSY)
{
uint32_t curr_max_consumers = get_max_consumers();
- snprintf(error, SCAP_LASTERR_SIZE, "Too many sysdig instances attached to device %s. Current value for /sys/module/" PROBE_DEVICE_NAME "_probe/parameters/max_consumers is '%"PRIu32"'.", filename, curr_max_consumers);
+ snprintf(error, SCAP_LASTERR_SIZE, "Too many Falco instances attached to device %s. Current value for /sys/module/" PROBE_DEVICE_NAME "/parameters/max_consumers is '%"PRIu32"'.", filename, curr_max_consumers);
}
else
{
@@ -2175,7 +2175,7 @@ int32_t scap_disable_dynamic_snaplen(scap_t* handle)
const char* scap_get_host_root()
{
- char* p = getenv("SYSDIG_HOST_ROOT");
+ char* p = getenv("HOST_ROOT");
static char env_str[SCAP_MAX_PATH_SIZE + 1];
static bool inited = false;
if (! inited) {

View File

@ -1,57 +0,0 @@
diff --git a/userspace/libsinsp/chisel.cpp b/userspace/libsinsp/chisel.cpp
index 0a6e3cf8..0c2e255a 100644
--- a/userspace/libsinsp/chisel.cpp
+++ b/userspace/libsinsp/chisel.cpp
@@ -98,7 +98,7 @@ void lua_stackdump(lua_State *L)
// Lua callbacks
///////////////////////////////////////////////////////////////////////////////
#ifdef HAS_LUA_CHISELS
-const static struct luaL_reg ll_sysdig [] =
+const static struct luaL_Reg ll_sysdig [] =
{
{"set_filter", &lua_cbacks::set_global_filter},
{"set_snaplen", &lua_cbacks::set_snaplen},
@@ -134,7 +134,7 @@ const static struct luaL_reg ll_sysdig [] =
{NULL,NULL}
};
-const static struct luaL_reg ll_chisel [] =
+const static struct luaL_Reg ll_chisel [] =
{
{"request_field", &lua_cbacks::request_field},
{"set_filter", &lua_cbacks::set_filter},
@@ -146,7 +146,7 @@ const static struct luaL_reg ll_chisel [] =
{NULL,NULL}
};
-const static struct luaL_reg ll_evt [] =
+const static struct luaL_Reg ll_evt [] =
{
{"field", &lua_cbacks::field},
{"get_num", &lua_cbacks::get_num},
diff --git a/userspace/libsinsp/lua_parser.cpp b/userspace/libsinsp/lua_parser.cpp
index 0e26617d..78810d96 100644
--- a/userspace/libsinsp/lua_parser.cpp
+++ b/userspace/libsinsp/lua_parser.cpp
@@ -32,7 +32,7 @@ extern "C" {
#include "lauxlib.h"
}
-const static struct luaL_reg ll_filter [] =
+const static struct luaL_Reg ll_filter [] =
{
{"rel_expr", &lua_parser_cbacks::rel_expr},
{"bool_op", &lua_parser_cbacks::bool_op},
diff --git a/userspace/libsinsp/lua_parser_api.cpp b/userspace/libsinsp/lua_parser_api.cpp
index c89e9126..c3d8008a 100644
--- a/userspace/libsinsp/lua_parser_api.cpp
+++ b/userspace/libsinsp/lua_parser_api.cpp
@@ -266,7 +266,7 @@ int lua_parser_cbacks::rel_expr(lua_State *ls)
string err = "Got non-table as in-expression operand\n";
throw sinsp_exception("parser API error");
}
- int n = luaL_getn(ls, 4); /* get size of table */
+ int n = lua_objlen (ls, 4); /* get size of table */
for (i=1; i<=n; i++)
{
lua_rawgeti(ls, 4, i);

View File

@ -1,78 +0,0 @@
#
# Copyright (C) 2020 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
set(SYSDIG_CMAKE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/sysdig-repo")
set(SYSDIG_CMAKE_WORKING_DIR "${CMAKE_BINARY_DIR}/sysdig-repo")
# this needs to be here at the top
if(USE_BUNDLED_DEPS)
# explicitly force this dependency to use the bundled OpenSSL
if(NOT MINIMAL_BUILD)
set(USE_BUNDLED_OPENSSL ON)
endif()
set(USE_BUNDLED_JQ ON)
endif()
file(MAKE_DIRECTORY ${SYSDIG_CMAKE_WORKING_DIR})
# The sysdig git reference (branch name, commit hash, or tag) To update sysdig version for the next release, change the
# default below In case you want to test against another sysdig version just pass the variable - ie., `cmake
# -DSYSDIG_VERSION=dev ..`
if(NOT SYSDIG_VERSION)
set(SYSDIG_VERSION "5c0b863ddade7a45568c0ac97d037422c9efb750")
set(SYSDIG_CHECKSUM "SHA256=9de717b3a4b611ea6df56afee05171860167112f74bb7717b394bcc88ac843cd")
endif()
set(PROBE_VERSION "${SYSDIG_VERSION}")
# cd /path/to/build && cmake /path/to/source
execute_process(COMMAND "${CMAKE_COMMAND}" -DSYSDIG_VERSION=${SYSDIG_VERSION} -DSYSDIG_CHECKSUM=${SYSDIG_CHECKSUM}
${SYSDIG_CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${SYSDIG_CMAKE_WORKING_DIR})
# todo(leodido, fntlnz) > use the following one when CMake version will be >= 3.13
# execute_process(COMMAND "${CMAKE_COMMAND}" -B ${SYSDIG_CMAKE_WORKING_DIR} WORKING_DIRECTORY
# "${SYSDIG_CMAKE_SOURCE_DIR}")
execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${SYSDIG_CMAKE_WORKING_DIR}")
set(SYSDIG_SOURCE_DIR "${SYSDIG_CMAKE_WORKING_DIR}/sysdig-prefix/src/sysdig")
# jsoncpp
set(JSONCPP_SRC "${SYSDIG_SOURCE_DIR}/userspace/libsinsp/third-party/jsoncpp")
set(JSONCPP_INCLUDE "${JSONCPP_SRC}")
set(JSONCPP_LIB_SRC "${JSONCPP_SRC}/jsoncpp.cpp")
# Add driver directory
add_subdirectory("${SYSDIG_SOURCE_DIR}/driver" "${PROJECT_BINARY_DIR}/driver")
# Add libscap directory
add_definitions(-D_GNU_SOURCE)
add_definitions(-DHAS_CAPTURE)
add_definitions(-DNOCURSESUI)
if(MUSL_OPTIMIZED_BUILD)
add_definitions(-DMUSL_OPTIMIZED)
endif()
add_subdirectory("${SYSDIG_SOURCE_DIR}/userspace/libscap" "${PROJECT_BINARY_DIR}/userspace/libscap")
# Add libsinsp directory
add_subdirectory("${SYSDIG_SOURCE_DIR}/userspace/libsinsp" "${PROJECT_BINARY_DIR}/userspace/libsinsp")
add_dependencies(sinsp tbb b64 luajit)
# explicitly disable the tests of this dependency
set(CREATE_TEST_TARGETS OFF)
if(USE_BUNDLED_DEPS)
add_dependencies(scap jq)
if(NOT MINIMAL_BUILD)
add_dependencies(scap curl grpc)
endif()
endif()

View File

@ -1,33 +1,28 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2020 The Falco Authors.
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
mark_as_advanced(YAMLCPP_INCLUDE_DIR YAMLCPP_LIB)
if(NOT USE_BUNDLED_DEPS)
find_path(YAMLCPP_INCLUDE_DIR NAMES yaml-cpp/yaml.h)
find_library(YAMLCPP_LIB NAMES yaml-cpp)
if(YAMLCPP_INCLUDE_DIR AND YAMLCPP_LIB)
message(STATUS "Found yamlcpp: include: ${YAMLCPP_INCLUDE_DIR}, lib: ${YAMLCPP_LIB}")
else()
message(FATAL_ERROR "Couldn't find system yamlcpp")
endif()
option(USE_BUNDLED_YAMLCPP "Enable building of the bundled yamlcpp" ${USE_BUNDLED_DEPS})
if(USE_BUNDLED_YAMLCPP)
include(FetchContent)
FetchContent_Declare(
yamlcpp
URL https://github.com/jbeder/yaml-cpp/archive/c2bec4c755c67ad86185a2a264996137904fb712.tar.gz
URL_HASH SHA256=faea1ffdbad81b958b3b45a63ba667f4db53a3fffb983ca5df4745cf90044797
)
FetchContent_MakeAvailable(yamlcpp)
else()
set(YAMLCPP_SRC "${PROJECT_BINARY_DIR}/yamlcpp-prefix/src/yamlcpp")
message(STATUS "Using bundled yaml-cpp in '${YAMLCPP_SRC}'")
set(YAMLCPP_LIB "${YAMLCPP_SRC}/libyaml-cpp.a")
set(YAMLCPP_INCLUDE_DIR "${YAMLCPP_SRC}/include")
ExternalProject_Add(
yamlcpp
URL "https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.6.2.tar.gz"
URL_HASH "SHA256=e4d8560e163c3d875fd5d9e5542b5fd5bec810febdcba61481fe5fc4e6b1fd05"
BUILD_IN_SOURCE 1
INSTALL_COMMAND "")
find_package(yaml-cpp CONFIG REQUIRED)
endif()

View File

@ -0,0 +1,2 @@
# Enable container plugin for linux non musl installation.
load_plugins: [container]

View File

@ -0,0 +1,2 @@
# Enable iso 8601 time format on docker
time_format_iso_8601: true

View File

@ -1 +0,0 @@
add_subdirectory(local)

View File

@ -2,5 +2,4 @@ labels:
- area/integration
approvers:
- leogr
reviewers:
- leogr

View File

@ -4,13 +4,9 @@ This directory contains various ways to package Falco as a container and related
## Currently Supported Images
| Name | Directory | Description |
|---|---|---|
| [falcosecurity/falco:latest](https://hub.docker.com/repository/docker/falcosecurity/falco), [falcosecurity/falco:_tag_](https://hub.docker.com/repository/docker/falcosecurity/falco), [falcosecurity/falco:master](https://hub.docker.com/repository/docker/falcosecurity/falco) | docker/falco | Falco (DEB built from git tag or from the master) with all the building toolchain. |
| [falcosecurity/falco-driver-loader:latest](https://hub.docker.com/repository/docker/falcosecurity/falco-driver-loader), [falcosecurity/falco-driver-loader:_tag_](https://hub.docker.com/repository/docker/falcosecurity/falco-driver-loader), [falcosecurity/falco-driver-loader:master](https://hub.docker.com/repository/docker/falcosecurity/falco-driver-loader) | docker/driver-loader | `falco-driver-loader` as entrypoint with the building toolchain. |
| [falcosecurity/falco-no-driver:latest](https://hub.docker.com/repository/docker/falcosecurity/falco-no-driver), [falcosecurity/falco-no-driver:_tag_](https://hub.docker.com/repository/docker/falcosecurity/falco-no-driver),[falcosecurity/falco-no-driver:master](https://hub.docker.com/repository/docker/falcosecurity/falco-no-driver) | docker/no-driver | Falco (TGZ built from git tag or from the master) without the building toolchain. |
| [falcosecurity/falco-builder:latest](https://hub.docker.com/repository/docker/falcosecurity/falco-builder) | docker/builder | The complete build tool chain for compiling Falco from source. See [the documentation](https://falco.org/docs/getting-started/source/) for more details on building from source. Used to build Falco (CI). |
| [falcosecurity/falco-tester:latest](https://hub.docker.com/repository/docker/falcosecurity/falco-tester) | docker/tester | Container image for running the Falco test suite. Used to run Falco integration tests (CI). |
| _to not be published_ | docker/local | Built on-the-fly and used by falco-tester. |
> Note: `falco-builder`, `falco-tester` (and the `docker/local` image that it's built on the fly) are not integrated into the release process because they are development and CI tools that need to be manually pushed only when updated.
| Name | Directory | Description |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [falcosecurity/falco:latest](https://hub.docker.com/repository/docker/falcosecurity/falco), [falcosecurity/falco:_tag_](https://hub.docker.com/repository/docker/falcosecurity/falco), [falcosecurity/falco:master](https://hub.docker.com/repository/docker/falcosecurity/falco) | docker/falco | Distroless image based on the latest released tar.gz of Falco. No tools are included in the image. |
| [falcosecurity/falco:latest-debian](https://hub.docker.com/repository/docker/falcosecurity/falco), [falcosecurity/falco:_tag_-debian](https://hub.docker.com/repository/docker/falcosecurity/falco), [falcosecurity/falco:master-debian](https://hub.docker.com/repository/docker/falcosecurity/falco) | docker/falco-debian | Debian-based image. Include some tools (i.e. jq, curl). No driver-building toolchain support. |
| [falcosecurity/falco-driver-loader:latest](https://hub.docker.com/repository/docker/falcosecurity/falco-driver-loader), [falcosecurity/falco-driver-loader:_tag_](https://hub.docker.com/repository/docker/falcosecurity/falco-driver-loader), [falcosecurity/falco-driver-loader:master](https://hub.docker.com/repository/docker/falcosecurity/falco-driver-loader) | docker/driver-loader | Based on falcosecurity/falco:x.y.z-debian (see above) plus the driver building toolchain support and falcoctl. This is intended to be used as an installer or an init container when modern eBPF cannot be used. |
| [falcosecurity/falco-driver-loader:latest-buster](https://hub.docker.com/repository/docker/falcosecurity/falco-driver-loader), [falcosecurity/falco-driver-loader:_tag_-buster](https://hub.docker.com/repository/docker/falcosecurity/falco-driver-loader), [falcosecurity/falco-driver-loader:master-debian](https://hub.docker.com/repository/docker/falcosecurity/falco-driver-loader) | docker/driver-loader-buster | Similar to falcosecurity/falco-driver-loader (see above) but based on a legacy Debian image (i.e. buster ). Recommended only for old kernel versions. |

View File

@ -1,45 +0,0 @@
FROM centos:7
LABEL name="falcosecurity/falco-builder"
LABEL usage="docker run -v $PWD/..:/source -v $PWD/build:/build falcosecurity/falco-builder cmake"
LABEL maintainer="cncf-falco-dev@lists.cncf.io"
ARG BUILD_TYPE=release
ARG BUILD_DRIVER=OFF
ARG BUILD_BPF=OFF
ARG BUILD_WARNINGS_AS_ERRORS=ON
ARG MAKE_JOBS=4
ARG FALCO_VERSION
ENV BUILD_TYPE=${BUILD_TYPE}
ENV BUILD_DRIVER=${BUILD_DRIVER}
ENV BUILD_BPF=${BUILD_BPF}
ENV BUILD_WARNINGS_AS_ERRORS=${BUILD_WARNINGS_AS_ERRORS}
ENV MAKE_JOBS=${MAKE_JOBS}
ENV FALCO_VERSION=${FALCO_VERSION}
# build toolchain
RUN yum -y install centos-release-scl && \
INSTALL_PKGS="devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-toolchain devtoolset-7-libstdc++-devel devtoolset-7-elfutils-libelf-devel llvm-toolset-7 glibc-static autoconf automake libtool createrepo expect git which libcurl-devel zlib-devel ncurses-devel rpm-build libyaml-devel" && \
yum -y install --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS
ARG CMAKE_VERSION=3.5.1
RUN source scl_source enable devtoolset-7 llvm-toolset-7 && \
cd /tmp && \
curl -L https://github.com/kitware/cmake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz | tar xz; \
cd cmake-${CMAKE_VERSION} && \
./bootstrap --system-curl && \
make -j${MAKE_JOBS} && \
make install && \
rm -rf /tmp/cmake-${CMAKE_VERSION}
COPY ./root /
# DTS
ENV BASH_ENV=/usr/bin/scl_enable \
ENV=/usr/bin/scl_enable \
PROMPT_COMMAND=". /usr/bin/scl_enable"
ENTRYPOINT ["entrypoint"]
CMD ["usage"]

View File

@ -1,60 +0,0 @@
#!/usr/bin/env bash
set -eu -o pipefail
SOURCE_DIR=/source
BUILD_DIR=/build
CMD=${1:-usage}
shift
# Build type can be "debug" or "release", fallbacks to "release" by default
BUILD_TYPE=$(echo "$BUILD_TYPE" | tr "[:upper:]" "[:lower:]")
DRAIOS_DEBUG_FLAGS=
case "$BUILD_TYPE" in
"debug")
DRAIOS_DEBUG_FLAGS="-D_DEBUG -DNDEBUG"
;;
*)
BUILD_TYPE="release"
;;
esac
case "$CMD" in
"cmake")
# Check that source directory contains Falco
if [ ! -d "$SOURCE_DIR/falco" ]; then
echo "Missing falco source." >&2
exit 1
fi
# Prepare build directory
mkdir -p "$BUILD_DIR/$BUILD_TYPE"
cd "$BUILD_DIR/$BUILD_TYPE"
cmake \
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_DRIVER="$BUILD_DRIVER" \
-DMINIMAL_BUILD="$MINIMAL_BUILD" \
-DBUILD_BPF="$BUILD_BPF" \
-DBUILD_WARNINGS_AS_ERRORS="$BUILD_WARNINGS_AS_ERRORS" \
-DFALCO_VERSION="$FALCO_VERSION" \
-DDRAIOS_DEBUG_FLAGS="$DRAIOS_DEBUG_FLAGS" \
-DUSE_BUNDLED_DEPS=ON \
"$SOURCE_DIR/falco"
exit "$(printf '%d\n' $?)"
;;
"bash")
CMD=/bin/bash
;& # fallthrough
"usage")
exec "$CMD" "$@"
;;
*)
if [ ! -d "$BUILD_DIR/$BUILD_TYPE" ]; then
echo "Missing $BUILD_DIR/$BUILD_TYPE directory: run cmake."
exit 1
fi
cd "$BUILD_DIR/$BUILD_TYPE"
make -j"$MAKE_JOBS" "$CMD"
;;
esac

View File

@ -1,6 +0,0 @@
# IMPORTANT: Do not add more content to this file unless you know what you are doing.
# This file is sourced everytime the shell session is opened.
#
# This will make scl collection binaries work out of box.
unset BASH_ENV PROMPT_COMMAND ENV
source scl_source enable devtoolset-7 llvm-toolset-7

View File

@ -1,53 +0,0 @@
#!/usr/bin/env bash
gccversion=$(gcc --version | head -n1)
cppversion=$(g++ -dM -E -x c++ /dev/null | grep -F __cplusplus | cut -d' ' -f3)
cmakeversion=$(cmake --version | head -n1)
clangversion=$(clang --version | head -n1)
cat <<EOF
Hello, this is the Falco builder container.
How to use.
The default commands for the Falco builder image reports usage and environment info.
* docker run falcosecurity/falco-builder
* docker run falcosecurity/falco-builder usage
It supports bash.
* docker run -ti falcosecurity/falco-builder bash
To build Falco it needs:
- a bind-mount on the source directory (ie., the directory containing Falco and sysdig source as siblings)
Optionally, you can also bind-mount the build directory.
So, you can execute it from the Falco root directory as follows.
* docker run -v $PWD/..:/source -v $PWD/build:/build falcosecurity/falco-builder cmake
* docker run -v $PWD/..:/source -v $PWD/build:/build falcosecurity/falco-builder [<cmake-target-x>, ..., <cmake-target-y>]
Eg.,
* docker run -v $PWD/..:/source -v $PWD/build:/build falcosecurity/falco-builder tests
* docker run -v $PWD/..:/source -v $PWD/build:/build falcosecurity/falco-builder install
How to build.
* cd docker/builder && DOCKER_BUILDKIT=1 docker build -t falcosecurity/falco-builder .
In case you want to customise the builder at build time the following build arguments are provided:
- BUILD_TYPE whether you want a "release" or "debug" build (defaults to "release").
- BUILD_DRIVER whether to build the driver or not (defaults to "OFF")
- BUILD_BPF whether to build the BPF driver or not (defaults to "OFF")
- BUILD_WARNINGS_AS_ERRORS whether to intend warnings as errors or not (defaults to "ON")
- MAKE_JOBS the number of jobs to use during make (defaults to "4")
- FALCO_VERSION the version to label the build (built from git index in case it is missing)
It is possible to change these at runtime (in the container) since environment variables with the same names are provided, too.
Environment.
* ${gccversion}
* cplusplus ${cppversion}
* ${cmakeversion}
* ${clangversion}
EOF

Some files were not shown because too many files have changed in this diff Show More