Skip to content

Commit

Permalink
Change dashboard visualizations
Browse files Browse the repository at this point in the history
  • Loading branch information
asteriscos committed Mar 20, 2024
1 parent 91ff5b6 commit 7e50933
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 53 deletions.
Expand Up @@ -113,6 +113,29 @@ const DashboardVulsComponent: React.FC = () => {
) : null}
{!isLoading && !isSearching && results?.hits?.total > 0 ? (
<div className='vulnerability-dashboard-responsive'>
<DashboardByRenderer
input={{
viewMode: ViewMode.VIEW,
panels: getKPIsPanel(VULNERABILITIES_INDEX_PATTERN_ID),
isFullScreenMode: false,
filters: fetchFilters ?? [],
useMargins: true,
id: 'kpis-vulnerability-detector-dashboard-tab',
timeRange: {
from: searchBarProps.dateRangeFrom,
to: searchBarProps.dateRangeTo,
},
title: 'KPIs Vulnerability detector dashboard',
description: 'KPIs Dashboard of the Vulnerability detector',
query: searchBarProps.query,
refreshConfig: {
pause: false,
value: 15,
},
hidePanelTitles: true,
}}
onInputUpdated={handleFilterByVisualization}
/>
<div className='vulnerability-dashboard-filters-wrapper'>
<DashboardByRenderer
input={{
Expand Down Expand Up @@ -141,29 +164,6 @@ const DashboardVulsComponent: React.FC = () => {
onInputUpdated={handleFilterByVisualization}
/>
</div>
<DashboardByRenderer
input={{
viewMode: ViewMode.VIEW,
panels: getKPIsPanel(VULNERABILITIES_INDEX_PATTERN_ID),
isFullScreenMode: false,
filters: fetchFilters ?? [],
useMargins: true,
id: 'kpis-vulnerability-detector-dashboard-tab',
timeRange: {
from: searchBarProps.dateRangeFrom,
to: searchBarProps.dateRangeTo,
},
title: 'KPIs Vulnerability detector dashboard',
description: 'KPIs Dashboard of the Vulnerability detector',
query: searchBarProps.query,
refreshConfig: {
pause: false,
value: 15,
},
hidePanelTitles: true,
}}
onInputUpdated={handleFilterByVisualization}
/>
<DashboardByRenderer
input={{
viewMode: ViewMode.VIEW,
Expand Down
Expand Up @@ -401,7 +401,8 @@ const getVisStateAccumulationMostDetectedVulnerabilities = (
enabled: true,
type: 'date_histogram',
params: {
field: '@timestamp',
field: 'wazuh.published_at',
customLabel: 'Published at',
timeRange: {
from: 'now-24h',
to: 'now',
Expand Down
Expand Up @@ -86,31 +86,31 @@ export const getDashboardFilters = (
>;
} => {
return {
topPackageSelector: {
topVulnerabilities: {
gridData: {
w: 12,
w: 9,
h: 12,
x: 0,
y: 0,
i: 'topPackageSelector',
i: 'topVulnerabilities',
},
type: 'visualization',
explicitInput: {
id: 'topPackageSelector',
id: 'topVulnerabilities',
savedVis: getVisStateFilter(
'topPackageSelector',
'topVulnerabilities',
indexPatternId,
'Top packages vulnerabilities',
'Top 5 packages',
'package.name',
'Top vulnerabilities',
'Top 5 vulnerabilities',
'vulnerability.id',
),
},
},
topOSVulnerabilities: {
gridData: {
w: 12,
w: 15,
h: 12,
x: 12,
x: 9,
y: 0,
i: 'topOSVulnerabilities',
},
Expand All @@ -128,7 +128,7 @@ export const getDashboardFilters = (
},
topAgentVulnerabilities: {
gridData: {
w: 12,
w: 15,
h: 12,
x: 24,
y: 0,
Expand All @@ -146,23 +146,23 @@ export const getDashboardFilters = (
),
},
},
topVulnerabilities: {
topPackageSelector: {
gridData: {
w: 12,
w: 9,
h: 12,
x: 36,
x: 39,
y: 0,
i: 'topVulnerabilities',
i: 'topPackageSelector',
},
type: 'visualization',
explicitInput: {
id: 'topVulnerabilities',
id: 'topPackageSelector',
savedVis: getVisStateFilter(
'topVulnerabilities',
'topPackageSelector',
indexPatternId,
'Top vulnerabilities',
'Top 5 vulnerabilities',
'vulnerability.id',
'Top packages vulnerabilities',
'Top 5 packages',
'package.name',
),
},
},
Expand Down
Expand Up @@ -60,7 +60,7 @@ const getVisStateSeverityCritical = (indexPatternId: string) => {
enabled: true,
type: 'count',
params: {
customLabel: ' ',
customLabel: 'Critical',
},
schema: 'metric',
},
Expand All @@ -75,7 +75,7 @@ const getVisStateSeverityCritical = (indexPatternId: string) => {
query: 'vulnerability.severity:"Critical"',
language: 'kuery',
},
label: '- Critical severity alerts',
label: 'Severity',
},
],
},
Expand Down Expand Up @@ -126,7 +126,7 @@ const getVisStateSeverityHigh = (indexPatternId: string) => {
uiState: {
vis: {
colors: {
'High Severity Alerts - Count': '#38D1BA',
'High Severity - Count': '#38D1BA',
},
},
},
Expand All @@ -152,7 +152,7 @@ const getVisStateSeverityHigh = (indexPatternId: string) => {
enabled: true,
type: 'count',
params: {
customLabel: ' ',
customLabel: 'High',
},
schema: 'metric',
},
Expand All @@ -167,7 +167,7 @@ const getVisStateSeverityHigh = (indexPatternId: string) => {
query: 'vulnerability.severity:"High"',
language: 'kuery',
},
label: '- High severity alerts',
label: 'Severity',
},
],
},
Expand Down Expand Up @@ -237,7 +237,7 @@ const getVisStateSeverityMedium = (indexPatternId: string) => {
enabled: true,
type: 'count',
params: {
customLabel: ' ',
customLabel: 'Medium',
},
schema: 'metric',
},
Expand All @@ -252,7 +252,7 @@ const getVisStateSeverityMedium = (indexPatternId: string) => {
query: 'vulnerability.severity:"Medium"',
language: 'kuery',
},
label: '- Medium severity alerts',
label: 'Severity',
},
],
},
Expand Down Expand Up @@ -322,7 +322,7 @@ const getVisStateSeverityLow = (indexPatternId: string) => {
enabled: true,
type: 'count',
params: {
customLabel: ' ',
customLabel: 'Low',
},
schema: 'metric',
},
Expand All @@ -337,7 +337,7 @@ const getVisStateSeverityLow = (indexPatternId: string) => {
query: 'vulnerability.severity:"Low"',
language: 'kuery',
},
label: '- Low severity alerts',
label: 'Severity',
},
],
},
Expand Down

0 comments on commit 7e50933

Please sign in to comment.