mirror of
https://github.com/falcosecurity/falco.git
synced 2026-03-24 21:52:15 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35ee18c435 | ||
|
|
876637839f | ||
|
|
76719bdc39 | ||
|
|
1347810eab | ||
|
|
2653b67342 | ||
|
|
89e30841da | ||
|
|
4d6332765f | ||
|
|
00e154870b | ||
|
|
62ab938973 | ||
|
|
7efabb7243 |
24
.github/workflows/reusable_build_packages.yaml
vendored
24
.github/workflows/reusable_build_packages.yaml
vendored
@@ -49,15 +49,37 @@ jobs:
|
||||
retention-days: 1
|
||||
|
||||
build-packages:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
# See https://github.com/actions/runner/issues/409#issuecomment-1158849936
|
||||
runs-on: ${{ (inputs.arch == 'aarch64' && 'actuated-arm64-8cpu-16gb') || 'ubuntu-latest' }}
|
||||
needs: [build-modern-bpf-skeleton]
|
||||
container: centos:7
|
||||
steps:
|
||||
# Always install deps before invoking checkout action, to properly perform a full clone.
|
||||
- name: Install build dependencies
|
||||
- name: Fix mirrors to use vault.centos.org
|
||||
run: |
|
||||
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
|
||||
sed -i s/^#.*baseurl=http/baseurl=https/g /etc/yum.repos.d/*.repo
|
||||
sed -i s/^mirrorlist=http/#mirrorlist=https/g /etc/yum.repos.d/*.repo
|
||||
|
||||
- name: Install scl repos
|
||||
run: |
|
||||
yum -y install centos-release-scl
|
||||
|
||||
- name: Fix new mirrors to use vault.centos.org
|
||||
run: |
|
||||
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
|
||||
sed -i s/^#.*baseurl=http/baseurl=https/g /etc/yum.repos.d/*.repo
|
||||
sed -i s/^mirrorlist=http/#mirrorlist=https/g /etc/yum.repos.d/*.repo
|
||||
|
||||
- name: Fix arm64 scl repos to use correct mirror
|
||||
if: inputs.arch == 'aarch64'
|
||||
run: |
|
||||
sed -i 's/vault.centos.org\/centos/vault.centos.org\/altarch/g' /etc/yum.repos.d/CentOS-SCLo-scl*.repo
|
||||
|
||||
- name: Install build deps
|
||||
run: |
|
||||
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++
|
||||
source /opt/rh/devtoolset-9/enable
|
||||
yum install -y wget git make m4 rpm-build elfutils-libelf-devel perl-IPC-Cmd devtoolset-9-libasan-devel devtoolset-9-libubsan-devel
|
||||
|
||||
40
CHANGELOG.md
40
CHANGELOG.md
@@ -1,5 +1,45 @@
|
||||
# Change Log
|
||||
|
||||
## v0.38.2
|
||||
|
||||
Released on 2024-08-19
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix(engine): fix metrics names to better adhere to best practices [[#3272](https://github.com/falcosecurity/falco/pull/3272)] - [@incertum](https://github.com/incertum)
|
||||
* fix(ci): use vault.centos.org for centos:7 CI build. [[#3274](https://github.com/falcosecurity/falco/pull/3274)] - [@FedeDP](https://github.com/FedeDP)
|
||||
|
||||
## v0.38.1
|
||||
|
||||
Released on 2024-06-19
|
||||
|
||||
### Major Changes
|
||||
|
||||
* new(metrics): enable plugins metrics [[#3228](https://github.com/falcosecurity/falco/pull/3228)] - [@mrgian](https://github.com/mrgian)
|
||||
|
||||
|
||||
### Minor Changes
|
||||
|
||||
* cleanup(falco): clarify that --print variants only affect syscalls [[#3238](https://github.com/falcosecurity/falco/pull/3238)] - [@LucaGuerra](https://github.com/LucaGuerra)
|
||||
* update(engine): enable -p option for all sources, -pk, -pc etc only for syscall sources [[#3239](https://github.com/falcosecurity/falco/pull/3239)] - [@LucaGuerra](https://github.com/LucaGuerra)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix(engine): enable output substitution only for syscall rules, prevent engine from exiting with validation errors when a plugin is loaded and -pc/pk is specified [[#3236](https://github.com/falcosecurity/falco/pull/3236)] - [@mrgian](https://github.com/mrgian)
|
||||
* fix(metrics): allow each metric output channel to be selected independently [[#3232](https://github.com/falcosecurity/falco/pull/3232)] - [@incertum](https://github.com/incertum)
|
||||
* fix(userspace/falco): fixed `falco_metrics::to_text` implementation when running with plugins [[#3230](https://github.com/falcosecurity/falco/pull/3230)] - [@FedeDP](https://github.com/FedeDP)
|
||||
|
||||
|
||||
|
||||
### Statistics
|
||||
|
||||
| MERGED PRS | NUMBER |
|
||||
|-----------------|--------|
|
||||
| Not user-facing | 0 |
|
||||
| Release note | 6 |
|
||||
| Total | 6 |
|
||||
|
||||
## v0.38.0
|
||||
|
||||
Released on 2024-05-30
|
||||
|
||||
@@ -34,8 +34,8 @@ else()
|
||||
# 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 "7.2.0+driver")
|
||||
set(DRIVER_CHECKSUM "SHA256=82424189620010092d0eaabbfa59d904510771e293fd03f67a01b099691b4c4b")
|
||||
set(DRIVER_VERSION "7.2.1+driver")
|
||||
set(DRIVER_CHECKSUM "SHA256=0ae749718557812dc008bdfd8eaa81355094a0975380df1021b1e2bf2ee91457")
|
||||
endif()
|
||||
|
||||
# cd /path/to/build && cmake /path/to/source
|
||||
|
||||
@@ -16,14 +16,14 @@ include(ExternalProject)
|
||||
|
||||
string(TOLOWER ${CMAKE_HOST_SYSTEM_NAME} FALCOCTL_SYSTEM_NAME)
|
||||
|
||||
set(FALCOCTL_VERSION "0.8.0")
|
||||
set(FALCOCTL_VERSION "0.9.0")
|
||||
|
||||
if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
|
||||
set(FALCOCTL_SYSTEM_PROC_GO "amd64")
|
||||
set(FALCOCTL_HASH "7b763bfaf38faf582840af22750dca7150d03958a5dc47f6118748713d661589")
|
||||
set(FALCOCTL_HASH "04a689cca5b18c82427fe0cdc15c37b35f3f4696f6bc13d92aa903183b25b2c5")
|
||||
else() # aarch64
|
||||
set(FALCOCTL_SYSTEM_PROC_GO "arm64")
|
||||
set(FALCOCTL_HASH "7f826de7a8a84e65c46a160e7e59d1deca874f39b79a8251721a2669905baf14")
|
||||
set(FALCOCTL_HASH "cd37537a7d1a81e5e372760e14b3a945c650f845e98649fc15e560b0ba7a6597")
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(
|
||||
|
||||
@@ -35,8 +35,8 @@ else()
|
||||
# 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 "0.17.2")
|
||||
set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=5c4f0c987272b7d5236f6ab2bbe3906ffdaf76b59817b63cf90cc8c387ab5b15")
|
||||
set(FALCOSECURITY_LIBS_VERSION "0.17.3")
|
||||
set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=6ff90672fe35d725e79dcb1d940c1518154daef28a3eb1cd127432c503cab079")
|
||||
endif()
|
||||
|
||||
# cd /path/to/build && cmake /path/to/source
|
||||
|
||||
@@ -48,11 +48,6 @@ falco::app::run_result falco::app::actions::open_live_inspector(
|
||||
{
|
||||
try
|
||||
{
|
||||
if((s.config->m_metrics_flags & METRICS_V2_STATE_COUNTERS))
|
||||
{
|
||||
inspector->set_sinsp_stats_v2_enabled();
|
||||
}
|
||||
|
||||
if(s.config->m_falco_libs_thread_table_size > 0)
|
||||
{
|
||||
// Default value is set in libs as part of the sinsp_thread_manager setup
|
||||
|
||||
@@ -115,10 +115,19 @@ falco::app::run_result falco::app::actions::init_inspectors(falco::app::state& s
|
||||
|
||||
// in capture mode, every event source uses the offline inspector.
|
||||
// in live mode, we create a new inspector for each event source
|
||||
src_info->inspector = s.is_capture_mode()
|
||||
? s.offline_inspector
|
||||
: std::make_shared<sinsp>();
|
||||
|
||||
if (s.is_capture_mode())
|
||||
{
|
||||
src_info->inspector = s.offline_inspector;
|
||||
}
|
||||
else
|
||||
{
|
||||
src_info->inspector = std::make_shared<sinsp>(false,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
s.config->m_metrics_flags & METRICS_V2_STATE_COUNTERS);
|
||||
}
|
||||
|
||||
// do extra preparation for the syscall source
|
||||
if (src == falco_common::syscall_source)
|
||||
{
|
||||
|
||||
@@ -96,20 +96,17 @@ std::string falco_metrics::to_text(const falco::app::state& state)
|
||||
}
|
||||
|
||||
#if defined(__linux__) and !defined(MINIMAL_BUILD) and !defined(__EMSCRIPTEN__)
|
||||
// Distinguish between config and rules files using labels, following Prometheus best practices: https://prometheus.io/docs/practices/naming/#labels
|
||||
for (const auto& item : state.config.get()->m_loaded_rules_filenames_sha256sum)
|
||||
{
|
||||
fs::path fs_path = item.first;
|
||||
std::string metric_name_file_sha256 = fs_path.filename().stem();
|
||||
metric_name_file_sha256 = "falco_sha256_rules_file_" + falco::utils::sanitize_metric_name(metric_name_file_sha256);
|
||||
prometheus_text += prometheus_metrics_converter.convert_metric_to_text_prometheus(metric_name_file_sha256, "falcosecurity", "falco", {{metric_name_file_sha256, item.second}});
|
||||
prometheus_text += prometheus_metrics_converter.convert_metric_to_text_prometheus("falco_sha256_rules_files", "falcosecurity", "falco", {{"file_name", fs_path.filename().stem()}, {"sha256", item.second}});
|
||||
}
|
||||
|
||||
for (const auto& item : state.config.get()->m_loaded_configs_filenames_sha256sum)
|
||||
{
|
||||
fs::path fs_path = item.first;
|
||||
std::string metric_name_file_sha256 = fs_path.filename().stem();
|
||||
metric_name_file_sha256 = "falco_sha256_config_file_" + falco::utils::sanitize_metric_name(metric_name_file_sha256);
|
||||
prometheus_text += prometheus_metrics_converter.convert_metric_to_text_prometheus(metric_name_file_sha256, "falcosecurity", "falco", {{metric_name_file_sha256, item.second}});
|
||||
prometheus_text += prometheus_metrics_converter.convert_metric_to_text_prometheus("falco_sha256_config_files", "falcosecurity", "falco", {{"file_name", fs_path.filename().stem()}, {"sha256", item.second}});
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -174,35 +171,29 @@ std::string falco_metrics::to_text(const falco::app::state& state)
|
||||
{
|
||||
const stats_manager& rule_stats_manager = state.engine->get_rule_stats_manager();
|
||||
const indexed_vector<falco_rule>& rules = state.engine->get_rules();
|
||||
auto metric = libs_metrics_collector.new_metric("rules.matches_total",
|
||||
METRICS_V2_RULE_COUNTERS,
|
||||
METRIC_VALUE_TYPE_U64,
|
||||
METRIC_VALUE_UNIT_COUNT,
|
||||
METRIC_VALUE_METRIC_TYPE_MONOTONIC,
|
||||
rule_stats_manager.get_total().load());
|
||||
|
||||
prometheus_metrics_converter.convert_metric_to_unit_convention(metric);
|
||||
prometheus_text += prometheus_metrics_converter.convert_metric_to_text_prometheus(metric, "falcosecurity", "falco");
|
||||
const std::vector<std::unique_ptr<std::atomic<uint64_t>>>& rules_by_id = rule_stats_manager.get_by_rule_id();
|
||||
// Distinguish between rules counters using labels, following Prometheus best practices: https://prometheus.io/docs/practices/naming/#labels
|
||||
for (size_t i = 0; i < rules_by_id.size(); i++)
|
||||
{
|
||||
auto rule = rules.at(i);
|
||||
std::string rules_metric_name = "rules." + falco::utils::sanitize_metric_name(rule->name);
|
||||
// Separate processing of rules counter metrics given we add extra tags
|
||||
auto metric = libs_metrics_collector.new_metric(rules_metric_name.c_str(),
|
||||
auto count = rules_by_id[i]->load();
|
||||
if (count > 0)
|
||||
{
|
||||
auto metric = libs_metrics_collector.new_metric("rules_counters",
|
||||
METRICS_V2_RULE_COUNTERS,
|
||||
METRIC_VALUE_TYPE_U64,
|
||||
METRIC_VALUE_UNIT_COUNT,
|
||||
METRIC_VALUE_METRIC_TYPE_MONOTONIC,
|
||||
rules_by_id[i]->load());
|
||||
prometheus_metrics_converter.convert_metric_to_unit_convention(metric);
|
||||
const std::map<std::string, std::string>& const_labels = {
|
||||
{"rule", rule->name},
|
||||
{"priority", std::to_string(rule->priority)},
|
||||
{"source", rule->source},
|
||||
{"tags", concat_set_in_order(rule->tags)}
|
||||
};
|
||||
prometheus_text += prometheus_metrics_converter.convert_metric_to_text_prometheus(metric, "falcosecurity", "falco", const_labels);
|
||||
prometheus_metrics_converter.convert_metric_to_unit_convention(metric);
|
||||
const std::map<std::string, std::string>& const_labels = {
|
||||
{"rule_name", rule->name},
|
||||
{"priority", std::to_string(rule->priority)},
|
||||
{"source", rule->source},
|
||||
{"tags", concat_set_in_order(rule->tags)}
|
||||
};
|
||||
prometheus_text += prometheus_metrics_converter.convert_metric_to_text_prometheus(metric, "falcosecurity", "falco", const_labels);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user