wazuh-dashboard-plugins
wazuh-dashboard-plugins copied to clipboard
SCA checks are not being paginated properly
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:
In this case, we have 27 pages of information being loaded in a single request:
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.
Proposed solution
The data to retrieve of the Wazuh API endpoint should be the one to be displayed in the UI.
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
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
.
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
Blocked by:
- https://github.com/wazuh/wazuh/issues/14407
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:
I reopened the issue because some work was not done in the previous PR: #4653
The UI displays duplicated buttons:
It was requested to be moved to another issue: https://github.com/wazuh/wazuh-kibana-app/issues/5011