diff options
author | robiscool <robrob2626@yahoo.com> | 2009-11-24 12:22:29 -0800 |
---|---|---|
committer | robiscool <robrob2626@yahoo.com> | 2009-11-24 12:22:29 -0800 |
commit | dc5d3683c84a74869fb36f20037204048b000040 (patch) | |
tree | 6ec2073899a40451b41e5804f0312ce22e63f4fd /config | |
parent | a897942428ad9834f2c0732d4ed8ccd1d28a68d7 (diff) | |
download | pfsense-packages-dc5d3683c84a74869fb36f20037204048b000040.tar.gz pfsense-packages-dc5d3683c84a74869fb36f20037204048b000040.tar.bz2 pfsense-packages-dc5d3683c84a74869fb36f20037204048b000040.zip |
snort-dev, add if snort is running add color disply, error checking for snort_interface_edit.php
Diffstat (limited to 'config')
-rw-r--r-- | config/snort-dev/NOTES.txt | 9 | ||||
-rw-r--r-- | config/snort-dev/help_and_info.html | 1 | ||||
-rw-r--r-- | config/snort-dev/snort.inc | 2 | ||||
-rw-r--r-- | config/snort-dev/snort_interfaces.php | 25 | ||||
-rw-r--r-- | config/snort-dev/snort_interfaces_edit.php | 10 |
5 files changed, 41 insertions, 6 deletions
diff --git a/config/snort-dev/NOTES.txt b/config/snort-dev/NOTES.txt index fa3eb844..9b4d8d0e 100644 --- a/config/snort-dev/NOTES.txt +++ b/config/snort-dev/NOTES.txt @@ -18,6 +18,15 @@ Move the Snort GUI to base of Pfsense. The divert options should be added to fir Ask Ermal to add divert out to Pfsense again though, he has kept divert in. +===================== +What Im working on +===================== + +snort.inc +Must be recoded so that it reads the [snortglobal] [snortglobal][rule] options in conf.xml and makes the files whitelist, snort.sh, snort.conf, and barnyard.conf. +This is easy, just cut and paste from the old snort.inc. I will work on this. + + ================================= Any Devs that would like to help please work on snort_rules_edit.php and snort_rules.php. They work but need cleaning up. ================================= diff --git a/config/snort-dev/help_and_info.html b/config/snort-dev/help_and_info.html index fc506f93..894d647f 100644 --- a/config/snort-dev/help_and_info.html +++ b/config/snort-dev/help_and_info.html @@ -3,6 +3,7 @@ <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Help & Info</title>
+<base target="main">
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
diff --git a/config/snort-dev/snort.inc b/config/snort-dev/snort.inc index 76754ee4..4e582d7a 100644 --- a/config/snort-dev/snort.inc +++ b/config/snort-dev/snort.inc @@ -239,7 +239,7 @@ rc_start() { /usr/local/bin/php -f /usr/local/pkg/pf/snort_dynamic_ip_reload.php $id $if_real /bin/kill -HUP \${snort_pid} sleep 3 - AFTER_MEM=`/usr/bin/top | /usr/bin/grep Wired | /usr/bin/awk '{print $12}'` + AFTER_MEM=`/usr/bin/top | /usr/bin/grep Wired | /usr/bin/awk '{print $2}'` /bin/cp /var/log/system.log /var/log/snort/snort_sys_$if_real.log /bin/killall syslogd /usr/sbin/clog -i -s 262144 /var/log/system.log diff --git a/config/snort-dev/snort_interfaces.php b/config/snort-dev/snort_interfaces.php index fc640df0..6a275ca7 100644 --- a/config/snort-dev/snort_interfaces.php +++ b/config/snort-dev/snort_interfaces.php @@ -161,6 +161,17 @@ border-top:2px solid #DBAC48; border-bottom:2px solid #DBAC48; padding: 15px 10px 50% 50px; } +.listbg2 { + border-right: 1px solid #999999; + border-bottom: 1px solid #999999; + font-size: 11px; + background-color: #090; + color: #000; + padding-right: 16px; + padding-left: 6px; + padding-top: 4px; + padding-bottom: 4px; +} </style> <noscript><div class="alert" ALIGN=CENTER><img src="/themes/nervecenter/images/icons/icon_alert.gif"/><strong>Please enable JavaScript to view this content</CENTER></div></noscript> @@ -215,7 +226,17 @@ padding: 15px 10px 50% 50px; <tr valign="top" id="fr<?=$nnats;?>"> <td class="listt"><input type="checkbox" id="frc<?=$nnats;?>" name="rule[]" value="<?=$i;?>" onClick="fr_bgcolor('<?=$nnats;?>')" style="margin: 0; padding: 0; width: 15px; height: 15px;"></td> <td class="listt" align="center"></td> - <td class="listlr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='snort_interfaces_edit.php?id=<?=$nnats;?>';"> + <?php + /* convert fake interfaces to real and check if iface is up */ + $if_real = convert_friendly_interface_to_real_interface_name($natent['interface']); + $color_up = exec("/bin/ps -auwx | grep -v grep | grep \"{$nnats}{$if_real} -c\" | awk '{print $2;}'"); + If ($color_up != "") { + $class_color_up = "listbg2"; + }else{ + $class_color_up = "listbg"; + } + ?> + <td class="<?=$class_color_up;?>" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='snort_interfaces_edit.php?id=<?=$nnats;?>';"> <?php if (!$natent['interface'] || ($natent['interface'] == "wan")) echo "WAN"; @@ -226,7 +247,7 @@ padding: 15px 10px 50% 50px; else if(strtolower($natent['interface']) == "pptp") echo "PPTP"; else - echo strtoupper($config['interfaces'][$natent['interface']]['descr']); + echo strtoupper($config['interfaces']); ?> </td> <td class="listr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='snort_interfaces_edit.php?id=<?=$nnats;?>';"> diff --git a/config/snort-dev/snort_interfaces_edit.php b/config/snort-dev/snort_interfaces_edit.php index 8467dfb4..410bb02b 100644 --- a/config/snort-dev/snort_interfaces_edit.php +++ b/config/snort-dev/snort_interfaces_edit.php @@ -119,9 +119,13 @@ if ($_POST["Submit"]) { // $input_errors[] = "The target port range must be an integer between 1 and 65535."; // } -// if ($a_nat[$id]['performance'] == "lowmem") { -// $input_errors[] = "This is a test of error echecking"; -// } + if ($_POST['interface'] == $pconfig['interface']) { + $input_errors[] = "The {$pconfig['interface']} interface is in use. Please select another interface."; + } + + if ($pconfig['descr'] == "") { + $input_errors[] = "Please enter a description for your reference."; + } /* check for overlaps */ |