diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/imspector/services_imspector_logs.php | 118 | ||||
-rw-r--r-- | config/snort/snort.inc | 4 | ||||
-rw-r--r-- | config/snort/snort.xml | 2 | ||||
-rw-r--r-- | config/stunnel.xml | 15 |
4 files changed, 73 insertions, 66 deletions
diff --git a/config/imspector/services_imspector_logs.php b/config/imspector/services_imspector_logs.php index fce9b892..8f208e5d 100644 --- a/config/imspector/services_imspector_logs.php +++ b/config/imspector/services_imspector_logs.php @@ -151,6 +151,8 @@ include("head.inc"); //echo $pfSenseHead->getHTML(); ?> <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> +<script type="text/javascript" language="javascript" src="/javascript/scriptaculous/prototype.js"></script> +<script type="text/javascript" language="javascript" src="/javascript/scriptaculous/scriptaculous.js"></script> <?php include("fbegin.inc"); ?> <?php if ($savemsg) print_info_box($savemsg); ?> <div id="mainlevel"> @@ -170,26 +172,23 @@ var section = 'none'; var moveit = 1; var the_timeout; -function xmlhttpPost() -{ - var xmlHttpReq = false; - var self = this; - - if (window.XMLHttpRequest) - self.xmlHttpReq = new XMLHttpRequest(); - else if (window.ActiveXObject) - self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); - - self.xmlHttpReq.open('POST', 'services_imspector_logs.php', true); - self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - - self.xmlHttpReq.onreadystatechange = function() { - if (self.xmlHttpReq && self.xmlHttpReq.readyState == 4) - updatepage(self.xmlHttpReq.responseText); - } - - document.getElementById('im_status').style.display = "inline"; - self.xmlHttpReq.send("mode=render§ion=" + section); +function xmlhttpPost(){ + var url = "/services_imspector_logs.php" + new Ajax.Request(url, { + method: 'post', + parameters: { + mode: 'render', + section: section + }, + onSuccess: function(transport){ + var response = transport.responseText || ""; + updatepage(response); + $('im_status').style.display = "none"; + }, + onLoading: function(){ + $('im_status').style.display = "inline"; + } + }); } function updatepage(str) @@ -203,54 +202,61 @@ function updatepage(str) if (!a[1] || !a[2] || !a[3]) continue; + var image = a[0]; + var protocol = a[1]; + var login = a[2]; + var destination = a[3]; + var date = a[4]; + + /* create titling information if needed */ - if (!document.getElementById(a[1])) { - document.getElementById('im_convos').innerHTML += - "<div id='" + a[1] + "_t' style='width: 100%; background-color: $list_protocol_bgcolor; color: $list_protocol_color;'>" + a[1] + "</div>" + - "<div id='" + a[1] + "' style='width: 100%; background-color: $list_local_bgcolor;'></div>"; + if (!$(protocol)) { + $('im_convos').innerHTML += + "<div id='" + protocol + "_t' style='width: 100%; background-color: $list_protocol_bgcolor; color: $list_protocol_color;'>" + protocol + "</div>" + + "<div id='" + protocol + "' style='width: 100%; background-color: $list_local_bgcolor;'></div>"; } - if (!document.getElementById(a[1] + "_" + a[2])) { + if (!$(protocol + "_" + login)) { var imageref = ""; - if (a[0]) imageref = "<img src='" + a[0] + "' alt='" + a[1] + "'/>"; - document.getElementById(a[1]).innerHTML += - "<div id='" + a[1] + "_" + a[2] + "_t' style='width: 100%; color: $list_local_color; padding-left: 5px;'>" + imageref + a[2] + "</div>" + - "<div id='" + a[1] + "_" + a[2] + "' style='width: 100%; background-color: $list_remote_bgcolor; border-bottom: solid 1px $list_end_bgcolor;'></div>"; + if (image) imageref = "<img src='" + image + "' alt='" + protocol + "'/>"; + $(protocol).innerHTML += + "<div id='" + protocol + "_" + login + "_t' style='width: 100%; color: $list_local_color; padding-left: 5px;'>" + imageref + login + "</div>" + + "<div id='" + protocol + "_" + login + "' style='width: 100%; background-color: $list_remote_bgcolor; border-bottom: solid 1px $list_end_bgcolor;'></div>"; } - if (!document.getElementById(a[1] + "_" + a[2] + "_" + a[3])) { - document.getElementById(a[1] + "_" + a[2]).innerHTML += - "<div id='" + a[1] + "_" + a[2] + "_" + a[3] + "_t' style='width: 100%; color: $list_remote_color; padding-left: 10px;'>" + a[3] + "</div>" + - "<div id='" + a[1] + "_" + a[2] + "_" + a[3] + "' style='width: 100%;'></div>"; + if (!$(protocol + "_" + login + "_" + destination)) { + $(protocol + "_" + login).innerHTML += + "<div id='" + protocol + "_" + login + "_" + destination + "_t' style='width: 100%; color: $list_remote_color; padding-left: 10px;'>" + destination + "</div>" + + "<div id='" + protocol + "_" + login + "_" + destination + "' style='width: 100%;'></div>"; } - if (!document.getElementById(a[1] + "_" + a[2] + "_" + a[3] + "_" + a[4])) { - document.getElementById(a[1] + "_" + a[2] + "_" + a[3]).innerHTML += - "<div id='" + a[1] + "_" + a[2] + "_" + a[3] + "_" + a[4] + + if (!$(protocol + "_" + login + "_" + destination + "_" + date)) { + /* XXX: use observer instead of onclick */ + $(protocol + "_" + login + "_" + destination).innerHTML += + "<div id='" + protocol + "_" + login + "_" + destination + "_" + date + "' style='width: 100%; color: $list_convo_color; cursor: pointer; padding-left: 15px;' onClick=" + - '"' + "setsection('" + a[1] + "|" + a[2] + "|" + a[3] + "|" + a[4] + "');" + '"' + "' + >»" + a[4] + "</div>"; + '"' + "setsection('" + protocol + "|" + login + "|" + destination + "|" + date + "');" + '"' + "' + >»" + date + "</div>"; } } /* determine the title of this conversation */ var details = parts[1].split(","); - var title = details[0] + " conversation between <span style='color: $convo_local_color;'>" + details[ 1 ] + + var title = details[0] + " conversation between <span style='color: $convo_local_color;'>" + details[1] + "</span> and <span style='color: $convo_remote_color;'>" + details[2] + "</span>"; if (!details[1]) title = " "; if (!parts[2]) parts[2] = " "; - document.getElementById('im_status').style.display = "none"; - var bottom = parseInt(document.getElementById('im_content').scrollTop); - var bottom2 = parseInt(document.getElementById('im_content').style.height); + var bottom = parseInt($('im_content').scrollTop); + var bottom2 = parseInt($('im_content').style.height); var absheight = parseInt( bottom + bottom2 ); - if (absheight == document.getElementById('im_content').scrollHeight) { + if (absheight == $('im_content').scrollHeight) { moveit = 1; } else { moveit = 0; } - document.getElementById('im_content').innerHTML = parts[2]; + $('im_content').update(parts[2]); if (moveit == 1) { - document.getElementById('im_content').scrollTop = 0; - document.getElementById('im_content').scrollTop = document.getElementById('im_content').scrollHeight; + $('im_content').scrollTop = 0; + $('im_content').scrollTop = $('im_content').scrollHeight; } - document.getElementById('im_content_title').innerHTML = title; + $('im_content_title').update(title); the_timeout = setTimeout( "xmlhttpPost();", 5000 ); } @@ -259,9 +265,14 @@ function setsection(value) section = value; clearTimeout(the_timeout); xmlhttpPost(); - document.getElementById('im_content').scrollTop = 0; - document.getElementById('im_content').scrollTop = document.getElementById('im_content').scrollHeight; + $('im_content').scrollTop = 0; + $('im_content').scrollTop = $('im_content').scrollHeight; } + +document.observe('dom:loaded', function() { + xmlhttpPost(); +}); + </script> EOD; print($zz); @@ -273,22 +284,19 @@ print($zz); <div style='width: 100%; text-align: right;'><span id='im_status' style='display: none;'>Updating</span> </div> <table width="100%"> <tr> - <td width="15%" bgcolor="<?=$default_bgcolor?>" style="overflow: auto; border: solid 1px <?=$border_color?>;"> - <div id="im_convos" style="height: 400px; overflow: auto; overflow-x: hidden;"></div> - </td> + <td width="15%" bgcolor="<?=$default_bgcolor?>" style="overflow: auto; border: solid 1px <?=$border_color?>;"> + <div id="im_convos" style="height: 400px; overflow: auto; overflow-x: hidden;"></div> + </td> <td width="75%" bgcolor="<?=$default_bgcolor?>" style="border: solid 1px <?=$border_color?>;"> <div id="im_content_title" style="height: 20px; overflow: auto; vertical-align: top; color: <?=$convo_title_color?>; background-color: <?=$convo_title_bgcolor?>;"></div> - <div id="im_content" style="height: 380px; overflow: auto; vertical-align: bottom; overflow-x: hidden;"></div> + <div id="im_content" style="height: 380px; overflow: auto; vertical-align: bottom; overflow-x: hidden;"></div> </td> </tr> </table> </td> </tr> </table> - -<script type="text/javascript">xmlhttpPost();</script> - </div> <?php include("fend.inc"); ?> </body> diff --git a/config/snort/snort.inc b/config/snort/snort.inc index c1c1a400..20a03f93 100644 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -140,12 +140,12 @@ function sync_package_snort() /* Note the sleep delay. Seems to help getting mult interfaces to start -gtm */ foreach($snortInterfaces as $snortIf) { - $start .= ";sleep 8;snort -c /usr/local/etc/snort/snort.conf -l /var/log/snort -D -i {$snortIf} -A fast &"; + $start .= ";sleep 8;snort -c /usr/local/etc/snort/snort.conf -l /var/log/snort -D -i {$snortIf} -A fast -q"; } /* if block offenders is checked, start snort2c */ if($_POST['blockoffenders']) - $start .= ";sleep 8;snort2c -w /var/db/whitelist -a /var/log/snort/alert"; + $start .= "\nsleep 8;snort2c -w /var/db/whitelist -a /var/log/snort/alert"; $sample_before = "\nBEFORE_MEM=`top | grep Free | grep Wired | awk '{print \$10}'`\n"; $sample_after = "\nAFTER_MEM=`top | grep Free | grep Wired | awk '{print \$10}'`\n"; diff --git a/config/snort/snort.xml b/config/snort/snort.xml index 6ba362c0..22b8e874 100644 --- a/config/snort/snort.xml +++ b/config/snort/snort.xml @@ -46,7 +46,7 @@ <requirements>Describe your package requirements here</requirements> <faq>Currently there are no FAQ items provided.</faq> <name>Snort</name> - <version>2.8.2.2</version> + <version>2.8.3.2</version> <title>Services: Snort</title> <include_file>/usr/local/pkg/snort.inc</include_file> <menu> diff --git a/config/stunnel.xml b/config/stunnel.xml index d2f0dd3a..64c9becd 100644 --- a/config/stunnel.xml +++ b/config/stunnel.xml @@ -149,17 +149,16 @@ </custom_add_php_command_late> <custom_php_install_command> <![CDATA[ - safe_mkdir("/usr/local/etc/stunnel"); - system("/usr/bin/openssl req -new -x509 -days 365 -nodes -out /usr/local/etc/stunnel/stunnel.pem -keyout /usr/local/etc/stunnel/stunnel.pem 2>/dev/null"); - chmod("/usr/local/etc/stunnel/stunnel.pem", 600); - system("/bin/mkdir -p /var/tmp/stunnel/var/tmp/run/stunnel"); - system("/usr/sbin/chown -R stunnel:stunnel /var/tmp/stunnel"); + safe_mkdir("/usr/local/etc/stunnel"); + system("/usr/bin/openssl req -new -x509 -days 365 -nodes -out /usr/local/etc/stunnel/stunnel.pem -keyout /usr/local/etc/stunnel/stunnel.pem 2>/dev/null"); + chmod("/usr/local/etc/stunnel/stunnel.pem", 600); + make_dirs("/var/tmp/stunnel/var/tmp/run/stunnel"); + system("/usr/sbin/chown -R stunnel:stunnel /var/tmp/stunnel"); $_rcfile['file']='stunnel.sh'; $_rcfile['start'].="/usr/local/bin/stunnel /usr/local/etc/stunnel/stunnel.conf \n\t"; $_rcfile['stop'].="killall stunnel \n\t"; write_rcfile($_rcfile); - system("rm /usr/local/etc/rc.d/stunnel"); - + unlink_if_exists("/usr/local/etc/rc.d/stunnel"); conf_mount_rw(); config_lock(); $fout = fopen("/usr/local/etc/stunnel/stunnel.conf","w"); @@ -183,7 +182,7 @@ <![CDATA[ rmdir_recursive("/var/tmp/stunnel"); rmdir_recursive("/usr/local/etc/stunnel*"); - system("rm /usr/local/etc/rc.d/stunnel.sh"); + unlink_if_exists("/usr/local/etc/rc.d/stunnel.sh"); ]]> </custom_php_deinstall_command> </packagegui> |