mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-31 06:10:45 +00:00
update(userspace/engine): correctly use describe rule based on config
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
This commit is contained in:
@@ -123,7 +123,7 @@ public:
|
||||
// Print details on the given rule. If rule is NULL, print
|
||||
// details on all rules.
|
||||
//
|
||||
void describe_rule(std::string *rule) const;
|
||||
void describe_rule(std::string *rule, bool json) const;
|
||||
|
||||
//
|
||||
// Print statistics on how many events matched each rule.
|
||||
@@ -298,6 +298,9 @@ private:
|
||||
//
|
||||
inline bool should_drop_evt() const;
|
||||
|
||||
// Retrieve details of a rule in json format
|
||||
Json::Value get_json_rule_details(const falco_rule& r) const;
|
||||
|
||||
rule_loader::collector m_rule_collector;
|
||||
indexed_vector<falco_rule> m_rules;
|
||||
stats_manager m_rule_stats_manager;
|
||||
|
@@ -118,13 +118,13 @@ falco::app::run_result falco::app::actions::load_rules_files(falco::app::state&
|
||||
|
||||
if (s.options.describe_all_rules)
|
||||
{
|
||||
s.engine->describe_rule(NULL);
|
||||
s.engine->describe_rule(NULL, s.config->m_json_output);
|
||||
return run_result::exit();
|
||||
}
|
||||
|
||||
if (!s.options.describe_rule.empty())
|
||||
{
|
||||
s.engine->describe_rule(&(s.options.describe_rule));
|
||||
s.engine->describe_rule(&(s.options.describe_rule), s.config->m_json_output);
|
||||
return run_result::exit();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user