mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-17 00:01:52 +00:00
fix(userspace/falco): enforce filtercheck overlap check for static fields too against plugin fields.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com> Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
parent
ca954c0508
commit
9ed05db767
@ -56,6 +56,12 @@ static bool populate_filterchecks(const std::shared_ptr<sinsp>& inspector,
|
|||||||
std::unordered_set<std::string>& used_plugins,
|
std::unordered_set<std::string>& used_plugins,
|
||||||
std::map<std::string, std::string> static_fields,
|
std::map<std::string, std::string> static_fields,
|
||||||
std::string& err) {
|
std::string& err) {
|
||||||
|
// Add static filterchecks loaded from config
|
||||||
|
if(!static_fields.empty()) {
|
||||||
|
filterchecks.add_filter_check(std::make_unique<sinsp_filter_check_static>(static_fields));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add plugin-defined filterchecks, checking that they do not overlap any internal filtercheck
|
||||||
std::vector<const filter_check_info*> infos;
|
std::vector<const filter_check_info*> infos;
|
||||||
for(const auto& plugin : inspector->get_plugin_manager()->plugins()) {
|
for(const auto& plugin : inspector->get_plugin_manager()->plugins()) {
|
||||||
if(!(plugin->caps() & CAP_EXTRACTION)) {
|
if(!(plugin->caps() & CAP_EXTRACTION)) {
|
||||||
@ -85,9 +91,6 @@ static bool populate_filterchecks(const std::shared_ptr<sinsp>& inspector,
|
|||||||
used_plugins.insert(plugin->name());
|
used_plugins.insert(plugin->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!static_fields.empty()) {
|
|
||||||
filterchecks.add_filter_check(std::make_unique<sinsp_filter_check_static>(static_fields));
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user