From ff83888df68e86d2c6440112797abbaa88dde1ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Wed, 13 Mar 2024 15:04:21 +0100 Subject: [PATCH 01/15] feat(GDPR): replace the dashboard on GDPR application --- .../common/modules/modules-defaults.js | 18 +- .../common/components/loading_spinner.scss | 4 + .../common/components/loading_spinner.tsx | 21 + .../gdpr/common/components/no_results.tsx | 60 ++ .../overview/gdpr/dashboards/dashboard.tsx | 136 +++ .../gdpr/dashboards/dashboard_panels.ts | 997 ++++++++++++++++++ .../overview/gdpr/dashboards/index.tsx | 1 + .../overview/gdpr/dashboards/styles.scss | 10 + 8 files changed, 1246 insertions(+), 1 deletion(-) create mode 100644 plugins/main/public/components/overview/gdpr/common/components/loading_spinner.scss create mode 100644 plugins/main/public/components/overview/gdpr/common/components/loading_spinner.tsx create mode 100644 plugins/main/public/components/overview/gdpr/common/components/no_results.tsx create mode 100644 plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx create mode 100644 plugins/main/public/components/overview/gdpr/dashboards/dashboard_panels.ts create mode 100644 plugins/main/public/components/overview/gdpr/dashboards/index.tsx create mode 100644 plugins/main/public/components/overview/gdpr/dashboards/styles.scss diff --git a/plugins/main/public/components/common/modules/modules-defaults.js b/plugins/main/public/components/common/modules/modules-defaults.js index 7b1705b0e4..ade8a7d2df 100644 --- a/plugins/main/public/components/common/modules/modules-defaults.js +++ b/plugins/main/public/components/common/modules/modules-defaults.js @@ -43,6 +43,7 @@ import { virustotalColumns } from '../../overview/virustotal/events/virustotal-c import { malwareDetectionColumns } from '../../overview/malware-detection/events/malware-detection-columns'; import { WAZUH_VULNERABILITIES_PATTERN } from '../../../../common/constants'; import { withVulnerabilitiesStateDataSource } from '../../overview/vulnerabilities/common/hocs/validate-vulnerabilities-states-index-pattern'; +import { DashboardGDPR } from '../../overview/gdpr/dashboards/dashboard'; const DashboardTab = { id: 'dashboard', @@ -285,7 +286,22 @@ export const ModulesDefaults = { }, gdpr: { init: 'dashboard', - tabs: RegulatoryComplianceTabs(gdprColumns), + tabs: [ + DashboardTab, + { + id: 'dashboard2', + name: 'Dashboard', + buttons: [ButtonModuleExploreAgent, ButtonModuleGenerateReport], + component: DashboardGDPR || withPinnedAgent(DashboardGDPR), // TODO: use withPinnedAgent + }, + { + id: 'inventory', + name: 'Controls', + buttons: [ButtonModuleExploreAgent], + component: ComplianceTable, + }, + renderDiscoverTab(DEFAULT_INDEX_PATTERN, gdprColumns), + ], availableFor: ['manager', 'agent'], }, tsc: { diff --git a/plugins/main/public/components/overview/gdpr/common/components/loading_spinner.scss b/plugins/main/public/components/overview/gdpr/common/components/loading_spinner.scss new file mode 100644 index 0000000000..051ab642c1 --- /dev/null +++ b/plugins/main/public/components/overview/gdpr/common/components/loading_spinner.scss @@ -0,0 +1,4 @@ +.discoverNoResults { + display: flex; + align-items: center; +} diff --git a/plugins/main/public/components/overview/gdpr/common/components/loading_spinner.tsx b/plugins/main/public/components/overview/gdpr/common/components/loading_spinner.tsx new file mode 100644 index 0000000000..7f505e6167 --- /dev/null +++ b/plugins/main/public/components/overview/gdpr/common/components/loading_spinner.tsx @@ -0,0 +1,21 @@ +import './loading_spinner.scss'; +import React from 'react'; +import { EuiTitle, EuiPanel, EuiEmptyPrompt, EuiLoadingSpinner } from '@elastic/eui'; +import { FormattedMessage } from '@osd/i18n/react'; + +export function LoadingSpinner() { + return ( + + } + title={ + +

+ +

+
+ } + /> +
+ ); +} diff --git a/plugins/main/public/components/overview/gdpr/common/components/no_results.tsx b/plugins/main/public/components/overview/gdpr/common/components/no_results.tsx new file mode 100644 index 0000000000..babfd51d32 --- /dev/null +++ b/plugins/main/public/components/overview/gdpr/common/components/no_results.tsx @@ -0,0 +1,60 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Any modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import React from 'react'; +import { FormattedMessage, I18nProvider } from '@osd/i18n/react'; + +import { EuiCallOut, EuiPanel } from '@elastic/eui'; + +interface Props { + message?: string; +} + +export const DiscoverNoResults = ({ message }: Props) => { + return ( + + + + ) + } + color='warning' + iconType='help' + data-test-subj='discoverNoResults' + /> + + + ); +}; diff --git a/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx new file mode 100644 index 0000000000..22c36f4677 --- /dev/null +++ b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx @@ -0,0 +1,136 @@ +import React, { useState, useEffect } from 'react'; +import { SearchResponse } from '../../../../../../../src/core/server'; +import { getPlugins } from '../../../../kibana-services'; +import { ViewMode } from '../../../../../../../src/plugins/embeddable/public'; +import { getDashboardPanels } from './dashboard_panels'; +import { I18nProvider } from '@osd/i18n/react'; +import useSearchBar from '../../../common/search-bar/use-search-bar'; +import './styles.scss'; +import { withErrorBoundary } from '../../../common/hocs'; +import { DiscoverNoResults } from '../common/components/no_results'; +import { LoadingSpinner } from '../common/components/loading_spinner'; +import { search } from '../../../common/search-bar/search-bar-service'; +import { IndexPattern } from '../../../../../../../src/plugins/data/common'; +import { + ErrorFactory, + ErrorHandler, + HttpError, +} from '../../../../react-services/error-management'; +import { compose } from 'redux'; +import { DashboardContainerInput } from '../../../../../../../src/plugins/dashboard/public'; +import { SampleDataWarning } from '../../../visualize/components'; + +const plugins = getPlugins(); + +const SearchBar = getPlugins().data.ui.SearchBar; + +const DashboardByRenderer = plugins.dashboard.DashboardContainerByValueRenderer; + +/* The vulnerabilities dashboard is made up of 3 dashboards because the filters need +a wrapper for visual adjustments, while the Kpi, the Open vs Close visualization and +the rest of the visualizations have different configurations at the dashboard level. */ + +const DashboardGDPRComponent: React.FC = ({ pinnedAgent }) => { + const ALERTS_INDEX_PATTERN_ID = 'wazuh-alerts-*'; // TODO: use the data source + const { searchBarProps } = useSearchBar({ + defaultIndexPatternID: ALERTS_INDEX_PATTERN_ID, + onMount: () => {}, // TODO: use data source + onUpdate: () => {}, // TODO: use data source + onUnMount: () => {}, // TODO: use data source + }); + + /* This function is responsible for updating the storage filters so that the + filters between dashboard and inventory added using visualizations call to actions. + Without this feature, filters added using visualizations call to actions are + not maintained between dashboard and inventory tabs */ + const handleFilterByVisualization = (newInput: DashboardContainerInput) => { + return; // TODO: adapt to the data source + updateFiltersStorage(newInput.filters); + }; + + // TODO: add the hidden filters: allowed agents and hideManagerAlerts + const fetchFilters = searchBarProps.filters; + + const { isLoading, query, indexPatterns } = searchBarProps; + + const [isSearching, setIsSearching] = useState(false); + const [results, setResults] = useState({} as SearchResponse); + + useEffect(() => { + if (!isLoading) { + search({ + indexPattern: indexPatterns?.[0] as IndexPattern, + filters: fetchFilters, + query, + }) + .then(results => { + setResults(results); + setIsSearching(false); + }) + .catch(error => { + const searchError = ErrorFactory.create(HttpError, { + error, + message: 'Error fetching vulnerabilities', + }); + ErrorHandler.handleError(searchError); + setIsSearching(false); + }); + } + }, [JSON.stringify(searchBarProps), JSON.stringify(fetchFilters)]); + + return ( + <> + + <> + {isLoading ? : null} + {!isLoading ? ( + + ) : null} + + {isSearching ? : null} + {!isLoading && !isSearching && results?.hits?.total === 0 ? ( + + ) : null} + {!isLoading && !isSearching && results?.hits?.total > 0 ? ( +
+ +
+ ) : null} + +
+ + ); +}; + +export const DashboardGDPR = compose(withErrorBoundary)(DashboardGDPRComponent); diff --git a/plugins/main/public/components/overview/gdpr/dashboards/dashboard_panels.ts b/plugins/main/public/components/overview/gdpr/dashboards/dashboard_panels.ts new file mode 100644 index 0000000000..35c7dded9c --- /dev/null +++ b/plugins/main/public/components/overview/gdpr/dashboards/dashboard_panels.ts @@ -0,0 +1,997 @@ +import { DashboardPanelState } from '../../../../../../../src/plugins/dashboard/public/application'; +import { EmbeddableInput } from '../../../../../../../src/plugins/embeddable/public'; + +// Visualization ID: Wazuh-App-Overview-GDPR-Agents +const getVisStateTopAgentsByAlertsCount = (indexPatternId: string) => { + return { + title: 'Top 10 agents by alerts number', + type: 'pie', + params: { + type: 'pie', + addTooltip: true, + addLegend: true, + legendPosition: 'right', + isDonut: true, + }, + uiState: {}, + data: { + searchSource: { + query: { + language: 'kuery', + query: '', + }, + filter: [], + index: indexPatternId, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: indexPatternId, + }, + ], + aggs: [ + { + id: '1', + enabled: true, + type: 'count', + schema: 'metric', + params: {}, + }, + { + id: '2', + enabled: true, + type: 'terms', + schema: 'segment', + params: { + field: 'agent.name', + size: 10, + order: 'desc', + orderBy: '1', + }, + }, + ], + }, + }; +}; + +// Visualization ID: Wazuh-App-Overview-GDPR-requirements +const getVisStateRequirements = (indexPatternId: string) => { + return { + title: 'GDPR requirements', + type: 'line', + params: { + type: 'line', + grid: { categoryLines: true, valueAxis: 'ValueAxis-1' }, + categoryAxes: [ + { + id: 'CategoryAxis-1', + type: 'category', + position: 'bottom', + show: true, + style: {}, + scale: { type: 'linear' }, + labels: { show: true, filter: true, truncate: 100 }, + title: {}, + }, + ], + valueAxes: [ + { + id: 'ValueAxis-1', + name: 'LeftAxis-1', + type: 'value', + position: 'left', + show: true, + style: {}, + scale: { type: 'linear', mode: 'normal' }, + labels: { show: true, rotate: 0, filter: false, truncate: 100 }, + title: { text: 'Count' }, + }, + ], + seriesParams: [ + { + show: 'true', + type: 'line', + mode: 'normal', + data: { label: 'Count', id: '1' }, + valueAxis: 'ValueAxis-1', + drawLinesBetweenPoints: false, + showCircles: true, + }, + ], + addTooltip: true, + addLegend: true, + legendPosition: 'right', + times: [], + addTimeMarker: false, + dimensions: { + x: { + accessor: 0, + format: { id: 'date', params: { pattern: 'YYYY-MM-DD' } }, + params: { date: true, interval: 'P1D', format: 'YYYY-MM-DD' }, + aggType: 'date_histogram', + }, + y: [ + { + accessor: 2, + format: { id: 'number' }, + params: {}, + aggType: 'count', + }, + ], + z: [ + { + accessor: 3, + format: { id: 'number' }, + params: {}, + aggType: 'count', + }, + ], + series: [ + { + accessor: 1, + format: { + id: 'terms', + params: { + id: 'string', + otherBucketLabel: 'Other', + missingBucketLabel: 'Missing', + }, + }, + params: {}, + aggType: 'terms', + }, + ], + }, + radiusRatio: 50, + }, + uiState: { vis: { legendOpen: false } }, + data: { + searchSource: { + query: { + language: 'kuery', + query: '', + }, + filter: [], + index: indexPatternId, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: indexPatternId, + }, + ], + aggs: [ + { + id: '1', + enabled: true, + type: 'count', + schema: 'metric', + params: {}, + }, + { + id: '3', + enabled: true, + type: 'terms', + schema: 'group', + params: { + field: 'rule.gdpr', + orderBy: '1', + order: 'desc', + size: 10, + otherBucket: false, + otherBucketLabel: 'Other', + missingBucket: false, + missingBucketLabel: 'Missing', + }, + }, + { + id: '2', + enabled: true, + type: 'date_histogram', + schema: 'segment', + params: { + field: 'timestamp', + timeRange: { from: 'now-1h', to: 'now' }, + useNormalizedEsInterval: true, + interval: 'auto', + drop_partials: false, + min_doc_count: 1, + extended_bounds: {}, + }, + }, + { + id: '4', + enabled: true, + type: 'count', + schema: 'radius', + params: {}, + }, + ], + }, + }; +}; +// Visualization ID: Wazuh-App-Overview-GDPR-Requirements-heatmap +const getVisStateRequirementsOverTime = (indexPatternId: string) => { + return { + title: 'Top requirements over time', + type: 'area', + params: { + type: 'area', + grid: { + categoryLines: true, + style: { color: '#eee' }, + valueAxis: 'ValueAxis-1', + }, + categoryAxes: [ + { + id: 'CategoryAxis-1', + type: 'category', + position: 'bottom', + show: true, + style: {}, + scale: { type: 'linear' }, + labels: { show: true, filter: true, truncate: 100 }, + title: {}, + }, + ], + valueAxes: [ + { + id: 'ValueAxis-1', + name: 'LeftAxis-1', + type: 'value', + position: 'left', + show: true, + style: {}, + scale: { type: 'linear', mode: 'normal' }, + labels: { show: true, rotate: 0, filter: false, truncate: 100 }, + title: { text: 'Count' }, + }, + ], + seriesParams: [ + { + show: 'true', + type: 'area', + mode: 'stacked', + data: { label: 'Count', id: '1' }, + drawLinesBetweenPoints: true, + showCircles: true, + interpolate: 'cardinal', + valueAxis: 'ValueAxis-1', + }, + ], + addTooltip: true, + addLegend: true, + legendPosition: 'right', + times: [], + addTimeMarker: false, + }, + uiState: {}, + data: { + searchSource: { + query: { + language: 'kuery', + query: '', + }, + filter: [], + index: indexPatternId, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: indexPatternId, + }, + ], + aggs: [ + { + id: '1', + enabled: true, + type: 'count', + schema: 'metric', + params: {}, + }, + { + id: '3', + enabled: true, + type: 'terms', + schema: 'group', + params: { + field: 'rule.gdpr', + size: 5, + order: 'desc', + orderBy: '1', + otherBucket: false, + otherBucketLabel: 'Other', + missingBucket: false, + missingBucketLabel: 'Missing', + }, + }, + { + id: '2', + enabled: true, + type: 'date_histogram', + schema: 'segment', + params: { + field: 'timestamp', + timeRange: { from: 'now-24h', to: 'now', mode: 'quick' }, + useNormalizedEsInterval: true, + interval: 'auto', + time_zone: 'Europe/Berlin', + drop_partials: false, + customInterval: '2h', + min_doc_count: 1, + extended_bounds: {}, + }, + }, + ], + }, + }; +}; + +// Visualization ID: Wazuh-App-Overview-GDPR-Requirements-Agents-heatmap +const getVisStateRequirementsHeatmap = (indexPatternId: string) => { + return { + title: 'Last alerts', + type: 'heatmap', + params: { + type: 'heatmap', + addTooltip: true, + addLegend: true, + enableHover: false, + legendPosition: 'right', + times: [], + colorsNumber: 10, + colorSchema: 'Greens', + setColorRange: false, + colorsRange: [], + invertColors: false, + percentageMode: false, + valueAxes: [ + { + show: false, + id: 'ValueAxis-1', + type: 'value', + scale: { type: 'linear', defaultYExtents: false }, + labels: { + show: false, + rotate: 0, + overwriteColor: false, + color: '#555', + }, + }, + ], + }, + uiState: { + vis: { + defaultColors: { + '0 - 13': 'rgb(247,252,245)', + '13 - 26': 'rgb(233,247,228)', + '26 - 39': 'rgb(211,238,205)', + '39 - 52': 'rgb(184,227,177)', + '52 - 65': 'rgb(152,213,148)', + '65 - 78': 'rgb(116,196,118)', + '78 - 91': 'rgb(75,176,98)', + '91 - 104': 'rgb(47,152,79)', + '104 - 117': 'rgb(21,127,59)', + '117 - 130': 'rgb(0,100,40)', + }, + }, + }, + data: { + searchSource: { + query: { + language: 'kuery', + query: '', + }, + filter: [], + index: indexPatternId, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: indexPatternId, + }, + ], + aggs: [ + { + id: '1', + enabled: true, + type: 'count', + schema: 'metric', + params: {}, + }, + { + id: '2', + enabled: true, + type: 'terms', + schema: 'segment', + params: { + field: 'rule.gdpr', + size: 5, + order: 'desc', + orderBy: '1', + otherBucket: false, + otherBucketLabel: 'Other', + missingBucket: false, + missingBucketLabel: 'Missing', + customLabel: 'Requirements', + }, + }, + { + id: '3', + enabled: true, + type: 'terms', + schema: 'group', + params: { + field: 'agent.name', + size: 5, + order: 'desc', + orderBy: '1', + otherBucket: false, + otherBucketLabel: 'Other', + missingBucket: false, + missingBucketLabel: 'Missing', + customLabel: 'Agents', + }, + }, + ], + }, + }; +}; + +// Visualization ID: Wazuh-App-Overview-GDPR-Requirements-by-agent +const getVisStateRequirementsByAgent = (indexPatternId: string) => { + return { + title: 'Requirements by agent', + type: 'histogram', + params: { + type: 'histogram', + grid: { categoryLines: false, style: { color: '#eee' } }, + categoryAxes: [ + { + id: 'CategoryAxis-1', + type: 'category', + position: 'bottom', + show: true, + style: {}, + scale: { type: 'linear' }, + labels: { show: true, filter: true, truncate: 100, rotate: 0 }, + title: {}, + }, + ], + valueAxes: [ + { + id: 'ValueAxis-1', + name: 'LeftAxis-1', + type: 'value', + position: 'left', + show: true, + style: {}, + scale: { type: 'linear', mode: 'normal' }, + labels: { show: true, rotate: 0, filter: false, truncate: 100 }, + title: { text: 'Count' }, + }, + ], + seriesParams: [ + { + show: 'true', + type: 'histogram', + mode: 'stacked', + data: { label: 'Count', id: '1' }, + valueAxis: 'ValueAxis-1', + drawLinesBetweenPoints: true, + showCircles: true, + }, + ], + addTooltip: true, + addLegend: true, + legendPosition: 'right', + times: [], + addTimeMarker: false, + radiusRatio: 51, + }, + uiState: {}, + data: { + searchSource: { + query: { + language: 'kuery', + query: '', + }, + filter: [], + index: indexPatternId, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: indexPatternId, + }, + ], + aggs: [ + { + id: '1', + enabled: true, + type: 'count', + schema: 'metric', + params: {}, + }, + { + id: '2', + enabled: true, + type: 'terms', + schema: 'segment', + params: { + field: 'rule.gdpr', + size: 5, + order: 'desc', + orderBy: '1', + customLabel: 'GDPR Requirements', + }, + }, + { + id: '3', + enabled: true, + type: 'terms', + schema: 'group', + params: { + field: 'agent.name', + size: 5, + order: 'desc', + orderBy: '1', + }, + }, + ], + }, + }; +}; + +// Visualization ID: Wazuh-App-Agents-GDPR-Groups +const getVisStateTopRuleGroups = (indexPatternId: string) => { + return { + title: 'Top 5 rule groups', + type: 'pie', + params: { + type: 'pie', + addTooltip: true, + addLegend: true, + legendPosition: 'right', + isDonut: true, + }, + uiState: {}, + data: { + searchSource: { + query: { + language: 'kuery', + query: '', + }, + filter: [], + index: indexPatternId, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: indexPatternId, + }, + ], + aggs: [ + { id: '1', enabled: true, type: 'count', schema: 'metric', params: {} }, + { + id: '2', + enabled: true, + type: 'terms', + schema: 'segment', + params: { + field: 'rule.groups', + size: 5, + order: 'desc', + orderBy: '1', + }, + }, + ], + }, + }; +}; + +// Visualization ID: Wazuh-App-Agents-GDPR-Rule +const getVisStateTopRules = (indexPatternId: string) => { + return { + title: 'Top 5 rules', + type: 'pie', + params: { + type: 'pie', + addTooltip: true, + addLegend: true, + legendPosition: 'right', + isDonut: true, + }, + uiState: {}, + data: { + searchSource: { + query: { + language: 'kuery', + query: '', + }, + filter: [], + index: indexPatternId, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: indexPatternId, + }, + ], + aggs: [ + { id: '1', enabled: true, type: 'count', schema: 'metric', params: {} }, + { + id: '2', + enabled: true, + type: 'terms', + schema: 'segment', + params: { + field: 'rule.description', + size: 5, + order: 'desc', + orderBy: '1', + }, + }, + ], + }, + }; +}; + +// Visualization ID: Wazuh-App-Agents-GDPR-Requirement +const getVisStateAgentTopRequirements = (indexPatternId: string) => { + return { + title: 'Top 5 requirements', + type: 'pie', + params: { + type: 'pie', + addTooltip: true, + addLegend: true, + legendPosition: 'right', + isDonut: true, + }, + uiState: {}, + data: { + searchSource: { + query: { + language: 'kuery', + query: '', + }, + filter: [], + index: indexPatternId, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: indexPatternId, + }, + ], + aggs: [ + { id: '1', enabled: true, type: 'count', schema: 'metric', params: {} }, + { + id: '2', + enabled: true, + type: 'terms', + schema: 'segment', + params: { field: 'rule.gdpr', size: 5, order: 'desc', orderBy: '1' }, + }, + ], + }, + }; +}; + +// Visualization ID: Wazuh-App-Agents-GDPR-Requirements +const getVisStateAgentTopRequirementsCount = (indexPatternId: string) => { + return { + title: 'GDPR Requirements', + type: 'histogram', + params: { + type: 'histogram', + grid: { categoryLines: false, style: { color: '#eee' } }, + categoryAxes: [ + { + id: 'CategoryAxis-1', + type: 'category', + position: 'bottom', + show: true, + style: {}, + scale: { type: 'linear' }, + labels: { show: true, filter: true, truncate: 100, rotate: 0 }, + title: {}, + }, + ], + valueAxes: [ + { + id: 'ValueAxis-1', + name: 'LeftAxis-1', + type: 'value', + position: 'left', + show: true, + style: {}, + scale: { type: 'linear', mode: 'normal' }, + labels: { show: true, rotate: 0, filter: false, truncate: 100 }, + title: { text: 'Count' }, + }, + ], + seriesParams: [ + { + show: 'true', + type: 'histogram', + mode: 'stacked', + data: { label: 'Count', id: '1' }, + valueAxis: 'ValueAxis-1', + drawLinesBetweenPoints: true, + showCircles: true, + }, + ], + addTooltip: true, + addLegend: true, + legendPosition: 'right', + times: [], + addTimeMarker: false, + }, + uiState: {}, + data: { + searchSource: { + query: { + language: 'kuery', + query: '', + }, + filter: [], + index: indexPatternId, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: indexPatternId, + }, + ], + aggs: [ + { id: '1', enabled: true, type: 'count', schema: 'metric', params: {} }, + { + id: '3', + enabled: true, + type: 'terms', + schema: 'group', + params: { + field: 'rule.gdpr', + size: 5, + order: 'desc', + orderBy: '1', + customLabel: '', + }, + }, + { + id: '2', + enabled: true, + type: 'terms', + schema: 'segment', + params: { + field: 'rule.gdpr', + size: 10, + order: 'desc', + orderBy: '1', + customLabel: 'GDPR requirements', + }, + }, + ], + }, + }; +}; + +// Visualization ID: Wazuh-App-Agents-GDPR-Rule-level-distribution +const getVisStateAgentRuleLevelDistribution = (indexPatternId: string) => { + return { + title: 'Rule level distribution', + type: 'pie', + params: { + type: 'pie', + addTooltip: true, + addLegend: false, + legendPosition: 'right', + isDonut: true, + labels: { show: true, values: true, last_level: true, truncate: 100 }, + }, + uiState: { vis: { legendOpen: false } }, + data: { + searchSource: { + query: { + language: 'kuery', + query: '', + }, + filter: [], + index: indexPatternId, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: indexPatternId, + }, + ], + aggs: [ + { id: '1', enabled: true, type: 'count', schema: 'metric', params: {} }, + { + id: '2', + enabled: true, + type: 'terms', + schema: 'segment', + params: { + field: 'rule.level', + size: 15, + order: 'desc', + orderBy: '1', + otherBucket: false, + otherBucketLabel: 'Other', + missingBucket: false, + missingBucketLabel: 'Missing', + }, + }, + ], + }, + }; +}; + +export const getDashboardPanels = ( + indexPatternId: string, + isPinnedAgent: boolean, +): { + [panelId: string]: DashboardPanelState< + EmbeddableInput & { [k: string]: unknown } + >; +} => { + const overviewDashboard = { + '10': { + gridData: { + w: 33, + h: 14, + x: 0, + y: 0, + i: '10', + }, + type: 'visualization', + explicitInput: { + id: '10', + savedVis: getVisStateTopAgentsByAlertsCount(indexPatternId), + }, + }, + '11': { + gridData: { + w: 15, + h: 14, + x: 33, + y: 0, + i: '11', + }, + type: 'visualization', + explicitInput: { + id: '11', + savedVis: getVisStateRequirements(indexPatternId), + }, + }, + '20': { + gridData: { + w: 48, + h: 11, + x: 0, + y: 14, + i: '20', + }, + type: 'visualization', + explicitInput: { + id: '20', + savedVis: getVisStateRequirementsOverTime(indexPatternId), + }, + }, + '30': { + gridData: { + w: 48, + h: 19, + x: 0, + y: 25, + i: '30', + }, + type: 'visualization', + explicitInput: { + id: '30', + savedVis: getVisStateRequirementsHeatmap(indexPatternId), + }, + }, + '40': { + gridData: { + w: 48, + h: 9, + x: 0, + y: 43, + i: '40', + }, + type: 'visualization', + explicitInput: { + id: '40', + savedVis: getVisStateRequirementsByAgent(indexPatternId), + }, + }, + }; + + const agentDashboard = { + '10': { + gridData: { + w: 16, + h: 11, + x: 0, + y: 0, + i: '10', + }, + type: 'visualization', + explicitInput: { + id: '10', + savedVis: getVisStateTopRuleGroups(indexPatternId), + }, + }, + '11': { + gridData: { + w: 16, + h: 11, + x: 16, + y: 0, + i: '11', + }, + type: 'visualization', + explicitInput: { + id: '11', + savedVis: getVisStateTopRules(indexPatternId), + }, + }, + '12': { + gridData: { + w: 16, + h: 11, + x: 32, + y: 0, + i: '12', + }, + type: 'visualization', + explicitInput: { + id: '12', + savedVis: getVisStateAgentTopRequirements(indexPatternId), + }, + }, + '20': { + gridData: { + w: 35, + h: 11, + x: 0, + y: 11, + i: '20', + }, + type: 'visualization', + explicitInput: { + id: '20', + savedVis: getVisStateAgentTopRequirementsCount(indexPatternId), + }, + }, + '21': { + gridData: { + w: 13, + h: 11, + x: 35, + y: 11, + i: '21', + }, + type: 'visualization', + explicitInput: { + id: '21', + savedVis: getVisStateAgentRuleLevelDistribution(indexPatternId), + }, + }, + }; + return isPinnedAgent ? agentDashboard : overviewDashboard; +}; diff --git a/plugins/main/public/components/overview/gdpr/dashboards/index.tsx b/plugins/main/public/components/overview/gdpr/dashboards/index.tsx new file mode 100644 index 0000000000..b691822976 --- /dev/null +++ b/plugins/main/public/components/overview/gdpr/dashboards/index.tsx @@ -0,0 +1 @@ +export * from './dashboard'; \ No newline at end of file diff --git a/plugins/main/public/components/overview/gdpr/dashboards/styles.scss b/plugins/main/public/components/overview/gdpr/dashboards/styles.scss new file mode 100644 index 0000000000..a3b1005567 --- /dev/null +++ b/plugins/main/public/components/overview/gdpr/dashboards/styles.scss @@ -0,0 +1,10 @@ +.pci-dss-dashboard-responsive { + @media (max-width: 767px) { + .react-grid-layout { + height: auto !important; + } + .dshLayout-isMaximizedPanel { + height: 100% !important; + } + } +} From 0fff07fe5688fff201ec8a1a53c93b8915c9d2f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Thu, 14 Mar 2024 12:55:40 +0100 Subject: [PATCH 02/15] fix: fix ids dashboards panels --- .../gdpr/dashboards/dashboard_panels.ts | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/plugins/main/public/components/overview/gdpr/dashboards/dashboard_panels.ts b/plugins/main/public/components/overview/gdpr/dashboards/dashboard_panels.ts index 35c7dded9c..9ead916639 100644 --- a/plugins/main/public/components/overview/gdpr/dashboards/dashboard_panels.ts +++ b/plugins/main/public/components/overview/gdpr/dashboards/dashboard_panels.ts @@ -849,146 +849,146 @@ export const getDashboardPanels = ( >; } => { const overviewDashboard = { - '10': { + g1: { gridData: { w: 33, h: 14, x: 0, y: 0, - i: '10', + i: 'g1', }, type: 'visualization', explicitInput: { - id: '10', + id: 'g1', savedVis: getVisStateTopAgentsByAlertsCount(indexPatternId), }, }, - '11': { + g2: { gridData: { w: 15, h: 14, x: 33, y: 0, - i: '11', + i: 'g2', }, type: 'visualization', explicitInput: { - id: '11', + id: 'g2', savedVis: getVisStateRequirements(indexPatternId), }, }, - '20': { + g3: { gridData: { w: 48, h: 11, x: 0, y: 14, - i: '20', + i: 'g3', }, type: 'visualization', explicitInput: { - id: '20', + id: 'g3', savedVis: getVisStateRequirementsOverTime(indexPatternId), }, }, - '30': { + g4: { gridData: { w: 48, h: 19, x: 0, y: 25, - i: '30', + i: 'g4', }, type: 'visualization', explicitInput: { - id: '30', + id: 'g4', savedVis: getVisStateRequirementsHeatmap(indexPatternId), }, }, - '40': { + g5: { gridData: { w: 48, h: 9, x: 0, y: 43, - i: '40', + i: 'g5', }, type: 'visualization', explicitInput: { - id: '40', + id: 'g5', savedVis: getVisStateRequirementsByAgent(indexPatternId), }, }, }; const agentDashboard = { - '10': { + a1: { gridData: { w: 16, h: 11, x: 0, y: 0, - i: '10', + i: 'a1', }, type: 'visualization', explicitInput: { - id: '10', + id: 'a1', savedVis: getVisStateTopRuleGroups(indexPatternId), }, }, - '11': { + a2: { gridData: { w: 16, h: 11, x: 16, y: 0, - i: '11', + i: 'a2', }, type: 'visualization', explicitInput: { - id: '11', + id: 'a2', savedVis: getVisStateTopRules(indexPatternId), }, }, - '12': { + a3: { gridData: { w: 16, h: 11, x: 32, y: 0, - i: '12', + i: 'a3', }, type: 'visualization', explicitInput: { - id: '12', + id: 'a3', savedVis: getVisStateAgentTopRequirements(indexPatternId), }, }, - '20': { + a4: { gridData: { w: 35, h: 11, x: 0, y: 11, - i: '20', + i: 'a4', }, type: 'visualization', explicitInput: { - id: '20', + id: 'a4', savedVis: getVisStateAgentTopRequirementsCount(indexPatternId), }, }, - '21': { + a5: { gridData: { w: 13, h: 11, x: 35, y: 11, - i: '21', + i: 'a5', }, type: 'visualization', explicitInput: { - id: '21', + id: 'a5', savedVis: getVisStateAgentRuleLevelDistribution(indexPatternId), }, }, From 968104dfa2fbbd80f7b87b1f410a19e6f3461ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Thu, 14 Mar 2024 15:08:31 +0100 Subject: [PATCH 03/15] rename(gdpr): rename dashboard files --- .../{loading_spinner.scss => loading-spinner.scss} | 0 .../components/{loading_spinner.tsx => loading-spinner.tsx} | 0 .../common/components/{no_results.tsx => no-results.tsx} | 0 .../dashboards/{dashboard_panels.ts => dashboard-panels.ts} | 0 .../components/overview/gdpr/dashboards/dashboard.tsx | 6 +++--- 5 files changed, 3 insertions(+), 3 deletions(-) rename plugins/main/public/components/overview/gdpr/common/components/{loading_spinner.scss => loading-spinner.scss} (100%) rename plugins/main/public/components/overview/gdpr/common/components/{loading_spinner.tsx => loading-spinner.tsx} (100%) rename plugins/main/public/components/overview/gdpr/common/components/{no_results.tsx => no-results.tsx} (100%) rename plugins/main/public/components/overview/gdpr/dashboards/{dashboard_panels.ts => dashboard-panels.ts} (100%) diff --git a/plugins/main/public/components/overview/gdpr/common/components/loading_spinner.scss b/plugins/main/public/components/overview/gdpr/common/components/loading-spinner.scss similarity index 100% rename from plugins/main/public/components/overview/gdpr/common/components/loading_spinner.scss rename to plugins/main/public/components/overview/gdpr/common/components/loading-spinner.scss diff --git a/plugins/main/public/components/overview/gdpr/common/components/loading_spinner.tsx b/plugins/main/public/components/overview/gdpr/common/components/loading-spinner.tsx similarity index 100% rename from plugins/main/public/components/overview/gdpr/common/components/loading_spinner.tsx rename to plugins/main/public/components/overview/gdpr/common/components/loading-spinner.tsx diff --git a/plugins/main/public/components/overview/gdpr/common/components/no_results.tsx b/plugins/main/public/components/overview/gdpr/common/components/no-results.tsx similarity index 100% rename from plugins/main/public/components/overview/gdpr/common/components/no_results.tsx rename to plugins/main/public/components/overview/gdpr/common/components/no-results.tsx diff --git a/plugins/main/public/components/overview/gdpr/dashboards/dashboard_panels.ts b/plugins/main/public/components/overview/gdpr/dashboards/dashboard-panels.ts similarity index 100% rename from plugins/main/public/components/overview/gdpr/dashboards/dashboard_panels.ts rename to plugins/main/public/components/overview/gdpr/dashboards/dashboard-panels.ts diff --git a/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx index 22c36f4677..29a574259d 100644 --- a/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx +++ b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx @@ -2,13 +2,13 @@ import React, { useState, useEffect } from 'react'; import { SearchResponse } from '../../../../../../../src/core/server'; import { getPlugins } from '../../../../kibana-services'; import { ViewMode } from '../../../../../../../src/plugins/embeddable/public'; -import { getDashboardPanels } from './dashboard_panels'; +import { getDashboardPanels } from './dashboard-panels'; import { I18nProvider } from '@osd/i18n/react'; import useSearchBar from '../../../common/search-bar/use-search-bar'; import './styles.scss'; import { withErrorBoundary } from '../../../common/hocs'; -import { DiscoverNoResults } from '../common/components/no_results'; -import { LoadingSpinner } from '../common/components/loading_spinner'; +import { DiscoverNoResults } from '../common/components/no-results'; +import { LoadingSpinner } from '../common/components/loading-spinner'; import { search } from '../../../common/search-bar/search-bar-service'; import { IndexPattern } from '../../../../../../../src/plugins/data/common'; import { From f0c7f8ab8589dd84ea1a23ad332a9818e1b0da64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Thu, 14 Mar 2024 15:11:49 +0100 Subject: [PATCH 04/15] fix(gdpr): add id to visualizations --- .../gdpr/dashboards/dashboard-panels.ts | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/plugins/main/public/components/overview/gdpr/dashboards/dashboard-panels.ts b/plugins/main/public/components/overview/gdpr/dashboards/dashboard-panels.ts index 9ead916639..ae293f4ca8 100644 --- a/plugins/main/public/components/overview/gdpr/dashboards/dashboard-panels.ts +++ b/plugins/main/public/components/overview/gdpr/dashboards/dashboard-panels.ts @@ -1,9 +1,9 @@ import { DashboardPanelState } from '../../../../../../../src/plugins/dashboard/public/application'; import { EmbeddableInput } from '../../../../../../../src/plugins/embeddable/public'; -// Visualization ID: Wazuh-App-Overview-GDPR-Agents const getVisStateTopAgentsByAlertsCount = (indexPatternId: string) => { return { + id: 'Wazuh-App-Overview-GDPR-Agents', title: 'Top 10 agents by alerts number', type: 'pie', params: { @@ -55,9 +55,9 @@ const getVisStateTopAgentsByAlertsCount = (indexPatternId: string) => { }; }; -// Visualization ID: Wazuh-App-Overview-GDPR-requirements const getVisStateRequirements = (indexPatternId: string) => { return { + id: 'Wazuh-App-Overview-GDPR-requirements', title: 'GDPR requirements', type: 'line', params: { @@ -212,9 +212,10 @@ const getVisStateRequirements = (indexPatternId: string) => { }, }; }; -// Visualization ID: Wazuh-App-Overview-GDPR-Requirements-heatmap + const getVisStateRequirementsOverTime = (indexPatternId: string) => { return { + id: 'Wazuh-App-Overview-GDPR-Requirements-heatmap', title: 'Top requirements over time', type: 'area', params: { @@ -330,9 +331,9 @@ const getVisStateRequirementsOverTime = (indexPatternId: string) => { }; }; -// Visualization ID: Wazuh-App-Overview-GDPR-Requirements-Agents-heatmap const getVisStateRequirementsHeatmap = (indexPatternId: string) => { return { + id: 'Wazuh-App-Overview-GDPR-Requirements-Agents-heatmap', title: 'Last alerts', type: 'heatmap', params: { @@ -442,9 +443,9 @@ const getVisStateRequirementsHeatmap = (indexPatternId: string) => { }; }; -// Visualization ID: Wazuh-App-Overview-GDPR-Requirements-by-agent const getVisStateRequirementsByAgent = (indexPatternId: string) => { return { + id: 'Wazuh-App-Overview-GDPR-Requirements-by-agent', title: 'Requirements by agent', type: 'histogram', params: { @@ -548,9 +549,9 @@ const getVisStateRequirementsByAgent = (indexPatternId: string) => { }; }; -// Visualization ID: Wazuh-App-Agents-GDPR-Groups const getVisStateTopRuleGroups = (indexPatternId: string) => { return { + id: 'Wazuh-App-Agents-GDPR-Groups', title: 'Top 5 rule groups', type: 'pie', params: { @@ -596,9 +597,9 @@ const getVisStateTopRuleGroups = (indexPatternId: string) => { }; }; -// Visualization ID: Wazuh-App-Agents-GDPR-Rule const getVisStateTopRules = (indexPatternId: string) => { return { + id: 'Wazuh-App-Agents-GDPR-Rule', title: 'Top 5 rules', type: 'pie', params: { @@ -644,9 +645,9 @@ const getVisStateTopRules = (indexPatternId: string) => { }; }; -// Visualization ID: Wazuh-App-Agents-GDPR-Requirement const getVisStateAgentTopRequirements = (indexPatternId: string) => { return { + id: 'Wazuh-App-Agents-GDPR-Requirement', title: 'Top 5 requirements', type: 'pie', params: { @@ -687,9 +688,9 @@ const getVisStateAgentTopRequirements = (indexPatternId: string) => { }; }; -// Visualization ID: Wazuh-App-Agents-GDPR-Requirements const getVisStateAgentTopRequirementsCount = (indexPatternId: string) => { return { + id: 'Wazuh-App-Agents-GDPR-Requirements', title: 'GDPR Requirements', type: 'histogram', params: { @@ -787,9 +788,9 @@ const getVisStateAgentTopRequirementsCount = (indexPatternId: string) => { }; }; -// Visualization ID: Wazuh-App-Agents-GDPR-Rule-level-distribution const getVisStateAgentRuleLevelDistribution = (indexPatternId: string) => { return { + id: 'Wazuh-App-Agents-GDPR-Rule-level-distribution', title: 'Rule level distribution', type: 'pie', params: { From 21d6df688cedcc9cd3a9ab6db107046aded6f0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Thu, 14 Mar 2024 15:30:21 +0100 Subject: [PATCH 05/15] fix(gdpr): fix import of styles in the loading component --- .../common/components/loading-spinner.tsx | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/plugins/main/public/components/overview/gdpr/common/components/loading-spinner.tsx b/plugins/main/public/components/overview/gdpr/common/components/loading-spinner.tsx index 7f505e6167..2ebbdff8d7 100644 --- a/plugins/main/public/components/overview/gdpr/common/components/loading-spinner.tsx +++ b/plugins/main/public/components/overview/gdpr/common/components/loading-spinner.tsx @@ -1,17 +1,30 @@ -import './loading_spinner.scss'; +import './loading-spinner.scss'; import React from 'react'; -import { EuiTitle, EuiPanel, EuiEmptyPrompt, EuiLoadingSpinner } from '@elastic/eui'; +import { + EuiTitle, + EuiPanel, + EuiEmptyPrompt, + EuiLoadingSpinner, +} from '@elastic/eui'; import { FormattedMessage } from '@osd/i18n/react'; export function LoadingSpinner() { return ( - + } + icon={} title={ - +

- +

} From 477b96fb41e358951220749a39d8946181d419bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Fri, 15 Mar 2024 14:26:20 +0100 Subject: [PATCH 06/15] fix(gdpr): fix dashboards --- .../overview/gdpr/dashboards/dashboard.tsx | 14 +++++++------- .../overview/gdpr/dashboards/styles.scss | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx index 29a574259d..579691389c 100644 --- a/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx +++ b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx @@ -70,7 +70,7 @@ const DashboardGDPRComponent: React.FC = ({ pinnedAgent }) => { .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching vulnerabilities', + message: 'Error fetching alerts', }); ErrorHandler.handleError(searchError); setIsSearching(false); @@ -85,9 +85,9 @@ const DashboardGDPRComponent: React.FC = ({ pinnedAgent }) => { {isLoading ? : null} {!isLoading ? ( @@ -98,7 +98,7 @@ const DashboardGDPRComponent: React.FC = ({ pinnedAgent }) => { ) : null} {!isLoading && !isSearching && results?.hits?.total > 0 ? ( -
+
{ isFullScreenMode: false, filters: fetchFilters ?? [], useMargins: true, - id: 'vulnerability-detector-dashboard-tab', + id: 'gdpr-dashboard-tab', timeRange: { from: searchBarProps.dateRangeFrom, to: searchBarProps.dateRangeTo, }, - title: 'Vulnerability detector dashboard', - description: 'Dashboard of the Vulnerability detector', + title: 'GDPR dashboard', + description: 'Dashboard of the GDPR', query: searchBarProps.query, refreshConfig: { pause: false, diff --git a/plugins/main/public/components/overview/gdpr/dashboards/styles.scss b/plugins/main/public/components/overview/gdpr/dashboards/styles.scss index a3b1005567..a198ad811f 100644 --- a/plugins/main/public/components/overview/gdpr/dashboards/styles.scss +++ b/plugins/main/public/components/overview/gdpr/dashboards/styles.scss @@ -1,4 +1,4 @@ -.pci-dss-dashboard-responsive { +.gdpr-dashboard-responsive { @media (max-width: 767px) { .react-grid-layout { height: auto !important; From 13e4d55a893b950bebdcccbf8a1eb872444d3233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Thu, 11 Apr 2024 11:40:35 +0200 Subject: [PATCH 07/15] feat(gdpr): use data source on Dashboard and Events tabs --- plugins/main/common/constants.ts | 7 +- .../alerts-gdpr/alerts-gdpr-data-source.ts | 42 +++++++ .../common/modules/modules-defaults.tsx | 15 ++- .../common/components/loading-spinner.scss | 4 - .../common/components/loading-spinner.tsx | 34 ----- .../gdpr/common/components/no-results.tsx | 60 --------- .../overview/gdpr/dashboards/dashboard.tsx | 119 +++++++++--------- 7 files changed, 116 insertions(+), 165 deletions(-) create mode 100644 plugins/main/public/components/common/data-source/pattern/alerts/alerts-gdpr/alerts-gdpr-data-source.ts delete mode 100644 plugins/main/public/components/overview/gdpr/common/components/loading-spinner.scss delete mode 100644 plugins/main/public/components/overview/gdpr/common/components/loading-spinner.tsx delete mode 100644 plugins/main/public/components/overview/gdpr/common/components/no-results.tsx diff --git a/plugins/main/common/constants.ts b/plugins/main/common/constants.ts index 35399ea514..58a44b05d3 100644 --- a/plugins/main/common/constants.ts +++ b/plugins/main/common/constants.ts @@ -224,10 +224,13 @@ export enum WAZUH_MENU_SETTINGS_SECTIONS_ID { } export const AUTHORIZED_AGENTS = 'hidden-authorized-agents'; -export const DATA_SOURCE_FILTER_CONTROLLED_EXCLUDE_SERVER = 'hidden-exclude-server'; +export const DATA_SOURCE_FILTER_CONTROLLED_EXCLUDE_SERVER = + 'hidden-exclude-server'; export const DATA_SOURCE_FILTER_CONTROLLED_PINNED_AGENT = 'pinned-agent'; export const DATA_SOURCE_FILTER_CONTROLLED_CLUSTER_MANAGER = 'cluster-manager'; -export const DATA_SOURCE_FILTER_CONTROLLED_VULNERABILITIES_RULE_GROUP = 'vulnerabilities-rule-group'; +export const DATA_SOURCE_FILTER_CONTROLLED_VULNERABILITIES_RULE_GROUP = + 'vulnerabilities-rule-group'; +export const DATA_SOURCE_FILTER_CONTROLLED_GDPR_EXIST = 'gdpr-rule-exist'; // Wazuh links export const WAZUH_LINK_GITHUB = 'https://github.com/wazuh'; diff --git a/plugins/main/public/components/common/data-source/pattern/alerts/alerts-gdpr/alerts-gdpr-data-source.ts b/plugins/main/public/components/common/data-source/pattern/alerts/alerts-gdpr/alerts-gdpr-data-source.ts new file mode 100644 index 0000000000..0117d2fed2 --- /dev/null +++ b/plugins/main/public/components/common/data-source/pattern/alerts/alerts-gdpr/alerts-gdpr-data-source.ts @@ -0,0 +1,42 @@ +import { tFilter } from '../../../index'; +import { DATA_SOURCE_FILTER_CONTROLLED_GDPR_EXIST } from '../../../../../../../common/constants'; +import { AlertsDataSource } from '../alerts-data-source'; + +const KEY_EXIST = 'rule.gdpr'; + +export class AlertsGDPRDataSource extends AlertsDataSource { + constructor(id: string, title: string) { + super(id, title); + } + + private getFilterExist() { + return [ + { + meta: { + index: this.id, + negate: false, + disabled: false, + alias: null, + type: 'exists', + key: KEY_EXIST, + value: 'exists', + params: { + query: null, + type: 'phrase', + }, + controlledBy: DATA_SOURCE_FILTER_CONTROLLED_GDPR_EXIST, + }, + exists: { + field: KEY_EXIST, + }, + $state: { + store: 'appState', + }, + } as tFilter, + ]; + } + + getFixedFilters(): tFilter[] { + return [...this.getFilterExist(), ...super.getFixedFilters()]; + } +} diff --git a/plugins/main/public/components/common/modules/modules-defaults.tsx b/plugins/main/public/components/common/modules/modules-defaults.tsx index 8142347b7c..e4bd58e089 100644 --- a/plugins/main/public/components/common/modules/modules-defaults.tsx +++ b/plugins/main/public/components/common/modules/modules-defaults.tsx @@ -47,6 +47,7 @@ import { malwareDetectionColumns } from '../../overview/malware-detection/events import { WAZUH_VULNERABILITIES_PATTERN } from '../../../../common/constants'; import { DashboardGDPR } from '../../overview/gdpr/dashboards/dashboard'; import { AlertsVulnerabilitiesDataSource } from '../data-source'; +import { AlertsGDPRDataSource } from '../data-source/pattern/alerts/alerts-gdpr/alerts-gdpr-data-source'; const ALERTS_INDEX_PATTERN = 'wazuh-alerts-*'; const DEFAULT_INDEX_PATTERN = ALERTS_INDEX_PATTERN; @@ -282,20 +283,24 @@ export const ModulesDefaults = { gdpr: { init: 'dashboard', tabs: [ - DashboardTab, { - id: 'dashboard2', + id: 'dashboard', name: 'Dashboard', buttons: [ButtonModuleExploreAgent, ButtonModuleGenerateReport], - component: DashboardGDPR || withPinnedAgent(DashboardGDPR), // TODO: use withPinnedAgent + component: DashboardGDPR, }, { id: 'inventory', name: 'Controls', buttons: [ButtonModuleExploreAgent], - component: ComplianceTable, + component: props => ( + + ), }, - renderDiscoverTab(DEFAULT_INDEX_PATTERN, gdprColumns), + renderDiscoverTab({ + tableColumns: gdprColumns, + DataSource: AlertsGDPRDataSource, + }), ], availableFor: ['manager', 'agent'], }, diff --git a/plugins/main/public/components/overview/gdpr/common/components/loading-spinner.scss b/plugins/main/public/components/overview/gdpr/common/components/loading-spinner.scss deleted file mode 100644 index 051ab642c1..0000000000 --- a/plugins/main/public/components/overview/gdpr/common/components/loading-spinner.scss +++ /dev/null @@ -1,4 +0,0 @@ -.discoverNoResults { - display: flex; - align-items: center; -} diff --git a/plugins/main/public/components/overview/gdpr/common/components/loading-spinner.tsx b/plugins/main/public/components/overview/gdpr/common/components/loading-spinner.tsx deleted file mode 100644 index 2ebbdff8d7..0000000000 --- a/plugins/main/public/components/overview/gdpr/common/components/loading-spinner.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import './loading-spinner.scss'; -import React from 'react'; -import { - EuiTitle, - EuiPanel, - EuiEmptyPrompt, - EuiLoadingSpinner, -} from '@elastic/eui'; -import { FormattedMessage } from '@osd/i18n/react'; - -export function LoadingSpinner() { - return ( - - } - title={ - -

- -

-
- } - /> -
- ); -} diff --git a/plugins/main/public/components/overview/gdpr/common/components/no-results.tsx b/plugins/main/public/components/overview/gdpr/common/components/no-results.tsx deleted file mode 100644 index babfd51d32..0000000000 --- a/plugins/main/public/components/overview/gdpr/common/components/no-results.tsx +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; -import { FormattedMessage, I18nProvider } from '@osd/i18n/react'; - -import { EuiCallOut, EuiPanel } from '@elastic/eui'; - -interface Props { - message?: string; -} - -export const DiscoverNoResults = ({ message }: Props) => { - return ( - - - - ) - } - color='warning' - iconType='help' - data-test-subj='discoverNoResults' - /> - - - ); -}; diff --git a/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx index 579691389c..be99639c83 100644 --- a/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx +++ b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx @@ -7,9 +7,8 @@ import { I18nProvider } from '@osd/i18n/react'; import useSearchBar from '../../../common/search-bar/use-search-bar'; import './styles.scss'; import { withErrorBoundary } from '../../../common/hocs'; -import { DiscoverNoResults } from '../common/components/no-results'; -import { LoadingSpinner } from '../common/components/loading-spinner'; -import { search } from '../../../common/search-bar/search-bar-service'; +import { DiscoverNoResults } from '../../../common/no-results/no-results'; +import { LoadingSpinner } from '../../../common/loading-spinner/loading-spinner'; import { IndexPattern } from '../../../../../../../src/plugins/data/common'; import { ErrorFactory, @@ -17,8 +16,14 @@ import { HttpError, } from '../../../../react-services/error-management'; import { compose } from 'redux'; -import { DashboardContainerInput } from '../../../../../../../src/plugins/dashboard/public'; import { SampleDataWarning } from '../../../visualize/components'; +import { AlertsGDPRDataSource } from '../../../common/data-source/pattern/alerts/alerts-gdpr/alerts-gdpr-data-source'; +import { + AlertsDataSourceRepository, + PatternDataSource, + tParsedIndexPattern, + useDataSource, +} from '../../../common/data-source'; const plugins = getPlugins(); @@ -30,81 +35,76 @@ const DashboardByRenderer = plugins.dashboard.DashboardContainerByValueRenderer; a wrapper for visual adjustments, while the Kpi, the Open vs Close visualization and the rest of the visualizations have different configurations at the dashboard level. */ -const DashboardGDPRComponent: React.FC = ({ pinnedAgent }) => { - const ALERTS_INDEX_PATTERN_ID = 'wazuh-alerts-*'; // TODO: use the data source - const { searchBarProps } = useSearchBar({ - defaultIndexPatternID: ALERTS_INDEX_PATTERN_ID, - onMount: () => {}, // TODO: use data source - onUpdate: () => {}, // TODO: use data source - onUnMount: () => {}, // TODO: use data source +const DashboardGDPRComponent: React.FC = () => { + const { + filters, + dataSource, + fetchFilters, + isLoading: isDataSourceLoading, + fetchData, + setFilters, + } = useDataSource({ + DataSource: AlertsGDPRDataSource, + repository: new AlertsDataSourceRepository(), }); + const [results, setResults] = useState({} as SearchResponse); - /* This function is responsible for updating the storage filters so that the - filters between dashboard and inventory added using visualizations call to actions. - Without this feature, filters added using visualizations call to actions are - not maintained between dashboard and inventory tabs */ - const handleFilterByVisualization = (newInput: DashboardContainerInput) => { - return; // TODO: adapt to the data source - updateFiltersStorage(newInput.filters); - }; - - // TODO: add the hidden filters: allowed agents and hideManagerAlerts - const fetchFilters = searchBarProps.filters; + const { searchBarProps } = useSearchBar({ + indexPattern: dataSource?.indexPattern as IndexPattern, + filters, + setFilters, + }); - const { isLoading, query, indexPatterns } = searchBarProps; - - const [isSearching, setIsSearching] = useState(false); - const [results, setResults] = useState({} as SearchResponse); + const { query } = searchBarProps; useEffect(() => { - if (!isLoading) { - search({ - indexPattern: indexPatterns?.[0] as IndexPattern, - filters: fetchFilters, - query, + if (isDataSourceLoading) { + return; + } + fetchData({ + query, + }) + .then(results => { + setResults(results); }) - .then(results => { - setResults(results); - setIsSearching(false); - }) - .catch(error => { - const searchError = ErrorFactory.create(HttpError, { - error, - message: 'Error fetching alerts', - }); - ErrorHandler.handleError(searchError); - setIsSearching(false); + .catch(error => { + const searchError = ErrorFactory.create(HttpError, { + error, + message: 'Error fetching alerts', }); - } - }, [JSON.stringify(searchBarProps), JSON.stringify(fetchFilters)]); + ErrorHandler.handleError(searchError); + }); + }, [JSON.stringify(fetchFilters), JSON.stringify(query)]); return ( <> <> - {isLoading ? : null} - {!isLoading ? ( - - ) : null} + {isDataSourceLoading && !dataSource ? ( + + ) : ( +
+ +
+ )} - {isSearching ? : null} - {!isLoading && !isSearching && results?.hits?.total === 0 ? ( + {dataSource && results?.hits?.total === 0 ? ( ) : null} - {!isLoading && !isSearching && results?.hits?.total > 0 ? ( + {dataSource && results?.hits?.total > 0 ? (
{ }, hidePanelTitles: false, }} - onInputUpdated={handleFilterByVisualization} />
) : null} From cbfa268697e4630587064a781ce672656f0d001d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Mon, 15 Apr 2024 11:34:20 +0200 Subject: [PATCH 08/15] fix(gdpr): remove comment --- .../public/components/overview/gdpr/dashboards/dashboard.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx index be99639c83..4e459f3ba5 100644 --- a/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx +++ b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx @@ -31,10 +31,6 @@ const SearchBar = getPlugins().data.ui.SearchBar; const DashboardByRenderer = plugins.dashboard.DashboardContainerByValueRenderer; -/* The vulnerabilities dashboard is made up of 3 dashboards because the filters need -a wrapper for visual adjustments, while the Kpi, the Open vs Close visualization and -the rest of the visualizations have different configurations at the dashboard level. */ - const DashboardGDPRComponent: React.FC = () => { const { filters, From c6b89e6e89eebea1ebb7f202b56d300dbb66c456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Mon, 15 Apr 2024 11:36:15 +0200 Subject: [PATCH 09/15] fix(gdpr): add date range to Dashboard query --- .../overview/gdpr/dashboards/dashboard.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx index 4e459f3ba5..aafa432ab0 100644 --- a/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx +++ b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx @@ -51,7 +51,7 @@ const DashboardGDPRComponent: React.FC = () => { setFilters, }); - const { query } = searchBarProps; + const { query, dateRangeFrom, dateRangeTo } = searchBarProps; useEffect(() => { if (isDataSourceLoading) { @@ -59,6 +59,10 @@ const DashboardGDPRComponent: React.FC = () => { } fetchData({ query, + dateRange: { + from: dateRangeFrom, + to: dateRangeTo, + }, }) .then(results => { setResults(results); @@ -70,7 +74,12 @@ const DashboardGDPRComponent: React.FC = () => { }); ErrorHandler.handleError(searchError); }); - }, [JSON.stringify(fetchFilters), JSON.stringify(query)]); + }, [ + JSON.stringify(fetchFilters), + JSON.stringify(query), + JSON.stringify(dateRangeFrom), + JSON.stringify(dateRangeTo), + ]); return ( <> From 889b51dd910e76966e4083ef014a1444ab72ff09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Mon, 15 Apr 2024 11:37:37 +0200 Subject: [PATCH 10/15] remove(gdpr): visualizations on server side --- .../visualizations/agents/agents-gdpr.ts | 333 -------- .../visualizations/agents/index.ts | 4 +- .../visualizations/overview/index.ts | 4 +- .../visualizations/overview/overview-gdpr.ts | 718 ------------------ 4 files changed, 2 insertions(+), 1057 deletions(-) delete mode 100644 plugins/main/server/integration-files/visualizations/agents/agents-gdpr.ts delete mode 100644 plugins/main/server/integration-files/visualizations/overview/overview-gdpr.ts diff --git a/plugins/main/server/integration-files/visualizations/agents/agents-gdpr.ts b/plugins/main/server/integration-files/visualizations/agents/agents-gdpr.ts deleted file mode 100644 index 61719f8bbd..0000000000 --- a/plugins/main/server/integration-files/visualizations/agents/agents-gdpr.ts +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Wazuh app - Module for Agents/GDPR visualizations - * Copyright (C) 2015-2022 Wazuh, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Find more information about this on the LICENSE file. - */ -export default [ - { - _id: 'Wazuh-App-Agents-GDPR-Groups', - _source: { - title: 'Top 5 rule groups', - visState: JSON.stringify({ - title: 'Top 5 rule groups', - type: 'pie', - params: { - type: 'pie', - addTooltip: true, - addLegend: true, - legendPosition: 'right', - isDonut: true, - }, - aggs: [ - { id: '1', enabled: true, type: 'count', schema: 'metric', params: {} }, - { - id: '2', - enabled: true, - type: 'terms', - schema: 'segment', - params: { field: 'rule.groups', size: 5, order: 'desc', orderBy: '1' }, - }, - ], - }), - uiStateJSON: '{}', - description: '', - version: 1, - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: 'wazuh-alerts', - filter: [], - query: { query: '', language: 'lucene' }, - }), - }, - }, - _type: 'visualization', - }, - { - _id: 'Wazuh-App-Agents-GDPR-Rule', - _source: { - title: 'Top 5 rules', - visState: JSON.stringify({ - title: 'Top 5 rules', - type: 'pie', - params: { - type: 'pie', - addTooltip: true, - addLegend: true, - legendPosition: 'right', - isDonut: true, - }, - aggs: [ - { id: '1', enabled: true, type: 'count', schema: 'metric', params: {} }, - { - id: '2', - enabled: true, - type: 'terms', - schema: 'segment', - params: { field: 'rule.description', size: 5, order: 'desc', orderBy: '1' }, - }, - ], - }), - uiStateJSON: '{}', - description: '', - version: 1, - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: 'wazuh-alerts', - filter: [], - query: { query: '', language: 'lucene' }, - }), - }, - }, - _type: 'visualization', - }, - { - _id: 'Wazuh-App-Agents-GDPR-Requirement', - _source: { - title: 'Top 5 requirements', - visState: JSON.stringify({ - title: 'Top 5 requirements', - type: 'pie', - params: { - type: 'pie', - addTooltip: true, - addLegend: true, - legendPosition: 'right', - isDonut: true, - }, - aggs: [ - { id: '1', enabled: true, type: 'count', schema: 'metric', params: {} }, - { - id: '2', - enabled: true, - type: 'terms', - schema: 'segment', - params: { field: 'rule.gdpr', size: 5, order: 'desc', orderBy: '1' }, - }, - ], - }), - uiStateJSON: '{}', - description: '', - version: 1, - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: 'wazuh-alerts', - filter: [], - query: { query: '', language: 'lucene' }, - }), - }, - }, - _type: 'visualization', - }, - { - _id: 'Wazuh-App-Agents-GDPR-Rule-level-distribution', - _source: { - title: 'Rule level distribution', - visState: JSON.stringify({ - title: 'Rule level distribution', - type: 'pie', - params: { - type: 'pie', - addTooltip: true, - addLegend: false, - legendPosition: 'right', - isDonut: true, - labels: { show: true, values: true, last_level: true, truncate: 100 }, - }, - aggs: [ - { id: '1', enabled: true, type: 'count', schema: 'metric', params: {} }, - { - id: '2', - enabled: true, - type: 'terms', - schema: 'segment', - params: { - field: 'rule.level', - size: 15, - order: 'desc', - orderBy: '1', - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - }, - }, - ], - }), - uiStateJSON: JSON.stringify({ vis: { legendOpen: false } }), - description: '', - version: 1, - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: 'wazuh-alerts', - filter: [], - query: { query: '', language: 'lucene' }, - }), - }, - }, - _type: 'visualization', - }, - { - _id: 'Wazuh-App-Agents-GDPR-Requirements', - _source: { - title: 'Requirements', - visState: JSON.stringify({ - title: 'Requirements', - type: 'histogram', - params: { - type: 'histogram', - grid: { categoryLines: false, style: { color: '#eee' } }, - categoryAxes: [ - { - id: 'CategoryAxis-1', - type: 'category', - position: 'bottom', - show: true, - style: {}, - scale: { type: 'linear' }, - labels: { show: true, filter:true,truncate: 100, rotate: 0 }, - title: {}, - }, - ], - valueAxes: [ - { - id: 'ValueAxis-1', - name: 'LeftAxis-1', - type: 'value', - position: 'left', - show: true, - style: {}, - scale: { type: 'linear', mode: 'normal' }, - labels: { show: true, rotate: 0, filter: false, truncate: 100 }, - title: { text: 'Count' }, - }, - ], - seriesParams: [ - { - show: 'true', - type: 'histogram', - mode: 'stacked', - data: { label: 'Count', id: '1' }, - valueAxis: 'ValueAxis-1', - drawLinesBetweenPoints: true, - showCircles: true, - }, - ], - addTooltip: true, - addLegend: true, - legendPosition: 'right', - times: [], - addTimeMarker: false, - }, - aggs: [ - { id: '1', enabled: true, type: 'count', schema: 'metric', params: {} }, - { - id: '3', - enabled: true, - type: 'terms', - schema: 'group', - params: { field: 'rule.gdpr', size: 5, order: 'desc', orderBy: '1', customLabel: '' }, - }, - { - id: '2', - enabled: true, - type: 'terms', - schema: 'segment', - params: { - field: 'rule.gdpr', - size: 10, - order: 'desc', - orderBy: '1', - customLabel: 'GDPR requirements', - }, - }, - ], - }), - uiStateJSON: '{}', - description: '', - version: 1, - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: 'wazuh-alerts', - filter: [], - query: { query: '', language: 'lucene' }, - }), - }, - }, - _type: 'visualization', - }, - { - _id: 'Wazuh-App-Agents-GDPR-Last-alerts', - _type: 'visualization', - _source: { - title: 'Last alerts', - visState: JSON.stringify({ - title: 'Last alerts', - type: 'table', - params: { - perPage: 10, - showPartialRows: false, - showMeticsAtAllLevels: false, - sort: { columnIndex: 2, direction: 'desc' }, - showTotal: false, - showToolbar: true, - totalFunc: 'sum', - }, - aggs: [ - { id: '1', enabled: true, type: 'count', schema: 'metric', params: {} }, - { - id: '3', - enabled: true, - type: 'terms', - schema: 'bucket', - params: { - field: 'rule.gdpr', - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - size: 50, - order: 'desc', - orderBy: '1', - customLabel: 'Requirement', - }, - }, - { - id: '4', - enabled: true, - type: 'terms', - schema: 'bucket', - params: { - field: 'rule.description', - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - size: 10, - order: 'desc', - orderBy: '1', - customLabel: 'Rule description', - }, - }, - ], - }), - uiStateJSON: JSON.stringify({ - vis: { params: { sort: { columnIndex: 2, direction: 'desc' } } }, - }), - description: '', - version: 1, - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: 'wazuh-alerts', - filter: [], - query: { query: '', language: 'lucene' }, - }), - }, - }, - }, -]; diff --git a/plugins/main/server/integration-files/visualizations/agents/index.ts b/plugins/main/server/integration-files/visualizations/agents/index.ts index 71a0dd7438..02ead52a56 100644 --- a/plugins/main/server/integration-files/visualizations/agents/index.ts +++ b/plugins/main/server/integration-files/visualizations/agents/index.ts @@ -16,7 +16,6 @@ import gcp from './agents-gcp'; import oscap from './agents-oscap'; import ciscat from './agents-ciscat'; import pci from './agents-pci'; -import gdpr from './agents-gdpr'; import hipaa from './agents-hipaa'; import mitre from './agents-mitre'; import nist from './agents-nist'; @@ -37,7 +36,6 @@ export { oscap, ciscat, pci, - gdpr, hipaa, nist, tsc, @@ -48,5 +46,5 @@ export { docker, welcome, aws, - github + github, }; diff --git a/plugins/main/server/integration-files/visualizations/overview/index.ts b/plugins/main/server/integration-files/visualizations/overview/index.ts index 8f8711b75f..1a56fbe3a7 100644 --- a/plugins/main/server/integration-files/visualizations/overview/index.ts +++ b/plugins/main/server/integration-files/visualizations/overview/index.ts @@ -17,7 +17,6 @@ import general from './overview-general'; import oscap from './overview-oscap'; import ciscat from './overview-ciscat'; import pci from './overview-pci'; -import gdpr from './overview-gdpr'; import hipaa from './overview-hipaa'; import nist from './overview-nist'; import tsc from './overview-tsc'; @@ -38,7 +37,6 @@ export { oscap, ciscat, pci, - gdpr, hipaa, nist, tsc, @@ -48,5 +46,5 @@ export { office, osquery, docker, - github + github, }; diff --git a/plugins/main/server/integration-files/visualizations/overview/overview-gdpr.ts b/plugins/main/server/integration-files/visualizations/overview/overview-gdpr.ts deleted file mode 100644 index d1be4a41bb..0000000000 --- a/plugins/main/server/integration-files/visualizations/overview/overview-gdpr.ts +++ /dev/null @@ -1,718 +0,0 @@ -/* - * Wazuh app - Module for Overview/GDPR visualizations - * Copyright (C) 2015-2022 Wazuh, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Find more information about this on the LICENSE file. - */ -export default [ - { - _id: 'Wazuh-App-Overview-GDPR-Requirements-heatmap', - _source: { - title: 'GDPR requirements over time', - visState: JSON.stringify({ - title: 'Alerts by action over time', - type: 'area', - params: { - type: 'area', - grid: { - categoryLines: true, - style: { color: '#eee' }, - valueAxis: 'ValueAxis-1', - }, - categoryAxes: [ - { - id: 'CategoryAxis-1', - type: 'category', - position: 'bottom', - show: true, - style: {}, - scale: { type: 'linear' }, - labels: { show: true, filter: true, truncate: 100 }, - title: {}, - }, - ], - valueAxes: [ - { - id: 'ValueAxis-1', - name: 'LeftAxis-1', - type: 'value', - position: 'left', - show: true, - style: {}, - scale: { type: 'linear', mode: 'normal' }, - labels: { show: true, rotate: 0, filter: false, truncate: 100 }, - title: { text: 'Count' }, - }, - ], - seriesParams: [ - { - show: 'true', - type: 'area', - mode: 'stacked', - data: { label: 'Count', id: '1' }, - drawLinesBetweenPoints: true, - showCircles: true, - interpolate: 'cardinal', - valueAxis: 'ValueAxis-1', - }, - ], - addTooltip: true, - addLegend: true, - legendPosition: 'right', - times: [], - addTimeMarker: false, - }, - aggs: [ - { - id: '1', - enabled: true, - type: 'count', - schema: 'metric', - params: {}, - }, - { - id: '3', - enabled: true, - type: 'terms', - schema: 'group', - params: { - field: 'rule.gdpr', - size: 5, - order: 'desc', - orderBy: '1', - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - }, - }, - { - id: '2', - enabled: true, - type: 'date_histogram', - schema: 'segment', - params: { - field: 'timestamp', - timeRange: { from: 'now-24h', to: 'now', mode: 'quick' }, - useNormalizedEsInterval: true, - interval: 'auto', - time_zone: 'Europe/Berlin', - drop_partials: false, - customInterval: '2h', - min_doc_count: 1, - extended_bounds: {}, - }, - }, - ], - }), - uiStateJSON: '{}', - description: '', - version: 1, - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: 'wazuh-alerts', - filter: [], - query: { language: 'lucene', query: '' }, - }), - }, - }, - _type: 'visualization', - }, - { - _id: 'Wazuh-App-Overview-GDPR-Requirements-Agents-heatmap', - _type: 'visualization', - _source: { - title: 'Last alerts', - visState: JSON.stringify({ - title: 'Last alerts', - type: 'heatmap', - params: { - type: 'heatmap', - addTooltip: true, - addLegend: true, - enableHover: false, - legendPosition: 'right', - times: [], - colorsNumber: 10, - colorSchema: 'Greens', - setColorRange: false, - colorsRange: [], - invertColors: false, - percentageMode: false, - valueAxes: [ - { - show: false, - id: 'ValueAxis-1', - type: 'value', - scale: { type: 'linear', defaultYExtents: false }, - labels: { - show: false, - rotate: 0, - overwriteColor: false, - color: '#555', - }, - }, - ], - }, - aggs: [ - { - id: '1', - enabled: true, - type: 'count', - schema: 'metric', - params: {}, - }, - { - id: '2', - enabled: true, - type: 'terms', - schema: 'segment', - params: { - field: 'rule.gdpr', - size: 5, - order: 'desc', - orderBy: '1', - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - customLabel: 'Requirements', - }, - }, - { - id: '3', - enabled: true, - type: 'terms', - schema: 'group', - params: { - field: 'agent.name', - size: 5, - order: 'desc', - orderBy: '1', - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - customLabel: 'Agents', - }, - }, - ], - }), - uiStateJSON: JSON.stringify({ - vis: { - defaultColors: { - '0 - 13': 'rgb(247,252,245)', - '13 - 26': 'rgb(233,247,228)', - '26 - 39': 'rgb(211,238,205)', - '39 - 52': 'rgb(184,227,177)', - '52 - 65': 'rgb(152,213,148)', - '65 - 78': 'rgb(116,196,118)', - '78 - 91': 'rgb(75,176,98)', - '91 - 104': 'rgb(47,152,79)', - '104 - 117': 'rgb(21,127,59)', - '117 - 130': 'rgb(0,100,40)', - }, - }, - }), - description: '', - version: 1, - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: 'wazuh-alerts', - query: { query: '', language: 'lucene' }, - filter: [], - }), - }, - }, - }, - { - _id: 'Wazuh-App-Overview-GDPR-requirements', - _source: { - title: 'GDPR requirements', - visState: JSON.stringify({ - title: 'GDPR requirements', - type: 'line', - params: { - type: 'line', - grid: { categoryLines: true, valueAxis: 'ValueAxis-1' }, - categoryAxes: [ - { - id: 'CategoryAxis-1', - type: 'category', - position: 'bottom', - show: true, - style: {}, - scale: { type: 'linear' }, - labels: { show: true, filter: true, truncate: 100 }, - title: {}, - }, - ], - valueAxes: [ - { - id: 'ValueAxis-1', - name: 'LeftAxis-1', - type: 'value', - position: 'left', - show: true, - style: {}, - scale: { type: 'linear', mode: 'normal' }, - labels: { show: true, rotate: 0, filter: false, truncate: 100 }, - title: { text: 'Count' }, - }, - ], - seriesParams: [ - { - show: 'true', - type: 'line', - mode: 'normal', - data: { label: 'Count', id: '1' }, - valueAxis: 'ValueAxis-1', - drawLinesBetweenPoints: false, - showCircles: true, - }, - ], - addTooltip: true, - addLegend: true, - legendPosition: 'right', - times: [], - addTimeMarker: false, - dimensions: { - x: { - accessor: 0, - format: { id: 'date', params: { pattern: 'YYYY-MM-DD' } }, - params: { date: true, interval: 'P1D', format: 'YYYY-MM-DD' }, - aggType: 'date_histogram', - }, - y: [ - { - accessor: 2, - format: { id: 'number' }, - params: {}, - aggType: 'count', - }, - ], - z: [ - { - accessor: 3, - format: { id: 'number' }, - params: {}, - aggType: 'count', - }, - ], - series: [ - { - accessor: 1, - format: { - id: 'terms', - params: { - id: 'string', - otherBucketLabel: 'Other', - missingBucketLabel: 'Missing', - }, - }, - params: {}, - aggType: 'terms', - }, - ], - }, - radiusRatio: 50, - }, - aggs: [ - { - id: '1', - enabled: true, - type: 'count', - schema: 'metric', - params: {}, - }, - { - id: '3', - enabled: true, - type: 'terms', - schema: 'group', - params: { - field: 'rule.gdpr', - orderBy: '1', - order: 'desc', - size: 10, - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - }, - }, - { - id: '2', - enabled: true, - type: 'date_histogram', - schema: 'segment', - params: { - field: 'timestamp', - timeRange: { from: 'now-1h', to: 'now' }, - useNormalizedEsInterval: true, - interval: 'auto', - drop_partials: false, - min_doc_count: 1, - extended_bounds: {}, - }, - }, - { - id: '4', - enabled: true, - type: 'count', - schema: 'radius', - params: {}, - }, - ], - }), - uiStateJSON: '{"vis":{"legendOpen":false}}', - description: '', - version: 1, - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: 'wazuh-alerts', - filter: [], - query: { query: '', language: 'lucene' }, - }), - }, - }, - _type: 'visualization', - }, - { - _id: 'Wazuh-App-Overview-GDPR-Agents', - _source: { - title: 'GDPR Agents', - visState: JSON.stringify({ - title: 'GDPR Agents', - type: 'pie', - params: { - type: 'pie', - addTooltip: true, - addLegend: true, - legendPosition: 'right', - isDonut: false, - }, - aggs: [ - { - id: '1', - enabled: true, - type: 'count', - schema: 'metric', - params: {}, - }, - { - id: '2', - enabled: true, - type: 'terms', - schema: 'segment', - params: { - field: 'agent.name', - size: 10, - order: 'desc', - orderBy: '1', - }, - }, - ], - }), - uiStateJSON: '{}', - description: '', - version: 1, - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: 'wazuh-alerts', - filter: [], - query: { query: '', language: 'lucene' }, - }), - }, - }, - _type: 'visualization', - }, - { - _id: 'Wazuh-App-Overview-GDPR-Requirements-by-agent', - _source: { - title: 'GDPR Requirements by agent', - visState: JSON.stringify({ - title: 'GDPR Requirements by agent', - type: 'histogram', - params: { - type: 'histogram', - grid: { categoryLines: false, style: { color: '#eee' } }, - categoryAxes: [ - { - id: 'CategoryAxis-1', - type: 'category', - position: 'bottom', - show: true, - style: {}, - scale: { type: 'linear' }, - labels: { show: true, filter: true, truncate: 100, rotate: 0 }, - title: {}, - }, - ], - valueAxes: [ - { - id: 'ValueAxis-1', - name: 'LeftAxis-1', - type: 'value', - position: 'left', - show: true, - style: {}, - scale: { type: 'linear', mode: 'normal' }, - labels: { show: true, rotate: 0, filter: false, truncate: 100 }, - title: { text: 'Count' }, - }, - ], - seriesParams: [ - { - show: 'true', - type: 'histogram', - mode: 'stacked', - data: { label: 'Count', id: '1' }, - valueAxis: 'ValueAxis-1', - drawLinesBetweenPoints: true, - showCircles: true, - }, - ], - addTooltip: true, - addLegend: true, - legendPosition: 'right', - times: [], - addTimeMarker: false, - radiusRatio: 51, - }, - aggs: [ - { - id: '1', - enabled: true, - type: 'count', - schema: 'metric', - params: {}, - }, - { - id: '2', - enabled: true, - type: 'terms', - schema: 'segment', - params: { - field: 'rule.gdpr', - size: 5, - order: 'desc', - orderBy: '1', - customLabel: 'GDPR Requirements', - }, - }, - { - id: '3', - enabled: true, - type: 'terms', - schema: 'group', - params: { - field: 'agent.name', - size: 5, - order: 'desc', - orderBy: '1', - }, - }, - ], - }), - uiStateJSON: '{}', - description: '', - version: 1, - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: 'wazuh-alerts', - filter: [], - query: { query: '', language: 'lucene' }, - }), - }, - }, - _type: 'visualization', - }, - { - _id: 'Wazuh-App-Overview-GDPR-Last-alerts', - _type: 'visualization', - _source: { - title: 'GDPR Last alerts', - visState: JSON.stringify({ - title: 'GDPR Last alerts', - type: 'table', - params: { - perPage: 10, - showPartialRows: false, - showMeticsAtAllLevels: false, - sort: { columnIndex: null, direction: null }, - showTotal: false, - showToolbar: true, - totalFunc: 'sum', - }, - aggs: [ - { - id: '1', - enabled: true, - type: 'count', - schema: 'metric', - params: {}, - }, - { - id: '2', - enabled: true, - type: 'terms', - schema: 'bucket', - params: { - field: 'agent.name', - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - size: 50, - order: 'desc', - orderBy: '1', - customLabel: 'Agent name', - }, - }, - { - id: '3', - enabled: true, - type: 'terms', - schema: 'bucket', - params: { - field: 'rule.gdpr', - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - size: 10, - order: 'desc', - orderBy: '1', - customLabel: 'Requirement', - }, - }, - { - id: '4', - enabled: true, - type: 'terms', - schema: 'bucket', - params: { - field: 'rule.description', - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - size: 10, - order: 'desc', - orderBy: '1', - customLabel: 'Rule description', - }, - }, - ], - }), - uiStateJSON: - '{"vis":{"params":{"sort":{"columnIndex":3,"direction":"desc"}}}}', - description: '', - version: 1, - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: 'wazuh-alerts', - filter: [], - query: { query: '', language: 'lucene' }, - }), - }, - }, - }, - { - _id: 'Wazuh-App-Overview-GDPR-Alerts-summary', - _type: 'visualization', - _source: { - title: 'Alerts summary', - visState: JSON.stringify({ - title: 'Alerts summary', - type: 'table', - params: { - perPage: 10, - showPartialRows: false, - showMeticsAtAllLevels: false, - sort: { columnIndex: 3, direction: 'desc' }, - showTotal: false, - showToolbar: true, - totalFunc: 'sum', - }, - aggs: [ - { - id: '1', - enabled: true, - type: 'count', - schema: 'metric', - params: {}, - }, - { - id: '2', - enabled: true, - type: 'terms', - schema: 'bucket', - params: { - field: 'agent.name', - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - size: 50, - order: 'desc', - orderBy: '1', - customLabel: 'Agent name', - }, - }, - { - id: '3', - enabled: true, - type: 'terms', - schema: 'bucket', - params: { - field: 'rule.gdpr', - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - size: 10, - order: 'desc', - orderBy: '1', - customLabel: 'Requirement', - }, - }, - { - id: '4', - enabled: true, - type: 'terms', - schema: 'bucket', - params: { - field: 'rule.description', - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - size: 10, - order: 'desc', - orderBy: '1', - customLabel: 'Rule description', - }, - }, - ], - }), - uiStateJSON: - '{"vis":{"params":{"sort":{"columnIndex":3,"direction":"desc"}}}}', - description: '', - version: 1, - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: 'wazuh-alerts', - filter: [], - query: { query: '', language: 'lucene' }, - }), - }, - }, - }, -]; From 23e511e8d302715efe05686f6b6fcc0cb68fea03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Fri, 3 May 2024 10:45:41 +0200 Subject: [PATCH 11/15] feat(gdpr): hide filter control on the search bar of controls --- .../public/components/overview/gdpr/dashboards/dashboard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx index aafa432ab0..363a8f8261 100644 --- a/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx +++ b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx @@ -88,7 +88,7 @@ const DashboardGDPRComponent: React.FC = () => { {isDataSourceLoading && !dataSource ? ( ) : ( -
+
Date: Fri, 3 May 2024 13:18:04 +0200 Subject: [PATCH 12/15] feat(gdpr): move sample data warning on the dashboard --- .../overview/gdpr/dashboards/dashboard.tsx | 58 ++++++++++--------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx index 363a8f8261..ed8934cefa 100644 --- a/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx +++ b/plugins/main/public/components/overview/gdpr/dashboards/dashboard.tsx @@ -98,38 +98,40 @@ const DashboardGDPRComponent: React.FC = () => { />
)} - {dataSource && results?.hits?.total === 0 ? ( ) : null} {dataSource && results?.hits?.total > 0 ? ( -
- -
+ <> + +
+ +
+ ) : null} From 91f2c57d39b7fe4d86498342b8e10d2924d3a1c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Wed, 8 May 2024 09:51:23 +0200 Subject: [PATCH 13/15] fix: repeated request on WazuhFlyoutDiscover --- .../wazuh-discover/wz-flyout-discover.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/plugins/main/public/components/common/wazuh-discover/wz-flyout-discover.tsx b/plugins/main/public/components/common/wazuh-discover/wz-flyout-discover.tsx index 9d9ef8b296..661cd05f7b 100644 --- a/plugins/main/public/components/common/wazuh-discover/wz-flyout-discover.tsx +++ b/plugins/main/public/components/common/wazuh-discover/wz-flyout-discover.tsx @@ -79,11 +79,10 @@ const WazuhFlyoutDiscoverComponent = (props: WazuhDiscoverProps) => { : undefined; // table states const [pagination, setPagination] = useState< - EuiBasicTableProps['pagination'] + Omit['pagination'], 'totalItemCount'> >({ pageIndex: 0, pageSize: DEFAULT_PAGE_SIZE, - totalItemCount: 0, }); const [sorting, setSorting] = useState['sorting']>({ sort: { field: timeField || '@timestamp', direction: 'desc' }, @@ -146,13 +145,8 @@ const WazuhFlyoutDiscoverComponent = (props: WazuhDiscoverProps) => { sorting: parseSorting, }) .then((response: SearchResponse) => { - const totalHits = response?.hits?.total || 0; setPagination({ ...pagination, - totalItemCount: - totalHits > MAX_ENTRIES_PER_QUERY - ? MAX_ENTRIES_PER_QUERY - : totalHits, }); setResults(response); }) @@ -197,7 +191,6 @@ const WazuhFlyoutDiscoverComponent = (props: WazuhDiscoverProps) => { setPagination({ pageIndex, pageSize, - totalItemCount: results?.hits?.total || 0, }); setSorting({ sort: { field, direction: direction as Direction } }); }; @@ -325,7 +318,13 @@ const WazuhFlyoutDiscoverComponent = (props: WazuhDiscoverProps) => { itemIdToExpandedRowMap={itemIdToExpandedRowMap} isExpandable={isExpanded} columns={getColumns()} - pagination={pagination} + pagination={{ + ...pagination, + totalItemCount: + (results?.hits?.total ?? 0) > MAX_ENTRIES_PER_QUERY + ? MAX_ENTRIES_PER_QUERY + : results?.hits?.total ?? 0, + }} sorting={sorting} onChange={onTableChange} /> From 8b85f1c805fbbf63b34a9eb51564721fdf764803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20David=20Guti=C3=A9rrez?= Date: Wed, 8 May 2024 09:55:50 +0200 Subject: [PATCH 14/15] changelog: add pull request entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6428a645bf..51621c5538 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ All notable changes to the Wazuh app project will be documented in this file. ### Changed -- Removed embedded discover [#6120](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6120) [#6235](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6235) [#6254](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6254) [#6285](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6285) [#6288](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6288) [#6290](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6290) [#6289](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6289) [#6286](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6286) [#6275](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6275) [#6287](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6287) [#6297](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6297) [#6287](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6287) [#6291](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6287) [#6459](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6459) [#6434](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6434) [#6504](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6504) +- Removed embedded discover [#6120](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6120) [#6235](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6235) [#6254](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6254) [#6285](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6285) [#6288](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6288) [#6290](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6290) [#6289](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6289) [#6286](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6286) [#6275](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6275) [#6287](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6287) [#6297](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6297) [#6287](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6287) [#6291](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6287) [#6459](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6459) [#6434](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6434) [#6504](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6504) [#6506](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6506) - Develop logic of a new index for the fim module [#6227](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6227) - Allow editing groups for an agent from Endpoints Summary [#6250](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6250) - Change how the configuration is managed in the backend side [#6337](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6337) [#6519](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6519) [#6573](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6573) From 2e64c5739408f35f60d39b9fbdec1de66bdf4b80 Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Mon, 13 May 2024 12:17:38 +0200 Subject: [PATCH 15/15] Fix base branch merge --- .../public/components/common/modules/modules-defaults.tsx | 1 - .../server/integration-files/visualizations/agents/index.ts | 4 ---- .../server/integration-files/visualizations/overview/index.ts | 4 ---- 3 files changed, 9 deletions(-) diff --git a/plugins/main/public/components/common/modules/modules-defaults.tsx b/plugins/main/public/components/common/modules/modules-defaults.tsx index 944a35b12d..dd327e3b6b 100644 --- a/plugins/main/public/components/common/modules/modules-defaults.tsx +++ b/plugins/main/public/components/common/modules/modules-defaults.tsx @@ -55,7 +55,6 @@ import { DashboardDocker } from '../../overview/docker/dashboards'; import { DashboardMalwareDetection } from '../../overview/malware-detection/dashboard'; import { DashboardFIM } from '../../overview/fim/dashboard/dashboard'; import { DashboardHIPAA } from '../../overview/hipaa/dashboards/dashboard'; -import { MitreAttackDataSource } from '../data-source/pattern/alerts/mitre-attack/mitre-attack-data-source'; import { AlertsDockerDataSource, AlertsDataSource, diff --git a/plugins/main/server/integration-files/visualizations/agents/index.ts b/plugins/main/server/integration-files/visualizations/agents/index.ts index 1d95c2c6a4..6e89a3634f 100644 --- a/plugins/main/server/integration-files/visualizations/agents/index.ts +++ b/plugins/main/server/integration-files/visualizations/agents/index.ts @@ -15,8 +15,6 @@ import general from './agents-general'; import gcp from './agents-gcp'; import oscap from './agents-oscap'; import ciscat from './agents-ciscat'; -import hipaa from './agents-hipaa'; -import gdpr from './agents-gdpr'; import mitre from './agents-mitre'; import nist from './agents-nist'; import tsc from './agents-tsc'; @@ -35,8 +33,6 @@ export { gcp, oscap, ciscat, - hipaa, - gdpr, nist, tsc, pm, diff --git a/plugins/main/server/integration-files/visualizations/overview/index.ts b/plugins/main/server/integration-files/visualizations/overview/index.ts index 88cd324ca4..36750830c6 100644 --- a/plugins/main/server/integration-files/visualizations/overview/index.ts +++ b/plugins/main/server/integration-files/visualizations/overview/index.ts @@ -16,8 +16,6 @@ import fim from './overview-fim'; import general from './overview-general'; import oscap from './overview-oscap'; import ciscat from './overview-ciscat'; -import hipaa from './overview-hipaa'; -import gdpr from './overview-gdpr'; import nist from './overview-nist'; import tsc from './overview-tsc'; import pm from './overview-pm'; @@ -36,8 +34,6 @@ export { general, oscap, ciscat, - hipaa, - gdpr, nist, tsc, pm,