update(userspace/engine): add event codes to json output

Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
This commit is contained in:
Lorenzo Susini
2023-05-16 10:32:59 +00:00
committed by poiana
parent 46cbc3c589
commit e11b4c4430
3 changed files with 32 additions and 1 deletions

View File

@@ -386,7 +386,11 @@ void rule_loader::compiler::compile_rule_infos(
std::string err, condition;
std::set<falco::load_result::load_result::warning_code> warn_codes;
filter_warning_resolver warn_resolver;
for (auto &r : col.rules())
// note: cast away the const qualifier in the for loop
// this is needed because we want to store information about evttypes
// used by any rules, which might come in handy when describing rules.
for (auto &r : const_cast<indexed_vector<rule_info>&>(col.rules()))
{
// skip the rule if below the minimum priority
if (r.priority > cfg.min_priority)
@@ -505,6 +509,7 @@ void rule_loader::compiler::compile_rule_infos(
"Rule matches too many evt.type values. This has a significant performance penalty.",
r.ctx);
}
r.evttypes = evttypes;
}
}
}