wazuh-dashboard-plugins icon indicating copy to clipboard operation
wazuh-dashboard-plugins copied to clipboard

`Delay` body parameter in `PUT /cluster/restart`

Open Selutario opened this issue 10 months ago • 0 comments

Wazuh Rev Browser
X.Y.Z xyzw Chrome, Firefox, Safari, etc

Description When the dashboard restarts the cluster through the API, it sends a {"delay": 1500} body, which is completely ignored since said endpoint does not expect a body:

2024/04/19 08:20:15 INFO: wazuh-wui 172.19.0.4 "PUT /cluster/restart" with parameters {} and body {"delay": 15000} done in 0.020s: 200

This happens at least when clicking the restart button after modifying a rule, although it might behaves the same way in other use cases. Also, when the cluster is disabled, PUT /manager/restart is used instead without body:

"PUT /manager/restart" with parameters {} and body {} done in 0.012s: 200

Preconditions

  1. Enable clusterd in the manager's ossec.conf and restart it.

Steps to reproduce

  1. Navigate to Management > Rules > Edit any rule file.
  2. Save and restart cluster.
  3. Check api.log, the delay parameter is included in PUT /cluster/restart.

Expected Result

  1. The body should be empty for PUT /cluster/restart.

Actual Result

  1. It contains a useless parameter, delay.

Selutario avatar Apr 19 '24 08:04 Selutario