mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-02 01:22:16 +00:00
chore(userspace,falco.yaml,unit_tests): configs_files
-> config_files
.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
This commit is contained in:
parent
1b22c4566a
commit
a48965a00c
14
falco.yaml
14
falco.yaml
@ -25,8 +25,8 @@
|
||||
#
|
||||
# (Falco command-line arguments)
|
||||
# (Falco environment variables)
|
||||
# Falco configs files
|
||||
# configs_files [Stable]
|
||||
# Falco config files settings
|
||||
# config_files [Stable]
|
||||
# watch_config_files [Stable]
|
||||
# Falco rules files
|
||||
# rules_files [Stable]
|
||||
@ -130,11 +130,11 @@
|
||||
# disabling the automatic artifacts followed by falcoctl.
|
||||
|
||||
|
||||
#######################
|
||||
# Falco configs files #
|
||||
#######################
|
||||
###############################
|
||||
# Falco config files settings #
|
||||
###############################
|
||||
|
||||
# [Stable] `configs_files`
|
||||
# [Stable] `config_files`
|
||||
#
|
||||
# Falco will load additional configs files specified here.
|
||||
# Their loading is assumed to be made *after* main config file has been processed,
|
||||
@ -143,7 +143,7 @@
|
||||
# Also, nested include is not allowed, ie: included config files won't be able to include other config files.
|
||||
#
|
||||
# Like for 'rules_files', specifying a folder will load all the configs files present in it in a lexicographical order.
|
||||
configs_files:
|
||||
config_files:
|
||||
- /etc/falco/config.d
|
||||
|
||||
# [Stable] `watch_config_files`
|
||||
|
@ -368,7 +368,7 @@ TEST(Configuration, configuration_config_files_unexistent)
|
||||
std::filesystem::remove("main.yaml");
|
||||
}
|
||||
|
||||
TEST(Configuration, configuration_config_files_scalar_configs_files)
|
||||
TEST(Configuration, configuration_config_files_scalar_config_files)
|
||||
{
|
||||
/* Test that a single file can be included as a scalar (thanks to get_sequence_from_node magic) */
|
||||
const std::string main_conf_yaml =
|
||||
@ -413,7 +413,7 @@ TEST(Configuration, configuration_config_files_scalar_configs_files)
|
||||
std::filesystem::remove("conf_2.yaml");
|
||||
}
|
||||
|
||||
TEST(Configuration, configuration_config_files_empty_configs_files)
|
||||
TEST(Configuration, configuration_config_files_empty_config_files)
|
||||
{
|
||||
/* Test that empty includes list is accepted */
|
||||
const std::string main_conf_yaml =
|
||||
@ -561,7 +561,7 @@ TEST(Configuration, configuration_config_files_cmdline)
|
||||
outfile << conf_yaml_2;
|
||||
outfile.close();
|
||||
|
||||
// Pass "configs_files=..." cmdline option
|
||||
// Pass "config_files=..." cmdline option
|
||||
std::vector<std::string> cmdline_config_options;
|
||||
cmdline_config_options.push_back((yaml_helper::configs_key+"=conf_2.yaml"));
|
||||
|
||||
|
@ -30,7 +30,7 @@ static falco::app::run_result apply_deprecated_options(const falco::app::state&
|
||||
falco::app::run_result falco::app::actions::load_config(const falco::app::state& s)
|
||||
{
|
||||
// List of loaded conf files, ie: s.options.conf_filename
|
||||
// plus all the `configs_files` expanded list of configs.
|
||||
// plus all the `config_files` expanded list of configs.
|
||||
std::vector<std::string> loaded_conf_files;
|
||||
try
|
||||
{
|
||||
|
@ -99,7 +99,7 @@ void falco_configuration::init_from_file(const std::string& conf_filename, std::
|
||||
throw e;
|
||||
}
|
||||
init_cmdline_options(cmdline_options);
|
||||
merge_configs_files(conf_filename, loaded_conf_files);
|
||||
merge_config_files(conf_filename, loaded_conf_files);
|
||||
load_yaml(conf_filename);
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ std::string falco_configuration::dump()
|
||||
return config.dump();
|
||||
}
|
||||
|
||||
void falco_configuration::merge_configs_files(const std::string& config_name, std::vector<std::string>& loaded_config_files)
|
||||
void falco_configuration::merge_config_files(const std::string& config_name, std::vector<std::string>& loaded_config_files)
|
||||
{
|
||||
// Load configs files to be included and merge them into current config
|
||||
// NOTE: loaded_config_files will resolve to the filepaths list of loaded config.
|
||||
|
@ -195,7 +195,7 @@ public:
|
||||
yaml_helper config;
|
||||
|
||||
private:
|
||||
void merge_configs_files(const std::string& config_name, std::vector<std::string>& loaded_config_files);
|
||||
void merge_config_files(const std::string& config_name, std::vector<std::string>& loaded_config_files);
|
||||
void load_yaml(const std::string& config_name);
|
||||
void init_logger();
|
||||
void load_engine_config(const std::string& config_name);
|
||||
|
@ -78,7 +78,7 @@ private:
|
||||
class yaml_helper
|
||||
{
|
||||
public:
|
||||
inline static const std::string configs_key = "configs_files";
|
||||
inline static const std::string configs_key = "config_files";
|
||||
|
||||
/**
|
||||
* Load the YAML document represented by the input string.
|
||||
@ -104,7 +104,7 @@ public:
|
||||
{
|
||||
/*
|
||||
* To avoid recursion hell,
|
||||
* we don't support `configs_files` directives from included config files
|
||||
* we don't support `config_files` directives from included config files
|
||||
* (that use load_from_file_int recursively).
|
||||
*/
|
||||
const auto &key = n.first.Scalar();
|
||||
|
Loading…
Reference in New Issue
Block a user