$contents = implode("\n", $list); $title = "Pass List"; } elseif ($type == "suppress") { $list = snort_find_list($wlist, $type); $contents = str_replace("\r", "", base64_decode($list['suppresspassthru'])); $title = "Suppress List"; } elseif ($type == "externalnet") { if ($wlist == "default") { $list = snort_build_list($a_rule, $a_rule['homelistname']); $contents = ""; foreach ($list as $ip) { $contents .= "!{$ip}\n"; } $contents = trim($contents, "\n"); } else { $list = snort_build_list($a_rule, $wlist, false, true); $contents = implode("\n", $list); } $title = "EXTERNAL_NET"; } else { $contents = gettext("\n\nERROR -- Requested List Type entity is not valid!"); } } else { $contents = gettext("\n\nERROR -- Supplied interface or List entity is not valid!"); } $pgtitle = array(gettext("Snort"), gettext($title . " Viewer")); ?> <?php include "head.inc"; ?>
if ($snortcfg['barnyard_log_mpls_events'] == 'on') { $snortunifiedlog_type .= ", mpls_event_types"; } // If AppID detector is enabled, add it to unified2 logging if ($snortcfg['appid_preproc'] == 'on') { $snortunifiedlog_type .= ", appid_event_types"; } } /* define spoink */ $spoink_type = ""; if ($snortcfg['blockoffenders7'] == "on") { $pfkill = ""; if ($snortcfg['blockoffenderskill'] == "on") { $pfkill = "kill"; } $spoink_wlist = snort_build_list($snortcfg, $snortcfg['whitelistname'], true); /* write Pass List */ @file_put_contents("{$snortcfgdir}/{$snortcfg['whitelistname']}", implode("\n", $spoink_wlist)); $spoink_type = "output alert_pf: {$snortcfgdir}/{$snortcfg['whitelistname']},snort2c,{$snortcfg['blockoffendersip']},{$pfkill}"; } /* define selected suppress file */ $suppress_file_name = ""; $suppress = snort_find_list($snortcfg['suppresslistname'], 'suppress'); if (!empty($suppress)) { $suppress_data = str_replace("\r", "", base64_decode($suppress['suppresspassthru'])); @file_put_contents("{$snortcfgdir}/supp{$snortcfg['suppresslistname']}", $suppress_data); $suppress_file_name = "include {$snortcfgdir}/supp{$snortcfg['suppresslistname']}"; } /* set the snort performance model */ $snort_performance = "ac-bnfa"; if (!empty($snortcfg['performance'])) {