From: Masud Hasan (mashasan) Date: Tue, 30 Jun 2020 18:26:10 +0000 (+0000) Subject: Merge pull request #2293 in SNORT/snort3 from ~SMINUT/snort3:rna_build to master X-Git-Tag: 3.0.2-1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8f79f97d21c0fae9b6862d726c8655fa0015aa1;p=thirdparty%2Fsnort3.git Merge pull request #2293 in SNORT/snort3 from ~SMINUT/snort3:rna_build to master Squashed commit of the following: commit 97cdecaa0c4008dbebc381810f494d627b617a9e Author: Silviu Minut Date: Fri Jun 26 18:01:48 2020 -0400 rna: remove custom_fingerprint_dir from configuration --- diff --git a/src/network_inspectors/rna/dev_notes.txt b/src/network_inspectors/rna/dev_notes.txt index 63dc76b3d..3fa1052fa 100644 --- a/src/network_inspectors/rna/dev_notes.txt +++ b/src/network_inspectors/rna/dev_notes.txt @@ -44,7 +44,7 @@ portexclusion dst udp 53 8.8.8.8 # exclude this ip for UDP port 53 in destina portexclusion both tcp 4000 ::0/0 # exclude any ipv6 for TCP port 4000 in both direction Note that exclusion has higher priority than inclusion. RNA does not support application/user -discovery, fingerprint, util_lib_path decoder, enable_banner_grab, etc. The enable_logger config +discovery, fingerprint, fingerprint reader, enable_banner_grab, etc. The enable_logger config is to enable/disable sending RNA discovery events to EventManager::call_loggers. Such event logger or reader is not implemented yet. However, since RNA stores host information into host_cache, to log the discovered hosts into a file, one can diff --git a/src/network_inspectors/rna/rna_config.h b/src/network_inspectors/rna/rna_config.h index b1a7bad5c..f6063cba1 100644 --- a/src/network_inspectors/rna/rna_config.h +++ b/src/network_inspectors/rna/rna_config.h @@ -24,9 +24,7 @@ struct RnaModuleConfig { std::string rna_conf_path; - std::string rna_util_lib_path; std::string fingerprint_dir; - std::string custom_fingerprint_dir; bool enable_logger; bool log_when_idle; }; diff --git a/src/network_inspectors/rna/rna_inspector.cc b/src/network_inspectors/rna/rna_inspector.cc index 015e247a3..3c66c9bb7 100644 --- a/src/network_inspectors/rna/rna_inspector.cc +++ b/src/network_inspectors/rna/rna_inspector.cc @@ -105,9 +105,7 @@ void RnaInspector::show(const SnortConfig*) const if ( mod_conf ) { ConfigLogger::log_value("rna_conf_path", mod_conf->rna_conf_path.c_str()); - ConfigLogger::log_value("rna_util_lib_path", mod_conf->rna_util_lib_path.c_str()); ConfigLogger::log_value("fingerprint_dir", mod_conf->fingerprint_dir.c_str()); - ConfigLogger::log_value("custom_fingerprint_dir", mod_conf->custom_fingerprint_dir.c_str()); ConfigLogger::log_flag("enable_logger", mod_conf->enable_logger); ConfigLogger::log_flag("log_when_idle", mod_conf->log_when_idle); } diff --git a/src/network_inspectors/rna/rna_module.cc b/src/network_inspectors/rna/rna_module.cc index ed9c35cfe..47bcdb999 100644 --- a/src/network_inspectors/rna/rna_module.cc +++ b/src/network_inspectors/rna/rna_module.cc @@ -85,15 +85,9 @@ static const Parameter rna_params[] = { "rna_conf_path", Parameter::PT_STRING, nullptr, nullptr, "path to rna configuration" }, - { "rna_util_lib_path", Parameter::PT_STRING, nullptr, nullptr, - "path to library for utilities such as fingerprint decoder" }, - { "fingerprint_dir", Parameter::PT_STRING, nullptr, nullptr, "directory to fingerprint patterns" }, - { "custom_fingerprint_dir", Parameter::PT_STRING, nullptr, nullptr, - "directory to custom fingerprint patterns" }, - { "enable_logger", Parameter::PT_BOOL, nullptr, "true", "enable or disable writing discovery events into logger" }, @@ -144,12 +138,8 @@ bool RnaModule::set(const char*, Value& v, SnortConfig*) { if (v.is("rna_conf_path")) mod_conf->rna_conf_path = std::string(v.get_string()); - else if (v.is("rna_util_lib_path")) - mod_conf->rna_util_lib_path = std::string(v.get_string()); else if (v.is("fingerprint_dir")) mod_conf->fingerprint_dir = std::string(v.get_string()); - else if (v.is("custom_fingerprint_dir")) - mod_conf->custom_fingerprint_dir = std::string(v.get_string()); else if (v.is("enable_logger")) mod_conf->enable_logger = v.get_bool(); else if (v.is("log_when_idle")) @@ -213,28 +203,18 @@ TEST_CASE("RNA module", "[rna_module]") v1.set(Parameter::find(rna_params, "rna_conf_path")); CHECK(mod.set(nullptr, v1, nullptr) == true); - Value v2("rna_util.so"); - v2.set(Parameter::find(rna_params, "rna_util_lib_path")); + Value v2("/dir/fingerprints"); + v2.set(Parameter::find(rna_params, "fingerprint_dir")); CHECK(mod.set(nullptr, v2, nullptr) == true); - Value v3("/dir/fingerprints"); - v3.set(Parameter::find(rna_params, "fingerprint_dir")); - CHECK(mod.set(nullptr, v3, nullptr) == true); - - Value v4("/dir/custom_fingerprints"); - v4.set(Parameter::find(rna_params, "custom_fingerprint_dir")); - CHECK(mod.set(nullptr, v4, nullptr) == true); - - Value v5("dummy"); - CHECK(mod.set(nullptr, v5, nullptr) == false); + Value v3("dummy"); + CHECK(mod.set(nullptr, v3, nullptr) == false); CHECK(mod.end("rna", 0, &sc) == true); RnaModuleConfig* rc = mod.get_config(); CHECK(rc != nullptr); CHECK(rc->rna_conf_path == "rna.conf"); - CHECK(rc->rna_util_lib_path == "rna_util.so"); CHECK(rc->fingerprint_dir == "/dir/fingerprints"); - CHECK(rc->custom_fingerprint_dir == "/dir/custom_fingerprints"); delete rc; }