From b29927c47d47ce6a1394f2167954f18de3963d7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Fri, 14 Apr 2023 12:04:53 +0200 Subject: [PATCH 1/3] fix: fix the GitHub and Office 365 module visibility when changing the plugin - Add the extensions.github and extensions.office to the plugin configuration file - Enhance tests related to the extension configuration when changing the plugin --- common/constants.ts | 48 +++++++++++++++++++++++++++ server/start/initialize/index.test.ts | 4 +-- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/common/constants.ts b/common/constants.ts index 6832a172be..08f4b87662 100644 --- a/common/constants.ts +++ b/common/constants.ts @@ -1355,6 +1355,30 @@ export const PLUGIN_SETTINGS: { [key: string]: TPluginSetting } = { return schema.boolean(); }, }, + "extensions.github": { + title: "GitHub", + description: "Enable or disable the GitHub tab on Overview and Agents.", + category: SettingCategory.EXTENSIONS, + type: EpluginSettingType.switch, + defaultValue: false, + isConfigurableFromFile: true, + isConfigurableFromUI: false, + options: { + switch: { + values: { + disabled: { label: 'false', value: false }, + enabled: { label: 'true', value: true }, + } + } + }, + uiFormTransformChangedInputValue: function (value: boolean | string): boolean { + return Boolean(value); + }, + validate: SettingsValidator.isBoolean, + validateBackend: function(schema){ + return schema.boolean(); + }, + }, "extensions.hipaa": { title: "Hipaa", description: "Enable or disable the HIPAA tab on Overview and Agents.", @@ -1403,6 +1427,30 @@ export const PLUGIN_SETTINGS: { [key: string]: TPluginSetting } = { return schema.boolean(); }, }, + "extensions.office": { + title: "Office 365", + description: "Enable or disable the Office 365 tab on Overview and Agents.", + category: SettingCategory.EXTENSIONS, + type: EpluginSettingType.switch, + defaultValue: false, + isConfigurableFromFile: true, + isConfigurableFromUI: false, + options: { + switch: { + values: { + disabled: { label: 'false', value: false }, + enabled: { label: 'true', value: true }, + } + } + }, + uiFormTransformChangedInputValue: function (value: boolean | string): boolean { + return Boolean(value); + }, + validate: SettingsValidator.isBoolean, + validateBackend: function(schema){ + return schema.boolean(); + }, + }, "extensions.oscap": { title: "OSCAP", description: "Enable or disable the Open SCAP tab on Overview and Agents.", diff --git a/server/start/initialize/index.test.ts b/server/start/initialize/index.test.ts index 96c776281d..92ab1ee0b2 100644 --- a/server/start/initialize/index.test.ts +++ b/server/start/initialize/index.test.ts @@ -338,9 +338,7 @@ describe("[initialize] `wazuh-registry.json` created", () => { if ( Object.keys(contentRegistryFile.hosts).length ){ Object.entries(contentRegistryFile.hosts).forEach(([hostID, hostData]) => { if(hostData.extensions){ - Object.entries(hostData.extensions).forEach(([extensionID, extensionEnabled]) => { - expect(extensionEnabled).toBe(contentRegistryExpected.hosts[hostID].extensions[extensionID]) - }); + expect(hostData.extensions).toEqual(contentRegistryExpected.hosts[hostID].extensions); }; }); }; From a8ac719a5dc9dd41db3c68fbe664e1bcedfaf27a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Fri, 14 Apr 2023 12:07:22 +0200 Subject: [PATCH 2/3] fix: typos --- common/constants.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/constants.ts b/common/constants.ts index 08f4b87662..86d3e8f258 100644 --- a/common/constants.ts +++ b/common/constants.ts @@ -502,7 +502,7 @@ export const PLUGIN_SETTINGS_CATEGORIES: { [category: number]: TPluginSettingCat }, [SettingCategory.STATISTICS]: { title: 'Task:Statistics', - description: "Options related to the daemons manager monitoring job and their storage in indexes..", + description: "Options related to the daemons manager monitoring job and their storage in indexes.", renderOrder: SettingCategory.STATISTICS, }, [SettingCategory.CUSTOMIZATION]: { @@ -1380,7 +1380,7 @@ export const PLUGIN_SETTINGS: { [key: string]: TPluginSetting } = { }, }, "extensions.hipaa": { - title: "Hipaa", + title: "HIPAA", description: "Enable or disable the HIPAA tab on Overview and Agents.", category: SettingCategory.EXTENSIONS, type: EpluginSettingType.switch, From 20dcd6b1c6b2996208440bd768b223a2db24377f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Fri, 14 Apr 2023 12:36:58 +0200 Subject: [PATCH 3/3] changelog: add pull request entries --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7883079c01..aee7e94123 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to the Wazuh app project will be documented in this file. - Added rel="noopener noreferrer" in documentation links. [#5197](https://github.com/wazuh/wazuh-kibana-app/pull/5197) [#5274](https://github.com/wazuh/wazuh-kibana-app/pull/5274) [#5298](https://github.com/wazuh/wazuh-kibana-app/pull/5298) - Added `ignore` and `restrict` options to Syslog configuration. [#5203](https://github.com/wazuh/wazuh-kibana-app/pull/5203) +- Added the `extensions.github` and `extensions.office` settings to the default configuration file [#5376](https://github.com/wazuh/wazuh-kibana-app/pull/5376) ### Changed @@ -22,6 +23,8 @@ All notable changes to the Wazuh app project will be documented in this file. - Handling endpoint response was done when there is no data to show [#4918](https://github.com/wazuh/wazuh-kibana-app/pull/4918) - Fixed references to Elasticsearch in Wazuh-stack plugin [4894](https://github.com/wazuh/wazuh-kibana-app/pull/4894) - Fixed the 2 errors that appeared in console in Settings>Configuration section. [#5135](https://github.com/wazuh/wazuh-kibana-app/pull/5135) +- Fixed the GitHub and Office 365 module visibility configuration for each API host was not kept when changing/upgrading the plugin [#5376](https://github.com/wazuh/wazuh-kibana-app/pull/5376) +- Fixed the GitHub and Office 365 modules appear in the main menu when they were not configured [#5376](https://github.com/wazuh/wazuh-kibana-app/pull/5376) ## Wazuh v4.4.1 - OpenSearch Dashboards 2.6.0 - Revision 01