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

Replace the tables on the Security section with TableWzAPI component #5467

Open
Desvelao opened this issue May 19, 2023 · 3 comments
Open

Replace the tables on the Security section with TableWzAPI component #5467

Desvelao opened this issue May 19, 2023 · 3 comments
Labels
level/task Task issue type/enhancement Enhancement issue

Comments

@Desvelao
Copy link
Member

Desvelao commented May 19, 2023

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

Description
We are working to implement a new search bar, and redoing some sections that have a search bar and table to use the reusable TableWzAPI component. See #4312.

It would be interesting to unify the tables in the Security section to use the new search bar. Currently, these sections retrieve the first 500 results (this is a bug) and use a EuiInMemoryTable component with the provided search bar. The problem is that these tables are using data from 2 different endpoints, and this reduces the possibility of using the TableWzAPI component. Moreover, some searches could not be possible due to how the data is saved in the data endpoint.

For example, the section Security/Users, displays data about the Wazuh API users (username, allow run as and roles). The data is coming from:

  • GET /security/users
  • GET /security/roles
    and combined to generate the table.

In the case, we want to implement the new search bar, the suggestions for the Roles will display number IDs instead of the names.

image

The same situation happens in the rest of the Security sections.

@Desvelao Desvelao added level/task Task issue type/enhancement Enhancement issue labels May 19, 2023
@Desvelao Desvelao changed the title Replace the tables on the Security section by TableWzAPI component Replace the tables on the Security section with TableWzAPI component May 19, 2023
@Desvelao Desvelao mentioned this issue May 19, 2023
6 tasks
@lucianogorza lucianogorza self-assigned this Aug 15, 2023
@lucianogorza
Copy link
Contributor

lucianogorza commented Aug 16, 2023

Since the 4.8.0 branch is not available, I started working from the 4.7.0 branch. Then I realized that in that branch there are no changes to the new search bar applied in 4.6.0. For this reason, I am going to start from the 4.6.0 branch.

@lucianogorza
Copy link
Contributor

lucianogorza commented Aug 16, 2023

According to the documentation:
https://documentation.wazuh.com/current/user-manual/api/reference.html#operation/api.controllers.security_controller.get_users
It is not possible to filter or search the user's GET endpoint by individual fields. There is only a "search" parameter that allows you to specify a string. Therefore, to implement the TabeWzApi component, we have two options:

  • Make changes to the TableWzApi component to optionally support only a general search using the "search" parameter instead of the "q" parameter.

  • Modify the API to support the "q" parameter and thus enable specific search for fields.

@lucianogorza
Copy link
Contributor

After doing an analysis, I think it is better to see the possibility of incorporating the "q" parameter to the GET endpoints of the security section, instead of adapting the search bar for the "search" parameter, because it would be inconsistent for the user and would add unnecessary code to the component.

@lucianogorza lucianogorza removed their assignment Aug 16, 2023
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
None yet
Development

No branches or pull requests

2 participants