diff options
Diffstat (limited to 'config/snort/snort_rulesets.php')
-rw-r--r-- | config/snort/snort_rulesets.php | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/config/snort/snort_rulesets.php b/config/snort/snort_rulesets.php index b08d7e6f..f399655e 100644 --- a/config/snort/snort_rulesets.php +++ b/config/snort/snort_rulesets.php @@ -30,10 +30,9 @@ */ require_once("guiconfig.inc"); -require_once("/usr/local/pkg/snort/snort_gui.inc"); require_once("/usr/local/pkg/snort/snort.inc"); -global $g, $snortdir; +global $g; if (!is_array($config['installedpackages']['snortglobal']['rule'])) { $config['installedpackages']['snortglobal']['rule'] = array(); @@ -64,9 +63,9 @@ $pgtitle = "Snort: Interface $id $iface_uuid $if_real Categories"; /* Check if the rules dir is empy if so warn the user */ /* TODO give the user the option to delete the installed rules rules */ -$isrulesfolderempty = exec("ls -A {$snortdir}/snort_{$iface_uuid}_{$if_real}/rules/*.rules"); +$isrulesfolderempty = exec("ls -A /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/*.rules"); if ($isrulesfolderempty == "") { - $isrulesfolderempty = exec("ls -A {$snortdir}/rules/*.rules"); + $isrulesfolderempty = exec("ls -A /usr/local/etc/snort/rules/*.rules"); if ($isrulesfolderempty == "") { include_once("head.inc"); include("fbegin.inc"); @@ -105,7 +104,7 @@ if ($isrulesfolderempty == "") { <table id=\"maintable\" class=\"tabcont\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n <tr>\n <td>\n - # The rules directory is empty. {$snortdir}/snort_{$iface_uuid}_{$if_real}/rules \n + # The rules directory is empty. /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules \n </td>\n </tr>\n </table>\n @@ -127,7 +126,7 @@ if ($isrulesfolderempty == "") { exit(0); } else { /* Make sure that we have the rules */ - mwexec("/bin/cp {$snortdir}/rules/*.rules {$snortdir}/snort_{$iface_uuid}_{$if_real}/rules", true); + mwexec("/bin/cp /usr/local/etc/snort/rules/*.rules /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules", true); } } @@ -167,7 +166,6 @@ include_once("head.inc"); <?php include("fbegin.inc"); ?> <?if($pfsense_stable == 'yes'){echo '<p class="pgtitle">' . $pgtitle . '</p>';}?> -<div class="body2"> <?php echo "<form action=\"snort_rulesets.php?id={$id}\" method=\"post\" name=\"iform\" id=\"iform\">"; @@ -181,16 +179,16 @@ if ($input_errors) { } if ($savemsg) { - print_info_box2($savemsg); + print_info_box($savemsg); } if (file_exists($d_snortconfdirty_path)) { echo '<p>'; if($savemsg) { - print_info_box_np2("{$savemsg}"); + print_info_box_np("{$savemsg}"); }else{ - print_info_box_np2(' + print_info_box_np(' The Snort configuration has changed and snort needs to be restarted on this interface.<br> You must apply the changes in order for them to take effect.<br> '); @@ -234,8 +232,9 @@ if (file_exists($d_snortconfdirty_path)) { <td class="listhdrr"><?php if($snort_arch == 'x86'){echo 'Ruleset: Rules that end with "so.rules" are shared object rules.';}else{echo 'Shared object rules are "so.rules" and not available on 64 bit architectures.';}?></td> <!-- <td class="listhdrr">Description</td> --> </tr> - <?php - $dh = opendir("{$snortdir}/snort_{$iface_uuid}_{$if_real}/rules/"); + <?php + $dir = "/usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/"; + $dh = opendir($dir); while (false !== ($filename = readdir($dh))) { $files[] = basename($filename); } @@ -256,10 +255,14 @@ if (file_exists($d_snortconfdirty_path)) { echo " \n<input type='checkbox' name='toenable[]' value='$file' {$CHECKED} />\n"; echo "</td>\n"; echo "<td>\n"; - echo "<a href='snort_rules.php?id={$id}&openruleset={$snortdir}/snort_{$iface_uuid}_{$if_real}/rules/" . urlencode($file) . "'>{$file}</a>\n"; + echo "<a href='snort_rules.php?id={$id}&openruleset=/usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/" . urlencode($file) . "'>{$file}</a>\n"; echo "</td>\n</tr>\n\n"; + //echo "<td>"; + //echo "description"; + //echo "</td>"; } - ?> + + ?> </table> </td> </tr> @@ -282,7 +285,6 @@ if (file_exists($d_snortconfdirty_path)) { </table> </form> <p><b>NOTE:</b> You can click on a ruleset name to edit the ruleset.</p> -</div> <?php include("fend.inc"); ?> |