From 2d0407fc77b1ac25bf92b6bda3a35d6b2e970070 Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 12 Jun 2012 21:06:59 +0000 Subject: Put a single alert file for each instance of snort so it actually works. Also correct blocked page/ For large files this still will bail out --- config/snort/snort_alerts.php | 67 +++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 28 deletions(-) (limited to 'config/snort/snort_alerts.php') diff --git a/config/snort/snort_alerts.php b/config/snort/snort_alerts.php index 53b9e3a2..3094d1a7 100644 --- a/config/snort/snort_alerts.php +++ b/config/snort/snort_alerts.php @@ -43,7 +43,13 @@ $snort_load_sortabletable = 'yes'; $snort_load_mootools = 'yes'; $snortalertlogt = $config['installedpackages']['snortglobal']['snortalertlogtype']; -$snort_logfile = '/var/log/snort/alert'; + +if (!is_array($config['installedpackages']['snortglobal']['rule'])) + $config['installedpackages']['snortglobal']['rule'] = array(); +$a_instance = &$config['installedpackages']['snortglobal']['rule']; +$snort_uuid = $a_instance[0]['uuid']; +if ($_POST['instance']) + $snort_uuid = $a_instance[$_POST['instance']]['uuid']; if (is_array($config['installedpackages']['snortglobal']['alertsblocks'])) { $pconfig['arefresh'] = $config['installedpackages']['snortglobal']['alertsblocks']['arefresh']; @@ -87,10 +93,10 @@ if ($_POST['save']) if ($_GET['action'] == "clear" || $_POST['clear']) { - if(file_exists('/var/log/snort/alert')) + if (file_exists("/var/log/snort/alert_{$snort_uuid}")) { conf_mount_rw(); - @file_put_contents("/var/log/snort/alert", ""); + @file_put_contents("/var/log/snort/alert_{$snort_uuid}", ""); post_delete_logs(); /* XXX: This is needed is snort is run as snort user */ //mwexec('/usr/sbin/chown snort:snort /var/log/snort/*', true); @@ -291,40 +297,45 @@ if ($pconfig['arefresh'] == 'on')
- +
+ - - + + + + + +
Last - Alert Entries.Latest Alert Entries Are Listed - First.Last Alert Entries.Latest Alert Entries Are Listed First.
Instance to inspect +

Choose which instance alerts you want to inspect. +
Save or Remove Logs - All - log files will be saved. - Warning: all log files - will be deleted. + All + log files will be saved. + + Warning: all log files will be deleted.
Auto Refresh and Log View -
Refresh + Refresh > - Default is ON. Enter the - number of log entries to view. Default is 250. -
+ Default is ON. + + Enter the number of log entries to view. Default is 250.
@@ -370,16 +381,16 @@ if ($pconfig['arefresh'] == 'on')