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

Migrate wazuh.yml configuration to opensearch_dashboards.yml #7175

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

Machi3mfl
Copy link
Member

@Machi3mfl Machi3mfl commented Nov 25, 2024

Description

This PR move the location of the wazuh.yml to opensearch_dashboards.yml

Closes wazuh/wazuh-dashboard#339

Test

Check the Dashboard Management > Advanced settings validations

Field Type Validations Chrome Firefox Safari 
alerts.sample.prefix EpluginSettingType.text - String
- notEmpty
- noSpaces
- noStartsWith('-', '_', '+', '.')
- noInvalidCharacters('\', '/', '?', '"', '<', '>', '#', '*')
configuration.ui_api_editable EpluginSettingType.switch - Boolean
cron.prefix EpluginSettingType.text - String
- notEmpty
- noSpaces
- noStartsWith('-', '_', '+', '.')
- noInvalidCharacters('\', '/', '?', '"', '<', '>','#', '*')
customization.enabled EpluginSettingType.switch - Boolean
enrollment.dns EpluginSettingType.text - String
- serverAddressHostnameFQDNIPv4IPv6
enrollment.password EpluginSettingType.text - String
hideManagerAlerts EpluginSettingType.switch - Boolean
ip.ignore EpluginSettingType.editor - Array of:
- String
- notEmpty
- noSpaces
- noLiteralString('.', '..')
- noStartsWith('-', '_', '+', '.')
- noInvalidCharacters('\', '/', '?', '"', '<', '>', '#')
ip.selector EpluginSettingType.switch - Boolean
wazuh.updates.disabled EpluginSettingType.switch - Boolean
pattern EpluginSettingType.text - String
- notEmpty
- noSpaces
- noLiteralString('.', '..')
- noStartsWith('-', '_', '+', '.')
- noInvalidCharacters('\', '/', '?', '"', '<', '>', '#')
timeout EpluginSettingType.number - Number (min: 1500, integer)
vulnerabilities.pattern EpluginSettingType.text - String
- notEmpty
- noSpaces
- noLiteralString('.', '..')
- noStartsWith('-', '_', '+', '.')
- noInvalidCharacters('\', '/', '?', '"', '<', '>', ',', '#')

Check the opensearch_dashboards.yml validations

Field Type Validations Chrome Firefox Safari 
hosts EpluginSettingType.objectOf url:
- String
- notEmpty
port:
- Number (0-65535)
username:
- String
- notEmpty
password:
- String
- notEmpty
run_as:
- Boolean

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

@Machi3mfl Machi3mfl marked this pull request as ready for review December 20, 2024 19:27
@JuanGarriuz
Copy link
Member

JuanGarriuz commented Dec 23, 2024

Pre-test

Something is going wrong with the environment loading.

Grabacion.2024-12-02.123459.mp4

Change URL manually to app/management/opensearch-dashboards/settings

Test

Check the Dashboard Management > Advanced settings validations

Field Type Validations Chrome Firefox Safari 
alerts.sample.prefix EpluginSettingType.text - String
- notEmpty
- noSpaces
- noStartsWith('-', '_', '+', '.')
- noInvalidCharacters('\', '/', '?', '"', '<', '>', '#', '*')
🟢
configuration.ui_api_editable EpluginSettingType.switch - Boolean 🟢
cron.prefix EpluginSettingType.text - String
- notEmpty
- noSpaces
- noStartsWith('-', '_', '+', '.')
- noInvalidCharacters('\', '/', '?', '"', '<', '>','#', '*')
🟢
customization.enabled EpluginSettingType.switch - Boolean 🟢
enrollment.dns EpluginSettingType.text - String
- serverAddressHostnameFQDNIPv4IPv6
enrollment.password EpluginSettingType.text - String 🟢
hideManagerAlerts EpluginSettingType.switch - Boolean 🟢
ip.ignore EpluginSettingType.editor - Array of:
- String
- notEmpty
- noSpaces
- noLiteralString('.', '..')
- noStartsWith('-', '_', '+', '.')
- noInvalidCharacters('\', '/', '?', '"', '<', '>', '#')
🟢
ip.selector EpluginSettingType.switch - Boolean 🟢
wazuh.updates.disabled EpluginSettingType.switch - Boolean
pattern EpluginSettingType.text - String
- notEmpty
- noSpaces
- noLiteralString('.', '..')
- noStartsWith('-', '_', '+', '.')
- noInvalidCharacters('\', '/', '?', '"', '<', '>', '#')
🟢
timeout EpluginSettingType.number - Number (min: 1500, integer) 🟢
vulnerabilities.pattern EpluginSettingType.text - String
- notEmpty
- noSpaces
- noLiteralString('.', '..')
- noStartsWith('-', '_', '+', '.')
- noInvalidCharacters('\', '/', '?', '"', '<', '>', ',', '#')
🟢

Check the opensearch_dashboards.yml validations

Testing error message from

image

image

image

image

image

image

image

image

image

image

image

image

image

FireShot Capture 009 - Wazuh - localhost

chantal-kelm
chantal-kelm previously approved these changes Dec 23, 2024
Copy link
Member

@chantal-kelm chantal-kelm 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: ✅

Captura de pantalla 2024-12-23 a la(s) 11 41 11 a  m Captura de pantalla 2024-12-23 a la(s) 11 40 56 a  m Captura de pantalla 2024-12-23 a la(s) 11 40 45 a  m Captura de pantalla 2024-12-23 a la(s) 11 39 57 a  m Captura de pantalla 2024-12-23 a la(s) 11 39 35 a  m Captura de pantalla 2024-12-23 a la(s) 11 39 22 a  m Captura de pantalla 2024-12-23 a la(s) 11 39 09 a  m Captura de pantalla 2024-12-23 a la(s) 11 38 22 a  m Captura de pantalla 2024-12-23 a la(s) 11 38 06 a  m

JuanGarriuz
JuanGarriuz previously approved these changes Dec 23, 2024
Copy link
Member

@JuanGarriuz JuanGarriuz left a comment

Choose a reason for hiding this comment

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

LGTM!!

@Machi3mfl Machi3mfl dismissed stale reviews from JuanGarriuz and chantal-kelm via 3d754b2 December 23, 2024 20:00
chantal-kelm
chantal-kelm previously approved these changes Dec 23, 2024
Copy link
Member

@chantal-kelm chantal-kelm 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: ✅

Captura de pantalla 2024-12-23 a la(s) 6 00 58 p  m Captura de pantalla 2024-12-23 a la(s) 6 00 45 p  m Captura de pantalla 2024-12-23 a la(s) 6 00 28 p  m Captura de pantalla 2024-12-23 a la(s) 6 00 03 p  m Captura de pantalla 2024-12-23 a la(s) 5 59 44 p  m Captura de pantalla 2024-12-23 a la(s) 5 59 24 p  m Captura de pantalla 2024-12-23 a la(s) 5 59 00 p  m Captura de pantalla 2024-12-23 a la(s) 5 57 05 p  m Captura de pantalla 2024-12-23 a la(s) 5 56 23 p  m

JuanGarriuz
JuanGarriuz previously approved these changes Dec 24, 2024
chantal-kelm
chantal-kelm previously approved these changes Dec 24, 2024
Copy link
Member

@chantal-kelm chantal-kelm 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: ✅

Captura de pantalla 2024-12-24 a la(s) 11 30 16 a  m Captura de pantalla 2024-12-24 a la(s) 11 30 01 a  m Captura de pantalla 2024-12-24 a la(s) 11 29 44 a  m Captura de pantalla 2024-12-24 a la(s) 11 29 09 a  m Captura de pantalla 2024-12-24 a la(s) 11 28 39 a  m Captura de pantalla 2024-12-24 a la(s) 11 28 02 a  m Captura de pantalla 2024-12-24 a la(s) 11 27 46 a  m Captura de pantalla 2024-12-24 a la(s) 11 27 30 a  m Captura de pantalla 2024-12-24 a la(s) 11 27 12 a  m

@yenienserrano yenienserrano removed their request for review December 26, 2024 12:42
@Machi3mfl Machi3mfl dismissed stale reviews from chantal-kelm and JuanGarriuz via 0b38816 December 26, 2024 17:40
Copy link
Contributor

Wazuh Engine plugin code coverage (Jest) test % values
Statements 8.63% ( 64 / 741 )
Branches 7.94% ( 22 / 277 )
Functions 1.87% ( 7 / 373 )
Lines 9.1% ( 64 / 703 )

Copy link
Contributor

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

Copy link
Contributor

Wazuh Fleet plugin code coverage (Jest) test % values
Statements 4.68% ( 9 / 192 )
Branches 16.66% ( 7 / 42 )
Functions 1.11% ( 1 / 90 )
Lines 4.76% ( 9 / 189 )

Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 30.38% ( 621 / 2044 )
Branches 30.19% ( 333 / 1103 )
Functions 27.53% ( 155 / 563 )
Lines 30.52% ( 616 / 2018 )

Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 13.5% ( 4027 / 29825 )
Branches 9.02% ( 1749 / 19389 )
Functions 13.01% ( 943 / 7245 )
Lines 13.67% ( 3925 / 28708 )

@guidomodarelli
Copy link
Contributor

guidomodarelli commented Dec 26, 2024

Test

Check the Dashboard Management > Advanced settings validations

Field Type Validations Chrome Firefox Safari 
alerts.sample.prefix EpluginSettingType.text - String
- notEmpty
- noSpaces
- noStartsWith('-', '_', '+', '.')
- noInvalidCharacters('\', '/', '?', '"', '<', '>', '#', '*')
🟢
configuration.ui_api_editable EpluginSettingType.switch - Boolean 🟢
cron.prefix EpluginSettingType.text - String
- notEmpty
- noSpaces
- noStartsWith('-', '_', '+', '.')
- noInvalidCharacters('\', '/', '?', '"', '<', '>','#', '*')
🟢
customization.enabled EpluginSettingType.switch - Boolean 🟢
enrollment.dns EpluginSettingType.text - String
- serverAddressHostnameFQDNIPv4IPv6
🟢
enrollment.password EpluginSettingType.text - String 🟢
hideManagerAlerts EpluginSettingType.switch - Boolean 🟢
ip.ignore EpluginSettingType.editor - Array of:
- String
- notEmpty
- noSpaces
- noLiteralString('.', '..')
- noStartsWith('-', '_', '+', '.')
- noInvalidCharacters('\', '/', '?', '"', '<', '>', '#')
🟢
ip.selector EpluginSettingType.switch - Boolean 🟢
wazuh.updates.disabled EpluginSettingType.switch - Boolean 🟢
pattern EpluginSettingType.text - String
- notEmpty
- noSpaces
- noLiteralString('.', '..')
- noStartsWith('-', '_', '+', '.')
- noInvalidCharacters('\', '/', '?', '"', '<', '>', '#')
🟢
timeout EpluginSettingType.number - Number (min: 1500, integer) 🟢
vulnerabilities.pattern EpluginSettingType.text - String
- notEmpty
- noSpaces
- noLiteralString('.', '..')
- noStartsWith('-', '_', '+', '.')
- noInvalidCharacters('\', '/', '?', '"', '<', '>', ',', '#')
🟢

Check the opensearch_dashboards.yml validations

Field Type Validations Chrome Firefox Safari 
hosts EpluginSettingType.objectOf url:
- String
- notEmpty
port:
- Number (0-65535)
username:
- String
- notEmpty
password:
- String
- notEmpty
run_as:
- Boolean
🔴
alerts.sample.prefix 🟢

notEmpty

image

noSpaces

image

noStartsWith('-', '_', '+', '.')

image

noInvalidCharacters('\', '/', '?', '"', '<', '>', '#', '*')

image

configuration.ui_api_editable 🟢

image

cron.prefix 🟢

notEmpty

image

noSpaces

image

noStartsWith('-', '_', '+', '.')

image

noInvalidCharacters('\', '/', '?', '"', '<', '>', '#', '*')

image

customization.enabled 🟢

image

enrollment.dns 🟢
enrollment.password 🟢

image

hideManagerAlerts 🟢

image

ip.ignore 🟢

Array of

image

ip.selector 🟢

image

wazuh.updates.disabled 🟢

image

pattern 🟢

image

timeout 🟢

image

vulnerabilities.pattern 🟢

image

opensearch_dashboards.yml » hosts 🔴

url: String 🟢

image

url: notEmpty 🟢

image

port: -1 🔴

image

image

port: 65536 🔴

image

image

port: Number 🟢

image

username: String 🟢

image

username: notEmpty 🟢

image

password: String 🟢

image

password: notEmpty 🟢

image

run_as: Boolean 🟢

image

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.

Migrate wazuh.yml configuration to opensearch_dashboard.yml
4 participants