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

Wazuh API usage - Magement/Status #5243

Closed
Tracked by #5233
Desvelao opened this issue Mar 3, 2023 · 0 comments · Fixed by #5528, #5536 or #5537
Closed
Tracked by #5233

Wazuh API usage - Magement/Status #5243

Desvelao opened this issue Mar 3, 2023 · 0 comments · Fixed by #5528, #5536 or #5537
Assignees
Labels
level/task Task issue type/enhancement Enhancement issue

Comments

@Desvelao
Copy link
Member

Desvelao commented Mar 3, 2023

Wazuh Elastic Rev Security
4.x 7.x 4xxx Basic, ODFE, Xpack
Browser
Chrome, Firefox, Safari, etc

Description

Analysis: #5233

When clicking on the status section

image

Issue
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /cluster/nodes" with parameters {} and body {} done in 0.017s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /agents/summary/status" with parameters {} and body {} done in 0.027s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /cluster/status" with parameters {} and body {} done in 0.024s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /cluster/status" with parameters {} and body {} done in 0.018s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /manager/info" with parameters {} and body {} done in 0.014s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /overview/agents" with parameters {} and body {} done in 0.043s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /cluster/nodes" with parameters {} and body {} done in 0.014s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /cluster/master-node/status" with parameters {} and body {} done in 0.015s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /cluster/master-node/info" with parameters {} and body {} done in 0.015s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /agents" with parameters {"limit": "1", "sort": "-dateAdd", "q": "id!=000"} and body {} done in 0.020s: 200
  • Improvements and suggestions

    1. GET /overview/agents and GET /agents/summary/status: why is GET /agents/summary/status used? It is not needed as the information obtained in its response is available in the GET /overview/agents response.
    2. "GET /agents" with parameters {"limit": "1", "sort": "-dateAdd", "q": "id!=000"}: this request is used to get the last registered agent. It is not necessary as this information can be obtained from the GET /overview/agents response.
    3. GET /manager/info and GET /cluster/master-node/status + GET /cluster/master-node/info: GET /cluster/node_id/status is needed as it is used to take the running daemons. GET /manager/info is redundant as the node information is obtained in the GET /cluster/node_id/info response.> #### When clicking on the status section

image

Issue
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /cluster/nodes" with parameters {} and body {} done in 0.017s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /agents/summary/status" with parameters {} and body {} done in 0.027s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /cluster/status" with parameters {} and body {} done in 0.024s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /cluster/status" with parameters {} and body {} done in 0.018s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /manager/info" with parameters {} and body {} done in 0.014s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /overview/agents" with parameters {} and body {} done in 0.043s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /cluster/nodes" with parameters {} and body {} done in 0.014s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /cluster/master-node/status" with parameters {} and body {} done in 0.015s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /cluster/master-node/info" with parameters {} and body {} done in 0.015s: 200
2021/11/09 15:06:27 INFO: wazuh-wui 172.19.0.105 "GET /agents" with parameters {"limit": "1", "sort": "-dateAdd", "q": "id!=000"} and body {} done in 0.020s: 200
  • Improvements and suggestions

    1. GET /overview/agents and GET /agents/summary/status: why is GET /agents/summary/status used? It is not needed as the information obtained in its response is available in the GET /overview/agents response.
    2. "GET /agents" with parameters {"limit": "1", "sort": "-dateAdd", "q": "id!=000"}: this request is used to get the last registered agent. It is not necessary as this information can be obtained from the GET /overview/agents response.
    3. GET /manager/info and GET /cluster/master-node/status + GET /cluster/master-node/info: GET /cluster/node_id/status is needed as it is used to take the running daemons. GET /manager/info is redundant as the node information is obtained in the GET /cluster/node_id/info response.
  1. We could use the data provided by GET /overview/agents request to get the agent status data and could remove the GET /agents/summary/status.
  2. We could use the data provided by GET /overview/agents request to get the last registered agent data and could remove the GET /agents?limit=1&sort=-dateAdd.
  3. We should do a deep analysis.

When changing to another node to see its status, the following logs appear:

image

Issue
2021/11/09 15:35:12 INFO: wazuh-wui 172.19.0.105 "GET /agents/summary/status" with parameters {} and body {} done in 0.022s: 200
2021/11/09 15:35:12 INFO: wazuh-wui 172.19.0.105 "GET /overview/agents" with parameters {} and body {} done in 0.041s: 200
2021/11/09 15:35:12 INFO: wazuh-wui 172.19.0.105 "GET /cluster/worker1/status" with parameters {} and body {} done in 0.040s: 200
2021/11/09 15:35:12 INFO: wazuh-wui 172.19.0.105 "GET /cluster/worker1/info" with parameters {} and body {} done in 0.030s: 200
2021/11/09 15:35:12 INFO: wazuh-wui 172.19.0.105 "GET /agents" with parameters {"limit": "1", "sort": "-dateAdd", "q": "id!=000"} and body {} done in 0.020s: 200
  • Improvements and suggestions

    1. Number 1 explained above.
    2. Number 2 explained above.
  1. Apply the suggestion.
  2. Apply the suggestion.
    Preconditions

Steps to reproduce

  1. Navigate to '...'
  2. Click on '....'
  3. Scroll down to '....'

Expected Result
1.

Actual Result
1.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here. Here you can paste log entries too or any other useful information that may help with the issue.

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