win32ui: remove manual manager IP editing now that the address comes from enrollment
Component: win32ui (Windows agent tray/config GUI, src/win32/ui/)
Depends on: #38940
Rough size: S
Description
#38940 makes the manager address a single endpoint (adr) delivered through an enrollment token, not something an end user is meant to hand-type on an already-deployed agent — implementation restriction 3 removes server rotation, and the whole point of the token/trust-anchor flow is that the verified manager identity comes from enrollment, not from free text typed into a box after the fact.
The Windows tray GUI still predates that model. Its main dialog (src/win32/ui/win32ui.rc:45-52) has an editable Manager IP field (EDITTEXT UI_SERVER_TEXT) and a &Save button (PUSHBUTTON "&Save", IDC_ADD). The IDC_ADD handler in src/win32/ui/os_win32ui.c:131-273 reads that box and calls set_ossec_server() to overwrite the configured manager address directly, with no verification step at all — exactly the free-form edit the new bootstrap flow is designed to prevent.
The same IDC_ADD handler also reads a second field, Authentication key (UI_SERVER_AUTH), decodes a base64 blob and imports it via set_ossec_key() (os_win32ui.c:165-246). That path is unrelated to the address field but shares the same button and WM_COMMAND case, so it has to be pulled apart as part of this change, not just deleted alongside the address editing.
Tasks
- Change the
Manager IPcontrol (UI_SERVER_TEXT,win32ui.rc:46) to read-only/disabled, so it only ever displays the currently configured address (sourced the same waygen_server_info()/config_read()populate it today,win32/ui/common.c). - Remove the
&Savebutton (IDC_ADD,win32ui.rc:51) and the manager-IP-writing part of its handler (os_win32ui.c:131-164, theset_ossec_server()call). - Decide the fate of the auth-key import path (
UI_SERVER_AUTHfield +set_ossec_key(),os_win32ui.c:165-246), which today shares the Save button — in coordination with the follow-up enrollment-token issue, since it may be replaced by the token flow rather than just deleted. - Make sure the read-only address display is refreshed after any re-enrollment (e.g. once the follow-up token-based enrollment issue lands), not just at dialog open.
- Keep
&Refresh(IDC_CANCEL) as the way to pull the current values into the read-only fields: it already callsconfig_read()+gen_server_info()(win32/ui/common.c:22-52), which already repopulates bothUI_SERVER_TEXT(manager address) andUI_SERVER_AUTH(key) fromconfig_inst— keep this behavior intentional and covered once Save is gone, rather than an accidental side effect of code that used to also support editing. - Update any Windows GUI documentation/screenshots that reference the Save button or manual IP editing.
Definition of Done
- The Windows agent tray GUI no longer offers a way to type and save an arbitrary manager address.
- The manager address and key shown in the GUI always reflect the actual configured/enrolled value, and pressing
&Refreshre-reads and re-displays both (display-only, no edit path). - No dead code/controls (
IDC_ADDand unused strings) left over from the removed Save flow.
Source: wazuh/wazuh