From 6f24483e980dc0dee55edd461560a960899e0266 Mon Sep 17 00:00:00 2001
From: Oskar Johansson
Date: Fri, 16 May 2014 16:20:23 +0200
Subject: Bugfix: Slave zones honour allow transfer
Fix bug where slave zones didn't honour the allow-transfer setting and wrote "none" in the config at all times
---
config/bind/bind.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'config')
diff --git a/config/bind/bind.inc b/config/bind/bind.inc
index 9b4a444d..4f6e0d87 100644
--- a/config/bind/bind.inc
+++ b/config/bind/bind.inc
@@ -347,7 +347,7 @@ EOD;
switch ($zonetype){
case "slave":
$bind_conf .= "\t\tmasters { $zoneipslave; };\n";
- $bind_conf .= "\t\tallow-transfer {none;};\n";
+ $bind_conf .= "\t\tallow-transfer { $zoneallowtransfer;};\n";
$bind_conf .= "\t\tnotify no;\n";
break;
case "forward":
--
cgit v1.2.3
From 3f93b420c60e0a514f851a7efd04afebcbce9d9d Mon Sep 17 00:00:00 2001
From: Martin Fuchs
Date: Tue, 17 Jun 2014 21:06:02 +0200
Subject: add reminder to set up DNS-A-record for autodiscover
---
config/squid3/31/squid_reverse.xml | 3 ++-
config/squid3/31/squid_reverse_general.xml | 3 ++-
config/squid3/33/squid_reverse.xml | 3 ++-
config/squid3/33/squid_reverse_general.xml | 3 ++-
4 files changed, 8 insertions(+), 4 deletions(-)
(limited to 'config')
diff --git a/config/squid3/31/squid_reverse.xml b/config/squid3/31/squid_reverse.xml
index b0f6a614..885282be 100644
--- a/config/squid3/31/squid_reverse.xml
+++ b/config/squid3/31/squid_reverse.xml
@@ -252,7 +252,8 @@
Enable AutoDiscoverreverse_owa_autodiscover
- If this field is checked, AutoDiscover will be enabled.
+
+ You also should set up a DNS-A-record to point to you WAN-IP.]]>checkbox
diff --git a/config/squid3/31/squid_reverse_general.xml b/config/squid3/31/squid_reverse_general.xml
index 9bff5d8e..b75fadd0 100644
--- a/config/squid3/31/squid_reverse_general.xml
+++ b/config/squid3/31/squid_reverse_general.xml
@@ -240,7 +240,8 @@
Enable AutoDiscoverreverse_owa_autodiscover
- If this field is checked, AutoDiscover will be enabled.
+
+ You also should set up a DNS-A-record to point to you WAN-IP.]]>checkbox
diff --git a/config/squid3/33/squid_reverse.xml b/config/squid3/33/squid_reverse.xml
index b0f6a614..885282be 100755
--- a/config/squid3/33/squid_reverse.xml
+++ b/config/squid3/33/squid_reverse.xml
@@ -252,7 +252,8 @@
Enable AutoDiscoverreverse_owa_autodiscover
- If this field is checked, AutoDiscover will be enabled.
+
+ You also should set up a DNS-A-record to point to you WAN-IP.]]>checkbox
diff --git a/config/squid3/33/squid_reverse_general.xml b/config/squid3/33/squid_reverse_general.xml
index 9bff5d8e..b75fadd0 100755
--- a/config/squid3/33/squid_reverse_general.xml
+++ b/config/squid3/33/squid_reverse_general.xml
@@ -240,7 +240,8 @@
Enable AutoDiscoverreverse_owa_autodiscover
- If this field is checked, AutoDiscover will be enabled.
+
+ You also should set up a DNS-A-record to point to you WAN-IP.]]>checkbox
--
cgit v1.2.3
From d9861455da523a0ac7201db239232c92a552fe2c Mon Sep 17 00:00:00 2001
From: Martin Fuchs
Date: Wed, 18 Jun 2014 20:39:23 +0200
Subject: clarify the hint
---
config/squid3/31/squid_reverse.xml | 2 +-
config/squid3/31/squid_reverse_general.xml | 2 +-
config/squid3/33/squid_reverse.xml | 2 +-
config/squid3/33/squid_reverse_general.xml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
(limited to 'config')
diff --git a/config/squid3/31/squid_reverse.xml b/config/squid3/31/squid_reverse.xml
index 885282be..bc51d033 100644
--- a/config/squid3/31/squid_reverse.xml
+++ b/config/squid3/31/squid_reverse.xml
@@ -253,7 +253,7 @@
Enable AutoDiscoverreverse_owa_autodiscover
- You also should set up a DNS-A-record to point to you WAN-IP.]]>
+ You also should set up the autodiscover DNS-record to point to you WAN-IP.]]>
checkbox
diff --git a/config/squid3/31/squid_reverse_general.xml b/config/squid3/31/squid_reverse_general.xml
index b75fadd0..8b2a8c9b 100644
--- a/config/squid3/31/squid_reverse_general.xml
+++ b/config/squid3/31/squid_reverse_general.xml
@@ -241,7 +241,7 @@
Enable AutoDiscoverreverse_owa_autodiscover
- You also should set up a DNS-A-record to point to you WAN-IP.]]>
+ You also should set up the autodiscover DNS-record to point to you WAN-IP.]]>
checkbox
diff --git a/config/squid3/33/squid_reverse.xml b/config/squid3/33/squid_reverse.xml
index 885282be..bc51d033 100755
--- a/config/squid3/33/squid_reverse.xml
+++ b/config/squid3/33/squid_reverse.xml
@@ -253,7 +253,7 @@
Enable AutoDiscoverreverse_owa_autodiscover
- You also should set up a DNS-A-record to point to you WAN-IP.]]>
+ You also should set up the autodiscover DNS-record to point to you WAN-IP.]]>
checkbox
diff --git a/config/squid3/33/squid_reverse_general.xml b/config/squid3/33/squid_reverse_general.xml
index b75fadd0..8b2a8c9b 100755
--- a/config/squid3/33/squid_reverse_general.xml
+++ b/config/squid3/33/squid_reverse_general.xml
@@ -241,7 +241,7 @@
Enable AutoDiscoverreverse_owa_autodiscover
- You also should set up a DNS-A-record to point to you WAN-IP.]]>
+ You also should set up the autodiscover DNS-record to point to you WAN-IP.]]>
checkbox
--
cgit v1.2.3
From 641c850336fc271440d3377d09db20be4bc717c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Lapie?=
Date: Wed, 25 Jun 2014 02:00:37 +0900
Subject: Switched back to one Apache 2.4 config template
---
config/apache_mod_security-dev/apache22.template | 517 ---------------------
.../apache_mod_security.inc | 5 +-
.../apache_mod_security-dev/apache_virtualhost.xml | 2 +-
3 files changed, 2 insertions(+), 522 deletions(-)
delete mode 100644 config/apache_mod_security-dev/apache22.template
(limited to 'config')
diff --git a/config/apache_mod_security-dev/apache22.template b/config/apache_mod_security-dev/apache22.template
deleted file mode 100644
index e5342dc4..00000000
--- a/config/apache_mod_security-dev/apache22.template
+++ /dev/null
@@ -1,517 +0,0 @@
- for detailed information.
-# In particular, see
-#
-# for a discussion of each configuration directive.
-#
-# Do NOT simply read the instructions in here without understanding
-# what they do. They're here only as hints or reminders. If you are unsure
-# consult the online docs. You have been warned.
-#
-# Configuration and logfile names: If the filenames you specify for many
-# of the server's control files begin with "/" (or "drive:/" for Win32), the
-# server will use that explicit path. If the filenames do *not* begin
-# with "/", the value of ServerRoot is prepended -- so "/var/log/foo_log"
-# with ServerRoot set to "/usr/local" will be interpreted by the
-# server as "/usr/local//var/log/foo_log".
-
-#
-# ServerRoot: The top of the directory tree under which the server's
-# configuration, error, and log files are kept.
-#
-# Do not add a slash at the end of the directory path. If you point
-# ServerRoot at a non-local disk, be sure to point the LockFile directive
-# at a local disk. If you wish to share the same ServerRoot for multiple
-# httpd daemons, you will need to change at least LockFile and PidFile.
-#
-ServerRoot "{$apache_dir}"
-
-#
-# Listen: Allows you to bind Apache to specific IP addresses and/or
-# ports, instead of the default. See also the
-# directive.
-#
-# Change this to Listen on specific IP addresses as shown below to
-# prevent Apache from glomming onto all bound IP addresses.
-#
-Listen {$global_listen}
-{$aliases}
-
-#
-# Dynamic Shared Object (DSO) Support
-#
-# To be able to use the functionality of a module which was built as a DSO you
-# have to place corresponding `LoadModule' lines at this location so the
-# directives contained in it are actually available _before_ they are used.
-# Statically compiled modules (those listed by `httpd -l') do not need
-# to be loaded here.
-#
-# Example:
-# LoadModule foo_module modules/mod_foo.so
-#
-# have to place corresponding `LoadModule' lines at this location so the
-# LoadModule foo_module modules/mod_foo.so
-LoadModule authn_file_module libexec/{$apache_version}/mod_authn_file.so
-LoadModule authn_dbm_module libexec/{$apache_version}/mod_authn_dbm.so
-LoadModule authn_anon_module libexec/{$apache_version}/mod_authn_anon.so
-LoadModule authn_default_module libexec/{$apache_version}/mod_authn_default.so
-LoadModule authn_alias_module libexec/{$apache_version}/mod_authn_alias.so
-LoadModule authz_host_module libexec/{$apache_version}/mod_authz_host.so
-LoadModule authz_groupfile_module libexec/{$apache_version}/mod_authz_groupfile.so
-LoadModule authz_user_module libexec/{$apache_version}/mod_authz_user.so
-LoadModule authz_dbm_module libexec/{$apache_version}/mod_authz_dbm.so
-LoadModule authz_owner_module libexec/{$apache_version}/mod_authz_owner.so
-LoadModule authz_default_module libexec/{$apache_version}/mod_authz_default.so
-LoadModule auth_basic_module libexec/{$apache_version}/mod_auth_basic.so
-LoadModule auth_digest_module libexec/{$apache_version}/mod_auth_digest.so
-LoadModule file_cache_module libexec/{$apache_version}/mod_file_cache.so
-LoadModule cache_module libexec/{$apache_version}/mod_cache.so
-LoadModule disk_cache_module libexec/{$apache_version}/mod_disk_cache.so
-LoadModule dumpio_module libexec/{$apache_version}/mod_dumpio.so
-LoadModule include_module libexec/{$apache_version}/mod_include.so
-LoadModule filter_module libexec/{$apache_version}/mod_filter.so
-LoadModule charset_lite_module libexec/{$apache_version}/mod_charset_lite.so
-LoadModule deflate_module libexec/{$apache_version}/mod_deflate.so
-LoadModule log_config_module libexec/{$apache_version}/mod_log_config.so
-LoadModule logio_module libexec/{$apache_version}/mod_logio.so
-LoadModule env_module libexec/{$apache_version}/mod_env.so
-LoadModule mime_magic_module libexec/{$apache_version}/mod_mime_magic.so
-LoadModule cern_meta_module libexec/{$apache_version}/mod_cern_meta.so
-LoadModule expires_module libexec/{$apache_version}/mod_expires.so
-LoadModule headers_module libexec/{$apache_version}/mod_headers.so
-LoadModule usertrack_module libexec/{$apache_version}/mod_usertrack.so
-LoadModule unique_id_module libexec/{$apache_version}/mod_unique_id.so
-LoadModule setenvif_module libexec/{$apache_version}/mod_setenvif.so
-LoadModule version_module libexec/{$apache_version}/mod_version.so
-LoadModule proxy_module libexec/{$apache_version}/mod_proxy.so
-LoadModule proxy_connect_module libexec/{$apache_version}/mod_proxy_connect.so
-LoadModule proxy_ftp_module libexec/{$apache_version}/mod_proxy_ftp.so
-LoadModule proxy_http_module libexec/{$apache_version}/mod_proxy_http.so
-LoadModule proxy_ajp_module libexec/{$apache_version}/mod_proxy_ajp.so
-LoadModule proxy_balancer_module libexec/{$apache_version}/mod_proxy_balancer.so
-LoadModule ssl_module libexec/{$apache_version}/mod_ssl.so
-LoadModule mime_module libexec/{$apache_version}/mod_mime.so
-LoadModule status_module libexec/{$apache_version}/mod_status.so
-LoadModule autoindex_module libexec/{$apache_version}/mod_autoindex.so
-LoadModule asis_module libexec/{$apache_version}/mod_asis.so
-LoadModule info_module libexec/{$apache_version}/mod_info.so
-#LoadModule cgi_module libexec/{$apache_version}/mod_cgi.so
-LoadModule vhost_alias_module libexec/{$apache_version}/mod_vhost_alias.so
-LoadModule negotiation_module libexec/{$apache_version}/mod_negotiation.so
-LoadModule dir_module libexec/{$apache_version}/mod_dir.so
-LoadModule imagemap_module libexec/{$apache_version}/mod_imagemap.so
-LoadModule actions_module libexec/{$apache_version}/mod_actions.so
-LoadModule speling_module libexec/{$apache_version}/mod_speling.so
-LoadModule userdir_module libexec/{$apache_version}/mod_userdir.so
-LoadModule alias_module libexec/{$apache_version}/mod_alias.so
-LoadModule rewrite_module libexec/{$apache_version}/mod_rewrite.so
-LoadModule reqtimeout_module libexec/{$apache_version}/mod_reqtimeout.so
-{$mod_mem_cache}
-{$mod_security_module}
-
-
-
-#
-# If you wish httpd to run as a different user or group, you must run
-# httpd as root initially and it will switch.
-#
-# User/Group: The name (or #number) of the user/group to run httpd as.
-# It is usually good practice to create a dedicated user and group for
-# running httpd, as with most system services.
-#
-User www
-Group www
-
-
-
-
-# 'Main' server configuration
-#
-# The directives in this section set up the values used by the 'main'
-# server, which responds to any requests that aren't handled by a
-# definition. These values also provide defaults for
-# any containers you may define later in the file.
-#
-# All of these directives may appear inside containers,
-# in which case these default settings will be overridden for the
-# virtual host being defined.
-#
-# worker MPM
-
-{$performance_settings}
-
-#
-# ServerAdmin: Your address, where problems with the server should be
-# e-mailed. This address appears on some server-generated pages, such
-# as error documents. e.g. admin@your-domain.com
-#
-ServerAdmin {$global_site_email}
-
-#
-# ServerName gives the name and port that the server uses to identify itself.
-# This can often be determined automatically, but we recommend you specify
-# it explicitly to prevent problems during startup.
-#
-# If your host doesn't have a registered DNS name, enter its IP address here.
-#
-ServerName {$servername}
-
-#
-# DocumentRoot: The directory out of which you will serve your
-# documents. By default, all requests are taken from this directory, but
-# symbolic links and aliases may be used to point to other locations.
-#
-DocumentRoot "{$apache_dir}/www/{$apache_version}"
-
-#
-# Each directory to which Apache has access can be configured with respect
-# to which services and features are allowed and/or disabled in that
-# directory (and its subdirectories).
-#
-# First, we configure the "default" to be a very restrictive set of
-# features.
-#
-
- AllowOverride None
- Order deny,allow
- Deny from all
-
-
-#
-# Note that from this point forward you must specifically allow
-# particular features to be enabled - so if something's not working as
-# you might expect, make sure that you have specifically enabled it
-# below.
-#
-
-#
-# This should be changed to whatever you set DocumentRoot to.
-#
-#
-# #
-# # Possible values for the Options directive are "None", "All",
-# # or any combination of:
-# # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
-# #
-# # Note that "MultiViews" must be named *explicitly* --- "Options All"
-# # doesn't give it to you.
-# #
-# # The Options directive is both complicated and important. Please see
-# # http://httpd.apache.org/docs/2.2/mod/core.html#options
-# # for more information.
-# #
-# Options Indexes FollowSymLinks
-#
-# #
-# # AllowOverride controls what directives may be placed in .htaccess files.
-# # It can be "All", "None", or any combination of the keywords:
-# # Options FileInfo AuthConfig Limit
-# #
-# AllowOverride None
-#
-# #
-# # Controls who can get stuff from this server.
-# #
-# Order allow,deny
-# Allow from all
-#
-#
-#
-#
-# DirectoryIndex: sets the file that Apache will serve if a directory
-# is requested.
-#
-#
-# DirectoryIndex index.html
-#
-#
-#
-# The following lines prevent .htaccess and .htpasswd files from being
-# viewed by Web clients.
-#
-#
-# Order allow,deny
-# Deny from all
-# Satisfy All
-#
-#
-#
-# ErrorLog: The location of the error log file.
-# If you do not specify an ErrorLog directive within a
-# container, error messages relating to that virtual host will be
-# logged here. If you *do* define an error logfile for a
-# container, that host's errors will be logged there and not here.
-#
-ErrorLog "/var/log/httpd-error.log"
-
-#
-# LogLevel: Control the number of messages logged to the error_log.
-# Possible values include: debug, info, notice, warn, error, crit,
-# alert, emerg.
-#
-LogLevel warn
-
-
- #
- # The following directives define some format nicknames for use with
- # a CustomLog directive (see below).
- #
- LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
- LogFormat "%h %l %u %t \"%r\" %>s %b" common
-
-
- # You need to enable mod_logio.c to use %I and %O
- LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
-
-
- #
- # The location and format of the access logfile (Common Logfile Format).
- # If you do not define any access logfiles within a
- # container, they will be logged here. Contrariwise, if you *do*
- # define per- access logfiles, transactions will be
- # logged therein and *not* in this file.
- #
- #CustomLog "/var/log/httpd-access.log" common
-
- #
- # If you prefer a logfile with access, agent, and referer information
- # (Combined Logfile Format) you can use the following directive.
- #
- CustomLog "/var/log/httpd-access.log" combined
-
-
-#
-# #
-# # Redirect: Allows you to tell clients about documents that used to
-# # exist in your server's namespace, but do not anymore. The client
-# # will make a new request for the document at its new location.
-# # Example:
-# # Redirect permanent /foo http://www.example.com/bar
-#
-# #
-# # Alias: Maps web paths into filesystem paths and is used to
-# # access content that does not live under the DocumentRoot.
-# # Example:
-# # Alias /webpath /full/filesystem/path
-# #
-# # If you include a trailing / on /webpath then the server will
-# # require it to be present in the URL. You will also likely
-# # need to provide a section to allow access to
-# # the filesystem path.
-#
-# #
-# # ScriptAlias: This controls which directories contain server scripts.
-# # ScriptAliases are essentially the same as Aliases, except that
-# # documents in the target directory are treated as applications and
-# # run by the server when requested rather than as documents sent to the
-# # client. The same rules about trailing "/" apply to ScriptAlias
-# # directives as to Alias.
-# #
-# ScriptAlias /cgi-bin/ "/usr/local/www/{$apache_version}/cgi-bin/"
-#
-#
-
-#
-# #
-# # ScriptSock: On threaded servers, designate the path to the UNIX
-# # socket used to communicate with the CGI daemon of mod_cgid.
-# #
-# #Scriptsock /var/run/cgisock
-#
-
-#
-# "/usr/local/www/{$apache_version}/cgi-bin" should be changed to whatever your ScriptAliased
-# CGI directory exists, if you have that configured.
-#
-#
-# AllowOverride None
-# Options None
-# Order allow,deny
-# Allow from all
-#
-
-#
-# DefaultType: the default MIME type the server will use for a document
-# if it cannot otherwise determine one, such as from filename extensions.
-# If your server contains mostly text or HTML documents, "text/plain" is
-# a good value. If most of your content is binary, such as applications
-# or images, you may want to use "application/octet-stream" instead to
-# keep browsers from trying to display binary files as though they are
-# text.
-#
-DefaultType text/plainm
-
-
- #
- # TypesConfig points to the file containing the list of mappings from
- # filename extension to MIME-type.
- #
- TypesConfig etc/{$apache_version}/mime.types
-
- #
- # AddType allows you to add to or override the MIME configuration
- # file specified in TypesConfig for specific file types.
- #
- #AddType application/x-gzip .tgz
- #
- # AddEncoding allows you to have certain browsers uncompress
- # information on the fly. Note: Not all browsers support this.
- #
- #AddEncoding x-compress .Z
- #AddEncoding x-gzip .gz .tgz
- #
- # If the AddEncoding directives above are commented-out, then you
- # probably should define those extensions to indicate media types:
- #
- AddType application/x-compress .Z
- AddType application/x-gzip .gz .tgz
-
- #
- # AddHandler allows you to map certain file extensions to "handlers":
- # actions unrelated to filetype. These can be either built into the server
- # or added with the Action directive (see below)
- #
- # To use CGI scripts outside of ScriptAliased directories:
- # (You will also need to add "ExecCGI" to the "Options" directive.)
- #
- #AddHandler cgi-script .cgi
-
- # For type maps (negotiated resources):
- #AddHandler type-map var
-
- #
- # Filters allow you to process content before it is sent to the client.
- #
- # To parse .shtml files for server-side includes (SSI):
- # (You will also need to add "Includes" to the "Options" directive.)
- #
- #AddType text/html .shtml
- #AddOutputFilter INCLUDES .shtml
-
-
-#
-# The mod_mime_magic module allows the server to use various hints from the
-# contents of the file itself to determine its type. The MIMEMagicFile
-# directive tells the module where the hint definitions are located.
-#
-#MIMEMagicFile etc/{$apache_version}/magic
-
-#
-# Customizable error responses come in three flavors:
-# 1) plain text 2) local redirects 3) external redirects
-#
-# Some examples:
-
-{$errordocument}
-
-#ErrorDocument 500 "The server made a boo boo."
-#ErrorDocument 404 /missing.html
-#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
-#ErrorDocument 402 http://www.example.com/subscription_info.html
-#
-
-#
-# EnableMMAP and EnableSendfile: On systems that support it,
-# memory-mapping or the sendfile syscall is used to deliver
-# files. This usually improves server performance, but must
-# be turned off when serving from networked-mounted
-# filesystems or if support for these functions is otherwise
-# broken on your system.
-#
-#EnableMMAP off
-#EnableSendfile off
-
-# Supplemental configuration
-#
-# The configuration files in the etc/{$apache_version}/extra/ directory can be
-# included to add extra features or to modify the default configuration of
-# the server, or you may simply copy their contents here and change as
-# necessary.
-
-# Server-pool management (MPM specific)
-#Include etc/{$apache_version}/extra/httpd-mpm.conf
-
-# Multi-language error messages
-#Include etc/{$apache_version}/extra/httpd-multilang-errordoc.conf
-
-# Fancy directory listings
-#Include etc/{$apache_version}/extra/httpd-autoindex.conf
-
-# Language settings
-#Include etc/{$apache_version}/extra/httpd-languages.conf
-
-# User home directories
-#Include etc/{$apache_version}/extra/httpd-userdir.conf
-
-# Real-time info on requests and configuration
-#Include etc/{$apache_version}/extra/httpd-info.conf
-
-# Virtual hosts
-#Include etc/{$apache_version}/extra/httpd-vhosts.conf
-
-# Local access to the Apache HTTP Server Manual
-#Include etc/{$apache_version}/extra/httpd-manual.conf
-
-# Distributed authoring and versioning (WebDAV)
-#Include etc/{$apache_version}/extra/httpd-dav.conf
-
-# Various default settings
-#Include etc/{$apache_version}/extra/httpd-default.conf
-
-# Secure (SSL/TLS) connections
-#Include etc/{$apache_version}/extra/httpd-ssl.conf
-#
-# Note: The following must must be present to support
-# starting without SSL on platforms with no /dev/random equivalent
-# but a statically compiled-in mod_ssl.
-#
-
-SSLRandomSeed startup builtin
-SSLRandomSeed connect builtin
-
-
-# Cache settings
-{$mem_cache}
-{$cache_root}
-
-#accf_http are not present on current build
-AcceptFilter http none
-AcceptFilter https none
-
-# Mod security
-{$mod_security}
-
-# Proxysettings
-{$mod_proxy}
-
-# Mod status
-{$mod_status}
-
-
-# Include anything else
-Include etc/{$apache_version}/Includes/*.conf
-
-EOF;
-
-?>
diff --git a/config/apache_mod_security-dev/apache_mod_security.inc b/config/apache_mod_security-dev/apache_mod_security.inc
index 93757e22..5d1e51bb 100644
--- a/config/apache_mod_security-dev/apache_mod_security.inc
+++ b/config/apache_mod_security-dev/apache_mod_security.inc
@@ -39,10 +39,7 @@ if ($pf_version > 2.0)
else
define('APACHEDIR', '/usr/local');
-if (file_exists(APACHEDIR . "/libexec/apache22"))
- define('APACHEVERSION', 'apache22');
-if (file_exists(APACHEDIR . "/libexec/apache24"))
- define('APACHEVERSION', 'apache24');
+define('APACHEVERSION', 'apache24');
// End of system check
define ('MODSECURITY_DIR','crs');
diff --git a/config/apache_mod_security-dev/apache_virtualhost.xml b/config/apache_mod_security-dev/apache_virtualhost.xml
index 488eb822..8558c490 100644
--- a/config/apache_mod_security-dev/apache_virtualhost.xml
+++ b/config/apache_mod_security-dev/apache_virtualhost.xml
@@ -77,7 +77,7 @@
/usr/local/pkg/0644
- https://packages.pfsense.org/packages/config/apache_mod_security-dev/apache.template
+ https://packages.pfsense.org/packages/config/apache_mod_security-dev/apache24.template/usr/local/pkg/
--
cgit v1.2.3
From b468b8725ca571f72f11728e8bd7b1dbceda8f3b Mon Sep 17 00:00:00 2001
From: Phil Davis
Date: Thu, 26 Jun 2014 17:30:39 +0545
Subject: bandwidthd for 2.2 full install
Thanks to charliem https://forum.pfsense.org/index.php?topic=78175.msg428321#msg428321 for this patch to make bandwidthd find the right library environment on 2.2 full install.
I also tested on 2.1.4 full install in a VM, as this change does change the way bandwidthd is run in the 2.1.n series - it works.
---
config/bandwidthd/bandwidthd.inc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'config')
diff --git a/config/bandwidthd/bandwidthd.inc b/config/bandwidthd/bandwidthd.inc
index 16ce4ab1..b7ef3bbd 100644
--- a/config/bandwidthd/bandwidthd.inc
+++ b/config/bandwidthd/bandwidthd.inc
@@ -348,7 +348,9 @@ cd -
EOD;
} else {
$rc['start'] = <<
Date: Mon, 30 Jun 2014 21:34:28 -0500
Subject: add input validation to force filling in all of the fields on the
Settings tab of AutoConfigBackup.
While here, touch up some of the text (point to Gold sub)
---
config/autoconfigbackup/autoconfigbackup.inc | 11 ++++++++++-
config/autoconfigbackup/autoconfigbackup.xml | 2 +-
2 files changed, 11 insertions(+), 2 deletions(-)
(limited to 'config')
diff --git a/config/autoconfigbackup/autoconfigbackup.inc b/config/autoconfigbackup/autoconfigbackup.inc
index 0ca3ebe9..b49b81fd 100644
--- a/config/autoconfigbackup/autoconfigbackup.inc
+++ b/config/autoconfigbackup/autoconfigbackup.inc
@@ -43,8 +43,17 @@ if(file_exists("/usr/local/pkg/parse_config/parse_config_upload.php"))
function custom_php_validation_command($post, &$input_errors) {
global $_POST, $savemsg, $config;
+ if(!$post['username'])
+ $input_errors[] = "Username is required.";
+
+ if(!$post['password'] or !$post['passwordagain'])
+ $input_errors[] = "The subscription password is required.";
+
+ if(!$post['crypto_password'] or !$post['crypto_password2'])
+ $input_errors[] = "The encryption password is required.";
+
if($post['password'] <> $post['passwordagain'])
- $input_errors[] = "Sorry, the entered passwords do not match.";
+ $input_errors[] = "Sorry, the entered portal.pfsense.org passwords do not match.";
if($post['crypto_password'] <> $post['crypto_password2'])
$input_errors[] = "Sorry, the entered encryption passwords do not match.";
diff --git a/config/autoconfigbackup/autoconfigbackup.xml b/config/autoconfigbackup/autoconfigbackup.xml
index b0514e6a..ee125efc 100644
--- a/config/autoconfigbackup/autoconfigbackup.xml
+++ b/config/autoconfigbackup/autoconfigbackup.xml
@@ -34,7 +34,7 @@
*/
]]>
- Automatically backs up your pfSense configuration. All contents are encrypted on the server. Requires Gold or Support Subscription from https://portal.pfsense.org
+ Automatically backs up your pfSense configuration. All contents are encrypted before being sent to the server. Requires Gold Subscription from https://portal.pfsense.orgpfSense Portal subscriptionAutoConfigBackup1.25
--
cgit v1.2.3
From 22dfebb37d8940a737e6b3b24007ee28dfe4540e Mon Sep 17 00:00:00 2001
From: Daniel Becker
Date: Wed, 2 Jul 2014 10:33:44 -0700
Subject: fix avahi config generation
---
config/avahi/avahi.inc | 6 +++---
config/avahi/avahi.xml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
(limited to 'config')
diff --git a/config/avahi/avahi.inc b/config/avahi/avahi.inc
index 7b093276..0bc181ec 100644
--- a/config/avahi/avahi.inc
+++ b/config/avahi/avahi.inc
@@ -115,12 +115,12 @@ function avahi_write_config() {
[server]
host-name={$hostname}
-domain-name={$domain}
-browse-domains="{$browsedomains}"
+domain-name=local
+browse-domains={$browsedomains}
deny-interfaces={$denyinterfaces}
use-ipv4={$useipv4}
use-ipv6={$useipv6}
-enable-dbus=no
+enable-dbus=yes
#check-response-ttl=no
#use-iff-running=no
#disallow-other-stacks=no
diff --git a/config/avahi/avahi.xml b/config/avahi/avahi.xml
index d1e58bdc..2abed267 100644
--- a/config/avahi/avahi.xml
+++ b/config/avahi/avahi.xml
@@ -59,7 +59,7 @@
Browse domains (comma separated)browsedomains
- Enter the domains that you would like proxied. (example: .local, pfsense.org, mydomain.com)
+ Enter the domains that you would like proxied. (example: local, pfsense.org, mydomain.com)input
--
cgit v1.2.3
From b09fa5d1c81b02eac2b277cf376ff15550c094a5 Mon Sep 17 00:00:00 2001
From: Daniel Becker
Date: Wed, 2 Jul 2014 11:13:37 -0700
Subject: fix note to indicate that WAN interface is ALWAYS excluded
---
config/avahi/avahi.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'config')
diff --git a/config/avahi/avahi.xml b/config/avahi/avahi.xml
index 2abed267..1ad0568e 100644
--- a/config/avahi/avahi.xml
+++ b/config/avahi/avahi.xml
@@ -65,7 +65,7 @@
Deny interfacesdenyinterfaces
- Interfaces that you do NOT want Avahi to listen on. NOTE: WAN is disabled by default.
+ Interfaces that you do NOT want Avahi to listen on. NOTE: WAN is always disabled.interfaces_selectiontrue
--
cgit v1.2.3
From bbddcac64996454e5be9c3203607c31221d7547f Mon Sep 17 00:00:00 2001
From: Renato Botelho
Date: Thu, 17 Jul 2014 14:15:55 -0300
Subject: Bump avahi version to 1.0.5 due to recent changes
---
config/avahi/avahi.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'config')
diff --git a/config/avahi/avahi.xml b/config/avahi/avahi.xml
index 1ad0568e..f3f98dd4 100644
--- a/config/avahi/avahi.xml
+++ b/config/avahi/avahi.xml
@@ -34,7 +34,7 @@
Services: Avahiavahi
- 0.6.29 pkg v1.01
+ 0.6.31 pkg v1.05Save/usr/local/pkg/avahi.inc
diff --git a/config/squid3/33/squid_reverse_general.xml b/config/squid3/33/squid_reverse_general.xml
index 8b2a8c9b..296db638 100755
--- a/config/squid3/33/squid_reverse_general.xml
+++ b/config/squid3/33/squid_reverse_general.xml
@@ -241,7 +241,8 @@
Enable AutoDiscoverreverse_owa_autodiscover
- You also should set up the autodiscover DNS-record to point to you WAN-IP.]]>
+ You also should set up the autodiscover DNS-record to point to you WAN-IP.
+ HTTP-reverse Proxy should be enabled for most compability.]]>
checkbox
--
cgit v1.2.3
From 6c9bbf39f0dd898fad419b7a373375ef1faf2b50 Mon Sep 17 00:00:00 2001
From: Martin Fuchs
Date: Sun, 20 Jul 2014 11:51:48 +0200
Subject: Revert "add a hint for autodiscover over HTTP"
This reverts commit 9485b386dba7a4fbdfbc7941071cd4574f24c91c.
---
config/squid3/31/squid_reverse_general.xml | 3 +--
config/squid3/33/squid_reverse_general.xml | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
(limited to 'config')
diff --git a/config/squid3/31/squid_reverse_general.xml b/config/squid3/31/squid_reverse_general.xml
index 296db638..8b2a8c9b 100644
--- a/config/squid3/31/squid_reverse_general.xml
+++ b/config/squid3/31/squid_reverse_general.xml
@@ -241,8 +241,7 @@
Enable AutoDiscoverreverse_owa_autodiscover
- You also should set up the autodiscover DNS-record to point to you WAN-IP.
- HTTP-reverse Proxy should be enabled for most compability.]]>
+ You also should set up the autodiscover DNS-record to point to you WAN-IP.]]>
checkbox
diff --git a/config/squid3/33/squid_reverse_general.xml b/config/squid3/33/squid_reverse_general.xml
index 296db638..8b2a8c9b 100755
--- a/config/squid3/33/squid_reverse_general.xml
+++ b/config/squid3/33/squid_reverse_general.xml
@@ -241,8 +241,7 @@
Enable AutoDiscoverreverse_owa_autodiscover
- You also should set up the autodiscover DNS-record to point to you WAN-IP.
- HTTP-reverse Proxy should be enabled for most compability.]]>
+ You also should set up the autodiscover DNS-record to point to you WAN-IP.]]>
checkbox
--
cgit v1.2.3
From 0813e48c1dc469c2a0633fed512e0258af36da31 Mon Sep 17 00:00:00 2001
From: Martin Fuchs
Date: Mon, 21 Jul 2014 00:34:38 +0200
Subject: autocreate http-reverse for autodiscover
---
config/squid3/31/squid_reverse.inc | 4 ++--
config/squid3/33/squid_reverse.inc | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
(limited to 'config')
diff --git a/config/squid3/31/squid_reverse.inc b/config/squid3/31/squid_reverse.inc
index 749d0c44..badaeebe 100644
--- a/config/squid3/31/squid_reverse.inc
+++ b/config/squid3/31/squid_reverse.inc
@@ -78,7 +78,7 @@ function squid_resync_reverse() {
$real_ifaces[] = squid_get_real_interface_address($iface);
if($real_ifaces[$i][0]) {
//HTTP
- if (!empty($settings['reverse_http']))
+ if (!empty($settings['reverse_http']) OR ($settings['reverse_owa_autodiscover'] == 'on'))
$conf .= "http_port {$real_ifaces[$i][0]}:{$http_port} accel defaultsite={$http_defsite} vhost\n";
//HTTPS
if (!empty($settings['reverse_https']))
@@ -90,7 +90,7 @@ function squid_resync_reverse() {
$reverse_ip = explode(";", ($settings['reverse_ip']));
foreach ($reverse_ip as $reip) {
//HTTP
- if (!empty($settings['reverse_http']))
+ if (!empty($settings['reverse_http']) OR ($settings['reverse_owa_autodiscover'] == 'on'))
$conf .= "http_port {$reip}:{$http_port} accel defaultsite={$http_defsite} vhost\n";
//HTTPS
if (!empty($settings['reverse_https']))
diff --git a/config/squid3/33/squid_reverse.inc b/config/squid3/33/squid_reverse.inc
index 25f0ae93..1332f220 100755
--- a/config/squid3/33/squid_reverse.inc
+++ b/config/squid3/33/squid_reverse.inc
@@ -78,7 +78,7 @@ function squid_resync_reverse() {
$real_ifaces[] = squid_get_real_interface_address($iface);
if($real_ifaces[$i][0]) {
//HTTP
- if (!empty($settings['reverse_http']))
+ if (!empty($settings['reverse_http']) OR ($settings['reverse_owa_autodiscover'] == 'on'))
$conf .= "http_port {$real_ifaces[$i][0]}:{$http_port} accel defaultsite={$http_defsite} vhost\n";
//HTTPS
if (!empty($settings['reverse_https']))
@@ -90,7 +90,7 @@ function squid_resync_reverse() {
$reverse_ip = explode(";", ($settings['reverse_ip']));
foreach ($reverse_ip as $reip) {
//HTTP
- if (!empty($settings['reverse_http']))
+ if (!empty($settings['reverse_http']) OR ($settings['reverse_owa_autodiscover'] == 'on'))
$conf .= "http_port {$reip}:{$http_port} accel defaultsite={$http_defsite} vhost\n";
//HTTPS
if (!empty($settings['reverse_https']))
--
cgit v1.2.3
From ae3323845cd71bfae33f12203e6362f03fc634d9 Mon Sep 17 00:00:00 2001
From: bmeeks8
Date: Wed, 23 Jul 2014 15:37:29 -0400
Subject: Update Snort package to latest 2.9.6.2 binary and fix some GUI bugs.
---
config/snort/snort.inc | 1310 +-----------------------
config/snort/snort.priv.inc | 2 +
config/snort/snort.xml | 24 +-
config/snort/snort_alerts.php | 2 +
config/snort/snort_blocked.php | 2 +-
config/snort/snort_check_cron_misc.inc | 2 +-
config/snort/snort_check_for_rule_updates.php | 10 +-
config/snort/snort_conf_template.inc | 112 ++
config/snort/snort_define_servers.php | 2 +
config/snort/snort_download_rules.php | 3 +-
config/snort/snort_download_updates.php | 2 +-
config/snort/snort_edit_hat_data.php | 4 +
config/snort/snort_generate_conf.php | 1351 +++++++++++++++++++++++++
config/snort/snort_interfaces.php | 73 +-
config/snort/snort_interfaces_edit.php | 92 +-
config/snort/snort_interfaces_global.php | 4 +-
config/snort/snort_ip_reputation.php | 2 +
config/snort/snort_migrate_config.php | 96 +-
config/snort/snort_post_install.php | 1348 +-----------------------
config/snort/snort_preprocessors.php | 476 ++++++++-
config/snort/snort_rules.php | 6 +
config/snort/snort_rulesets.php | 2 +
22 files changed, 2261 insertions(+), 2664 deletions(-)
create mode 100644 config/snort/snort_conf_template.inc
create mode 100644 config/snort/snort_generate_conf.php
(limited to 'config')
diff --git a/config/snort/snort.inc b/config/snort/snort.inc
index 47274e77..362002cd 100755
--- a/config/snort/snort.inc
+++ b/config/snort/snort.inc
@@ -49,30 +49,28 @@ global $rebuild_rules, $pfSense_snort_version;
// Grab the Snort binary version programmatically, but if that fails use a safe default
$snortver = array();
exec("/usr/local/bin/snort -V 2>&1 |/usr/bin/grep Version | /usr/bin/cut -c20-26", $snortver);
-$snort_version = $snortver[0];
-if (empty($snort_version))
- $snort_version = "2.9.6.0";
/* Used to indicate latest version of this include file has been loaded */
-$pfSense_snort_version = "3.0.13";
+$pfSense_snort_version = "3.1";
/* get installed package version for display */
$snort_package_version = "Snort {$config['installedpackages']['package'][get_pkg_id("snort")]['version']}";
// Define SNORTDIR and SNORTLIBDIR constants according to pfSense version
$pfs_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pfs_version > 2.0) {
- define("SNORTDIR", "/usr/pbi/snort-" . php_uname("m") . "/etc/snort");
- define("SNORTLIBDIR", "/usr/pbi/snort-" . php_uname("m") . "/lib/snort");
-}
-else {
+if ($pfs_version < 2.1) {
define("SNORTDIR", "/usr/local/etc/snort");
define("SNORTLIBDIR", "/usr/local/lib/snort");
}
+else {
+ define("SNORTDIR", "/usr/pbi/snort-" . php_uname("m") . "/etc/snort");
+ define("SNORTLIBDIR", "/usr/pbi/snort-" . php_uname("m") . "/lib/snort");
+}
/* Define some useful constants for Snort */
/* Be sure to include trailing slash on the URL defines */
define("SNORTLOGDIR", "/var/log/snort");
+define("SNORT_BIN_VERSION", "2.9.6.2");
define("ET_DNLD_FILENAME", "emerging.rules.tar.gz");
define("ETPRO_DNLD_FILENAME", "etpro.rules.tar.gz");
define("GPLV2_DNLD_FILENAME", "community-rules.tar.gz");
@@ -761,7 +759,7 @@ function snort_rm_blocked_install_cron($should_install) {
// Now either install the new or updated cron job,
// or return if "rm_blocked" is disabled
if ($should_install) {
- $command = "/usr/bin/nice -n20 /usr/local/sbin/expiretable -t $snort_rm_blocked_expire snort2c";
+ $command = "/usr/bin/nice -n20 /sbin/pfctl -q -t snort2c -T expire {$snort_rm_blocked_expire}";
install_cron_job($command, $should_install, $snort_rm_blocked_min, $snort_rm_blocked_hr, $snort_rm_blocked_mday, $snort_rm_blocked_month, $snort_rm_blocked_wday, "root");
}
}
@@ -849,7 +847,7 @@ function sync_snort_package_config() {
/* do not start config build if rules is empty or there are no Snort settings */
if (!is_array($config['installedpackages']['snortglobal']) || !is_array($config['installedpackages']['snortglobal']['rule'])) {
- @unlink("{$rcdir}/snort.sh");
+ @unlink("{$rcdir}snort.sh");
conf_mount_ro();
return;
}
@@ -1936,11 +1934,8 @@ esac
EOD;
/* write out snort.sh */
- if (!@file_put_contents("{$rcdir}/snort.sh", $snort_sh_text)) {
- log_error("Could not open {$rcdir}/snort.sh for writing.");
- return;
- }
- @chmod("{$rcdir}/snort.sh", 0755);
+ @file_put_contents("{$rcdir}snort.sh", $snort_sh_text);
+ @chmod("{$rcdir}snort.sh", 0755);
}
function snort_generate_barnyard2_conf($snortcfg, $if_real) {
@@ -2152,7 +2147,7 @@ function snort_deinstall() {
log_error(gettext("[Snort] Package deletion requested... removing all files..."));
mwexec("/bin/rm -rf {$snortdir}");
mwexec("/bin/rm -rf {$snortlibdir}/dynamicrules");
- mwexec("/bin/rm -f {$rcdir}/snort.sh");
+ mwexec("/bin/rm -f {$rcdir}snort.sh");
mwexec("/bin/rm -rf /usr/local/pkg/snort");
mwexec("/bin/rm -rf /usr/local/www/snort");
mwexec("/bin/rm -rf /usr/local/etc/snort");
@@ -2515,1283 +2510,44 @@ function snort_filter_preproc_rules($snortcfg, &$active_rules, $persist_log = fa
function snort_generate_conf($snortcfg) {
+ /********************************************************/
+ /* This function generates the snort.conf file for the */
+ /* passed interface using stored values from the Snort */
+ /* package configuration. */
+ /********************************************************/
+
global $config, $g, $rebuild_rules;
+ // Exit if there are no configured Snort interfaces
+ if (!is_array($config['installedpackages']['snortglobal']['rule']))
+ return;
+
$snortdir = SNORTDIR;
$snortlibdir = SNORTLIBDIR;
$snortlogdir = SNORTLOGDIR;
$flowbit_rules_file = FLOWBITS_FILENAME;
$snort_enforcing_rules_file = ENFORCING_RULES_FILENAME;
- if (!is_array($config['installedpackages']['snortglobal']['rule']))
- return;
-
- conf_mount_rw();
-
- /* See if we should protect and not modify the preprocessor rules files */
- if (!empty($snortcfg['protect_preproc_rules']))
- $protect_preproc_rules = $snortcfg['protect_preproc_rules'];
- else
- $protect_preproc_rules = "off";
-
$if_real = get_real_interface($snortcfg['interface']);
$snort_uuid = $snortcfg['uuid'];
$snortcfgdir = "{$snortdir}/snort_{$snort_uuid}_{$if_real}";
- /* custom home nets */
- $home_net_list = snort_build_list($snortcfg, $snortcfg['homelistname']);
- $home_net = implode(",", $home_net_list);
-
- $external_net = '!$HOME_NET';
- if (!empty($snortcfg['externallistname']) && $snortcfg['externallistname'] != 'default') {
- $external_net_list = snort_build_list($snortcfg, $snortcfg['externallistname']);
- $external_net = implode(",", $external_net_list);
- }
-
- /* user added arguments */
- $snort_config_pass_thru = str_replace("\r", "", base64_decode($snortcfg['configpassthru']));
- // Remove the trailing newline
- $snort_config_pass_thru = rtrim($snort_config_pass_thru);
-
- /* create a few directories and ensure the sample files are in place */
- $snort_dirs = array( $snortdir, $snortcfgdir, "{$snortcfgdir}/rules",
- "{$snortlogdir}/snort_{$if_real}{$snort_uuid}",
- "{$snortlogdir}/snort_{$if_real}{$snort_uuid}/barnyard2",
- "{$snortcfgdir}/preproc_rules",
- "dynamicrules" => "{$snortlibdir}/dynamicrules",
- "dynamicengine" => "{$snortlibdir}/dynamicengine",
- "dynamicpreprocessor" => "{$snortcfgdir}/dynamicpreprocessor"
- );
- foreach ($snort_dirs as $dir) {
- if (!is_dir($dir))
- safe_mkdir($dir);
- }
-
- /********************************************************************/
- /* For fail-safe on an initial startup following installation, and */
- /* before a rules update has occurred, copy the default config */
- /* files to the interface directory. If files already exist in */
- /* the interface directory, or they are newer, that means a rule */
- /* update has been done and we should leave the customized files */
- /* put in place by the rules update process. */
- /********************************************************************/
- $snort_files = array("gen-msg.map", "classification.config", "reference.config", "attribute_table.dtd",
- "sid-msg.map", "unicode.map", "threshold.conf", "preproc_rules/preprocessor.rules",
- "preproc_rules/decoder.rules", "preproc_rules/sensitive-data.rules"
- );
- foreach ($snort_files as $file) {
- if (file_exists("{$snortdir}/{$file}")) {
- $ftime = filemtime("{$snortdir}/{$file}");
- if (!file_exists("{$snortcfgdir}/{$file}") || ($ftime > filemtime("{$snortcfgdir}/{$file}")))
- @copy("{$snortdir}/{$file}", "{$snortcfgdir}/{$file}");
- }
- }
-
- /* define alertsystemlog */
- $alertsystemlog_type = "";
- if ($snortcfg['alertsystemlog'] == "on")
- $alertsystemlog_type = "output alert_syslog: log_alert";
-
- /* define snortunifiedlog */
- $snortunifiedlog_type = "";
- if ($snortcfg['barnyard_enable'] == "on") {
- if (isset($snortcfg['unified2_log_limit']))
- $u2_log_limit = "limit {$snortcfg['unified2_log_limit']}";
- else
- $u2_log_limit = "limit 128";
-
- $snortunifiedlog_type = "output unified2: filename snort_{$snort_uuid}_{$if_real}.u2, {$u2_log_limit}";
- if ($snortcfg['barnyard_log_vlan_events'] == 'on')
- $snortunifiedlog_type .= ", vlan_event_types";
- if ($snortcfg['barnyard_log_mpls_events'] == 'on')
- $snortunifiedlog_type .= ", mpls_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']))
- $snort_performance = $snortcfg['performance'];
-
- /* if user has defined a custom ssh port, use it */
- if(is_array($config['system']['ssh']) && isset($config['system']['ssh']['port']))
- $ssh_port = $config['system']['ssh']['port'];
- else
- $ssh_port = "22";
-
- /* Define an array of default values for the various preprocessor ports */
- $snort_ports = array(
- "dns_ports" => "53", "smtp_ports" => "25", "mail_ports" => "25,465,587,691",
- "http_ports" => "36,80,81,82,83,84,85,86,87,88,89,90,311,383,591,593,631,901,1220,1414,1533,1741,1830,2301,2381,2809,3037,3057,3128,3443,3702,4343,4848,5250,6080,6988,7000,7001,7144,7145,7510,7777,7779,8000,8008,8014,8028,8080,8081,8082,8085,8088,8090,8118,8123,8180,8181,8222,8243,8280,8300,8500,8800,8888,8899,9000,9060,9080,9090,9091,9443,9999,10000,11371,15489,29991,33300,34412,34443,34444,41080,44440,50000,50002,51423,55555,56712",
- "oracle_ports" => "1024:", "mssql_ports" => "1433", "telnet_ports" => "23",
- "snmp_ports" => "161", "ftp_ports" => "21,2100,3535", "ssh_ports" => $ssh_port,
- "pop2_ports" => "109", "pop3_ports" => "110", "imap_ports" => "143",
- "sip_ports" => "5060,5061,5600", "auth_ports" => "113", "finger_ports" => "79",
- "irc_ports" => "6665,6666,6667,6668,6669,7000", "smb_ports" => "139,445",
- "nntp_ports" => "119", "rlogin_ports" => "513", "rsh_ports" => "514",
- "ssl_ports" => "443,465,563,636,989,992,993,994,995,7801,7802,7900,7901,7902,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,7920",
- "file_data_ports" => "\$HTTP_PORTS,110,143", "shellcode_ports" => "!80",
- "sun_rpc_ports" => "111,32770,32771,32772,32773,32774,32775,32776,32777,32778,32779",
- "DCERPC_NCACN_IP_TCP" => "139,445", "DCERPC_NCADG_IP_UDP" => "138,1024:",
- "DCERPC_NCACN_IP_LONG" => "135,139,445,593,1024:", "DCERPC_NCACN_UDP_LONG" => "135,1024:",
- "DCERPC_NCACN_UDP_SHORT" => "135,593,1024:", "DCERPC_NCACN_TCP" => "2103,2105,2107",
- "DCERPC_BRIGHTSTORE" => "6503,6504", "DNP3_PORTS" => "20000", "MODBUS_PORTS" => "502",
- "GTP_PORTS" => "2123,2152,3386"
- );
-
- /* Check for defined Aliases that may override default port settings as we build the portvars array */
- $portvardef = "";
- foreach ($snort_ports as $alias => $avalue) {
- if (!empty($snortcfg["def_{$alias}"]) && is_alias($snortcfg["def_{$alias}"]))
- $snort_ports[$alias] = trim(filter_expand_alias($snortcfg["def_{$alias}"]));
- $snort_ports[$alias] = preg_replace('/\s+/', ',', trim($snort_ports[$alias]));
- $portvardef .= "portvar " . strtoupper($alias) . " [" . $snort_ports[$alias] . "]\n";
- }
-
- /* Define the default ports for the Stream5 preprocessor (formatted for easier reading in the snort.conf file) */
- $stream5_ports_client = "21 22 23 25 42 53 70 79 109 110 111 113 119 135 136 137 \\\n";
- $stream5_ports_client .= "\t 139 143 161 445 513 514 587 593 691 1433 1521 1741 \\\n";
- $stream5_ports_client .= "\t 2100 3306 6070 6665 6666 6667 6668 6669 7000 8181 \\\n";
- $stream5_ports_client .= "\t 32770 32771 32772 32773 32774 32775 32776 32777 \\\n";
- $stream5_ports_client .= "\t 32778 32779";
- $stream5_ports_both = "80 81 82 83 84 85 86 87 88 89 90 110 311 383 443 465 563 \\\n";
- $stream5_ports_both .= "\t 591 593 631 636 901 989 992 993 994 995 1220 1414 1533 \\\n";
- $stream5_ports_both .= "\t 1830 2301 2381 2809 3037 3057 3128 3443 3702 4343 4848 \\\n";
- $stream5_ports_both .= "\t 5250 6080 6988 7907 7000 7001 7144 7145 7510 7802 7777 \\\n";
- $stream5_ports_both .= "\t 7779 7801 7900 7901 7902 7903 7904 7905 7906 7908 7909 \\\n";
- $stream5_ports_both .= "\t 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 \\\n";
- $stream5_ports_both .= "\t 8000 8008 8014 8028 8080 8081 8082 8085 8088 8090 8118 \\\n";
- $stream5_ports_both .= "\t 8123 8180 8222 8243 8280 8300 8500 8800 8888 8899 9000 \\\n";
- $stream5_ports_both .= "\t 9060 9080 9090 9091 9443 9999 10000 11371 15489 29991 \\\n";
- $stream5_ports_both .= "\t 33300 34412 34443 34444 41080 44440 50000 50002 51423 \\\n";
- $stream5_ports_both .= "\t 55555 56712";
-
- /////////////////////////////
- /* preprocessor code */
- /* def perform_stat */
- $perform_stat = << '0') {
- $ftp_telnet_protocol .= " \\\n\tayt_attack_thresh ";
- if ($snortcfg['ftp_telnet_ayt_attack_threshold'] != "")
- $ftp_telnet_protocol .= $snortcfg['ftp_telnet_ayt_attack_threshold'];
- else
- $ftp_telnet_protocol .= "20";
- }
-
- // Setup the standard FTP commands used for all FTP Server engines
- $ftp_cmds = << \
- cmd_validity EPSV < [ { char 12 | char A char L char L } ] > \
- cmd_validity MACB < string > \
- cmd_validity MDTM < [ date nnnnnnnnnnnnnn[.n[n[n]]] ] string > \
- cmd_validity MODE < char ASBCZ > \
- cmd_validity PORT < host_port > \
- cmd_validity PROT < char CSEP > \
- cmd_validity STRU < char FRPO [ string ] > \
- cmd_validity TYPE < { char AE [ char NTC ] | char I | char L [ number ] } >
-
-EOD;
-
- // Configure all the FTP_Telnet FTP protocol options
- // Iterate and configure the FTP Client engines
- $ftp_default_client_engine = array( "name" => "default", "bind_to" => "all", "max_resp_len" => 256,
- "telnet_cmds" => "no", "ignore_telnet_erase_cmds" => "yes",
- "bounce" => "yes", "bounce_to_net" => "", "bounce_to_port" => "" );
-
- if (!is_array($snortcfg['ftp_client_engine']['item']))
- $snortcfg['ftp_client_engine']['item'] = array();
-
- // If no FTP client engine is configured, use the default
- // to keep from breaking Snort.
- if (empty($snortcfg['ftp_client_engine']['item']))
- $snortcfg['ftp_client_engine']['item'][] = $ftp_default_client_engine;
- $ftp_client_engine = "";
-
- foreach ($snortcfg['ftp_client_engine']['item'] as $f => $v) {
- $buffer = "preprocessor ftp_telnet_protocol: ftp client ";
- if ($v['name'] == "default" && $v['bind_to'] == "all")
- $buffer .= "default \\\n";
- elseif (is_alias($v['bind_to'])) {
- $tmp = trim(filter_expand_alias($v['bind_to']));
- if (!empty($tmp)) {
- $tmp = preg_replace('/\s+/', ' ', $tmp);
- $buffer .= "{$tmp} \\\n";
- }
- else {
- log_error("[snort] ERROR: unable to resolve IP Address Alias '{$v['bind_to']}' for FTP client '{$v['name']}' ... skipping entry.");
- continue;
- }
- }
- else {
- log_error("[snort] ERROR: unable to resolve IP Address Alias '{$v['bind_to']}' for FTP client '{$v['name']}' ... skipping entry.");
- continue;
- }
-
- if ($v['max_resp_len'] == "")
- $buffer .= "\tmax_resp_len 256 \\\n";
- else
- $buffer .= "\tmax_resp_len {$v['max_resp_len']} \\\n";
-
- $buffer .= "\ttelnet_cmds {$v['telnet_cmds']} \\\n";
- $buffer .= "\tignore_telnet_erase_cmds {$v['ignore_telnet_erase_cmds']} \\\n";
-
- if ($v['bounce'] == "yes") {
- if (is_alias($v['bounce_to_net']) && is_alias($v['bounce_to_port'])) {
- $net = trim(filter_expand_alias($v['bounce_to_net']));
- $port = trim(filter_expand_alias($v['bounce_to_port']));
- if (!empty($net) && !empty($port) &&
- snort_is_single_addr_alias($v['bounce_to_net']) &&
- (is_port($port) || is_portrange($port))) {
- $port = preg_replace('/\s+/', ',', $port);
- // Change port range delimiter to comma for ftp_telnet client preprocessor
- if (is_portrange($port))
- $port = str_replace(":", ",", $port);
- $buffer .= "\tbounce yes \\\n";
- $buffer .= "\tbounce_to { {$net},{$port} }\n";
- }
- else {
- // One or both of the BOUNCE_TO alias values is not right,
- // so figure out which and log an appropriate error.
- if (empty($net) || !snort_is_single_addr_alias($v['bounce_to_net']))
- log_error("[snort] ERROR: illegal value for bounce_to Address Alias [{$v['bounce_to_net']}] for FTP client engine [{$v['name']}] ... omitting 'bounce_to' option for this client engine.");
- if (empty($port) || !(is_port($port) || is_portrange($port)))
- log_error("[snort] ERROR: illegal value for bounce_to Port Alias [{$v['bounce_to_port']}] for FTP client engine [{$v['name']}] ... omitting 'bounce_to' option for this client engine.");
- $buffer .= "\tbounce yes\n";
- }
- }
- else
- $buffer .= "\tbounce yes\n";
- }
- else
- $buffer .= "\tbounce no\n";
-
- // Add this FTP client engine to the master string
- $ftp_client_engine .= "{$buffer}\n";
- }
- // Trim final trailing newline
- rtrim($ftp_client_engine);
-
- // Iterate and configure the FTP Server engines
- $ftp_default_server_engine = array( "name" => "default", "bind_to" => "all", "ports" => "default",
- "telnet_cmds" => "no", "ignore_telnet_erase_cmds" => "yes",
- "ignore_data_chan" => "no", "def_max_param_len" => 100 );
-
- if (!is_array($snortcfg['ftp_server_engine']['item']))
- $snortcfg['ftp_server_engine']['item'] = array();
-
- // If no FTP server engine is configured, use the default
- // to keep from breaking Snort.
- if (empty($snortcfg['ftp_server_engine']['item']))
- $snortcfg['ftp_server_engine']['item'][] = $ftp_default_server_engine;
- $ftp_server_engine = "";
-
- foreach ($snortcfg['ftp_server_engine']['item'] as $f => $v) {
- $buffer = "preprocessor ftp_telnet_protocol: ftp server ";
- if ($v['name'] == "default" && $v['bind_to'] == "all")
- $buffer .= "default \\\n";
- elseif (is_alias($v['bind_to'])) {
- $tmp = trim(filter_expand_alias($v['bind_to']));
- if (!empty($tmp)) {
- $tmp = preg_replace('/\s+/', ' ', $tmp);
- $buffer .= "{$tmp} \\\n";
- }
- else {
- log_error("[snort] ERROR: unable to resolve IP Address Alias '{$v['bind_to']}' for FTP server '{$v['name']}' ... skipping entry.");
- continue;
- }
- }
- else {
- log_error("[snort] ERROR: unable to resolve IP Address Alias '{$v['bind_to']}' for FTP server '{$v['name']}' ... skipping entry.");
- continue;
- }
-
- if ($v['def_max_param_len'] == "")
- $buffer .= "\tdef_max_param_len 100 \\\n";
- elseif ($v['def_max_param_len'] <> '0')
- $buffer .= "\tdef_max_param_len {$v['def_max_param_len']} \\\n";
-
- if ($v['ports'] == "default" || !is_alias($v['ports']) || empty($v['ports']))
- $buffer .= "\tports { {$ftp_ports} } \\\n";
- elseif (is_alias($v['ports'])) {
- $tmp = trim(filter_expand_alias($v['ports']));
- if (!empty($tmp)) {
- $tmp = preg_replace('/\s+/', ' ', $tmp);
- $tmp = snort_expand_port_range($tmp, ' ');
- $buffer .= "\tports { {$tmp} } \\\n";
- }
- else {
- log_error("[snort] ERROR: unable to resolve Port Alias '{$v['ports']}' for FTP server '{$v['name']}' ... reverting to defaults.");
- $buffer .= "\tports { {$ftp_ports} } \\\n";
- }
- }
-
- $buffer .= "\ttelnet_cmds {$v['telnet_cmds']} \\\n";
- $buffer .= "\tignore_telnet_erase_cmds {$v['ignore_telnet_erase_cmds']} \\\n";
- if ($v['ignore_data_chan'] == "yes")
- $buffer .= "\tignore_data_chan yes \\\n";
- $buffer .= "{$ftp_cmds}\n";
-
- // Add this FTP server engine to the master string
- $ftp_server_engine .= $buffer;
- }
- // Remove trailing newlines
- rtrim($ftp_server_engine);
-
- $ftp_preprocessor = << "\$HOME_NET", "smtp_servers" => "\$HOME_NET", "http_servers" => "\$HOME_NET",
- "www_servers" => "\$HOME_NET", "sql_servers" => "\$HOME_NET", "telnet_servers" => "\$HOME_NET",
- "snmp_servers" => "\$HOME_NET", "ftp_servers" => "\$HOME_NET", "ssh_servers" => "\$HOME_NET",
- "pop_servers" => "\$HOME_NET", "imap_servers" => "\$HOME_NET", "sip_proxy_ip" => "\$HOME_NET",
- "sip_servers" => "\$HOME_NET", "rpc_servers" => "\$HOME_NET", "dnp3_server" => "\$HOME_NET",
- "dnp3_client" => "\$HOME_NET", "modbus_server" => "\$HOME_NET", "modbus_client" => "\$HOME_NET",
- "enip_server" => "\$HOME_NET", "enip_client" => "\$HOME_NET",
- "aim_servers" => "64.12.24.0/23,64.12.28.0/23,64.12.161.0/24,64.12.163.0/24,64.12.200.0/24,205.188.3.0/24,205.188.5.0/24,205.188.7.0/24,205.188.9.0/24,205.188.153.0/24,205.188.179.0/24,205.188.248.0/24"
- );
-
- // Change old name from "var" to new name of "ipvar" for IP variables because
- // Snort is deprecating the old "var" name in newer versions.
- $ipvardef = "";
- foreach ($snort_servers as $alias => $avalue) {
- if (!empty($snortcfg["def_{$alias}"]) && is_alias($snortcfg["def_{$alias}"])) {
- $avalue = trim(filter_expand_alias($snortcfg["def_{$alias}"]));
- $avalue = preg_replace('/\s+/', ',', trim($avalue));
- }
- $ipvardef .= "ipvar " . strtoupper($alias) . " [{$avalue}]\n";
- }
-
- $snort_preproc_libs = array(
- "dce_rpc_2" => "dce2_preproc", "dns_preprocessor" => "dns_preproc", "ftp_preprocessor" => "ftptelnet_preproc", "imap_preproc" => "imap_preproc",
- "pop_preproc" => "pop_preproc", "reputation_preproc" => "reputation_preproc", "sensitive_data" => "sdf_preproc",
- "sip_preproc" => "sip_preproc", "gtp_preproc" => "gtp_preproc", "smtp_preprocessor" => "smtp_preproc", "ssh_preproc" => "ssh_preproc",
- "ssl_preproc" => "ssl_preproc", "dnp3_preproc" => "dnp3_preproc", "modbus_preproc" => "modbus_preproc"
- );
- $snort_preproc = array (
- "perform_stat", "other_preprocs", "ftp_preprocessor", "smtp_preprocessor", "ssl_preproc", "sip_preproc", "gtp_preproc", "ssh_preproc", "sf_portscan",
- "dce_rpc_2", "dns_preprocessor", "sensitive_data", "pop_preproc", "imap_preproc", "dnp3_preproc", "modbus_preproc", "reputation_preproc"
- );
- $default_disabled_preprocs = array(
- "sf_portscan", "gtp_preproc", "sensitive_data", "dnp3_preproc", "modbus_preproc", "reputation_preproc", "perform_stat"
- );
- $snort_preprocessors = "";
- foreach ($snort_preproc as $preproc) {
- if ($snortcfg[$preproc] == 'on' || empty($snortcfg[$preproc]) ) {
-
- /* If preprocessor is not explicitly "on" or "off", then default to "off" if in our default disabled list */
- if (empty($snortcfg[$preproc]) && in_array($preproc, $default_disabled_preprocs))
- continue;
-
- /* NOTE: The $$ is not a bug. It is an advanced feature of php */
- if (!empty($snort_preproc_libs[$preproc])) {
- $preproclib = "libsf_" . $snort_preproc_libs[$preproc];
- if (!file_exists($snort_dirs['dynamicpreprocessor'] . "{$preproclib}.so")) {
- if (file_exists("{$snortlibdir}/dynamicpreprocessor/{$preproclib}.so")) {
- @copy("{$snortlibdir}/dynamicpreprocessor/{$preproclib}.so", "{$snort_dirs['dynamicpreprocessor']}/{$preproclib}.so");
- $snort_preprocessors .= $$preproc;
- $snort_preprocessors .= "\n";
- } else
- log_error("Could not find the {$preproclib} file. Snort might error out!");
- } else {
- $snort_preprocessors .= $$preproc;
- $snort_preprocessors .= "\n";
- }
- } else {
- $snort_preprocessors .= $$preproc;
- $snort_preprocessors .= "\n";
- }
- }
- }
- // Remove final trailing newline
- $snort_preprocessors = rtrim($snort_preprocessors);
-
- $snort_misc_include_rules = "";
- if (file_exists("{$snortcfgdir}/reference.config"))
- $snort_misc_include_rules .= "include {$snortcfgdir}/reference.config\n";
- if (file_exists("{$snortcfgdir}/classification.config"))
- $snort_misc_include_rules .= "include {$snortcfgdir}/classification.config\n";
- if (!file_exists("{$snortcfgdir}/preproc_rules/decoder.rules") || !file_exists("{$snortcfgdir}/preproc_rules/preprocessor.rules")) {
- $snort_misc_include_rules .= "config autogenerate_preprocessor_decoder_rules\n";
- log_error("[Snort] Seems preprocessor and/or decoder rules are missing, enabling autogeneration of them in conf file.");
- }
-
- /* generate rule sections to load */
- /* The files are always configured so the update process is easier */
- $selected_rules_sections = "include \$RULE_PATH/{$snort_enforcing_rules_file}\n";
- $selected_rules_sections .= "include \$RULE_PATH/{$flowbit_rules_file}\n";
- $selected_rules_sections .= "include \$RULE_PATH/custom.rules\n";
-
- // Remove trailing newlines
- $snort_misc_include_rules = rtrim($snort_misc_include_rules);
- $selected_rules_sections = rtrim($selected_rules_sections);
+ // Write out snort.conf file using contents of $snort_conf_text
+ @file_put_contents("{$snortcfgdir}/snort.conf", $snort_conf_text);
- /* Create the actual rules files and save in the interface directory */
+ // Create the actual rules files and save them in the interface directory
snort_prepare_rule_files($snortcfg, $snortcfgdir);
- $cksumcheck = "all";
- if ($snortcfg['cksumcheck'] == 'on')
- $cksumcheck = "none";
-
- /* Pull in user-configurable detection config options */
- $cfg_detect_settings = "search-method {$snort_performance} max-pattern-len 20 max_queue_events 5";
- if ($snortcfg['fpm_split_any_any'] == "on")
- $cfg_detect_settings .= " split-any-any";
- if ($snortcfg['fpm_search_optimize'] == "on")
- $cfg_detect_settings .= " search-optimize";
- if ($snortcfg['fpm_no_stream_inserts'] == "on")
- $cfg_detect_settings .= " no_stream_inserts";
-
- /* Pull in user-configurable options for Frag3 preprocessor settings */
- /* Get global Frag3 options first and put into a string */
- $frag3_global = "preprocessor frag3_global: ";
- if (!empty($snortcfg['frag3_memcap']) || $snortcfg['frag3_memcap'] == "0")
- $frag3_global .= "memcap {$snortcfg['frag3_memcap']}, ";
- else
- $frag3_global .= "memcap 4194304, ";
- if (!empty($snortcfg['frag3_max_frags']))
- $frag3_global .= "max_frags {$snortcfg['frag3_max_frags']}";
- else
- $frag3_global .= "max_frags 8192";
- if ($snortcfg['frag3_detection'] == "off")
- $frag3_global .= ", disabled";
-
- $frag3_default_tcp_engine = array( "name" => "default", "bind_to" => "all", "policy" => "bsd",
- "timeout" => 60, "min_ttl" => 1, "detect_anomalies" => "on",
- "overlap_limit" => 0, "min_frag_len" => 0 );
- $frag3_engine = "";
-
- // Now iterate configured Frag3 engines and write them to a string if enabled
- if ($snortcfg['frag3_detection'] == "on") {
- if (!is_array($snortcfg['frag3_engine']['item']))
- $snortcfg['frag3_engine']['item'] = array();
-
- // If no frag3 tcp engine is configured, use the default
- if (empty($snortcfg['frag3_engine']['item']))
- $snortcfg['frag3_engine']['item'][] = $frag3_default_tcp_engine;
-
- foreach ($snortcfg['frag3_engine']['item'] as $f => $v) {
- $frag3_engine .= "preprocessor frag3_engine: ";
- $frag3_engine .= "policy {$v['policy']}";
- if ($v['bind_to'] <> "all") {
- $tmp = trim(filter_expand_alias($v['bind_to']));
- if (!empty($tmp)) {
- $tmp = preg_replace('/\s+/', ',', $tmp);
- if (strpos($tmp, ",") !== false)
- $frag3_engine .= " \\\n\tbind_to [{$tmp}]";
- else
- $frag3_engine .= " \\\n\tbind_to {$tmp}";
- }
- else
- log_error("[snort] WARNING: unable to resolve IP List Alias '{$v['bind_to']}' for Frag3 engine '{$v['name']}' ... using 0.0.0.0 failsafe.");
- }
- $frag3_engine .= " \\\n\ttimeout {$v['timeout']}";
- $frag3_engine .= " \\\n\tmin_ttl {$v['min_ttl']}";
- if ($v['detect_anomalies'] == "on") {
- $frag3_engine .= " \\\n\tdetect_anomalies";
- $frag3_engine .= " \\\n\toverlap_limit {$v['overlap_limit']}";
- $frag3_engine .= " \\\n\tmin_fragment_length {$v['min_frag_len']}";
- }
- // Add newlines to terminate this engine
- $frag3_engine .= "\n\n";
- }
- // Remove trailing newline
- $frag3_engine = rtrim($frag3_engine);
- }
-
- // Grab any user-customized value for Protocol Aware Flushing (PAF) max PDUs
- $paf_max_pdu_config = "config paf_max: ";
- if (empty($snortcfg['max_paf']) || $snortcfg['max_paf'] == '0')
- $paf_max_pdu_config .= "0";
- else
- $paf_max_pdu_config .= $snortcfg['max_paf'];
-
- // Pull in user-configurable options for Stream5 preprocessor settings
- // Get global options first and put into a string
- $stream5_global = "preprocessor stream5_global: \\\n";
- if ($snortcfg['stream5_reassembly'] == "off")
- $stream5_global .= "\tdisabled, \\\n";
- if ($snortcfg['stream5_track_tcp'] == "off")
- $stream5_global .= "\ttrack_tcp no,";
- else {
- $stream5_global .= "\ttrack_tcp yes,";
- if (!empty($snortcfg['stream5_max_tcp']))
- $stream5_global .= " \\\n\tmax_tcp {$snortcfg['stream5_max_tcp']},";
- else
- $stream5_global .= " \\\n\tmax_tcp 262144,";
- }
- if ($snortcfg['stream5_track_udp'] == "off")
- $stream5_global .= " \\\n\ttrack_udp no,";
- else {
- $stream5_global .= " \\\n\ttrack_udp yes,";
- if (!empty($snortcfg['stream5_max_udp']))
- $stream5_global .= " \\\n\tmax_udp {$snortcfg['stream5_max_udp']},";
- else
- $stream5_global .= " \\\n\tmax_udp 131072,";
- }
- if ($snortcfg['stream5_track_icmp'] == "on") {
- $stream5_global .= " \\\n\ttrack_icmp yes,";
- if (!empty($snortcfg['stream5_max_icmp']))
- $stream5_global .= " \\\n\tmax_icmp {$snortcfg['stream5_max_icmp']},";
- else
- $stream5_global .= " \\\n\tmax_icmp 65536,";
- }
- else
- $stream5_global .= " \\\n\ttrack_icmp no,";
- if (!empty($snortcfg['stream5_mem_cap']))
- $stream5_global .= " \\\n\tmemcap {$snortcfg['stream5_mem_cap']},";
- else
- $stream5_global .= " \\\n\tmemcap 8388608,";
-
- if (!empty($snortcfg['stream5_prune_log_max']) || $snortcfg['stream5_prune_log_max'] == '0')
- $stream5_global .= " \\\n\tprune_log_max {$snortcfg['stream5_prune_log_max']}";
- else
- $stream5_global .= " \\\n\tprune_log_max 1048576";
- if ($snortcfg['stream5_flush_on_alert'] == "on")
- $stream5_global .= ", \\\n\tflush_on_alert";
-
- $stream5_default_tcp_engine = array( "name" => "default", "bind_to" => "all", "policy" => "bsd", "timeout" => 30,
- "max_queued_bytes" => 1048576, "detect_anomalies" => "off", "overlap_limit" => 0,
- "max_queued_segs" => 2621, "require_3whs" => "off", "startup_3whs_timeout" => 0,
- "no_reassemble_async" => "off", "dont_store_lg_pkts" => "off", "max_window" => 0,
- "use_static_footprint_sizes" => "off", "check_session_hijacking" => "off", "ports_client" => "default",
- "ports_both" => "default", "ports_server" => "none" );
- $stream5_tcp_engine = "";
-
- // Now iterate configured Stream5 TCP engines and write them to a string if enabled
- if ($snortcfg['stream5_reassembly'] == "on") {
- if (!is_array($snortcfg['stream5_tcp_engine']['item']))
- $snortcfg['stream5_tcp_engine']['item'] = array();
-
- // If no stream5 tcp engine is configured, use the default
- if (empty($snortcfg['stream5_tcp_engine']['item']))
- $snortcfg['stream5_tcp_engine']['item'][] = $stream5_default_tcp_engine;
-
- foreach ($snortcfg['stream5_tcp_engine']['item'] as $f => $v) {
- $buffer = "preprocessor stream5_tcp: ";
- $buffer .= "policy {$v['policy']},";
- if ($v['bind_to'] <> "all") {
- $tmp = trim(filter_expand_alias($v['bind_to']));
- if (!empty($tmp)) {
- $tmp = preg_replace('/\s+/', ',', $tmp);
- if (strpos($tmp, ",") !== false)
- $buffer .= " \\\n\tbind_to [{$tmp}],";
- else
- $buffer .= " \\\n\tbind_to {$tmp},";
- }
- else {
- log_error("[snort] WARNING: unable to resolve IP Address Alias [{$v['bind_to']}] for Stream5 TCP engine '{$v['name']}' ... skipping this engine.");
- continue;
- }
- }
- $stream5_tcp_engine .= $buffer;
- $stream5_tcp_engine .= " \\\n\ttimeout {$v['timeout']},";
- $stream5_tcp_engine .= " \\\n\toverlap_limit {$v['overlap_limit']},";
- $stream5_tcp_engine .= " \\\n\tmax_window {$v['max_window']},";
- $stream5_tcp_engine .= " \\\n\tmax_queued_bytes {$v['max_queued_bytes']},";
- $stream5_tcp_engine .= " \\\n\tmax_queued_segs {$v['max_queued_segs']}";
- if ($v['use_static_footprint_sizes'] == "on")
- $stream5_tcp_engine .= ", \\\n\tuse_static_footprint_sizes";
- if ($v['check_session_hijacking'] == "on")
- $stream5_tcp_engine .= ", \\\n\tcheck_session_hijacking";
- if ($v['dont_store_lg_pkts'] == "on")
- $stream5_tcp_engine .= ", \\\n\tdont_store_large_packets";
- if ($v['no_reassemble_async'] == "on")
- $stream5_tcp_engine .= ", \\\n\tdont_reassemble_async";
- if ($v['detect_anomalies'] == "on")
- $stream5_tcp_engine .= ", \\\n\tdetect_anomalies";
- if ($v['require_3whs'] == "on")
- $stream5_tcp_engine .= ", \\\n\trequire_3whs {$v['startup_3whs_timeout']}";
- if (!empty($v['ports_client'])) {
- $stream5_tcp_engine .= ", \\\n\tports client";
- if ($v['ports_client'] == " all")
- $stream5_tcp_engine .= " all";
- elseif ($v['ports_client'] == "default")
- $stream5_tcp_engine .= " {$stream5_ports_client}";
- else {
- $tmp = trim(filter_expand_alias($v['ports_client']));
- if (!empty($tmp))
- $stream5_tcp_engine .= " " . trim(preg_replace('/\s+/', ' ', $tmp));
- else {
- $stream5_tcp_engine .= " {$stream5_ports_client}";
- log_error("[snort] WARNING: unable to resolve Ports Client Alias [{$v['ports_client']}] for Stream5 TCP engine '{$v['name']}' ... using default value.");
- }
- }
- }
- if (!empty($v['ports_both'])) {
- $stream5_tcp_engine .= ", \\\n\tports both";
- if ($v['ports_both'] == " all")
- $stream5_tcp_engine .= " all";
- elseif ($v['ports_both'] == "default")
- $stream5_tcp_engine .= " {$stream5_ports_both}";
- else {
- $tmp = trim(filter_expand_alias($v['ports_both']));
- if (!empty($tmp))
- $stream5_tcp_engine .= " " . trim(preg_replace('/\s+/', ' ', $tmp));
- else {
- $stream5_tcp_engine .= " {$stream5_ports_both}";
- log_error("[snort] WARNING: unable to resolve Ports Both Alias [{$v['ports_both']}] for Stream5 TCP engine '{$v['name']}' ... using default value.");
- }
- }
- }
- if (!empty($v['ports_server']) && $v['ports_server'] <> "none" && $v['ports_server'] <> "default") {
- if ($v['ports_server'] == " all") {
- $stream5_tcp_engine .= ", \\\n\tports server";
- $stream5_tcp_engine .= " all";
- }
- else {
- $tmp = trim(filter_expand_alias($v['ports_server']));
- if (!empty($tmp)) {
- $stream5_tcp_engine .= ", \\\n\tports server";
- $stream5_tcp_engine .= " " . trim(preg_replace('/\s+/', ' ', $tmp));
- }
- else
- log_error("[snort] WARNING: unable to resolve Ports Server Alias [{$v['ports_server']}] for Stream5 TCP engine '{$v['name']}' ... defaulting to none.");
- }
- }
-
- // Make sure the "ports" parameter is set, or else default to a safe value
- if (strpos($stream5_tcp_engine, "ports ") === false)
- $stream5_tcp_engine .= ", \\\n\tports both all";
-
- // Add a pair of newlines to terminate this engine
- $stream5_tcp_engine .= "\n\n";
- }
- // Trim off the final trailing newline
- $stream5_tcp_engine = rtrim($stream5_tcp_engine);
- }
-
- // Configure the Stream5 UDP engine if it and Stream5 reassembly are enabled
- if ($snortcfg['stream5_track_udp'] == "off" || $snortcfg['stream5_reassembly'] == "off")
- $stream5_udp_engine = "";
- else {
- $stream5_udp_engine = "preprocessor stream5_udp: ";
- if (!empty($snortcfg['stream5_udp_timeout']))
- $stream5_udp_engine .= "timeout {$snortcfg['stream5_udp_timeout']}";
- else
- $stream5_udp_engine .= "timeout 30";
- }
-
- // Configure the Stream5 ICMP engine if it and Stream5 reassembly are enabled
- if ($snortcfg['stream5_track_icmp'] == "on" && $snortcfg['stream5_reassembly'] == "on") {
- $stream5_icmp_engine = "preprocessor stream5_icmp: ";
- if (!empty($snortcfg['stream5_icmp_timeout']))
- $stream5_icmp_engine .= "timeout {$snortcfg['stream5_icmp_timeout']}";
- else
- $stream5_icmp_engine .= "timeout 30";
- }
- else
- $stream5_icmp_engine = "";
-
- // Check for and configure Host Attribute Table if enabled
- $host_attrib_config = "";
- if ($snortcfg['host_attribute_table'] == "on" && !empty($snortcfg['host_attribute_data'])) {
- @file_put_contents("{$snortcfgdir}/host_attributes", base64_decode($snortcfg['host_attribute_data']));
- $host_attrib_config = "# Host Attribute Table #\n";
- $host_attrib_config .= "attribute_table filename {$snortcfgdir}/host_attributes\n";
- if (!empty($snortcfg['max_attribute_hosts']))
- $host_attrib_config .= "config max_attribute_hosts: {$snortcfg['max_attribute_hosts']}\n";
- if (!empty($snortcfg['max_attribute_services_per_host']))
- $host_attrib_config .= "config max_attribute_services_per_host: {$snortcfg['max_attribute_services_per_host']}";
- }
-
- // Configure the HTTP_INSPECT preprocessor
- // Get global options first and put into a string
- $http_inspect_global = "preprocessor http_inspect: global ";
- if ($snortcfg['http_inspect'] == "off")
- $http_inspect_global .= "disabled ";
- $http_inspect_global .= "\\\n\tiis_unicode_map unicode.map 1252 \\\n";
- $http_inspect_global .= "\tcompress_depth 65535 \\\n";
- $http_inspect_global .= "\tdecompress_depth 65535 \\\n";
- if (!empty($snortcfg['http_inspect_memcap']))
- $http_inspect_global .= "\tmemcap {$snortcfg['http_inspect_memcap']} \\\n";
- else
- $http_inspect_global .= "\tmemcap 150994944 \\\n";
- if (!empty($snortcfg['http_inspect_max_gzip_mem']))
- $http_inspect_global .= "\tmax_gzip_mem {$snortcfg['http_inspect_max_gzip_mem']}";
- else
- $http_inspect_global .= "\tmax_gzip_mem 838860";
- if ($snortcfg['http_inspect_proxy_alert'] == "on")
- $http_inspect_global .= " \\\n\tproxy_alert";
-
- $http_inspect_default_engine = array( "name" => "default", "bind_to" => "all", "server_profile" => "all", "enable_xff" => "off",
- "log_uri" => "off", "log_hostname" => "off", "server_flow_depth" => 65535, "enable_cookie" => "on",
- "client_flow_depth" => 1460, "extended_response_inspection" => "on", "no_alerts" => "off",
- "unlimited_decompress" => "on", "inspect_gzip" => "on", "normalize_cookies" =>"on", "normalize_headers" => "on",
- "normalize_utf" => "on", "normalize_javascript" => "on", "allow_proxy_use" => "off", "inspect_uri_only" => "off",
- "max_javascript_whitespaces" => 200, "post_depth" => -1, "max_headers" => 0, "max_spaces" => 0,
- "max_header_length" => 0, "ports" => "default" );
- $http_ports = str_replace(",", " ", snort_expand_port_range($snort_ports['http_ports']));
- $http_inspect_servers = "";
-
- // Iterate configured HTTP_INSPECT servers and write them to string if HTTP_INSPECT enabled
- if ($snortcfg['http_inspect'] <> "off") {
- if (!is_array($snortcfg['http_inspect_engine']['item']))
- $snortcfg['http_inspect_engine']['item'] = array();
-
- // If no http_inspect_engine is configured, use the default
- if (empty($snortcfg['http_inspect_engine']['item']))
- $snortcfg['http_inspect_engine']['item'][] = $http_inspect_default_engine;
-
- foreach ($snortcfg['http_inspect_engine']['item'] as $f => $v) {
- $buffer = "preprocessor http_inspect_server: \\\n";
- if ($v['name'] == "default")
- $buffer .= "\tserver default \\\n";
- elseif (is_alias($v['bind_to'])) {
- $tmp = trim(filter_expand_alias($v['bind_to']));
- if (!empty($tmp)) {
- $tmp = preg_replace('/\s+/', ' ', $tmp);
- $buffer .= "\tserver { {$tmp} } \\\n";
- }
- else {
- log_error("[snort] WARNING: unable to resolve IP Address Alias [{$v['bind_to']}] for HTTP_INSPECT server '{$v['name']}' ... skipping this server engine.");
- continue;
- }
- }
- else {
- log_error("[snort] WARNING: unable to resolve IP Address Alias [{$v['bind_to']}] for HTTP_INSPECT server '{$v['name']}' ... skipping this server engine.");
- continue;
- }
- $http_inspect_servers .= $buffer;
- $http_inspect_servers .= "\tprofile {$v['server_profile']} \\\n";
-
- if ($v['no_alerts'] == "on")
- $http_inspect_servers .= "\tno_alerts \\\n";
-
- if ($v['ports'] == "default" || empty($v['ports']))
- $http_inspect_servers .= "\tports { {$http_ports} } \\\n";
- elseif (is_alias($v['ports'])) {
- $tmp = trim(filter_expand_alias($v['ports']));
- if (!empty($tmp)) {
- $tmp = preg_replace('/\s+/', ' ', $tmp);
- $tmp = snort_expand_port_range($tmp, ' ');
- $http_inspect_servers .= "\tports { {$tmp} } \\\n";
- }
- else {
- log_error("[snort] WARNING: unable to resolve Ports Alias [{$v['ports']}] for HTTP_INSPECT server '{$v['name']}' ... using safe default instead.");
- $http_inspect_servers .= "\tports { {$http_ports} } \\\n";
- }
- }
- else {
- log_error("[snort] WARNING: unable to resolve Ports Alias [{$v['ports']}] for HTTP_INSPECT server '{$v['name']}' ... using safe default instead.");
- $http_inspect_servers .= "\tports { {$http_ports} } \\\n";
- }
-
- $http_inspect_servers .= "\tserver_flow_depth {$v['server_flow_depth']} \\\n";
- $http_inspect_servers .= "\tclient_flow_depth {$v['client_flow_depth']} \\\n";
- $http_inspect_servers .= "\thttp_methods { GET POST PUT SEARCH MKCOL COPY MOVE LOCK UNLOCK NOTIFY POLL BCOPY BDELETE BMOVE LINK UNLINK OPTIONS HEAD DELETE TRACE TRACK CONNECT SOURCE SUBSCRIBE UNSUBSCRIBE PROPFIND PROPPATCH BPROPFIND BPROPPATCH RPC_CONNECT PROXY_SUCCESS BITS_POST CCM_POST SMS_POST RPC_IN_DATA RPC_OUT_DATA RPC_ECHO_DATA } \\\n";
- $http_inspect_servers .= "\tpost_depth {$v['post_depth']} \\\n";
- $http_inspect_servers .= "\tmax_headers {$v['max_headers']} \\\n";
- $http_inspect_servers .= "\tmax_header_length {$v['max_header_length']} \\\n";
- $http_inspect_servers .= "\tmax_spaces {$v['max_spaces']}";
- if ($v['enable_xff'] == "on")
- $http_inspect_servers .= " \\\n\tenable_xff";
- if ($v['enable_cookie'] == "on")
- $http_inspect_servers .= " \\\n\tenable_cookie";
- if ($v['normalize_cookies'] == "on")
- $http_inspect_servers .= " \\\n\tnormalize_cookies";
- if ($v['normalize_headers'] == "on")
- $http_inspect_servers .= " \\\n\tnormalize_headers";
- if ($v['normalize_utf'] == "on")
- $http_inspect_servers .= " \\\n\tnormalize_utf";
- if ($v['allow_proxy_use'] == "on")
- $http_inspect_servers .= " \\\n\tallow_proxy_use";
- if ($v['inspect_uri_only'] == "on")
- $http_inspect_servers .= " \\\n\tinspect_uri_only";
- if ($v['extended_response_inspection'] == "on") {
- $http_inspect_servers .= " \\\n\textended_response_inspection";
- if ($v['inspect_gzip'] == "on") {
- $http_inspect_servers .= " \\\n\tinspect_gzip";
- if ($v['unlimited_decompress'] == "on")
- $http_inspect_servers .= " \\\n\tunlimited_decompress";
- }
- if ($v['normalize_javascript'] == "on") {
- $http_inspect_servers .= " \\\n\tnormalize_javascript";
- $http_inspect_servers .= " \\\n\tmax_javascript_whitespaces {$v['max_javascript_whitespaces']}";
- }
- }
- if ($v['log_uri'] == "on")
- $http_inspect_servers .= " \\\n\tlog_uri";
- if ($v['log_hostname'] == "on")
- $http_inspect_servers .= " \\\n\tlog_hostname";
-
- // Add a pair of trailing newlines to terminate this server config
- $http_inspect_servers .= "\n\n";
- }
- /* Trim off the final trailing newline */
- $http_inspect_server = rtrim($http_inspect_server);
- }
-
- // Finally, build the Snort configuration file
- $snort_conf_text = <<
\ No newline at end of file
diff --git a/config/snort/snort.xml b/config/snort/snort.xml
index 977db98a..d9bc0ee6 100755
--- a/config/snort/snort.xml
+++ b/config/snort/snort.xml
@@ -46,8 +46,8 @@
NoneCurrently there are no FAQ items provided.Snort
- 2.9.6.0
- Services:2.9.6.0 pkg v3.0.13
+ 2.9.6.2
+ Services:2.9.6.2 pkg v3.1/usr/local/pkg/snort/snort.inc
- /usr/local/www/snort/
+ /usr/local/pkg/snort/
+ 077
+ https://packages.pfsense.org/packages/config/snort/snort_conf_template.inc
+
+
+ /usr/local/pkg/snort/077https://packages.pfsense.org/packages/config/snort/snort_migrate_config.php
- /usr/local/www/snort/
+ /usr/local/pkg/snort/077https://packages.pfsense.org/packages/config/snort/snort_post_install.php
@@ -119,7 +124,7 @@
https://packages.pfsense.org/packages/config/snort/snort_download_updates.php
- /usr/local/www/snort/
+ /usr/local/pkg/snort/077https://packages.pfsense.org/packages/config/snort/snort_check_for_rule_updates.php
@@ -248,6 +253,11 @@
077https://packages.pfsense.org/packages/config/snort/snort_iprep_list_browser.php
+
+ /usr/local/pkg/snort/
+ 077
+ https://packages.pfsense.org/packages/config/snort/snort_generate_conf.php
+ /usr/local/www/widgets/javascript/0644
@@ -269,13 +279,13 @@
diff --git a/config/snort/snort_alerts.php b/config/snort/snort_alerts.php
index 45443ec2..1c9d8492 100755
--- a/config/snort/snort_alerts.php
+++ b/config/snort/snort_alerts.php
@@ -283,7 +283,9 @@ if ($_POST['togglesid'] && is_numeric($_POST['sidid']) && is_numeric($_POST['gen
/* rules for this interface. */
/*************************************************/
$rebuild_rules = true;
+ conf_mount_rw();
snort_generate_conf($a_instance[$instanceid]);
+ conf_mount_ro();
$rebuild_rules = false;
/* Soft-restart Snort to live-load the new rules */
diff --git a/config/snort/snort_blocked.php b/config/snort/snort_blocked.php
index 76d5a9df..97301a0f 100644
--- a/config/snort/snort_blocked.php
+++ b/config/snort/snort_blocked.php
@@ -185,7 +185,7 @@ if ($savemsg) {
"/>
"
- onClick="return confirm('=gettext("Are you sure you want to remove all blocked hosts? Click OK to continue or CANCLE to quit.");?>');"/>
+ onClick="return confirm('=gettext("Are you sure you want to remove all blocked hosts? Click OK to continue or CANCEL to quit.");?>');"/>
diff --git a/config/snort/snort_check_cron_misc.inc b/config/snort/snort_check_cron_misc.inc
index a5b9e65e..9a1c7833 100644
--- a/config/snort/snort_check_cron_misc.inc
+++ b/config/snort/snort_check_cron_misc.inc
@@ -116,7 +116,7 @@ foreach ($config['installedpackages']['snortglobal']['rule'] as $value) {
}
unset($files);
if ($prune_count > 0)
- log_error(gettext("[Snort] Barnyard2 archived logs cleanup job removed {$prune_count} file(s)..."));
+ log_error(gettext("[Snort] Barnyard2 archived logs cleanup job removed {$prune_count} file(s) from {$snort_log_dir}/barnyard2/archive/..."));
}
}
diff --git a/config/snort/snort_check_for_rule_updates.php b/config/snort/snort_check_for_rule_updates.php
index 667f4044..7e93366a 100755
--- a/config/snort/snort_check_for_rule_updates.php
+++ b/config/snort/snort_check_for_rule_updates.php
@@ -37,7 +37,9 @@ require_once "/usr/local/pkg/snort/snort.inc";
global $g, $config, $pkg_interface, $snort_gui_include, $rebuild_rules;
if (!defined("VRT_DNLD_URL"))
- define("VRT_DNLD_URL", "https://www.snort.org/reg-rules/");
+ define("VRT_DNLD_URL", "https://www.snort.org/rules/");
+if (!defined("SNORT_BIN_VERSION"))
+ define("SNORT_BIN_VERSION", "2.9.6.1");
if (!defined("ET_VERSION"))
define("ET_VERSION", "2.9.0");
if (!defined("ET_BASE_DNLD_URL"))
@@ -98,7 +100,7 @@ exec("/usr/local/bin/snort -V 2>&1 |/usr/bin/grep Version | /usr/bin/cut -c20-26
// Save the version with decimal delimiters for use in extracting the rules
$snort_version = $snortver[0];
if (empty($snort_version))
- $snort_version = "2.9.6.0";
+ $snort_version = SNORT_BIN_VERSION;
// Create a collapsed version string for use in the tarball filename
$snortver[0] = str_replace(".", "", $snortver[0]);
@@ -431,10 +433,10 @@ $update_errors = false;
/* Check for and download any new Snort VRT sigs */
if ($snortdownload == 'on') {
- if (snort_check_rule_md5("{$snort_rule_url}{$snort_filename_md5}/{$oinkid}/", "{$tmpfname}/{$snort_filename_md5}", "Snort VRT rules")) {
+ if (snort_check_rule_md5("{$snort_rule_url}{$snort_filename_md5}?oinkcode={$oinkid}", "{$tmpfname}/{$snort_filename_md5}", "Snort VRT rules")) {
/* download snortrules file */
$file_md5 = trim(file_get_contents("{$tmpfname}/{$snort_filename_md5}"));
- if (!snort_fetch_new_rules("{$snort_rule_url}{$snort_filename}/{$oinkid}/", "{$tmpfname}/{$snort_filename}", $file_md5, "Snort VRT rules"))
+ if (!snort_fetch_new_rules("{$snort_rule_url}{$snort_filename}?oinkcode={$oinkid}", "{$tmpfname}/{$snort_filename}", $file_md5, "Snort VRT rules"))
$snortdownload = 'off';
}
else
diff --git a/config/snort/snort_conf_template.inc b/config/snort/snort_conf_template.inc
new file mode 100644
index 00000000..be4791af
--- /dev/null
+++ b/config/snort/snort_conf_template.inc
@@ -0,0 +1,112 @@
+
+
diff --git a/config/snort/snort_define_servers.php b/config/snort/snort_define_servers.php
index 4d1b3c2e..98a98fd9 100755
--- a/config/snort/snort_define_servers.php
+++ b/config/snort/snort_define_servers.php
@@ -138,7 +138,9 @@ if ($_POST['save']) {
/* Update the snort conf file for this interface. */
$rebuild_rules = false;
+ conf_mount_rw();
snort_generate_conf($a_nat[$id]);
+ conf_mount_ro();
/* Soft-restart Snort to live-load new variables. */
snort_reload_config($a_nat[$id]);
diff --git a/config/snort/snort_download_rules.php b/config/snort/snort_download_rules.php
index f35341f1..0fa20e08 100755
--- a/config/snort/snort_download_rules.php
+++ b/config/snort/snort_download_rules.php
@@ -43,7 +43,6 @@ include("head.inc");
-' . $pgtitle . '