Skip to content

Commit

Permalink
Change filter field to wazuh.cluster.name
Browse files Browse the repository at this point in the history
  • Loading branch information
asteriscos committed May 8, 2024
1 parent 8c567f5 commit 098f805
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
5 changes: 1 addition & 4 deletions plugins/main/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 1 addition & 3 deletions plugins/main/public/services/common-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
);
Expand Down

0 comments on commit 098f805

Please sign in to comment.