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>
This commit is contained in:
Mark Stemm
2022-06-27 14:51:13 -07:00
committed by poiana
parent c3ddd7d5f1
commit baf5540c30
5 changed files with 5 additions and 31 deletions

View File

@@ -164,13 +164,6 @@ void falco_engine::list_fields(std::string &source, bool verbose, bool names_onl
}
void falco_engine::load_rules(const string &rules_content, bool verbose, bool all_events)
{
uint64_t dummy;
return load_rules(rules_content, verbose, all_events, dummy);
}
void falco_engine::load_rules(const string &rules_content, bool verbose, bool all_events, uint64_t &required_engine_version)
{
rule_loader::configuration cfg(rules_content, m_sources);
cfg.min_priority = m_min_priority;
@@ -217,13 +210,6 @@ void falco_engine::load_rules(const string &rules_content, bool verbose, bool al
}
void falco_engine::load_rules_file(const string &rules_filename, bool verbose, bool all_events)
{
uint64_t dummy;
return load_rules_file(rules_filename, verbose, all_events, dummy);
}
void falco_engine::load_rules_file(const string &rules_filename, bool verbose, bool all_events, uint64_t &required_engine_version)
{
ifstream is;
@@ -238,7 +224,7 @@ void falco_engine::load_rules_file(const string &rules_filename, bool verbose, b
string rules_content((istreambuf_iterator<char>(is)),
istreambuf_iterator<char>());
load_rules(rules_content, verbose, all_events, required_engine_version);
load_rules(rules_content, verbose, all_events);
}
void falco_engine::enable_rule(const string &substring, bool enabled, const string &ruleset)
@@ -339,7 +325,7 @@ unique_ptr<falco_engine::rule_result> falco_engine::process_event(std::size_t so
{
return unique_ptr<struct rule_result>();
}
unique_ptr<struct rule_result> res(new rule_result());
res->evt = ev;
res->rule = rule.name;
@@ -441,8 +427,8 @@ bool falco_engine::check_plugin_requirements(
if (!plugin_version.check(req_version))
{
err = "Plugin '" + plugin.name
+ "' version '" + plugin.version
+ "' is not compatible with required plugin version '"
+ "' version '" + plugin.version
+ "' is not compatible with required plugin version '"
+ reqver + "'";
return false;
}