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

Add vulnerabilities configurations and healthCheck #6147

Conversation

jbiset
Copy link
Member

@jbiset jbiset commented Nov 23, 2023

Description

Add vulnerabilities configurations and healthCheck

Issues Resolved

Evidence

Warning message when the vulnerability index does not exist. Allowing to continue.

01_health_check_without_index_data_WARNING_NOTIFICATION

Dashboard status when the index does not exist. Each display shows its corresponding message.

02_vulnerability_detection_without_index_data

Health check when index exists but not mapping

03_health_check_with_index_data_NO_MAPPING_ON_MANAGER

04_health_check_with_index_data_NO_MAPPING_ON_MANAGER_open_logs

Dashboard status when index exists but not mapping

05_vulnerability_detection_with_index_data_NO_MAPPING_ON_MANAGER

Health check when index exists and correct mapping

06_vulnerability_detection_with_index_data_NO_MAPPING_ON_MANAGER_open_logs

07_health_check_with_index_data_MAPPING_ON_MANAGER

Dashboard status when index exists and correct mapping

08_vulnerability_detection_with_index_data_MAPPING_ON_MANAGER

Vulnerabilities appSettings

image

image

Vulnerability index pattern check disabled

image

Test

Before remember to create the mapping of port 9200:9200 in osd1 in the dev.yml

  • When raising the environment for the first time. If the vulnerability index does not exist, a Warning should appear in the Health Check. But it should allow you to continue. When going to the vulnerabilities module, the visualizations will show an error because they do not have the index or the mapping.
  • Create the index (wazuh-states-vulnerabilities) in the manager and insert data (using script of comment). The health-check will correctly create the index pattern and pass the health-check, although the dashboard will not be seen completely.
  • Insert the corresponding mapping and see that the healthcheck passes correctly and the dashboard is shown complete (using dev-tools of comment). Refresh vulnerabilities index-pattern then.
  • Disable the vulnerability index pattern check in appSettings. In the health-check it should appear as disabled, but it should allow you to continue

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 Nov 23, 2023
@jbiset jbiset requested a review from a team as a code owner November 23, 2023 14:39
@jbiset jbiset linked an issue Nov 23, 2023 that may be closed by this pull request
2 tasks
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: ✔️

Screenshots

With no index pattern present

image

Index pattern created when the index exists

Screenshot from 2023-11-23 16-20-52

image

With index, index pattern and template

image

Vulnerabilities configuration

image

image

Copy link
Member

@Machi3mfl Machi3mfl 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: 🟢

Screenshot 2023-11-23 at 15 32 25 Screenshot 2023-11-23 at 15 33 49 Screenshot 2023-11-23 at 15 36 17 Screenshot 2023-11-23 at 15 37 19 Screenshot 2023-11-23 at 15 40 46 Screenshot 2023-11-23 at 15 41 13 Screenshot 2023-11-23 at 15 42 07

Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 21.38% ( 185 / 865 )
Branches 18.07% ( 79 / 437 )
Functions 14.22% ( 36 / 253 )
Lines 21.61% ( 182 / 842 )

Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.95% ( 167 / 217 )
Branches 54.63% ( 53 / 97 )
Functions 60.86% ( 28 / 46 )
Lines 76.95% ( 167 / 217 )

Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 12.01% ( 4137 / 34438 )
Branches 8.16% ( 1890 / 23158 )
Functions 11.39% ( 934 / 8197 )
Lines 12.18% ( 4026 / 33032 )

@Machi3mfl Machi3mfl merged commit e391616 into 4.8.0 Nov 23, 2023
4 checks passed
@Machi3mfl Machi3mfl deleted the add-health-check-and-configuration-vulnerabilities-index-pattern branch November 23, 2023 18:58
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.

Add vulnerabilities index patter validation to health-check
3 participants