Fix multiple visualization names

This commit is contained in:
Jesús Ángel 2019-08-29 15:10:14 +02:00
parent bea2bb1e05
commit 4a521dcc06
10 changed files with 68 additions and 66 deletions

View File

@ -221,7 +221,9 @@ app.directive('kbnVis', function() {
});
const renderComplete = () => {
console.log(typeof $scope.visID)
if(!$scope.visID.toLowerCase().includes(tabVisualizations.getTab())){
console.log(`Destroying ${$scope.visID.toLowerCase()}, tab: ${tabVisualizations.getTab()}`)
destroyAll();
return;
}

View File

@ -29,7 +29,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Agents-Overview-Alert-groups-evolution" vis-id="'Wazuh-App-Agents-Overview-Alert-groups-evolution'"></kbn-vis>
<kbn-vis id="Wazuh-App-Agents-General-Alert-groups-evolution" vis-id="'Wazuh-App-Agents-General-Alert-groups-evolution'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card" ng-class="{'fullscreen': expandArray[1]}">
@ -41,7 +41,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Agents-Overview-Alerts" vis-id="'Wazuh-App-Agents-Overview-Alerts'"></kbn-vis>
<kbn-vis id="Wazuh-App-Agents-General-Alerts" vis-id="'Wazuh-App-Agents-General-Alerts'"></kbn-vis>
</md-card-content>
</md-card>
</div>
@ -57,7 +57,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Agents-Overview-Top-5-alerts" vis-id="'Wazuh-App-Agents-Overview-Top-5-alerts'">
<kbn-vis id="Wazuh-App-Agents-General-Top-5-alerts" vis-id="'Wazuh-App-Agents-General-Top-5-alerts'">
</kbn-vis>
</md-card-content>
</md-card>
@ -70,7 +70,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Agents-Overview-Top-10-groups" vis-id="'Wazuh-App-Agents-Overview-Top-10-groups'">
<kbn-vis id="Wazuh-App-Agents-General-Top-10-groups" vis-id="'Wazuh-App-Agents-General-Top-10-groups'">
</kbn-vis>
</md-card-content>
</md-card>
@ -83,7 +83,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Agents-Overview-Top-5-PCI-DSS-Requirements" vis-id="'Wazuh-App-Agents-Overview-Top-5-PCI-DSS-Requirements'"></kbn-vis>
<kbn-vis id="Wazuh-App-Agents-General-Top-5-PCI-DSS-Requirements" vis-id="'Wazuh-App-Agents-General-Top-5-PCI-DSS-Requirements'"></kbn-vis>
</md-card-content>
</md-card>
</div>
@ -98,7 +98,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis vis-id="'Wazuh-App-Agents-Overview-Alerts-summary'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Agents-General-Alerts-summary'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card" ng-class="{'fullscreen': expandArray[6]}">
@ -110,7 +110,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis vis-id="'Wazuh-App-Agents-Overview-Groups-summary'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Agents-General-Groups-summary'"></kbn-vis>
</md-card-content>
</md-card>
</div>

View File

@ -13,10 +13,10 @@
</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>
<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 layout="row" layout-align="center stretch" class="height-300">
@ -29,7 +29,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Agents-vulnerability-Alerts-severity-over-time" vis-id="'Wazuh-App-Agents-vulnerability-Alerts-severity-over-time'"></kbn-vis>
<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 class="wz-md-card" ng-class="{'fullscreen': expandArray[1]}">
@ -41,7 +41,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis vis-id="'Wazuh-App-Agents-vulnerability-Most-common-rules'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Agents-vuls-Most-common-rules'"></kbn-vis>
</md-card-content>
</md-card>
</div>
@ -55,7 +55,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Agents-vulnerability-Vulnerability-Most-common-CVEs" vis-id="'Wazuh-App-Agents-vulnerability-Vulnerability-Most-common-CVEs'"></kbn-vis>
<kbn-vis id="Wazuh-App-Agents-vuls-Vulnerability-Most-common-CVEs" vis-id="'Wazuh-App-Agents-vuls-Vulnerability-Most-common-CVEs'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card" ng-class="{'fullscreen': expandArray[3]}">
@ -67,7 +67,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Agents-vulnerability-Vulnerability-severity-distribution" vis-id="'Wazuh-App-Agents-vulnerability-Vulnerability-severity-distribution'"></kbn-vis>
<kbn-vis id="Wazuh-App-Agents-vuls-Vulnerability-severity-distribution" vis-id="'Wazuh-App-Agents-vuls-Vulnerability-severity-distribution'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card" ng-class="{'fullscreen': expandArray[4]}">
@ -79,7 +79,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Agents-vulnerability-Commonly-affected-packages" vis-id="'Wazuh-App-Agents-vulnerability-Commonly-affected-packages'"></kbn-vis>
<kbn-vis id="Wazuh-App-Agents-vuls-Commonly-affected-packages" vis-id="'Wazuh-App-Agents-vuls-Commonly-affected-packages'"></kbn-vis>
</md-card-content>
</md-card>
</div>
@ -94,7 +94,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis vis-id="'Wazuh-App-Agents-vulnerability-Alert-summary'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Agents-vuls-Alert-summary'"></kbn-vis>
</md-card-content>
</md-card>
</div>

View File

@ -13,10 +13,10 @@
</div>
<div class="wz-no-display">
<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>
<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>
</div>
<div layout="row" layout-align="center stretch" class="height-270">
@ -29,7 +29,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Overview-vulnerability-Most-affected-agents" vis-id="'Wazuh-App-Overview-vulnerability-Most-affected-agents'"></kbn-vis>
<kbn-vis id="Wazuh-App-Overview-vuls-Most-affected-agents" vis-id="'Wazuh-App-Overview-vuls-Most-affected-agents'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card" ng-class="{'fullscreen': octrl.expandArray[1]}">
@ -41,7 +41,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Overview-vulnerability-Alerts-severity" vis-id="'Wazuh-App-Overview-vulnerability-Alerts-severity'"></kbn-vis>
<kbn-vis id="Wazuh-App-Overview-vuls-Alerts-severity" vis-id="'Wazuh-App-Overview-vuls-Alerts-severity'"></kbn-vis>
</md-card-content>
</md-card>
</div>
@ -56,7 +56,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Overview-vulnerability-Vulnerability-severity-distribution" vis-id="'Wazuh-App-Overview-vulnerability-Vulnerability-severity-distribution'"></kbn-vis>
<kbn-vis id="Wazuh-App-Overview-vuls-Vulnerability-severity-distribution" vis-id="'Wazuh-App-Overview-vuls-Vulnerability-severity-distribution'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card" ng-class="{'fullscreen': octrl.expandArray[3]}">
@ -68,7 +68,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Overview-vulnerability-Commonly-affected-packages" vis-id="'Wazuh-App-Overview-vulnerability-Commonly-affected-packages'"></kbn-vis>
<kbn-vis id="Wazuh-App-Overview-vuls-Commonly-affected-packages" vis-id="'Wazuh-App-Overview-vuls-Commonly-affected-packages'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card" ng-class="{'fullscreen': octrl.expandArray[4]}">
@ -80,7 +80,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Overview-vulnerability-Most-common-CVEs" vis-id="'Wazuh-App-Overview-vulnerability-Most-common-CVEs'"></kbn-vis>
<kbn-vis id="Wazuh-App-Overview-vuls-Most-common-CVEs" vis-id="'Wazuh-App-Overview-vuls-Most-common-CVEs'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card" ng-class="{'fullscreen': octrl.expandArray[5]}">
@ -92,7 +92,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Overview-vulnerability-Most-common-CWEs" vis-id="'Wazuh-App-Overview-vulnerability-Most-common-CWEs'"></kbn-vis>
<kbn-vis id="Wazuh-App-Overview-vuls-Most-common-CWEs" vis-id="'Wazuh-App-Overview-vuls-Most-common-CWEs'"></kbn-vis>
</md-card-content>
</md-card>
</div>
@ -106,7 +106,7 @@
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis vis-id="'Wazuh-App-Overview-vulnerability-Alert-summary'"></kbn-vis>
<kbn-vis vis-id="'Wazuh-App-Overview-vuls-Alert-summary'"></kbn-vis>
</md-card-content>
</md-card>
</div>

View File

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

View File

@ -23,12 +23,12 @@ const metricsGeneral = {
// Metrics Vulnerability Detector
const metricsVulnerability = {
vulnCritical:
'[vis-id="\'Wazuh-App-Overview-vulnerability-Metric-Critical-severity\'"]',
'[vis-id="\'Wazuh-App-Overview-vuls-Metric-Critical-severity\'"]',
vulnHigh:
'[vis-id="\'Wazuh-App-Overview-vulnerability-Metric-High-severity\'"]',
'[vis-id="\'Wazuh-App-Overview-vuls-Metric-High-severity\'"]',
vulnMedium:
'[vis-id="\'Wazuh-App-Overview-vulnerability-Metric-Medium-severity\'"]',
vulnLow: '[vis-id="\'Wazuh-App-Overview-vulnerability-Metric-Low-severity\'"]'
'[vis-id="\'Wazuh-App-Overview-vuls-Metric-Medium-severity\'"]',
vulnLow: '[vis-id="\'Wazuh-App-Overview-vuls-Metric-Low-severity\'"]'
};
// Metrics Scap

View File

@ -261,7 +261,7 @@ export function Initialize(server) {
source.lastRestart = currentDate;
// If this function fails, it throws an exception
fs.writeFileSync(wazuhVersion, JSON.stringify(source), 'utf-8');
//fs.writeFileSync(wazuhVersion, JSON.stringify(source), 'utf-8');
}
} catch (error) {
return Promise.reject(error);

View File

@ -11,7 +11,7 @@
*/
export default [
{
_id: 'Wazuh-App-Agents-Overview-Top-5-alerts',
_id: 'Wazuh-App-Agents-General-Top-5-alerts',
_source: {
title: 'Top 5 alerts',
visState:
@ -188,7 +188,7 @@ export default [
_type: 'visualization'
},
{
_id: 'Wazuh-App-Agents-Overview-Top-10-groups',
_id: 'Wazuh-App-Agents-General-Top-10-groups',
_source: {
title: 'Top 5 rule groups',
visState:
@ -204,7 +204,7 @@ export default [
_type: 'visualization'
},
{
_id: 'Wazuh-App-Agents-Overview-Top-5-PCI-DSS-Requirements',
_id: 'Wazuh-App-Agents-General-Top-5-PCI-DSS-Requirements',
_source: {
title: 'Top 5 PCI DSS requirements',
visState:
@ -220,7 +220,7 @@ export default [
_type: 'visualization'
},
{
_id: 'Wazuh-App-Agents-Overview-Alert-groups-evolution',
_id: 'Wazuh-App-Agents-General-Alert-groups-evolution',
_source: {
title: 'Alert groups evolution',
visState:
@ -236,7 +236,7 @@ export default [
_type: 'visualization'
},
{
_id: 'Wazuh-App-Agents-Overview-Alerts',
_id: 'Wazuh-App-Agents-General-Alerts',
_source: {
title: 'Alerts',
visState:
@ -252,7 +252,7 @@ export default [
_type: 'visualization'
},
{
_id: 'Wazuh-App-Agents-Overview-Alerts-summary',
_id: 'Wazuh-App-Agents-General-Alerts-summary',
_type: 'visualization',
_source: {
title: 'Alerts summary',
@ -269,7 +269,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-Overview-Groups-summary',
_id: 'Wazuh-App-Agents-General-Groups-summary',
_type: 'visualization',
_source: {
title: 'Groups summary',

View File

@ -11,7 +11,7 @@
*/
export default [
{
_id: 'Wazuh-App-Agents-vulnerability-Alerts-severity-over-time',
_id: 'Wazuh-App-Agents-vuls-Alerts-severity-over-time',
_type: 'visualization',
_source: {
title: 'Alerts severity over time',
@ -27,7 +27,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-vulnerability-Alert-summary',
_id: 'Wazuh-App-Agents-vuls-Alert-summary',
_type: 'visualization',
_source: {
title: 'Alerts summary',
@ -44,7 +44,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-vulnerability-Commonly-affected-packages',
_id: 'Wazuh-App-Agents-vuls-Commonly-affected-packages',
_type: 'visualization',
_source: {
title: 'Top 5 affected packages',
@ -60,7 +60,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-vulnerability-Metric-Critical-severity',
_id: 'Wazuh-App-Agents-vuls-Metric-Critical-severity',
_type: 'visualization',
_source: {
title: 'Metric Critical severity',
@ -106,7 +106,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-vulnerability-Metric-High-severity',
_id: 'Wazuh-App-Agents-vuls-Metric-High-severity',
_type: 'visualization',
_source: {
title: 'Metric High severity',
@ -152,7 +152,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-vulnerability-Metric-Medium-severity',
_id: 'Wazuh-App-Agents-vuls-Metric-Medium-severity',
_type: 'visualization',
_source: {
title: 'Metric Medium severity',
@ -198,7 +198,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-vulnerability-Metric-Low-severity',
_id: 'Wazuh-App-Agents-vuls-Metric-Low-severity',
_type: 'visualization',
_source: {
title: 'Metric Low severity',
@ -244,7 +244,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-vulnerability-Top-Agents-severity',
_id: 'Wazuh-App-Agents-vuls-Top-Agents-severity',
_type: 'visualization',
_source: {
title: 'Top Agents severity',
@ -260,7 +260,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-vulnerability-Most-common-rules',
_id: 'Wazuh-App-Agents-vuls-Most-common-rules',
_type: 'visualization',
_source: {
title: 'Most common rules',
@ -277,7 +277,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-vulnerability-Vulnerability-severity-distribution',
_id: 'Wazuh-App-Agents-vuls-Vulnerability-severity-distribution',
_type: 'visualization',
_source: {
title: 'Severity distribution',
@ -293,7 +293,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Agents-vulnerability-Vulnerability-Most-common-CVEs',
_id: 'Wazuh-App-Agents-vuls-Vulnerability-Most-common-CVEs',
_type: 'visualization',
_source: {
title: 'Most common CVEs',

View File

@ -11,7 +11,7 @@
*/
export default [
{
_id: 'Wazuh-App-Overview-vulnerability-Alerts-severity',
_id: 'Wazuh-App-Overview-vuls-Alerts-severity',
_type: 'visualization',
_source: {
title: 'Severity count',
@ -27,7 +27,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Overview-vulnerability-Alert-summary',
_id: 'Wazuh-App-Overview-vuls-Alert-summary',
_type: 'visualization',
_source: {
title: 'Alert summary',
@ -44,7 +44,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Overview-vulnerability-Commonly-affected-packages',
_id: 'Wazuh-App-Overview-vuls-Commonly-affected-packages',
_type: 'visualization',
_source: {
title: 'Commonly affected packages',
@ -60,7 +60,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Overview-vulnerability-Most-common-CVEs',
_id: 'Wazuh-App-Overview-vuls-Most-common-CVEs',
_type: 'visualization',
_source: {
title: 'Most common CVEs',
@ -76,7 +76,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Overview-vulnerability-Most-common-CWEs',
_id: 'Wazuh-App-Overview-vuls-Most-common-CWEs',
_type: 'visualization',
_source: {
title: 'Most common CWEs',
@ -92,7 +92,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Overview-vulnerability-Metric-Critical-severity',
_id: 'Wazuh-App-Overview-vuls-Metric-Critical-severity',
_type: 'visualization',
_source: {
title: 'Metric Critical severity',
@ -138,7 +138,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Overview-vulnerability-Metric-High-severity',
_id: 'Wazuh-App-Overview-vuls-Metric-High-severity',
_type: 'visualization',
_source: {
title: 'Metric High severity',
@ -184,7 +184,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Overview-vulnerability-Metric-Medium-severity',
_id: 'Wazuh-App-Overview-vuls-Metric-Medium-severity',
_type: 'visualization',
_source: {
title: 'Metric Medium severity',
@ -230,7 +230,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Overview-vulnerability-Metric-Low-severity',
_id: 'Wazuh-App-Overview-vuls-Metric-Low-severity',
_type: 'visualization',
_source: {
title: 'Metric Low severity',
@ -276,7 +276,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Overview-vulnerability-Most-affected-agents',
_id: 'Wazuh-App-Overview-vuls-Most-affected-agents',
_type: 'visualization',
_source: {
title: 'Most affected agents',
@ -292,7 +292,7 @@ export default [
}
},
{
_id: 'Wazuh-App-Overview-vulnerability-Vulnerability-severity-distribution',
_id: 'Wazuh-App-Overview-vuls-Vulnerability-severity-distribution',
_type: 'visualization',
_source: {
title: 'Severity distribution',