mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-02 15:15:17 +00:00
cleanup(engine): only consider .yaml/.yml rule files
Signed-off-by: Luca Guerra <luca@guerra.sh>
This commit is contained in:
@@ -734,13 +734,21 @@ void falco_configuration::read_rules_file_directory(const std::string &path,
|
|||||||
std::sort(dir_filenames.begin(), dir_filenames.end());
|
std::sort(dir_filenames.begin(), dir_filenames.end());
|
||||||
|
|
||||||
for(std::string &ent : dir_filenames) {
|
for(std::string &ent : dir_filenames) {
|
||||||
rules_filenames.push_back(ent);
|
// only consider yaml files
|
||||||
|
if(falco::utils::matches_wildcard("*.yaml", ent) ||
|
||||||
|
falco::utils::matches_wildcard("*.yml", ent)) {
|
||||||
|
rules_filenames.push_back(ent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Assume it's a file and just add to
|
// Assume it's a file and just add to
|
||||||
// rules_filenames. If it can't be opened/etc that
|
// rules_filenames. If it can't be opened/etc that
|
||||||
// will be reported later..
|
// will be reported later..
|
||||||
rules_filenames.push_back(path);
|
// also, only consider yaml files
|
||||||
|
if(falco::utils::matches_wildcard("*.yaml", path) ||
|
||||||
|
falco::utils::matches_wildcard("*.yml", path)) {
|
||||||
|
rules_filenames.push_back(path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user