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

SCA checks are not being paginated properly

Open davidjiglesias opened this issue 2 years ago • 3 comments

The current implementation of the SCA checks view in the UI is not being handled properly. It is using a single API request to load all the information for all the checks, taking too long (1 to 4s depending on the number of checks), and making the UI feel unresponsive.

We can see in the following screenshot the current request without limit:

image

In this case, we have 27 pages of information being loaded in a single request:

image

We need to ensure we use proper pagination to reduce the processing time.

This issue is related to https://github.com/wazuh/wazuh/issues/7354, as the problem had already been reported and investigated several times.

davidjiglesias avatar Jul 08 '22 07:07 davidjiglesias

Proposed solution

The data to retrieve of the Wazuh API endpoint should be the one to be displayed in the UI.

Desvelao avatar Jul 22 '22 08:07 Desvelao

Research

I was implementing the proposed solution and I found a problem to display the search bar suggestions. Before the change, these suggestions are building from the fetched data, but if it now fetches only the page data, the number of suggestions will be reduced.

I was checking the SCA endpoint GET /sca/:agent_id/checks/:checks and currently don't have the distinct query parameter that could be used as it is done in Vulnerabilities/Inventory to get a subset of distinct values.

I asked for the possibility to add the distinct and select query parameters to give the possibility to don't lost funcionality in the search bar suggestions and optimize the fetched data.

Blocked by: https://github.com/wazuh/wazuh/issues/14407

Desvelao avatar Jul 22 '22 09:07 Desvelao

Partial patch

I will leave a partial patch of my current development that could be useful in the future. It is not completed and requires some work to fix some things that are not working.

enhance-requests-performance-sca-checks-table.partial.txt

Target branch: 4.3-7.10.

Desvelao avatar Jul 22 '22 09:07 Desvelao

The API team is working on a refactor of the SCA module and its endpoints, this issue is blocked until the following issues are finished:

  • https://github.com/wazuh/wazuh/issues/14812

gdiazlo avatar Sep 07 '22 21:09 gdiazlo

Blocked by:

  • https://github.com/wazuh/wazuh/issues/14407

AlexRuiz7 avatar Oct 05 '22 15:10 AlexRuiz7

I reopened the issue because some work was not done in the previous PR: https://github.com/wazuh/wazuh-kibana-app/pull/4653

The UI displays duplicated buttons: image

Desvelao avatar Dec 19 '22 14:12 Desvelao

I reopened the issue because some work was not done in the previous PR: #4653

The UI displays duplicated buttons: image

It was requested to be moved to another issue: https://github.com/wazuh/wazuh-kibana-app/issues/5011

Desvelao avatar Dec 19 '22 15:12 Desvelao