From e4c13a5752c5f7b4947edbc4227b005cd333566d Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 25 Jan 2012 23:12:11 +0000 Subject: Expose the new options of spoink to the GUI Improve spoink code a lot: - Allow to block by src/dst/both on the packet that generated alert. Default to src to keep backward compatibility - Speedup whitelist search - Create an option that allows to kill states on pf for blocked hosts. This allows to remove all access to the blocked host. TODO: - More fine grained blocking options? - Make whiwhitelist hparsing less sucky and IPv6 compatible --- config/snort/snort.inc | 6 ++++- config/snort/snort_interfaces_edit.php | 46 +++++++++++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 4 deletions(-) (limited to 'config/snort') diff --git a/config/snort/snort.inc b/config/snort/snort.inc index 98d7ebfa..6aef1eed 100644 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -1383,7 +1383,11 @@ function generate_snort_conf($id, $if_real, $snort_uuid) else if (file_exists("/usr/local/etc/snort/whitelist/{$snortcfg['whitelistname']}")) $spoink_whitelist_name = $snortcfg['whitelistname']; - $spoink_type = "output alert_pf: /usr/local/etc/snort/whitelist/{$spoink_whitelist_name},snort2c"; + $pfkill = ""; + if ($snortcfg['blockoffenderskill'] == "on") + $pfkill = "kill"; + + $spoink_type = "output alert_pf: /usr/local/etc/snort/whitelist/{$spoink_whitelist_name},snort2c,{$snortcfg['blockoffendersip']},{$pfkill}"; } /* define threshold file */ diff --git a/config/snort/snort_interfaces_edit.php b/config/snort/snort_interfaces_edit.php index 3b4ae8b4..90f48a4b 100644 --- a/config/snort/snort_interfaces_edit.php +++ b/config/snort/snort_interfaces_edit.php @@ -128,6 +128,8 @@ if (isset($id) && $a_nat[$id]) { $pconfig['descr'] = $a_nat[$id]['descr']; $pconfig['performance'] = $a_nat[$id]['performance']; $pconfig['blockoffenders7'] = $a_nat[$id]['blockoffenders7']; + $pconfig['blockoffenderskill'] = $a_nat[$id]['blockoffenderskill']; + $pconfig['blockoffendersip'] = $a_nat[$id]['blockoffendersip']; $pconfig['whitelistname'] = $a_nat[$id]['whitelistname']; $pconfig['homelistname'] = $a_nat[$id]['homelistname']; $pconfig['externallistname'] = $a_nat[$id]['externallistname']; @@ -204,6 +206,11 @@ if (isset($_GET['dup'])) $natent['blockoffenders7'] = 'on'; else $natent['blockoffenders7'] = 'off'; + if ($_POST['blockoffenderskill'] == "on") + $natent['blockoffenderskill'] = 'on'; + if ($_POST['blockoffendersip']) + $natent['blockoffendersip'] = $_POST['blockoffendersip']; + $natent['whitelistname'] = $_POST['whitelistname'] ? $_POST['whitelistname'] : $pconfig['whitelistname']; $natent['homelistname'] = $_POST['homelistname'] ? $_POST['homelistname'] : $pconfig['homelistname']; $natent['externallistname'] = $_POST['externallistname'] ? $_POST['externallistname'] : $pconfig['externallistname']; @@ -340,6 +347,12 @@ enable JavaScript to view this content -- cgit v1.2.3