diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/snort/help_and_info.php | 2 | ||||
-rw-r--r-- | config/snort/snort_check_cron_misc.inc | 160 | ||||
-rw-r--r-- | config/snort/snort_check_for_rule_updates.php | 2 | ||||
-rw-r--r-- | config/snort/snort_dynamic_ip_reload.php | 2 | ||||
-rw-r--r-- | config/snort/snort_head.inc | 248 |
5 files changed, 207 insertions, 207 deletions
diff --git a/config/snort/help_and_info.php b/config/snort/help_and_info.php index 215a055e..2ab05d07 100644 --- a/config/snort/help_and_info.php +++ b/config/snort/help_and_info.php @@ -244,4 +244,4 @@ Please do not email individuals, the coreteam address, or private message people '; -?>
\ No newline at end of file +?> diff --git a/config/snort/snort_check_cron_misc.inc b/config/snort/snort_check_cron_misc.inc index 0beff5dc..a20b42b4 100644 --- a/config/snort/snort_check_cron_misc.inc +++ b/config/snort/snort_check_cron_misc.inc @@ -1,80 +1,80 @@ -<?php
-/* $Id$ */
-/*
- snort_chk_log_dir_size.php
- part of pfSense
-
- Modified for the Pfsense snort package v. 1.8+
- Copyright (C) 2009-2010 Robert Zelaya Developer
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-require_once("/usr/local/pkg/snort/snort.inc");
-
-// 'B' => 1,
-// 'KB' => 1024,
-// 'MB' => 1024 * 1024,
-// 'GB' => 1024 * 1024 * 1024,
-// 'TB' => 1024 * 1024 * 1024 * 1024,
-// 'PB' => 1024 * 1024 * 1024 * 1024 * 1024,
-
-
-/* chk if snort log dir is full if so clear it */
-$snortloglimit = $config['installedpackages']['snortglobal']['snortloglimit'];
-$snortloglimitsize = $config['installedpackages']['snortglobal']['snortloglimitsize'];
-
-if ($g['booting']==true) {
- exit(0);
-}
-
-if ($snortloglimit == 'off') {
- exit(0);
-}
-
-$snortloglimitDSKsize = exec('/bin/df -k /var | grep -v "Filesystem" | awk \'{print $4}\'');
-
-$snortlogAlertsizeKB = snort_Getdirsize('/var/log/snort/alert');
-$snortloglimitAlertsizeKB = round($snortlogAlertsizeKB * .70);
-$snortloglimitsizeKB = round($snortloglimitsize * 1024);
-
-/* do I need HUP kill ? */
-if (snort_Getdirsize('/var/log/snort/') >= $snortloglimitsizeKB ) {
-
- conf_mount_rw();
- if(file_exists('/var/log/snort/alert')) {
- if ($snortlogAlertsizeKB >= $snortloglimitAlertsizeKB) {
- exec('/bin/echo "" > /var/log/snort/alert');
- }
- post_delete_logs();
- exec('/usr/sbin/chown snort:snort /var/log/snort/*');
- exec('/bin/chmod 660 /var/log/snort/*');
- //sleep(2);
- //exec('/usr/bin/killall -HUP snort');
- }
- conf_mount_ro();
-
-}
-
-
-?>
\ No newline at end of file +<?php +/* $Id$ */ +/* + snort_chk_log_dir_size.php + part of pfSense + + Modified for the Pfsense snort package v. 1.8+ + Copyright (C) 2009-2010 Robert Zelaya Developer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +require_once("/usr/local/pkg/snort/snort.inc"); + +// 'B' => 1, +// 'KB' => 1024, +// 'MB' => 1024 * 1024, +// 'GB' => 1024 * 1024 * 1024, +// 'TB' => 1024 * 1024 * 1024 * 1024, +// 'PB' => 1024 * 1024 * 1024 * 1024 * 1024, + + +/* chk if snort log dir is full if so clear it */ +$snortloglimit = $config['installedpackages']['snortglobal']['snortloglimit']; +$snortloglimitsize = $config['installedpackages']['snortglobal']['snortloglimitsize']; + +if ($g['booting']==true) { + exit(0); +} + +if ($snortloglimit == 'off') { + exit(0); +} + +$snortloglimitDSKsize = exec('/bin/df -k /var | grep -v "Filesystem" | awk \'{print $4}\''); + +$snortlogAlertsizeKB = snort_Getdirsize('/var/log/snort/alert'); +$snortloglimitAlertsizeKB = round($snortlogAlertsizeKB * .70); +$snortloglimitsizeKB = round($snortloglimitsize * 1024); + +/* do I need HUP kill ? */ +if (snort_Getdirsize('/var/log/snort/') >= $snortloglimitsizeKB ) { + + conf_mount_rw(); + if(file_exists('/var/log/snort/alert')) { + if ($snortlogAlertsizeKB >= $snortloglimitAlertsizeKB) { + exec('/bin/echo "" > /var/log/snort/alert'); + } + post_delete_logs(); + exec('/usr/sbin/chown snort:snort /var/log/snort/*'); + exec('/bin/chmod 660 /var/log/snort/*'); + //sleep(2); + //exec('/usr/bin/killall -HUP snort'); + } + conf_mount_ro(); + +} + + +?> diff --git a/config/snort/snort_check_for_rule_updates.php b/config/snort/snort_check_for_rule_updates.php index 51d403d9..79cc7a0b 100644 --- a/config/snort/snort_check_for_rule_updates.php +++ b/config/snort/snort_check_for_rule_updates.php @@ -849,4 +849,4 @@ if (file_exists("/tmp/snort_download_halt.pid")) { /* script finnished make system read only again */ conf_mount_ro(); -?>
\ No newline at end of file +?> diff --git a/config/snort/snort_dynamic_ip_reload.php b/config/snort/snort_dynamic_ip_reload.php index 94004b94..290b0e3b 100644 --- a/config/snort/snort_dynamic_ip_reload.php +++ b/config/snort/snort_dynamic_ip_reload.php @@ -44,4 +44,4 @@ sync_snort_package(); exec('/bin/rm /var/run/snort_dynamic_ip_reload.dirty'); -?>
\ No newline at end of file +?> diff --git a/config/snort/snort_head.inc b/config/snort/snort_head.inc index 70dece63..ca3afc5e 100644 --- a/config/snort/snort_head.inc +++ b/config/snort/snort_head.inc @@ -1,124 +1,124 @@ -<?php
-/*
- pfSense_MODULE: header
- */
-
-/*
- * if user has selected a custom template, use it.
- * otherwise default to pfsense tempalte
- */
-if($config['theme'] <> "")
-$g['theme'] = $config['theme'];
-else
-$g['theme'] = "pfsense";
-
-/*
- * If this device is an apple ipod/iphone
- * switch the theme to one that works with it.
- */
-$apple_ua = array("iPhone","iPod", "iPad");
-foreach($apple_ua as $useragent)
-if(strstr($_SERVER['HTTP_USER_AGENT'], $useragent))
-$g['theme'] = "pfsense";
-
-$pagetitle = gentitle( $pgtitle );
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<title><?php echo($config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pagetitle); ?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-<link rel="apple-touch-icon"
- href="/themes/<?php echo $g['theme']; ?>/apple-touch-icon.png" />
-<?php if (strpos($_SERVER["SCRIPT_FILENAME"], "wizard.php") !== false &&
-file_exists("{$g['www_path']}/themes/{$g['theme']}/wizard.css")): ?>
-<?php echo "<style type=\"text/css\" src=\"/themes/{$g['theme']}/wizard.css\"></style>"; ?>
-<?php else: ?>
-<link rel="stylesheet" href="/themes/<?php echo $g['theme']; ?>/all.css"
- media="all" />
-<?php endif; ?>
-<link rel="stylesheet" type="text/css" href="../niftycssCode.css">
-<link rel="stylesheet" type="text/css" href="../niftycssprintCode.css"
- media="print">
-
-<link rel="stylesheet" type="text/css" href="./css/new_tab_menu.css"
- media="all">
-<link rel="stylesheet" type="text/css" href="./css/sexybuttons.css"
- media="all" />
-<link rel="stylesheet" type="text/css" href="./css/colorbox.css"
- media="all" />
-<link rel="stylesheet" type="text/css" href="./css/style.css"
- media="all" />
-
-
-<script type="text/javascript" src="../javascript/niftyjsCode.js"></script>
-<script type="text/javascript">
- var theme = "<?php echo $g['theme']; ?>";
- </script> <?php echo "\t<script type=\"text/javascript\" src=\"/themes/{$g['theme']}/loader.js\"></script>\n"; ?>
-<?php
-if($_GET['enablefirebuglite']) {
- echo "\t<script type=\"text/javascript\" src=\"/javascript/pi.js\"></script>\n";
- echo "\t<script type=\"text/javascript\" src=\"/javascript/firebug-lite.js\"></script>\n";
-}
-
-/* only load javascript that you need, jquery and prototype dont play together */
-//if ($snort_load_jquery == 'yes') {
-echo "\t<script type=\"text/javascript\" src=\"/snort/javascript/jquery-1.4.2.min.js\"></script>\n";
-//}
-//if ($snort_load_jquery_colorbox == 'yes') {
-echo "\t<script type=\"text/javascript\" src=\"/snort/javascript/jquery.colorbox.js\"></script>\n";
-echo "\t<script type=\"text/javascript\" src=\"/javascript/sorttable.js\"></script>\n";
-//}
-if ($snort_load_mootools == 'yes') {
- echo "\t<script type=\"text/javascript\" src=\"/snort/javascript/mootools.js\"></script>\n";
-}
-if ($snort_load_sortabletable == 'yes') {
- echo "\t<script type=\"text/javascript\" src=\"/snort/javascript/sortableTable.js\"></script>\n";
-}
-
-/* some pfsense commercial versions require prototype to be in every tab on the GUI, for custom logos */
-echo "\t<script type=\"text/javascript\" src=\"/snort/javascript/prototype.js\"></script>\n";
-// echo "\t<script type=\"text/javascript\" src=\"../javascript/scriptaculous/prototype.js\"></script>\n";
-// echo "\t<script type=\"text/javascript\" src=\"../javascript/scriptaculous/scriptaculous.js\"></script>\n";
-// echo "\t<script type=\"text/javascript\" src=\"../javascript/scriptaculous/effects.js\"></script>\n";
-// echo "\t<script type=\"text/javascript\" src=\"../javascript/scriptaculous/dragdrop.js\"></script>\n";
-
-if(file_exists("{$g['www_path']}/javascript/global.js"))
-echo "\t<script type=\"text/javascript\" src=\"../javascript/global.js\"></script>\n";
-/*
- * Find all javascript files that need to be included
- * for this page ... from the arrays ... :)
- * Coded by: Erik Kristensen
- */
-
-$dir = trim(basename($_SERVER["SCRIPT_FILENAME"]), '.php');
-$path = "{$g['www_path']}/javascript/" . $dir . "/";
-if (is_dir($path)) {
- if ($dh = opendir($path)) {
- while (($file = readdir($dh)) !== false) {
- if (is_dir($file))
- continue;
- echo "\t<script type=\"text/javascript\" src=\"/javascript/{$dir}/{$file}\"></script>\n";
- }
- closedir($dh);
- }
-}
-
-if (!isset($closehead))
-echo "</head>";
-
-/* If this page is being remotely managed then do not allow the loading of the contents. */
-if($config['remote_managed_pages']['item']) {
- foreach($config['remote_managed_pages']['item'] as $rmp) {
- if($rmp == $_SERVER['SCRIPT_NAME']) {
- include("fbegin.inc");
- print_info_box_np("This page is currently being managed by a remote machine.");
- include("fend.inc");
- exit;
- }
- }
-}
-
-?>
\ No newline at end of file +<?php +/* + pfSense_MODULE: header + */ + +/* + * if user has selected a custom template, use it. + * otherwise default to pfsense tempalte + */ +if($config['theme'] <> "") +$g['theme'] = $config['theme']; +else +$g['theme'] = "pfsense"; + +/* + * If this device is an apple ipod/iphone + * switch the theme to one that works with it. + */ +$apple_ua = array("iPhone","iPod", "iPad"); +foreach($apple_ua as $useragent) +if(strstr($_SERVER['HTTP_USER_AGENT'], $useragent)) +$g['theme'] = "pfsense"; + +$pagetitle = gentitle( $pgtitle ); + +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> +<head> +<title><?php echo($config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pagetitle); ?></title> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +<link rel="apple-touch-icon" + href="/themes/<?php echo $g['theme']; ?>/apple-touch-icon.png" /> +<?php if (strpos($_SERVER["SCRIPT_FILENAME"], "wizard.php") !== false && +file_exists("{$g['www_path']}/themes/{$g['theme']}/wizard.css")): ?> +<?php echo "<style type=\"text/css\" src=\"/themes/{$g['theme']}/wizard.css\"></style>"; ?> +<?php else: ?> +<link rel="stylesheet" href="/themes/<?php echo $g['theme']; ?>/all.css" + media="all" /> +<?php endif; ?> +<link rel="stylesheet" type="text/css" href="../niftycssCode.css"> +<link rel="stylesheet" type="text/css" href="../niftycssprintCode.css" + media="print"> + +<link rel="stylesheet" type="text/css" href="./css/new_tab_menu.css" + media="all"> +<link rel="stylesheet" type="text/css" href="./css/sexybuttons.css" + media="all" /> +<link rel="stylesheet" type="text/css" href="./css/colorbox.css" + media="all" /> +<link rel="stylesheet" type="text/css" href="./css/style.css" + media="all" /> + + +<script type="text/javascript" src="../javascript/niftyjsCode.js"></script> +<script type="text/javascript"> + var theme = "<?php echo $g['theme']; ?>"; + </script> <?php echo "\t<script type=\"text/javascript\" src=\"/themes/{$g['theme']}/loader.js\"></script>\n"; ?> +<?php +if($_GET['enablefirebuglite']) { + echo "\t<script type=\"text/javascript\" src=\"/javascript/pi.js\"></script>\n"; + echo "\t<script type=\"text/javascript\" src=\"/javascript/firebug-lite.js\"></script>\n"; +} + +/* only load javascript that you need, jquery and prototype dont play together */ +//if ($snort_load_jquery == 'yes') { +echo "\t<script type=\"text/javascript\" src=\"/snort/javascript/jquery-1.4.2.min.js\"></script>\n"; +//} +//if ($snort_load_jquery_colorbox == 'yes') { +echo "\t<script type=\"text/javascript\" src=\"/snort/javascript/jquery.colorbox.js\"></script>\n"; +echo "\t<script type=\"text/javascript\" src=\"/javascript/sorttable.js\"></script>\n"; +//} +if ($snort_load_mootools == 'yes') { + echo "\t<script type=\"text/javascript\" src=\"/snort/javascript/mootools.js\"></script>\n"; +} +if ($snort_load_sortabletable == 'yes') { + echo "\t<script type=\"text/javascript\" src=\"/snort/javascript/sortableTable.js\"></script>\n"; +} + +/* some pfsense commercial versions require prototype to be in every tab on the GUI, for custom logos */ +echo "\t<script type=\"text/javascript\" src=\"/snort/javascript/prototype.js\"></script>\n"; +// echo "\t<script type=\"text/javascript\" src=\"../javascript/scriptaculous/prototype.js\"></script>\n"; +// echo "\t<script type=\"text/javascript\" src=\"../javascript/scriptaculous/scriptaculous.js\"></script>\n"; +// echo "\t<script type=\"text/javascript\" src=\"../javascript/scriptaculous/effects.js\"></script>\n"; +// echo "\t<script type=\"text/javascript\" src=\"../javascript/scriptaculous/dragdrop.js\"></script>\n"; + +if(file_exists("{$g['www_path']}/javascript/global.js")) +echo "\t<script type=\"text/javascript\" src=\"../javascript/global.js\"></script>\n"; +/* + * Find all javascript files that need to be included + * for this page ... from the arrays ... :) + * Coded by: Erik Kristensen + */ + +$dir = trim(basename($_SERVER["SCRIPT_FILENAME"]), '.php'); +$path = "{$g['www_path']}/javascript/" . $dir . "/"; +if (is_dir($path)) { + if ($dh = opendir($path)) { + while (($file = readdir($dh)) !== false) { + if (is_dir($file)) + continue; + echo "\t<script type=\"text/javascript\" src=\"/javascript/{$dir}/{$file}\"></script>\n"; + } + closedir($dh); + } +} + +if (!isset($closehead)) +echo "</head>"; + +/* If this page is being remotely managed then do not allow the loading of the contents. */ +if($config['remote_managed_pages']['item']) { + foreach($config['remote_managed_pages']['item'] as $rmp) { + if($rmp == $_SERVER['SCRIPT_NAME']) { + include("fbegin.inc"); + print_info_box_np("This page is currently being managed by a remote machine."); + include("fend.inc"); + exit; + } + } +} + +?> |