From 098f805304c1195cb995c491a62434fa6011fc55 Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Wed, 8 May 2024 11:38:38 +0200 Subject: [PATCH] Change filter field to wazuh.cluster.name --- plugins/main/common/constants.ts | 5 +---- .../public/components/common/modules/modules-helper.js | 4 +--- .../common/vulnerability_detector_adapters.tsx | 9 ++------- plugins/main/public/services/common-data.js | 4 +--- 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/plugins/main/common/constants.ts b/plugins/main/common/constants.ts index 602cf12c44..6f2f45c4dc 100644 --- a/plugins/main/common/constants.ts +++ b/plugins/main/common/constants.ts @@ -51,10 +51,7 @@ export const WAZUH_STATISTICS_DEFAULT_CRON_FREQ = '0 */5 * * * *'; // Wazuh vulnerabilities export const WAZUH_VULNERABILITIES_PATTERN = 'wazuh-states-vulnerabilities-*'; export const WAZUH_INDEX_TYPE_VULNERABILITIES = 'vulnerabilities'; -export const VULNERABILITY_IMPLICIT_CLUSTER_MODE_FILTER = { - enabled: 'wazuh.cluster.name', - disabled: 'wazuh.manager.name', -}; +export const VULNERABILITY_IMPLICIT_CLUSTER_MODE_FILTER = 'wazuh.cluster.name'; // Job - Wazuh initialize export const WAZUH_PLUGIN_PLATFORM_TEMPLATE_NAME = 'wazuh-kibana'; diff --git a/plugins/main/public/components/common/modules/modules-helper.js b/plugins/main/public/components/common/modules/modules-helper.js index 0443f4a40b..ef20ae2253 100644 --- a/plugins/main/public/components/common/modules/modules-helper.js +++ b/plugins/main/public/components/common/modules/modules-helper.js @@ -165,9 +165,7 @@ If this case happens, the implicit filters are regenerated and the function is c ? AppState.getClusterInfo().cluster : AppState.getClusterInfo().manager, isCluster, - VULNERABILITY_IMPLICIT_CLUSTER_MODE_FILTER[ - AppState.getClusterInfo().status - ], + VULNERABILITY_IMPLICIT_CLUSTER_MODE_FILTER, ), ); filters.push(filterHandler.pciQuery()); diff --git a/plugins/main/public/components/overview/vulnerabilities/common/vulnerability_detector_adapters.tsx b/plugins/main/public/components/overview/vulnerabilities/common/vulnerability_detector_adapters.tsx index b605aff9c4..58687502c5 100644 --- a/plugins/main/public/components/overview/vulnerabilities/common/vulnerability_detector_adapters.tsx +++ b/plugins/main/public/components/overview/vulnerabilities/common/vulnerability_detector_adapters.tsx @@ -46,9 +46,7 @@ export const vulnerabilityIndexFiltersAdapter = ( ? AppState.getClusterInfo().cluster : AppState.getClusterInfo().manager, true, - VULNERABILITY_IMPLICIT_CLUSTER_MODE_FILTER[ - AppState.getClusterInfo().status - ], + VULNERABILITY_IMPLICIT_CLUSTER_MODE_FILTER, ); // rule.groups is added so that the events tab can use it @@ -103,10 +101,7 @@ export const restorePrevIndexFiltersAdapter = ( defaultIndexPatternID, ).filter( (filter: Filter) => - filter?.meta?.key !== - VULNERABILITY_IMPLICIT_CLUSTER_MODE_FILTER[ - AppState.getClusterInfo().status - ], + filter?.meta?.key !== VULNERABILITY_IMPLICIT_CLUSTER_MODE_FILTER, ); /* Restore original manager implicit filter */ const managerFilter = filterHandler.managerQuery( diff --git a/plugins/main/public/services/common-data.js b/plugins/main/public/services/common-data.js index bd5d18d0f4..204e39f963 100644 --- a/plugins/main/public/services/common-data.js +++ b/plugins/main/public/services/common-data.js @@ -160,9 +160,7 @@ export class CommonData { : AppState.getClusterInfo().manager, isCluster, tab === 'vuls' - ? VULNERABILITY_IMPLICIT_CLUSTER_MODE_FILTER[ - AppState.getClusterInfo().status - ] + ? VULNERABILITY_IMPLICIT_CLUSTER_MODE_FILTER : undefined, ), );