Merge branch 'topic/christian/management-bugfixes'

* topic/christian/management-bugfixes:
  Management framework: bump cluster testsuite
  Management framework: log node set in dispatch requests cleanly
  Management framework: log additional node events
  Management framework: upon deployment, make agent log multiple node results
  Management framework: fix early return condition for get-id-value
This commit is contained in:
Christian Kreibich 2022-08-10 14:16:08 -07:00
commit 3a0a702723
6 changed files with 25 additions and 8 deletions

10
CHANGES
View file

@ -1,3 +1,13 @@
5.1.0-dev.357 | 2022-08-10 14:16:33 -0700
* Management framework: minor bugfixes and tweaks (Christian Kreibich, Corelight)
- bump cluster testsuite
- log node set in dispatch requests cleanly
- log additional node events
- upon deployment, make agent log multiple node results
- fix early return condition for get-id-value
5.1.0-dev.351 | 2022-08-09 09:50:13 -0700 5.1.0-dev.351 | 2022-08-09 09:50:13 -0700
* Fix module-scoped type definitions that conflict with existing global ones (Tim Wojtulewicz, Corelight) * Fix module-scoped type definitions that conflict with existing global ones (Tim Wojtulewicz, Corelight)

View file

@ -1 +1 @@
5.1.0-dev.351 5.1.0-dev.357

View file

@ -204,7 +204,7 @@ function send_deploy_response(req: Management::Request::Request)
} }
Management::Log::info(fmt("tx Management::Agent::API::deploy_response %s", Management::Log::info(fmt("tx Management::Agent::API::deploy_response %s",
Management::result_to_string(res))); Management::result_vec_to_string(req$results)));
Broker::publish(agent_topic(), Broker::publish(agent_topic(),
Management::Agent::API::deploy_response, req$id, req$results); Management::Agent::API::deploy_response, req$id, req$results);
@ -262,6 +262,8 @@ event Management::Agent::Runtime::trigger_log_archival(run_archival: bool)
event Management::Supervisor::API::notify_node_exit(node: string, outputs: Management::NodeOutputs) event Management::Supervisor::API::notify_node_exit(node: string, outputs: Management::NodeOutputs)
{ {
Management::Log::info(fmt("rx Management::Supervisor::API::notify_node_exit %s", node));
if ( node in g_nodes ) if ( node in g_nodes )
g_outputs[node] = outputs; g_outputs[node] = outputs;
} }
@ -753,7 +755,8 @@ event Management::Node::API::node_dispatch_response(reqid: string, result: Manag
event Management::Agent::API::node_dispatch_request(reqid: string, action: vector of string, nodes: set[string]) event Management::Agent::API::node_dispatch_request(reqid: string, action: vector of string, nodes: set[string])
{ {
Management::Log::info(fmt("rx Management::Agent::API::node_dispatch_request %s %s %s", reqid, action, nodes)); Management::Log::info(fmt("rx Management::Agent::API::node_dispatch_request %s %s %s",
reqid, action, Management::Util::set_to_vector(nodes)));
local node: string; local node: string;
local cluster_nodes: set[string]; local cluster_nodes: set[string];

View file

@ -1174,11 +1174,11 @@ event Management::Controller::API::get_id_value_request(reqid: string, id: strin
local res: Management::Result; local res: Management::Result;
# Special case: if we have no instances, respond right away. # Special case: if we have no deployed cluster, respond right away.
if ( |g_instances_known| == 0 ) if ( |g_instances| == 0 )
{ {
Management::Log::info(fmt("tx Management::Controller::API::get_id_value_response %s", reqid)); Management::Log::info(fmt("tx Management::Controller::API::get_id_value_response %s", reqid));
res = Management::Result($reqid=reqid, $success=F, $error="no instances connected"); res = Management::Result($reqid=reqid, $success=F, $error="no cluster deployed");
Broker::publish(Management::Controller::topic, Broker::publish(Management::Controller::topic,
Management::Controller::API::get_id_value_response, Management::Controller::API::get_id_value_response,
reqid, vector(res)); reqid, vector(res));

View file

@ -57,7 +57,8 @@ global g_dispatch_table: table[string] of DispatchCallback = {
event Management::Node::API::node_dispatch_request(reqid: string, action: vector of string, nodes: set[string]) event Management::Node::API::node_dispatch_request(reqid: string, action: vector of string, nodes: set[string])
{ {
Management::Log::info(fmt("rx Management::Node::API::node_dispatch_request %s %s %s", reqid, action, nodes)); Management::Log::info(fmt("rx Management::Node::API::node_dispatch_request %s %s %s",
reqid, action, Management::Util::set_to_vector(nodes)));
if ( |nodes| > 0 && Cluster::node !in nodes ) if ( |nodes| > 0 && Cluster::node !in nodes )
{ {
@ -102,7 +103,10 @@ event Broker::peer_added(peer: Broker::EndpointInfo, msg: string)
# If this is the agent peering, notify it that we're ready # If this is the agent peering, notify it that we're ready
if ( peer$network$address == epi$network$address && if ( peer$network$address == epi$network$address &&
peer$network$bound_port == epi$network$bound_port ) peer$network$bound_port == epi$network$bound_port )
{
Management::Log::info(fmt("tx Management::Node::API::notify_node_hello %s", Cluster::node));
Broker::publish(node_topic, Management::Node::API::notify_node_hello, Cluster::node); Broker::publish(node_topic, Management::Node::API::notify_node_hello, Cluster::node);
}
} }
event zeek_init() event zeek_init()

View file

@ -1 +1 @@
6e95008a28f5fe5d26d8a77384eb8355536df25e 80057a6ffcc0d5c99f6963d61052ff37c5f5de98