aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort
diff options
context:
space:
mode:
Diffstat (limited to 'config/snort')
-rw-r--r--config/snort/snort.inc41
-rw-r--r--config/snort/snort_interfaces.php19
-rw-r--r--config/snort/snort_interfaces_edit.php4
-rw-r--r--config/snort/snort_interfaces_global.php22
-rw-r--r--config/snort/snort_interfaces_suppress_edit.php14
5 files changed, 51 insertions, 49 deletions
diff --git a/config/snort/snort.inc b/config/snort/snort.inc
index 4c4cae5d..535bb0ea 100644
--- a/config/snort/snort.inc
+++ b/config/snort/snort.inc
@@ -656,8 +656,7 @@ function snort_rules_up_install_cron($should_install) {
}
/* Only run when all ifaces needed to sync. Expects filesystem rw */
-function sync_snort_package_config()
-{
+function sync_snort_package_config() {
global $config, $g;
/* RedDevil suggested code */
@@ -704,7 +703,31 @@ function sync_snort_package_config()
}
/* create snort bootup file snort.sh only create once */
- create_snort_sh();
+ snort_create_rc();
+
+ if (is_array($config['installedpackages']['snortglobal'])) {
+ $snort_snortloglimit_info_ck = $config['installedpackages']['snortglobal']['snortloglimit'];
+ snort_snortloglimit_install_cron($snort_snortloglimit_info_ck == 'ok' ? true : false);
+
+ /* set the snort block hosts time IMPORTANT */
+ $snort_rm_blocked_info_ck = $config['installedpackages']['snortglobal']['rm_blocked'];
+ if ($snort_rm_blocked_info_ck == "never_b")
+ $snort_rm_blocked_false = false;
+ else
+ $snort_rm_blocked_false = true;
+
+ snort_rm_blocked_install_cron($snort_rm_blocked_false);
+
+ /* set the snort rules update time */
+ $snort_rules_up_info_ck = $config['installedpackages']['snortglobal']['autorulesupdate7'];
+ if ($snort_rules_up_info_ck == "never_up")
+ $snort_rules_up_false = false;
+ else
+ $snort_rules_up_false = true;
+
+ snort_rules_up_install_cron($snort_rules_up_false);
+ configure_cron();
+ }
/* all new files are for the user snort nologin */
if (!is_dir('/var/log/snort'))
@@ -819,7 +842,7 @@ function create_snort_externalnet($id, $if_real) {
}
/* open snort.sh for writing" */
-function create_snort_sh() {
+function snort_create_rc() {
global $config, $g;
$snortdir = SNORTDIR;
@@ -861,8 +884,8 @@ EOE;
fi
EOE;
- if ($value['barnyard_enable'] == 'on' && $value['barnyard_mysql'] != '')
- $start_barnyard2 = $start_barnyard2;
+ if ($value['barnyard_enable'] == 'on' && !empty($value['barnyard_mysql']))
+ $start_barnyard2 = $start_barnyard;
else
$start_barnyard2 = $stop_barnyard2;
@@ -992,11 +1015,11 @@ function generate_barnyard2_conf($id, $if_real, $snort_uuid) {
/* define snortbarnyardlog */
/* TODO: add support for the other 5 output plugins */
-
- $snortbarnyardlog_database_info_chk = $config['installedpackages']['snortglobal']['rule'][$id]['barnyard_mysql'];
+ $snortconf = $config['installedpackages']['snortglobal']['rule'][$id];
+ $snortbarnyardlog_database_info_chk = $snortconf['barnyard_mysql'];
$snortbarnyardlog_hostname_info_chk = exec("/bin/hostname");
/* user add arguments */
- $snortbarnyardlog_config_pass_thru = str_replace("\r", "", base64_decode($config['installedpackages']['snortglobal']['rule'][$id]['barnconfigpassthru']));
+ $snortbarnyardlog_config_pass_thru = str_replace("\r", "", base64_decode($snortconf['barnconfigpassthru']));
$barnyard2_conf_text = <<<EOD
diff --git a/config/snort/snort_interfaces.php b/config/snort/snort_interfaces.php
index 8f600182..f72bf391 100644
--- a/config/snort/snort_interfaces.php
+++ b/config/snort/snort_interfaces.php
@@ -70,10 +70,10 @@ if (isset($_POST['del_x'])) {
/* if there are no ifaces do not create snort.sh */
if (!empty($config['installedpackages']['snortglobal']['rule']))
- create_snort_sh();
+ snort_create_rc();
else {
conf_mount_rw();
- exec('/bin/rm /usr/local/etc/rc.d/snort.sh');
+ @unlink('/usr/local/etc/rc.d/snort.sh');
conf_mount_ro();
}
@@ -275,24 +275,21 @@ if ($pfsense_stable == 'yes')
$color2_upb = Running_Ck_b($snort_uuid, $if_real, $id);
- if ($color2_upb == 'yes') {
- $class_color_upb = 'listbg2';
- }else{
- $class_color_upb = 'listbg';
- }
+ if ($color2_upb == 'yes')
+ $color_status = 'listr';
+ else
+ $color_status = 'listbg';
?>
- <td class="listr" onClick="fr_toggle(<?=$nnats;?>)"
+ <td class="<?=$color_status;?>" onClick="fr_toggle(<?=$nnats;?>)"
id="frd<?=$nnats;?>"
ondblclick="document.location='snort_interfaces_edit.php?id=<?=$nnats;?>';">
<?php
$check_snortbarnyardlog_info = $config['installedpackages']['snortglobal']['rule'][$nnats]['barnyard_enable'];
if ($check_snortbarnyardlog_info == "on")
- {
$check_snortbarnyardlog = strtoupper(enabled);
- }else{
+ else
$check_snortbarnyardlog = strtoupper(disabled);
- }
?> <?php echo "$check_snortbarnyardlog";?></td>
<td class="listbg" onClick="fr_toggle(<?=$nnats;?>)"
ondblclick="document.location='snort_interfaces_edit.php?id=<?=$nnats;?>';">
diff --git a/config/snort/snort_interfaces_edit.php b/config/snort/snort_interfaces_edit.php
index b83f4ad2..314a0200 100644
--- a/config/snort/snort_interfaces_edit.php
+++ b/config/snort/snort_interfaces_edit.php
@@ -385,7 +385,7 @@ function enable_change(enable_change) {
display_top_tabs($tab_array);
?>
</td></tr>
-</table>
+<tr><td class="tabcont">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td colspan="2" valign="top" class="listtopic">General Settings</td>
@@ -653,6 +653,8 @@ function enable_change(enable_change) {
Please save your settings before you click start. </td>
</tr>
</table>
+</td></tr>
+</table>
</form>
<script language="JavaScript">
<!--
diff --git a/config/snort/snort_interfaces_global.php b/config/snort/snort_interfaces_global.php
index 10559642..a328012a 100644
--- a/config/snort/snort_interfaces_global.php
+++ b/config/snort/snort_interfaces_global.php
@@ -79,28 +79,6 @@ if (!$input_errors) {
$retval = 0;
- $snort_snortloglimit_info_ck = $config['installedpackages']['snortglobal']['snortloglimit'];
- snort_snortloglimit_install_cron($snort_snortloglimit_info_ck == 'ok' ? true : false);
-
- /* set the snort block hosts time IMPORTANT */
- $snort_rm_blocked_info_ck = $config['installedpackages']['snortglobal']['rm_blocked'];
- if ($snort_rm_blocked_info_ck == "never_b")
- $snort_rm_blocked_false = false;
- else
- $snort_rm_blocked_false = true;
-
- snort_rm_blocked_install_cron($snort_rm_blocked_false);
-
- /* set the snort rules update time */
- $snort_rules_up_info_ck = $config['installedpackages']['snortglobal']['autorulesupdate7'];
- if ($snort_rules_up_info_ck == "never_up")
- $snort_rules_up_false = false;
- else
- $snort_rules_up_false = true;
-
- snort_rules_up_install_cron($snort_rules_up_false);
-
- configure_cron();
write_config();
/* create whitelist and homenet file then sync files */
diff --git a/config/snort/snort_interfaces_suppress_edit.php b/config/snort/snort_interfaces_suppress_edit.php
index db2757a9..082911b0 100644
--- a/config/snort/snort_interfaces_suppress_edit.php
+++ b/config/snort/snort_interfaces_suppress_edit.php
@@ -47,8 +47,6 @@ $a_suppress = &$config['installedpackages']['snortglobal']['suppress']['item'];
$id = $_GET['id'];
if (isset($_POST['id']))
$id = $_POST['id'];
-if (!is_numeric($id))
- $id = 0; // XXX: safety belt
/* gen uuid for each iface */
@@ -158,7 +156,9 @@ include("fbegin.inc");
}
?>
-<form action="/snort/snort_interfaces_suppress_edit.php?id=<?=$id?>" name="iform" id="iform">
+<form action="/snort/snort_interfaces_suppress_edit.php" name="iform" id="iform" method="post">
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabcont">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td colspan="2" class="listtopic">Add the name and description of the file.</td>
@@ -207,9 +207,9 @@ include("fbegin.inc");
count 100, seconds 1, new_action log, timeout 10</td>
</tr>
<tr>
- <td colspan="2" width="100%" class="vtable"><textarea wrap="off"
- name="suppresspassthru" cols="90" rows="28" id="suppresspassthru">
- <?=htmlspecialchars($pconfig['suppresspassthru']);?></textarea>
+ <td width="10%" class="vncell">&nbsp;Advanced pass through</td>
+ <td width="100%" class="vtable"><textarea wrap="off"
+ name="suppresspassthru" cols="90" rows="28" id="suppresspassthru" class="formpre"> <?=htmlspecialchars($pconfig['suppresspassthru']);?></textarea>
</td>
</tr>
<tr>
@@ -222,6 +222,8 @@ include("fbegin.inc");
</td>
</tr>
</table>
+</td></tr>
+</table>
</form>
<?php include("fend.inc"); ?>
<script type="text/javascript">