From b0ef1d14db39021d1063c435642b8228dee2da0c Mon Sep 17 00:00:00 2001 From: Adri Valle Date: Tue, 30 Apr 2019 18:19:44 +0200 Subject: [PATCH] Minor fixes (#685) --- .../appserver/static/css/styles/common.css | 45 ++++++++ .../integrity-monitoring.html | 2 + .../overview/sca/overview-sca.html | 101 ++++++++++-------- .../overview/sca/overviewSCACtrl.js | 29 +++-- .../js/directives/wz-table/wz-table.html | 12 +-- 5 files changed, 130 insertions(+), 59 deletions(-) diff --git a/SplunkAppForWazuh/appserver/static/css/styles/common.css b/SplunkAppForWazuh/appserver/static/css/styles/common.css index 6072c2b8f..707b6faf2 100644 --- a/SplunkAppForWazuh/appserver/static/css/styles/common.css +++ b/SplunkAppForWazuh/appserver/static/css/styles/common.css @@ -1082,6 +1082,11 @@ md-toast { text-overflow: ellipsis; } +.wz-text-sca { + width: calc(100% - 100px) !important; + line-height: initial; +} + .wz-text-truncatable-container { overflow: hidden; width: auto; @@ -1787,4 +1792,44 @@ label.wz-icon-loupe input { margin: 10px 5px; display: block; color: gray; +} + +.wz-md-card:not(.fullscreen) .vis-sca #radialGauge > div > div > svg > path:nth-child(6) { + visibility: hidden !important; +} + +.wz-md-card:not(.fullscreen) .vis-sca #radialGauge > div > div > svg > path:nth-child(8) { + visibility: hidden !important; +} + +.wz-md-card:not(.fullscreen) .vis-sca #radialGauge > div > div > svg > path:nth-child(10) { + visibility: hidden !important; +} + +.wz-md-card:not(.fullscreen) .vis-sca #radialGauge > div > div > svg > path:nth-child(12) { + visibility: hidden !important; +} + +.wz-md-card:not(.fullscreen) .vis-sca #radialGauge > div > div > svg > path:nth-child(14) { + visibility: hidden !important; +} + +.wz-md-card:not(.fullscreen) .vis-sca #radialGauge > div > div > svg > path:nth-child(16) { + visibility: hidden !important; +} + +.wz-md-card:not(.fullscreen) .vis-sca #radialGauge > div > div > svg > text:nth-child(20) { + font-size: 25px !important; +} + +.wz-md-card:not(.fullscreen) .vis-sca #radialGauge > div > div > svg > text:not(:nth-child(20)) { + visibility: hidden !important; +} + +.vis-sca .viz-panel { + width: 15% !important; +} + +#scoreByPolicy .lazy-view-container { + height: 80% !important; } \ No newline at end of file diff --git a/SplunkAppForWazuh/appserver/static/js/controllers/management/configuration/integrity-monitoring/integrity-monitoring.html b/SplunkAppForWazuh/appserver/static/js/controllers/management/configuration/integrity-monitoring/integrity-monitoring.html index bef340b6a..2a93504ff 100644 --- a/SplunkAppForWazuh/appserver/static/js/controllers/management/configuration/integrity-monitoring/integrity-monitoring.html +++ b/SplunkAppForWazuh/appserver/static/js/controllers/management/configuration/integrity-monitoring/integrity-monitoring.html @@ -256,6 +256,8 @@ + + diff --git a/SplunkAppForWazuh/appserver/static/js/controllers/overview/sca/overview-sca.html b/SplunkAppForWazuh/appserver/static/js/controllers/overview/sca/overview-sca.html index 14b5cdbce..4a5948198 100644 --- a/SplunkAppForWazuh/appserver/static/js/controllers/overview/sca/overview-sca.html +++ b/SplunkAppForWazuh/appserver/static/js/controllers/overview/sca/overview-sca.html @@ -52,59 +52,51 @@
- -
- - - Overall Score - - - -
-
-
- - - - - Score by policy - - - -
-
-
-
- +
+ + + Score by policy + + + + + +
+
+
+
+ +
- + Results distribution - + + +
- + Top 5 passed checks - + + +
- + Top 5 failed checks - + + +
@@ -114,28 +106,51 @@
- - +
- + + + Top 5 agents + + + + + +
+
+
+ Result distribution by policy - + + +
+ + + Score evolution over time + + + + + +
+
+
- +
Alerts summary - + + +
diff --git a/SplunkAppForWazuh/appserver/static/js/controllers/overview/sca/overviewSCACtrl.js b/SplunkAppForWazuh/appserver/static/js/controllers/overview/sca/overviewSCACtrl.js index f960b0604..00089e5c8 100644 --- a/SplunkAppForWazuh/appserver/static/js/controllers/overview/sca/overviewSCACtrl.js +++ b/SplunkAppForWazuh/appserver/static/js/controllers/overview/sca/overviewSCACtrl.js @@ -17,6 +17,7 @@ define([ '../../../services/visualizations/chart/gauge-chart', '../../../services/visualizations/chart/pie-chart', '../../../services/visualizations/chart/area-chart', + '../../../services/visualizations/chart/linear-chart', '../../../services/visualizations/table/table', '../../../services/visualizations/inputs/time-picker', ], function( @@ -26,6 +27,7 @@ define([ GaugeChart, PieChart, AreaChart, + LinearChart, Table, TimePicker, ) { @@ -104,14 +106,6 @@ define([ /** * Visualizations */ - new SingleValue( - 'overallScore', - `${ - this.filters - } | stats sum(data.sca.failed) as failed, sum(data.sca.passed) as passed | eval total=((passed/(failed+passed))*100) | eval total2=round(total,1) | eval total3=(total2 + "%") | table total3 `, - 'overallScore', - this.scope - ), new GaugeChart( 'scoreByPolicy', `${ @@ -154,6 +148,14 @@ define([ 'top5Failed', this.scope ), + new PieChart( + 'top5Agents', + `${ + this.filters + } | top agent.name limit=5`, + 'top5Agents', + this.scope + ), new AreaChart( 'alertLevelEvolution', `${ @@ -162,11 +164,19 @@ define([ 'alertLevelEvolution', this.scope ), + new LinearChart( + 'overTimePolicy', + `${ + this.filters + } | timechart count by data.sca.policy`, + 'overTimePolicy', + this.scope + ), new Table( 'alertsSummary', `${ this.filters - } | stats count by data.sca.policy,data.sca.passed,data.sca.failed | fields - count`, + } | stats count by data.sca.policy,data.sca.passed,data.sca.failed | fields - count | rename data.sca.policy as Policy data.sca.passed as Passed data.sca.failed as Failed | sort - Passed`, 'alertsSummary', this.scope ) @@ -180,7 +190,6 @@ define([ 'Configuration assessment', this.filters, [ - 'overallScore', 'scoreByPolicy', 'resultDistribution', 'alertsOverTime', diff --git a/SplunkAppForWazuh/appserver/static/js/directives/wz-table/wz-table.html b/SplunkAppForWazuh/appserver/static/js/directives/wz-table/wz-table.html index e83508c94..865af97a7 100644 --- a/SplunkAppForWazuh/appserver/static/js/directives/wz-table/wz-table.html +++ b/SplunkAppForWazuh/appserver/static/js/directives/wz-table/wz-table.html @@ -250,28 +250,28 @@
Check not applicable due to: -

{{ item.reason }}

+

{{ item.reason }}

Rationale -

{{item.rationale}}

+

{{item.rationale}}

Remediation -

{{item.remediation}}

+

{{item.remediation}}

Description -

{{item.description}}

+

{{item.description}}

Path(s) -

{{ item.directory }}

+

{{ item.directory }}

Checks
    -
  • +
  • {{r.rule}}