mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-12 14:08:27 +00:00
fix(userspace/falco): check plugin requirements when validating rule files
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
parent
bbb821fb8e
commit
663c1d073a
@ -70,6 +70,7 @@ application::run_result application::validate_rules_files()
|
|||||||
|
|
||||||
// The json output encompasses all files so the
|
// The json output encompasses all files so the
|
||||||
// validation result is a single json object.
|
// validation result is a single json object.
|
||||||
|
std::string err = "";
|
||||||
nlohmann::json results = nlohmann::json::array();
|
nlohmann::json results = nlohmann::json::array();
|
||||||
|
|
||||||
for(auto &filename : m_options.validate_rules_filenames)
|
for(auto &filename : m_options.validate_rules_filenames)
|
||||||
@ -77,6 +78,10 @@ application::run_result application::validate_rules_files()
|
|||||||
std::unique_ptr<falco::load_result> res;
|
std::unique_ptr<falco::load_result> res;
|
||||||
|
|
||||||
res = m_state->engine->load_rules(rc.at(filename), filename);
|
res = m_state->engine->load_rules(rc.at(filename), filename);
|
||||||
|
if (!check_rules_plugin_requirements(err))
|
||||||
|
{
|
||||||
|
return run_result::fatal(err);
|
||||||
|
}
|
||||||
|
|
||||||
successful &= res->successful();
|
successful &= res->successful();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user