Management framework: don't hardwire controller IP in agent

This changes the default IP address for the agent to connect to the controller
from a hardwired 127.0.0.1 to going through a cascade of considering a
configured Management::Controller::listen_address, then
Management::default_address, and falling back to 127.0.0.1.
This commit is contained in:
Christian Kreibich 2025-09-17 03:12:53 -07:00
parent 067c257480
commit c67f15414e
2 changed files with 14 additions and 9 deletions

View file

@ -76,7 +76,8 @@ export {
## like to use that mode, make sure to set
## :zeek:see:`Management::Agent::listen_address` and
## :zeek:see:`Management::Agent::listen_port` as needed.
const controller = Broker::NetworkInfo($address="127.0.0.1",
const controller = Broker::NetworkInfo(
$address=Management::Controller::network_info("127.0.0.1")$address,
$bound_port=Management::Controller::network_info()$bound_port) &redef;
## An optional working directory for the agent. Agent and controller