aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorbmeeks8 <bmeeks8@bellsouth.net>2014-03-07 21:35:27 -0500
committerbmeeks8 <bmeeks8@bellsouth.net>2014-03-07 21:35:27 -0500
commitbca1905789f4fdf938f81a7cfe5dd98751726aa7 (patch)
tree5b0d42531750c769f9b63cfdaf7db07b3fa23fc1 /config
parentc7526cc17efff74791562bfe0f01dfa21ebfed8d (diff)
downloadpfsense-packages-bca1905789f4fdf938f81a7cfe5dd98751726aa7.tar.gz
pfsense-packages-bca1905789f4fdf938f81a7cfe5dd98751726aa7.tar.bz2
pfsense-packages-bca1905789f4fdf938f81a7cfe5dd98751726aa7.zip
Put [] around IPv6 addr and tidy up Suri Dashboard Widget.
Diffstat (limited to 'config')
-rw-r--r--config/suricata/suricata_alerts.js6
-rw-r--r--config/suricata/suricata_alerts.widget.php29
2 files changed, 23 insertions, 12 deletions
diff --git a/config/suricata/suricata_alerts.js b/config/suricata/suricata_alerts.js
index 9e5b0b29..16e0c73c 100644
--- a/config/suricata/suricata_alerts.js
+++ b/config/suricata/suricata_alerts.js
@@ -14,9 +14,9 @@ function suricata_alerts_fetch_new_rules_callback(callback_data) {
for(var x=0; x<data_split.length-1; x++) {
row_split = data_split[x].split("||");
var line = '';
- line = '<td width="22%" class="listMRr" nowrap>' + row_split[0] + '<br/>' + row_split[1] + '</td>';
- line += '<td width="39%" class="listMRr">' + row_split[2] + '<br/>' + row_split[3] + '</td>';
- line += '<td width="39%" class="listMRr">' + 'Pri: ' + row_split[4] + '&nbsp;' + row_split[5] + '</td>';
+ line = '<td class="listMRr" nowrap>' + row_split[0] + '<br/>' + row_split[1] + '</td>';
+ line += '<td class="listMRr">' + row_split[2] + '<br/>' + row_split[3] + '</td>';
+ line += '<td class="listMRr">' + 'Pri: ' + row_split[4] + '&nbsp;' + row_split[5] + '</td>';
new_data_to_add[new_data_to_add.length] = line;
}
suricata_alerts_update_div_rows(new_data_to_add);
diff --git a/config/suricata/suricata_alerts.widget.php b/config/suricata/suricata_alerts.widget.php
index c9cfc98e..ce01c0a4 100644
--- a/config/suricata/suricata_alerts.widget.php
+++ b/config/suricata/suricata_alerts.widget.php
@@ -135,10 +135,16 @@ function suricata_widget_get_alerts() {
$suricata_alerts[$counter]['timeonly'] = date_format($event_tm, "H:i:s");
$suricata_alerts[$counter]['dateonly'] = date_format($event_tm, "M d");
// Add zero-width space as soft-break opportunity after each colon in any IPv6 address
- $suricata_alerts[$counter]['src'] = str_replace(":", ":&#8203;", $fields[9]);
+ if (is_ipaddrv6($fields[9]) && !empty($fields[10]))
+ $suricata_alerts[$counter]['src'] = "[" . str_replace(":", ":&#8203;", $fields[9]) . "]";
+ else
+ $suricata_alerts[$counter]['src'] = $fields[9];
$suricata_alerts[$counter]['srcport'] = $fields[10];
// Add zero-width space as soft-break opportunity after each colon in any IPv6 address
- $suricata_alerts[$counter]['dst'] = str_replace(":", ":&#8203;", $fields[11]);
+ if (is_ipaddrv6($fields[11]) && !empty($fields[12]))
+ $suricata_alerts[$counter]['dst'] = "[" . str_replace(":", ":&#8203;", $fields[11]) . "]";
+ else
+ $suricata_alerts[$counter]['dst'] = $fields[11];
$suricata_alerts[$counter]['dstport'] = $fields[12];
$suricata_alerts[$counter]['priority'] = $fields[7];
$suricata_alerts[$counter]['category'] = $fields[6];
@@ -179,12 +185,17 @@ var suri_nentries = <?php echo $suri_nentries; ?>;
</form>
</div>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
+<table width="100%" border="0" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
+ <colgroup>
+ <col style='width: 22%;' />
+ <col style='width: 39%;' />
+ <col style='width: 39%;' />
+ </colgroup>
<thead>
<tr class="suricata-alert-header">
- <td width="22%" class="widgetsubheader" align="center">IF/Date</td>
- <td width="39%" class="widgetsubheader" align="center">Src/Dst</td>
- <td width="39%" class="widgetsubheader" align="center">Details</td>
+ <th class="listhdrr" align="center">IF/Date</th>
+ <th class="listhdrr" align="center">Src/Dst</th>
+ <th class="listhdrr" align="center">Details</th>
</tr>
</thead>
<tbody id="suricata-alert-entries">
@@ -195,9 +206,9 @@ var suri_nentries = <?php echo $suri_nentries; ?>;
foreach ($suricata_alerts as $alert) {
$evenRowClass = $counter % 2 ? " listMReven" : " listMRodd";
echo(" <tr class='" . $evenRowClass . "'>
- <td width='22%' class='listMRr' nowrap>" . $alert['instanceid'] . " " . $alert['dateonly'] . "<br/>" . $alert['timeonly'] . "</td>
- <td width='39%' class='listMRr'>" . $alert['src'] . ":" . $alert['srcport'] . "<br>" . $alert['dst'] . ":" . $alert['dstport'] . "</td>
- <td width='39%' class='listMRr'>Pri: " . $alert['priority'] . "&nbsp;" . $alert['category'] . "</td></tr>");
+ <td class='listMRr' nowrap>" . $alert['instanceid'] . " " . $alert['dateonly'] . "<br/>" . $alert['timeonly'] . "</td>
+ <td class='listMRr'>" . $alert['src'] . ":" . $alert['srcport'] . "<br>" . $alert['dst'] . ":" . $alert['dstport'] . "</td>
+ <td class='listMRr'>Pri: " . $alert['priority'] . "&nbsp;" . $alert['category'] . "</td></tr>");
$counter++;
if($counter >= $suri_nentries)
break;