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

Fixed error when pinned agent in vulnerabilities #6827

Merged

Conversation

jbiset
Copy link
Member

@jbiset jbiset commented Jul 16, 2024

Description

This PR solves filter error when pinning an agent when an index pattern is used for wazuh-alerts that is not wazuh-alerts-*.

Issues Resolved

Evidence

Before

Before

After

After

Test

Note

It is necessary to inject data with the vulnerabilities script to test this PR.
You must also use a real Manager.

  1. It is necessary to remove both the index and the index pattern from wazuh-alerts-*. To remove wazuh-alerts indexes (DELETE wazuh-alerts-4.x-*)
  2. To emulate the problem, the indexes generated with sample data will be used, so sample data must be added.
  3. The default index pattern name in AppSettings must be changed. In this case I changed to wazuh-alerts-4.x-sample-security to take advantage of the sample data.
  4. An index pattern named wazuh-alerts-4.x-sample-security must be created to match the wazuh-alerts-4.x-sample-security index of sample data.
  5. Go to the vulnerabilities module, pin an agent in Dashboard/Inventory and then go to the Events tab.
  6. Check that the pinned agent filter appears correctly without error.

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@jbiset jbiset self-assigned this Jul 16, 2024
@jbiset jbiset marked this pull request as ready for review July 16, 2024 14:43
@yenienserrano yenienserrano self-requested a review July 16, 2024 14:44
yenienserrano
yenienserrano previously approved these changes Jul 16, 2024
Copy link
Member

@yenienserrano yenienserrano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: LGTM
TEST: LGTM

image

Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 20.94% ( 187 / 893 )
Branches 17.91% ( 79 / 441 )
Functions 13.79% ( 36 / 261 )
Lines 21.14% ( 184 / 870 )

Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.78% ( 172 / 224 )
Branches 58.65% ( 61 / 104 )
Functions 61.7% ( 29 / 47 )
Lines 76.78% ( 172 / 224 )

Copy link
Member

@asteriscos asteriscos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: 🟢
Test: 🟢

image

Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 12.3% ( 4278 / 34780 )
Branches 8.31% ( 1938 / 23294 )
Functions 11.63% ( 964 / 8284 )
Lines 12.48% ( 4168 / 33384 )

@asteriscos asteriscos merged commit 6eaec17 into 4.8.1 Jul 16, 2024
5 checks passed
@asteriscos asteriscos deleted the bug/6826-error-when-pinning-an-agent-in-vulnerabilities branch July 16, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when pinning an agent to vulnerabilities when using an index pattern other than default wazuh-alerts
3 participants