From db97880528fc0d5096d376f196025ea036fa650a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20C=C3=A9sar=20Biset?= <43619595+jbiset@users.noreply.github.com> Date: Wed, 3 Jan 2024 15:22:20 -0300 Subject: [PATCH] Remove Inventory table from vulnerability dashboard tab and change filter titles (#6260) * Remove Inventory table from vulnerability dashboard tab and change filter titles * Change KPIs and filters titles * Change title of Most vulnerable endpoints visualization --- .../dashboards/overview/dashboard_panels.ts | 162 +----------------- .../overview/dashboard_panels_filters.ts | 12 +- .../overview/dashboard_panels_kpis.ts | 8 +- 3 files changed, 11 insertions(+), 171 deletions(-) diff --git a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels.ts b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels.ts index d4d44a3f23..3269a8d65b 100644 --- a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels.ts +++ b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels.ts @@ -131,7 +131,7 @@ const getVisStateTopVulnerabilities = (indexPatternId: string) => { const getVisStateTopVulnerabilitiesEndpoints = (indexPatternId: string) => { return { id: 'most_vulnerable_endpoints_vulnerabilities', - title: 'The most vulnerable endpoints', + title: 'Most vulnerable endpoints', type: 'horizontal_bar', params: { type: 'histogram', @@ -420,152 +420,6 @@ const getVisStateAccumulationMostDetectedVulnerabilities = ( }; }; -const getVisStateInventoryTable = (indexPatternId: string) => { - return { - id: 'inventory_table_vulnerabilities', - title: 'Inventory table', - type: 'table', - params: { - perPage: 5, - showPartialRows: false, - showMetricsAtAllLevels: false, - showTotal: false, - totalFunc: 'sum', - percentageCol: '', - }, - 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', - params: { - customLabel: 'Count', - }, - schema: 'metric', - }, - { - id: '2', - enabled: true, - type: 'terms', - params: { - field: 'package.name', - orderBy: '1', - order: 'desc', - size: 5, - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - customLabel: 'name', - }, - schema: 'bucket', - }, - { - id: '3', - enabled: true, - type: 'terms', - params: { - field: 'package.version', - orderBy: '1', - order: 'desc', - size: 5, - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - customLabel: 'version', - }, - schema: 'bucket', - }, - { - id: '5', - enabled: true, - type: 'terms', - params: { - field: 'vulnerability.severity', - orderBy: '1', - order: 'desc', - size: 5, - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - customLabel: 'severity', - }, - schema: 'bucket', - }, - { - id: '6', - enabled: true, - type: 'terms', - params: { - field: 'vulnerability.id', - orderBy: '1', - order: 'desc', - size: 5, - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - customLabel: 'id', - }, - schema: 'bucket', - }, - { - id: '7', - enabled: true, - type: 'terms', - params: { - field: 'vulnerability.score.version', - orderBy: '1', - order: 'desc', - size: 5, - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - customLabel: 'score version', - }, - schema: 'bucket', - }, - { - id: '8', - enabled: true, - type: 'terms', - params: { - field: 'vulnerability.score.base', - orderBy: '1', - order: 'desc', - size: 5, - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - customLabel: 'score base', - }, - schema: 'bucket', - }, - ], - }, - }; -}; - export const getDashboardPanels = ( indexPatternId: string, ): { @@ -617,19 +471,5 @@ export const getDashboardPanels = ( getVisStateAccumulationMostDetectedVulnerabilities(indexPatternId), }, }, - '9': { - gridData: { - w: 48, - h: 12, - x: 0, - y: 14, - i: '9', - }, - type: 'visualization', - explicitInput: { - id: '9', - savedVis: getVisStateInventoryTable(indexPatternId), - }, - }, }; }; diff --git a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_filters.ts b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_filters.ts index 791b505bb1..074ca8947b 100644 --- a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_filters.ts +++ b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_filters.ts @@ -90,8 +90,8 @@ export const getDashboardFilters = ( savedVis: getVisStateFilter( 'topPackageSelector', indexPatternId, - 'Top Packages vulnerabilities', - 'Package', + 'Top packages vulnerabilities', + 'Top 5 package names', 'package.name', ), }, @@ -110,8 +110,8 @@ export const getDashboardFilters = ( savedVis: getVisStateFilter( 'topOSVulnerabilities', indexPatternId, - 'Top Operating system vulnerabilities', - 'Operating system', + 'Top operating system vulnerabilities', + 'Top 5 operating systems', 'host.os.full', ), }, @@ -131,7 +131,7 @@ export const getDashboardFilters = ( 'topAgentVulnerabilities', indexPatternId, 'Agent filter', - 'Agent', + 'Top 5 agents', 'agent.id', ), }, @@ -151,7 +151,7 @@ export const getDashboardFilters = ( 'topVulnerabilities', indexPatternId, 'Top vulnerabilities', - 'Vulnerability', + 'Top 5 vulnerabilities', 'vulnerability.id', ), }, diff --git a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_kpis.ts b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_kpis.ts index a4494d9c05..4fc899a67c 100644 --- a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_kpis.ts +++ b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard_panels_kpis.ts @@ -75,7 +75,7 @@ const getVisStateSeverityCritical = (indexPatternId: string) => { query: 'vulnerability.severity:"Critical"', language: 'kuery', }, - label: '- Critical Severity Alerts', + label: '- Critical severity alerts', }, ], }, @@ -167,7 +167,7 @@ const getVisStateSeverityHigh = (indexPatternId: string) => { query: 'vulnerability.severity:"High"', language: 'kuery', }, - label: '- High Severity Alerts', + label: '- High severity alerts', }, ], }, @@ -252,7 +252,7 @@ const getVisStateSeverityMedium = (indexPatternId: string) => { query: 'vulnerability.severity:"Medium"', language: 'kuery', }, - label: '- Medium Severity Alerts', + label: '- Medium severity alerts', }, ], }, @@ -337,7 +337,7 @@ const getVisStateSeverityLow = (indexPatternId: string) => { query: 'vulnerability.severity:"Low"', language: 'kuery', }, - label: '- Low Severity Alerts', + label: '- Low severity alerts', }, ], },