From dfa6b9b88e43434e6c1d52f6578acd92876e0f76 Mon Sep 17 00:00:00 2001 From: Luca Guerra Date: Mon, 30 Sep 2024 11:03:45 +0000 Subject: [PATCH] chore(falco): deprecated -A Signed-off-by: Luca Guerra --- .../app/actions/configure_interesting_sets.cpp | 14 ++++++++++++-- userspace/falco/app/options.cpp | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/userspace/falco/app/actions/configure_interesting_sets.cpp b/userspace/falco/app/actions/configure_interesting_sets.cpp index 8d084a9c576..a6e42fad327 100644 --- a/userspace/falco/app/actions/configure_interesting_sets.cpp +++ b/userspace/falco/app/actions/configure_interesting_sets.cpp @@ -200,11 +200,21 @@ static void select_event_set(falco::app::state& s, concat_set_in_order(non_rules_sc_set_names) + "\n"); } - /* -A flag behavior: + /* base_syscall.all / -A flag behavior: * (1) default: all syscalls in rules included, sinsp state enforcement without high volume syscalls - * (2) -A flag set: all syscalls in rules included, sinsp state enforcement + * (2) set: all syscalls in rules included, sinsp state enforcement and allowing high volume syscalls */ + bool all_events = false; + if(s.options.all_events) { + falco_logger::log(falco_logger::level::WARNING, + "The -A option is deprecated and will be removed. Use -o " + "base_syscalls.all=true instead."); + all_events = true; + } + if(s.config->m_base_syscalls_all) { + all_events = true; + } if(!(s.options.all_events || s.config->m_base_syscalls_all)) { auto ignored_sc_set = falco::app::ignored_sc_set(); auto erased_sc_set = s.selected_sc_set.intersect(ignored_sc_set); diff --git a/userspace/falco/app/options.cpp b/userspace/falco/app/options.cpp index 892e41e98a8..7f5285ec5ca 100644 --- a/userspace/falco/app/options.cpp +++ b/userspace/falco/app/options.cpp @@ -104,7 +104,7 @@ void options::define(cxxopts::Options& opts) #endif ("config-schema", "Print the config json schema and exit.", cxxopts::value(print_config_schema)->default_value("false")) ("rule-schema", "Print the rule json schema and exit.", cxxopts::value(print_rule_schema)->default_value("false")) - ("A", "Monitor all events supported by Falco and defined in rules and configs. Some events are ignored by default when -A is not specified (the -i option lists these events ignored). Using -A can impact performance. This option has no effect when reproducing events from a capture file.", cxxopts::value(all_events)->default_value("false")) + ("A", "DEPRECATED: use -o base_syscalls.all=true instead. Monitor all events supported by Falco and defined in rules and configs. Some events are ignored by default when -A is not specified (the -i option lists these events ignored). Using -A can impact performance. This option has no effect when reproducing events from a capture file.", cxxopts::value(all_events)->default_value("false")) ("b,print-base64", "Print data buffers in base64. This is useful for encoding binary data that needs to be used over media designed to consume this format.") ("disable-source", "Turn off a specific . By default, all loaded sources get enabled. Available sources are 'syscall' plus all sources defined by loaded plugins supporting the event sourcing capability. This option can be passed multiple times, but turning off all event sources simultaneously is not permitted. This option can not be mixed with --enable-source. This option has no effect when reproducing events from a capture file.", cxxopts::value(disable_sources), "") ("dry-run", "Run Falco without processing events. It can help check that the configuration and rules do not have any errors.", cxxopts::value(dry_run)->default_value("false"))