Enhancement #2864

Dashboard: execute snortalog only when accessing IPS tab

Added by Giacomo Sanchietti almost 7 years ago. Updated about 6 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-snort
Target version:v6.6
Resolution: NEEDINFO:No

Description

The IPS widger calls snortalog each time the dashboard is loaded.
The dashboard can be very slow if Snort logs are very big.

Execute snortalog only when the user explicitly select a log from the IPS tab.


Related issues

Duplicated by NethServer 6 - Enhancement #3069: IPS: dashboard optimization CLOSED

Associated revisions

Revision 1a9f5342
Added by Giacomo Sanchietti about 6 years ago

Web UI: move dashaboard widget to new page. Refs #2864

History

#1 Updated by Filippo Carletti almost 7 years ago

  • Target version set to ~FUTURE

#2 Updated by Giacomo Sanchietti over 6 years ago

#3 Updated by Giacomo Sanchietti over 6 years ago

Also, display the list of available logs from the newest to the oldest one.

Tested fix:

--- /usr/share/nethesis/NethServer/Module/Dashboard/IPS.php.ori    2015-03-03 14:13:23.395024779 +0100
+++ /usr/share/nethesis/NethServer/Module/Dashboard/IPS.php    2015-03-03 14:19:36.698516603 +0100
@@ -45,7 +45,7 @@
                 $logs[] = $log;
             }
         }
-
+        sort($logs);
         return $logs;
     }

@@ -79,7 +79,7 @@
             $this->logs = $this->listLogs();
         }

-        $view['logsDatasource'] =  array_map(function($fmt) use ($view) {
+        $tmp =  array_map(function($fmt) use ($view) {
             if ($fmt == 'alert') {
                 $label = $view->translate('log_current');
             } else {
@@ -88,11 +88,10 @@
             }
             return array($fmt, $label);
         }, $this->logs);
+        array_unshift($tmp, array('-','-'));
+        $view['logsDatasource'] =  $tmp;

-        if (!$this->report) {
-            $this->report = $this->getReport();
-        }
         $view['report'] = $this->report;
     }
 }

#4 Updated by Davide Principi over 6 years ago

#5 Updated by Davide Principi over 6 years ago

#6 Updated by Giacomo Sanchietti about 6 years ago

  • Status changed from NEW to TRIAGED
  • Target version changed from ~FUTURE to v6.6
  • % Done changed from 0 to 20

#7 Updated by Giacomo Sanchietti about 6 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Giacomo Sanchietti
  • % Done changed from 20 to 30

#8 Updated by Giacomo Sanchietti about 6 years ago

  • Status changed from ON_DEV to MODIFIED
  • % Done changed from 30 to 60

Moved IPS tab outside the Dashboard in a new page called "IPS report"-

#9 Updated by Giacomo Sanchietti about 6 years ago

  • Status changed from MODIFIED to ON_QA
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 60 to 70
Package in nethserver-testing:
  • nethserver-snort-1.0.0-1.7.gd84f09c.ns6.noarch.rpm
Test case
  • Install the new package
  • Check the tab is removed from the Dashboard page
  • Check the new page under the "Status" category on the left menu

NB: also release new language packs when this is ready

#10 Updated by Filippo Carletti about 6 years ago

  • Status changed from ON_QA to VERIFIED
  • % Done changed from 70 to 90

A new menu named "IPS report" appeared on the left below Dashboard.
The reports are correct, the list show the latest report at top in descending order.

#11 Updated by Giacomo Sanchietti about 6 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100
Released in nethserver-updates:
  • nethserver-snort-1.0.1-1.ns6.noarch.rpm
  • snort-2.9.7.2-2.x86_64.rpm

Also available in: Atom PDF