Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new(userspace/falco): allow entirely disabling plugin hostinfo support. #3412

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions falco.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ plugins:
- name: json
library_path: libjson.so

# Uncomment to disable host info support for source plugins
# that DO NOT generate raw events from the libscap event table,
# dropping the `hostPath` volume requirement for them.
# plugins_hostinfo: false

##########################
# Falco outputs settings #
Expand Down
4 changes: 3 additions & 1 deletion userspace/falco/app/actions/helpers_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ falco::app::run_result falco::app::actions::open_live_inspector(falco::app::stat
"Opening '" + source + "' source with plugin '" + cfg->m_name + "'");
inspector->open_plugin(cfg->m_name,
cfg->m_open_params,
sinsp_plugin_platform::SINSP_PLATFORM_HOSTINFO);
s.config->m_plugins_hostinfo
? sinsp_plugin_platform::SINSP_PLATFORM_HOSTINFO
: sinsp_plugin_platform::SINSP_PLATFORM_GENERIC);
return run_result::ok();
}
}
Expand Down
3 changes: 3 additions & 0 deletions userspace/falco/config_json_schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ const char config_schema_string[] = LONG_STRING_CONST(
"watch_config_files": {
"type": "boolean"
},
"plugins_hostinfo": {
"type": "boolean"
},
"rules_files": {
"type": "array",
"items": {
Expand Down
3 changes: 3 additions & 0 deletions userspace/falco/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ falco_configuration::falco_configuration():
m_metrics_flags(0),
m_metrics_convert_memory_to_mb(true),
m_metrics_include_empty_values(false),
m_plugins_hostinfo(true),
m_container_engines_mask(0),
m_container_engines_disable_cri_async(false),
m_container_engines_cri_socket_paths({"/run/containerd/containerd.sock",
Expand Down Expand Up @@ -616,6 +617,8 @@ void falco_configuration::load_yaml(const std::string &config_name) {
m_metrics_include_empty_values =
m_config.get_scalar<bool>("metrics.include_empty_values", false);

m_plugins_hostinfo = m_config.get_scalar<bool>("plugins_hostinfo", true);

m_config.get_sequence<std::vector<rule_selection_config>>(m_rules_selection, "rules");
m_config.get_sequence<std::vector<append_output_config>>(m_append_output, "append_output");

Expand Down
1 change: 1 addition & 0 deletions userspace/falco/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ class falco_configuration {
bool m_metrics_convert_memory_to_mb;
bool m_metrics_include_empty_values;
std::vector<plugin_config> m_plugins;
bool m_plugins_hostinfo;

// container engines
uint64_t m_container_engines_mask;
Expand Down
Loading