Skip to content

Commit

Permalink
Merge pull request #1313 from bmeeks8/pfSense-pkg-suricata-7.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-p committed Nov 10, 2023
2 parents be85a52 + f40e5cb commit 202c94e
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 10 deletions.
6 changes: 3 additions & 3 deletions security/pfSense-pkg-suricata/Makefile
@@ -1,8 +1,8 @@
# $FreeBSD$

PORTNAME= pfSense-pkg-suricata
PORTVERSION= 7.0.0
PORTREVISION= 2
PORTVERSION= 7.0.2
PORTREVISION= 0
CATEGORIES= security
MASTER_SITES= # empty
DISTFILES= # empty
Expand All @@ -13,7 +13,7 @@ COMMENT= pfSense package suricata

LICENSE= APACHE20

RUN_DEPENDS= suricata>=7.0.0:security/suricata
RUN_DEPENDS= suricata>=7.0.2:security/suricata

NO_BUILD= yes
NO_MTREE= yes
Expand Down
Expand Up @@ -53,10 +53,7 @@
$external_net = "[" . trim($external_net) . "]";
}
else {
$external_net = "[";
foreach ($home_net_list as $ip)
$external_net .= "!{$ip}, ";
$external_net = trim($external_net, ', ') . "]";
$external_net = "[!\$HOME_NET]";
}

// Set the PASS LIST and write its contents to disk,
Expand Down Expand Up @@ -413,6 +410,12 @@
else
$eve_systemlog_priority = "info";

// EVE Ethernet headers setting
if (!empty($suricatacfg['eve_log_ethernet']))
$eve_ethernet_output = $suricatacfg['eve_log_ethernet'];
else
$eve_ethernet_output = "no";

// EVE REDIS output settings
if (!empty($suricatacfg['eve_redis_server']))
$eve_redis_output = "\n server: ". $suricatacfg['eve_redis_server'];
Expand Down
Expand Up @@ -116,6 +116,7 @@ outputs:
enabled: {$enable_eve_log}
filetype: {$eve_output_type}
filename: {$eve_output_filename}
ethernet: {$eve_ethernet_output}
redis: {$eve_redis_output}
identity: "suricata"
facility: {$eve_systemlog_facility}
Expand Down
Expand Up @@ -1024,6 +1024,10 @@ function build_logfile_list() {
$tmp = array();
$decoder_event = FALSE;

// Drop any invalid line read from the log excerpt
if (empty(trim($buf)))
continue;

/**************************************************************/
/* Parse alert log entry to find the parts we want to display */
/**************************************************************/
Expand Down
Expand Up @@ -312,6 +312,10 @@
$fields = array();
$tmp = array();

// Drop any invalid line read from the log
if (empty(trim($buf)))
continue;

/***************************************************************/
/* Parse block log entry to find the parts we want to display. */
/* We parse out all the fields even though we currently use */
Expand Down
Expand Up @@ -586,7 +586,7 @@
'log_to_systemlog_priority',
'Log Priority',
$pconfig['log_to_systemlog_priority'],
array( "emerg" => "EMERG", "crit" => "CRIT", "alert" => "ALERT", "err" => "ERR", "warning" => "WARNING", "notice" => "NOTICE", "info" => "INFO" )
array( "debug" => "DEBUG", "config" => "CONF", "perf" => "PERF", "error" => "ERR", "warning" => "WARNING", "notice" => "NOTICE", "info" => "INFO" )
))->setHelp('Select system log Priority (Level) to use for reporting. Default is NOTICE.');

$section->addInput(new Form_Checkbox(
Expand Down
Expand Up @@ -202,6 +202,8 @@
$pconfig['eve_systemlog_facility'] = "local1";
if (empty($pconfig['eve_systemlog_priority']))
$pconfig['eve_systemlog_priority'] = "notice";
if (empty($pconfig['eve_log_ethernet']))
$pconfig['eve_log_ethernet'] = "no";
if (empty($pconfig['eve_log_drops']))
$pconfig['eve_log_drops'] = "on";
if (empty($pconfig['eve_log_alert_drops']))
Expand Down Expand Up @@ -514,6 +516,7 @@
}
if ($_POST['eve_systemlog_facility']) $natent['eve_systemlog_facility'] = $_POST['eve_systemlog_facility'];
if ($_POST['eve_systemlog_priority']) $natent['eve_systemlog_priority'] = $_POST['eve_systemlog_priority'];
if ($_POST['eve_log_ethernet'] == "yes") { $natent['eve_log_ethernet'] = 'yes'; }else{ $natent['eve_log_ethernet'] = 'no'; }
if ($_POST['eve_log_alerts'] == "on") { $natent['eve_log_alerts'] = 'on'; }else{ $natent['eve_log_alerts'] = 'off'; }
if ($_POST['eve_log_alerts_payload']) { $natent['eve_log_alerts_payload'] = $_POST['eve_log_alerts_payload']; }else{ $natent['eve_log_alerts_payload'] = 'off'; }
if ($_POST['eve_log_alerts_packet'] == "on") { $natent['eve_log_alerts_packet'] = 'on'; }else{ $natent['eve_log_alerts_packet'] = 'off'; }
Expand Down Expand Up @@ -907,7 +910,7 @@ function suricata_get_config_lists($lists) {
'alertsystemlog_priority',
'Log Priority',
$pconfig['alertsystemlog_priority'],
array( "emerg" => "EMERG", "crit" => "CRIT", "alert" => "ALERT", "err" => "ERR", "warning" => "WARNING", "notice" => "NOTICE", "info" => "INFO" )
array( "emergency" => "EMERG", "critical" => "CRIT", "alert" => "ALERT", "error" => "ERR", "warning" => "WARNING", "notice" => "NOTICE", "info" => "INFO", "debug" => "DEBUG" )
))->setHelp('Select system log Priority (Level) to use for reporting. Default is NOTICE.');

$section->addInput(new Form_Checkbox(
Expand Down Expand Up @@ -1198,6 +1201,14 @@ function suricata_get_config_lists($lists) {
$pconfig['eve_log_alerts_xff'] == 'on' ? true:false,
'on'
));
$section->addInput(new Form_Checkbox(
'eve_log_ethernet',
'EVE Ethernet MAC',
'Log Ethernet header in events when available. Default is Not Checked.',
$pconfig['eve_log_ethernet'] == 'yes' ? true:false,
'yes'
));

$section->addInput(new Form_Select(
'eve_log_alerts_xff_mode',
'EVE X-Forwarded-For Operational Mode',
Expand Down Expand Up @@ -2152,6 +2163,7 @@ function toggle_eve_log() {
hideCheckbox('eve_log_alerts',hide);
hideCheckbox('eve_log_anomaly',hide);
hideCheckbox('eve_log_alerts_xff',hide);
hideCheckbox('eve_log_ethernet',hide);
hideCheckbox('eve_log_drops',hide);
hideClass('eve_log_info', hide);
hideClass('eve_log_drops_options', hide);
Expand Down Expand Up @@ -2358,6 +2370,7 @@ function enable_change() {
disableInput('eve_log_alerts_packet',disable)
disableInput('eve_log_alerts_payload',disable);
disableInput('eve_log_alerts_http',disable);
disableInput('eve_log_ethernet',disable);
disableInput('eve_log_alerts_xff',disable);
disableInput('eve_log_alerts_xff_mode',disable);
disableInput('eve_log_alerts_xff_deployment',disable);
Expand Down
Expand Up @@ -68,7 +68,7 @@
elseif ($type == "externalnet") {
if ($wlist == "default") {
$list = suricata_build_list($a_rule, $a_rule['homelistname']);
$contents = "";
$contents = "Defined in suricata.yaml as: !\$HOME_NET which expands to:\n\n";
foreach ($list as $ip)
$contents .= "!{$ip}\n";
$contents = trim($contents, "\n");
Expand Down

0 comments on commit 202c94e

Please sign in to comment.