Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulnerability refactor #954

Merged
merged 5 commits into from
Oct 8, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 67 additions & 46 deletions public/templates/agents/agents-vuls.html
Original file line number Diff line number Diff line change
@@ -1,53 +1,74 @@
<md-content flex layout="column" ng-if="tab === 'vuls' && tabView === 'panels'" ng-class="{'no-opacity': resultState !== 'ready' || !rendered}" layout-align="start">
<md-content flex layout="column" ng-if="tab === 'vuls' && tabView === 'panels'" ng-class="{'no-opacity': resultState !== 'ready' || !rendered}"
layout-align="start">

<!-- View: Panels -->


<div layout="row">
<md-card flex class="wz-metric-color wz-md-card">
<md-card-content layout="row" class="wz-padding-metric">
<div flex>Critical severity alerts: <span class="wz-text-bold" ng-bind="vulnCritical()"></span></div>
<div flex>High severity alerts: <span class="wz-text-bold" ng-bind="vulnHigh()"></span></div>
<div flex>Medium severity alerts: <span class="wz-text-bold" ng-bind="vulnMedium()"></span></div>
<div flex>Low severity alerts: <span class="wz-text-bold" ng-bind="vulnLow()"></span></div>
</md-card-content>
</md-card>
</div>
<div layout="row">
<md-card flex class="wz-metric-color wz-md-card">
<md-card-content layout="row" class="wz-padding-metric">
<div flex>Critical severity alerts: <span class="wz-text-bold" ng-bind="vulnCritical()"></span></div>
<div flex>High severity alerts: <span class="wz-text-bold" ng-bind="vulnHigh()"></span></div>
<div flex>Medium severity alerts: <span class="wz-text-bold" ng-bind="vulnMedium()"></span></div>
<div flex>Low severity alerts: <span class="wz-text-bold" ng-bind="vulnLow()"></span></div>
</md-card-content>
</md-card>
</div>

<div class="wz-no-display">
<kbn-vis vis-id="'Wazuh-App-Agents-VULS-Metric-Critical-severity'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Agents-VULS-Metric-High-severity'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Agents-VULS-Metric-Medium-severity'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Agents-VULS-Metric-Low-severity'"></kbn-vis>
</div>
<div class="wz-no-display">
<kbn-vis vis-id="'Wazuh-App-Agents-vulnerability-Metric-Critical-severity'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Agents-vulnerability-Metric-High-severity'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Agents-vulnerability-Metric-Medium-severity'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Agents-vulnerability-Metric-Low-severity'"></kbn-vis>
</div>

<div layout="row" layout-align="center stretch" class="height-270">
<md-card flex="60" class="wz-md-card">
<md-card-content class="wazuh-column">
<span class="wz-headline-title">Alerts severity over time</span>
<md-divider class="wz-margin-top-10"></md-divider>
<kbn-vis id="Wazuh-App-Agents-VULS-Alerts-severity-over-time" vis-id="'Wazuh-App-Agents-VULS-Alerts-severity-over-time'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex="40" class="wz-md-card">
<md-card-content class="wazuh-column">
<span class="wz-headline-title">Affected packages - Top 5</span>
<md-divider class="wz-margin-top-10"></md-divider>
<kbn-vis id="Wazuh-App-Agents-VULS-Top-5-affected-packages" vis-id="'Wazuh-App-Agents-VULS-Top-5-affected-packages'"></kbn-vis>
</md-card-content>
</md-card>
</div>
<div layout="row" layout-align="center stretch" class="height-300">
<md-card flex class="wz-md-card">
<md-card-content class="wazuh-column">
<span class="wz-headline-title">Alerts severity over time</span>
<md-divider class="wz-margin-top-10"></md-divider>
<kbn-vis id="Wazuh-App-Agents-vulnerability-Alerts-severity-over-time" vis-id="'Wazuh-App-Agents-vulnerability-Alerts-severity-over-time'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card">
<md-card-content class="wazuh-column">
<span class="wz-headline-title">Most common rules</span>
<md-divider class="wz-margin-top-10"></md-divider>
<kbn-vis id="Wazuh-App-Agents-vulnerability-Most-common-rules" vis-id="'Wazuh-App-Agents-vulnerability-Most-common-rules'"></kbn-vis>
</md-card-content>
</md-card>
</div>
<div layout="row" layout-align="center stretch" class="height-270">
<md-card flex class="wz-md-card">
<md-card-content class="wazuh-column">
<span class="wz-headline-title">Most common CVEs</span>
<md-divider class="wz-margin-top-10"></md-divider>
<kbn-vis id="Wazuh-App-Agents-vulnerability-Vulnerability-Most-common-CVEs" vis-id="'Wazuh-App-Agents-vulnerability-Vulnerability-Most-common-CVEs'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card">
<md-card-content class="wazuh-column">
<span class="wz-headline-title">Severity distribution</span>
<md-divider class="wz-margin-top-10"></md-divider>
<kbn-vis id="Wazuh-App-Agents-vulnerability-Vulnerability-severity-distribution" vis-id="'Wazuh-App-Agents-vulnerability-Vulnerability-severity-distribution'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card">
<md-card-content class="wazuh-column">
<span class="wz-headline-title">Commonly affected packages</span>
<md-divider class="wz-margin-top-10"></md-divider>
<kbn-vis id="Wazuh-App-Agents-vulnerability-Commonly-affected-packages" vis-id="'Wazuh-App-Agents-vulnerability-Commonly-affected-packages'"></kbn-vis>
</md-card-content>
</md-card>
</div>

<div layout="row" class="height-570">
<md-card flex class="wz-md-card">
<md-card-content class="wazuh-column">
<span class="wz-headline-title">Alerts summary</span>
<md-divider class="wz-margin-top-10"></md-divider>
<kbn-vis vis-id="'Wazuh-App-Agents-VULS-Alerts-summary'"></kbn-vis>
</md-card-content>
</md-card>
</div>



</md-content>
<div layout="row" class="height-570">
<md-card flex class="wz-md-card">
<md-card-content class="wazuh-column">
<span class="wz-headline-title">Alert summary</span>
<md-divider class="wz-margin-top-10"></md-divider>
<kbn-vis vis-id="'Wazuh-App-Agents-vulnerability-Alert-summary'"></kbn-vis>
</md-card-content>
</md-card>
</div>
</md-content>
54 changes: 34 additions & 20 deletions public/templates/overview/overview-vuls.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<md-content flex layout="column" ng-if="tab === 'vuls' && tabView === 'panels'" ng-class="{'no-opacity': resultState !== 'ready' || !rendered}" layout-align="start">
<md-content flex layout="column" ng-if="tab === 'vuls' && tabView === 'panels'" ng-class="{'no-opacity': resultState !== 'ready' || !rendered}"
layout-align="start">

<div layout="row">
<md-card flex class="wz-metric-color wz-md-card">
Expand All @@ -12,47 +13,60 @@
</div>

<div class="wz-no-display">
<kbn-vis vis-id="'Wazuh-App-Overview-VULS-Metric-Critical-severity'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Overview-VULS-Metric-High-severity'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Overview-VULS-Metric-Medium-severity'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Overview-VULS-Metric-Low-severity'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Overview-vulnerability-Metric-Critical-severity'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Overview-vulnerability-Metric-High-severity'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Overview-vulnerability-Metric-Medium-severity'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Overview-vulnerability-Metric-Low-severity'"></kbn-vis>
</div>

<div layout="row" layout-align="center stretch" class="height-270">
<md-card flex="30" class="wz-md-card">
<md-card-content class="wazuh-column">
<span class="wz-headline-title">Most affected agents</span>
<md-divider class="wz-margin-top-10"></md-divider>
<kbn-vis id="Wazuh-App-Overview-vulnerability-Most-affected-agents" vis-id="'Wazuh-App-Overview-vulnerability-Most-affected-agents'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card">
<md-card-content class="wazuh-column" >
<span class="wz-headline-title">Alerts severity over time</span>
<md-card-content class="wazuh-column">
<span class="wz-headline-title">Alerts evolution over time</span>
<md-divider class="wz-margin-top-10"></md-divider>
<kbn-vis id="Wazuh-App-Overview-VULS-Alerts-severity-over-time" vis-id="'Wazuh-App-Overview-VULS-Alerts-severity-over-time'"></kbn-vis>
<kbn-vis id="Wazuh-App-Overview-vulnerability-Alerts-evolution-over-time" vis-id="'Wazuh-App-Overview-vulnerability-Alerts-evolution-over-time'"></kbn-vis>
</md-card-content>
</md-card>
</div>

<div layout="row" layout-align="center stretch" class="height-270">
<md-card flex="60" class="wz-md-card">
<md-card-content class="wazuh-column" >
<span class="wz-headline-title">Top Agents severity</span>
<md-card flex="30" class="wz-md-card">
<md-card-content class="wazuh-column">
<span class="wz-headline-title">Severity distribution</span>
<md-divider class="wz-margin-top-10"></md-divider>
<kbn-vis id="Wazuh-App-Overview-VULS-Top-Agents-severity" vis-id="'Wazuh-App-Overview-VULS-Top-Agents-severity'"></kbn-vis>
<kbn-vis id="Wazuh-App-Overview-vulnerability-Vulnerability-severity-distribution" vis-id="'Wazuh-App-Overview-vulnerability-Vulnerability-severity-distribution'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex="40" class="wz-md-card">
<md-card-content class="wazuh-column" >
<span class="wz-headline-title">Affected packages - Top 5</span>
<md-card flex="30" class="wz-md-card">
<md-card-content class="wazuh-column">
<span class="wz-headline-title">Commonly affected packages</span>
<md-divider class="wz-margin-top-10"></md-divider>
<kbn-vis id="Wazuh-App-Overview-VULS-Top-5-affected-packages" vis-id="'Wazuh-App-Overview-VULS-Top-5-affected-packages'"></kbn-vis>
<kbn-vis id="Wazuh-App-Overview-vulnerability-Commonly-affected-packages" vis-id="'Wazuh-App-Overview-vulnerability-Commonly-affected-packages'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card">
<md-card-content class="wazuh-column">
<span class="wz-headline-title">Most common CVEs</span>
<md-divider class="wz-margin-top-10"></md-divider>
<kbn-vis id="Wazuh-App-Overview-vulnerability-Most-common-CVEs" vis-id="'Wazuh-App-Overview-vulnerability-Most-common-CVEs'"></kbn-vis>
</md-card-content>
</md-card>
</div>

<div layout="row" class="height-570">
<md-card flex class="wz-md-card">
<md-card-content class="wazuh-column">
<span class="wz-headline-title">Alerts summary</span>
<span class="wz-headline-title">Alert summary</span>
<md-divider class="wz-margin-top-10"></md-divider>
<kbn-vis vis-id="'Wazuh-App-Overview-VULS-Alerts-summary'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Overview-vulnerability-Alert-summary'"></kbn-vis>
</md-card-content>
</md-card>
</div>

</md-content>
</md-content>
11 changes: 7 additions & 4 deletions public/utils/agents-metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ const metricsAudit = {

// Metrics Vulnerability Detector
const metricsVulnerability = {
vulnCritical: '[vis-id="\'Wazuh-App-Agents-VULS-Metric-Critical-severity\'"]',
vulnHigh: '[vis-id="\'Wazuh-App-Agents-VULS-Metric-High-severity\'"]',
vulnMedium: '[vis-id="\'Wazuh-App-Agents-VULS-Metric-Medium-severity\'"]',
vulnLow: '[vis-id="\'Wazuh-App-Agents-VULS-Metric-Low-severity\'"]'
vulnCritical:
'[vis-id="\'Wazuh-App-Agents-vulnerability-Metric-Critical-severity\'"]',
vulnHigh:
'[vis-id="\'Wazuh-App-Agents-vulnerability-Metric-High-severity\'"]',
vulnMedium:
'[vis-id="\'Wazuh-App-Agents-vulnerability-Metric-Medium-severity\'"]',
vulnLow: '[vis-id="\'Wazuh-App-Agents-vulnerability-Metric-Low-severity\'"]'
};

// Metrics Scap
Expand Down
10 changes: 6 additions & 4 deletions public/utils/overview-metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ const metricsAudit = {
// Metrics Vulnerability Detector
const metricsVulnerability = {
vulnCritical:
'[vis-id="\'Wazuh-App-Overview-VULS-Metric-Critical-severity\'"]',
vulnHigh: '[vis-id="\'Wazuh-App-Overview-VULS-Metric-High-severity\'"]',
vulnMedium: '[vis-id="\'Wazuh-App-Overview-VULS-Metric-Medium-severity\'"]',
vulnLow: '[vis-id="\'Wazuh-App-Overview-VULS-Metric-Low-severity\'"]'
'[vis-id="\'Wazuh-App-Overview-vulnerability-Metric-Critical-severity\'"]',
vulnHigh:
'[vis-id="\'Wazuh-App-Overview-vulnerability-Metric-High-severity\'"]',
vulnMedium:
'[vis-id="\'Wazuh-App-Overview-vulnerability-Metric-Medium-severity\'"]',
vulnLow: '[vis-id="\'Wazuh-App-Overview-vulnerability-Metric-Low-severity\'"]'
};

// Metrics Scap
Expand Down
65 changes: 57 additions & 8 deletions server/integration-files/visualizations/agents/agents-vuls.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
export default [
{
_id: 'Wazuh-App-Agents-VULS-Alerts-severity-over-time',
_id: 'Wazuh-App-Agents-vulnerability-Alerts-severity-over-time',
_type: 'visualization',
_source: {
title: 'Alerts severity over time',
Expand All @@ -27,7 +27,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-VULS-Alerts-summary',
_id: 'Wazuh-App-Agents-vulnerability-Alert-summary',
_type: 'visualization',
_source: {
title: 'Alerts summary',
Expand All @@ -44,7 +44,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-VULS-Top-5-affected-packages',
_id: 'Wazuh-App-Agents-vulnerability-Commonly-affected-packages',
_type: 'visualization',
_source: {
title: 'Top 5 affected packages',
Expand All @@ -60,7 +60,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-VULS-Metric-Critical-severity',
_id: 'Wazuh-App-Agents-vulnerability-Metric-Critical-severity',
_type: 'visualization',
_source: {
title: 'Metric Critical severity',
Expand Down Expand Up @@ -106,7 +106,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-VULS-Metric-High-severity',
_id: 'Wazuh-App-Agents-vulnerability-Metric-High-severity',
_type: 'visualization',
_source: {
title: 'Metric High severity',
Expand Down Expand Up @@ -152,7 +152,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-VULS-Metric-Medium-severity',
_id: 'Wazuh-App-Agents-vulnerability-Metric-Medium-severity',
_type: 'visualization',
_source: {
title: 'Metric Medium severity',
Expand Down Expand Up @@ -198,7 +198,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-VULS-Metric-Low-severity',
_id: 'Wazuh-App-Agents-vulnerability-Metric-Low-severity',
_type: 'visualization',
_source: {
title: 'Metric Low severity',
Expand Down Expand Up @@ -244,7 +244,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-VULS-Top-Agents-severity',
_id: 'Wazuh-App-Agents-vulnerability-Top-Agents-severity',
_type: 'visualization',
_source: {
title: 'Top Agents severity',
Expand All @@ -258,5 +258,54 @@ export default [
'{"index":"wazuh-alerts","filter":[],"query":{"query":"","language":"lucene"}}'
}
}
},
{
_id: 'Wazuh-App-Agents-vulnerability-Most-common-rules',
_type: 'visualization',
_source: {
title: 'Most common rules',
visState:
'{"title":"Most common rules","type":"table","params":{"perPage":10,"showPartialRows":false,"showMetricsAtAllLevels":false,"sort":{"columnIndex":null,"direction":null},"showTotal":false,"totalFunc":"sum"},"aggs":[{"id":"1","enabled":true,"type":"count","schema":"metric","params":{}},{"id":"2","enabled":true,"type":"terms","schema":"bucket","params":{"field":"rule.id","size":5,"order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing","customLabel":"Rule ID"}},{"id":"3","enabled":true,"type":"terms","schema":"bucket","params":{"field":"rule.description","size":1,"order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing","customLabel":"Description"}}]}',
uiStateJSON:
'{"vis":{"params":{"sort":{"columnIndex":null,"direction":null}}}}',
description: '',
version: 1,
kibanaSavedObjectMeta: {
searchSourceJSON:
'{"index":"wazuh-alerts","filter":[],"query":{"query":"","language":"lucene"}}'
}
}
},
{
_id: 'Wazuh-App-Agents-vulnerability-Vulnerability-severity-distribution',
_type: 'visualization',
_source: {
title: 'Severity distribution',
visState:
'{"title":"Severity distribution","type":"pie","params":{"type":"pie","addTooltip":true,"addLegend":true,"legendPosition":"right","isDonut":true,"labels":{"show":false,"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":"data.vulnerability.severity","size":5,"order":"desc","orderBy":"1","customLabel":"Severity"}}]}',
uiStateJSON: '{}',
description: '',
version: 1,
kibanaSavedObjectMeta: {
searchSourceJSON:
'{"index":"wazuh-alerts","filter":[],"query":{"query":"","language":"lucene"}}'
}
}
},
{
_id: 'Wazuh-App-Agents-vulnerability-Vulnerability-Most-common-CVEs',
_type: 'visualization',
_source: {
title: 'Most common CVEs',
visState:
'{"title":"Most common CVEs","type":"pie","params":{"type":"pie","addTooltip":true,"addLegend":true,"legendPosition":"right","isDonut":true,"labels":{"show":false,"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":"data.vulnerability.cve","size":5,"order":"desc","orderBy":"1","customLabel":"CVE"}}]}',
uiStateJSON: '{}',
description: '',
version: 1,
kibanaSavedObjectMeta: {
searchSourceJSON:
'{"index":"wazuh-alerts","filter":[],"query":{"query":"","language":"lucene"}}'
}
}
}
];
Loading