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

Only master IP is suggested during agent deployment in a Wazuh cluster #4109

Closed
Tracked by #4205
davidjiglesias opened this issue Apr 27, 2022 · 8 comments · Fixed by #4737 or #4776
Closed
Tracked by #4205

Only master IP is suggested during agent deployment in a Wazuh cluster #4109

davidjiglesias opened this issue Apr 27, 2022 · 8 comments · Fixed by #4737 or #4776
Assignees
Labels
type/enhancement Enhancement issue

Comments

@davidjiglesias
Copy link
Member

Using the deploy new agent section from the Wazuh WUI, only the Wazuh master address is included even though we have set up a Wazuh cluster with a master and a worker node.

Describe the solution you'd like
All the available node IPs in the Wazuh cluster should appear in the IP section.

Additional context
It may be difficult to extract the available IPs from the Wazuh WUI as the interface only connects to the master API.

@AlexRuiz7
Copy link
Member

The nodes' IPs can be obtained from the API, using the GET /cluster/nodes endpoint.

@gdiazlo gdiazlo mentioned this issue Sep 1, 2022
29 tasks
@Machi3mfl Machi3mfl self-assigned this Oct 19, 2022
@Machi3mfl
Copy link
Member

Solution details

  • Replace the current Server Adress Input with a Select Input with Node IPs.
    Selection_088
  • Get Node IPs from /cluster/nodes
  • Add the Selected Node IP in the command using the WAZUH_MANAGER parameter

Considerations (questions)

  • What to do when the environment doesn't have cluster enabled
  • Could select more than one Node IP or only one.

@gdiazlo
Copy link
Member

gdiazlo commented Oct 20, 2022

The server address is used to build the agent install command. It generated the variable WAZUH_MANAGER so the agent install command automatically initializes and enrolls the agent into Wazuh.

We documented the variable usage in https://documentation.wazuh.com/current/user-manual/deployment-variables/deployment-variables-windows.html, a user might want to specify multiple IP addresses or FQDNs separated by semicolons.

I think we need to enable a user to select multiple IP addresses.

@gdiazlo gdiazlo linked a pull request Oct 20, 2022 that will close this issue
6 tasks
@Machi3mfl
Copy link
Member

Machi3mfl commented Oct 21, 2022

Server Address Combobox (Deploy agent section) with multiple IP selectors

Delimiter by comma (not windows)

Peek 2022-10-26 13-38

Delimiter by a semicolon (windows)

Peek 2022-10-26 13-39

Unit tests

image

image

Considerations (new Behavior)

  • Replace free input with node IP suggestions
  • Added Combobox to the Address Server input to allow users multiple server address (nodes) selections.
  • Select by default the master node
  • Show in the Combobox option list Name and IP and paste only IP
  • Allow users to enter a new IP Address in the Combobox
  • We add in the WAZUH_MANAGER command parameter the node IPs delimiters by a semicolon|comma when the selection is multiple.
    Delimiters conditions:
    Selected OS is Windows = semicolon
    Selected OS is Linux, Amazon Linux, macOS, or AIX = comma

Linux: https://documentation.wazuh.com/current/user-manual/deployment-variables/deployment-variables-linux.html#deployment-variables-for-linux
macOs: https://documentation.wazuh.com/current/user-manual/deployment-variables/deployment-variables-macos.html
AIX: https://documentation.wazuh.com/current/user-manual/deployment-variables/deployment-variables-aix.html
Windows: https://documentation.wazuh.com/current/user-manual/deployment-variables/deployment-variables-windows.html

Tasks

  • Choose which fields show in the Combobox options (name or IP or both)
  • Choose the description text
  • Set master node IP like default Combobox value
  • Paste (tag) only the node name when the option is selected
  • Add the possibility to enter a free text in the Combobox.
  • Add delimiters conditions by OS selected
  • Add testing for the new behavior (component)

Test cases List

  1. Check if master-node is selected by default
  2. Check if options lists show node.name:node.ip
  3. Check if the WAZUH_MANAGER params only show the selected IPs delimiters.
    Selected OS is Windows = semicolon
    Selected OS is Linux, Amazon Linux, macOS, or AIX = comma
  4. Check when an item is selected, a badge must be created and shows only the node name (not IP)
  5. Check if the user is able to enter a new IP/DNS address typing in the Combobox input.
  6. Check if the user did not select any node the WAZUH_MANAGER param in the command must not be visible.

@Machi3mfl Machi3mfl moved this to Triage in Release 4.4.0 Oct 24, 2022
@Machi3mfl Machi3mfl moved this from Triage to In Progress in Release 4.4.0 Oct 24, 2022
@Machi3mfl Machi3mfl moved this from In Progress to In Review in Release 4.4.0 Oct 25, 2022
Repository owner moved this from In Review to Done in Release 4.4.0 Oct 28, 2022
Repository owner moved this from Known issues to Done in Release 4.3.0 Oct 28, 2022
@Machi3mfl Machi3mfl moved this from Done to On Hold in Release 4.4.0 Oct 28, 2022
@Machi3mfl Machi3mfl reopened this Oct 28, 2022
@Machi3mfl
Copy link
Member

Machi3mfl commented Oct 28, 2022

Reopened issue because is related to #4318
Details in #4318 (comment)

@Machi3mfl Machi3mfl moved this from On Hold to In Progress in Release 4.4.0 Oct 31, 2022
@chantal-kelm chantal-kelm self-assigned this Nov 3, 2022
@chantal-kelm
Copy link
Member

chantal-kelm commented Nov 3, 2022

According to what we have discussed with the Framework team these are the cases we are going to take into account:

  • In all cases the client can only choose one IP.

The value of the protocol is handled by this other issue

  • When the client has the IP address configured then in the server address field you will see that IP address and the protocol will be TCP.

Screenshot from 2022-11-03 09-56-51

  • In case the user does not have the IP address configured then a selector will be shown in the server address where the manager and cluster will be shown, the user can choose one and based on the one he chooses, the protocol will be TCP or UDP as appropriate, the user can also write an IP and in that case the protocol will be TCP.

@vikman90 vikman90 added this to the Release 4.4.0 milestone Nov 7, 2022
@Machi3mfl
Copy link
Member

Issue solved in #4776

@Machi3mfl Machi3mfl moved this from In Progress to In Review in Release 4.4.0 Nov 8, 2022
@chantal-kelm chantal-kelm moved this from In Review to Done in Release 4.4.0 Nov 11, 2022
@Machi3mfl
Copy link
Member

Bug found in manual testing fixed in PR #4849

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Enhancement issue
Projects
No open projects
Status: Done
Status: Done
6 participants