Merge tag 'release_3_0_15' into tr-integ
[freeradius.git] / raddb / radiusd.conf.in
index 584fc34..a83c1f6 100644 (file)
@@ -1,6 +1,6 @@
 # -*- text -*-
 ##
-## radiusd.conf        -- FreeRADIUS server configuration file - @RADIUSD_VERSION@
+## radiusd.conf        -- FreeRADIUS server configuration file - @RADIUSD_VERSION_STRING@
 ##
 ##     http://www.freeradius.org/
 ##     $Id$
@@ -46,9 +46,8 @@
 #      documented in that "man" page.  They are only documented here,
 #      in the comments.
 #
-#      As of 2.0.0, FreeRADIUS supports a simple processing language
-#      in the "authorize", "authenticate", "accounting", etc. sections.
-#      See "man unlang" for details.
+#      The "unlang" policy language can be used to create complex
+#      if / else policies.  See "man unlang" for details.
 #
 
 prefix = @prefix@
@@ -66,6 +65,7 @@ name = radiusd
 
 #  Location of config and logfiles.
 confdir = ${raddbdir}
+modconfdir = ${confdir}/mods-config
 certdir = ${confdir}/certs
 cadir   = ${confdir}/certs
 run_dir = ${localstatedir}/run/${name}
@@ -118,6 +118,63 @@ libdir = @libdir@
 #
 pidfile = ${run_dir}/${name}.pid
 
+#
+#  correct_escapes: use correct backslash escaping
+#
+#  Prior to version 3.0.5, the handling of backslashes was a little
+#  awkward, i.e. "wrong".  In some cases, to get one backslash into
+#  a regex, you had to put 4 in the config files.
+#
+#  Version 3.0.5 fixes that.  However, for backwards compatibility,
+#  the new method of escaping is DISABLED BY DEFAULT.  This means
+#  that upgrading to 3.0.5 won't break your configuration.
+#
+#  If you don't have double backslashes (i.e. \\) in your configuration,
+#  this won't matter to you.  If you do have them, fix that to use only
+#  one backslash, and then set "correct_escapes = true".
+#
+#  You can check for this by doing:
+#
+#      $ grep '\\\\' $(find raddb -type f -print)
+#
+correct_escapes = true
+
+#  panic_action: Command to execute if the server dies unexpectedly.
+#
+#  FOR PRODUCTION SYSTEMS, ACTIONS SHOULD ALWAYS EXIT.
+#  AN INTERACTIVE ACTION MEANS THE SERVER IS NOT RESPONDING TO REQUESTS.
+#  AN INTERACTICE ACTION MEANS THE SERVER WILL NOT RESTART.
+#
+#  THE SERVER MUST NOT BE ALLOWED EXECUTE UNTRUSTED PANIC ACTION CODE
+#  PATTACH CAN BE USED AS AN ATTACK VECTOR.
+#
+#  The panic action is a command which will be executed if the server
+#  receives a fatal, non user generated signal, i.e. SIGSEGV, SIGBUS,
+#  SIGABRT or SIGFPE.
+#
+#  This can be used to start an interactive debugging session so
+#  that information regarding the current state of the server can
+#  be acquired.
+#
+#  The following string substitutions are available:
+#  - %e   The currently executing program e.g. /sbin/radiusd
+#  - %p   The PID of the currently executing program e.g. 12345
+#
+#  Standard ${} substitutions are also allowed.
+#
+#  An example panic action for opening an interactive session in GDB would be:
+#
+#panic_action = "gdb %e %p"
+#
+#  Again, don't use that on a production system.
+#
+#  An example panic action for opening an automated session in GDB would be:
+#
+#panic_action = "gdb -silent -x ${raddbdir}/panic.gdb %e %p 2>&1 | tee ${logdir}/gdb-${name}-%p.log"
+#
+#  That command can be used on a production system.
+#
+
 #  max_request_time: The maximum time (in seconds) to handle a request.
 #
 #  Requests which take more time than this to process may be killed, and
@@ -146,7 +203,7 @@ max_request_time = 30
 #  cached reply.
 #
 #  If this value is set too low, then duplicate requests from the NAS
-#  MAY NOT be detected, and will instead be handled as seperate requests.
+#  MAY NOT be detected, and will instead be handled as separate requests.
 #
 #  If this value is set too high, then the server will cache too many
 #  requests, and some new requests may get blocked.  (See 'max_requests'.)
@@ -172,162 +229,7 @@ cleanup_delay = 5
 #
 #  Useful range of values: 256 to infinity
 #
-max_requests = 1024
-
-#  listen: Make the server listen on a particular IP address, and send
-#  replies out from that address. This directive is most useful for
-#  hosts with multiple IP addresses on one interface.
-#
-#  If you want the server to listen on additional addresses, or on
-#  additionnal ports, you can use multiple "listen" sections.
-#
-#  Each section make the server listen for only one type of packet,
-#  therefore authentication and accounting have to be configured in
-#  different sections.
-#
-#  The server ignore all "listen" section if you are using '-i' and '-p'
-#  on the command line.
-#
-listen {
-       #  Type of packets to listen for.
-       #  Allowed values are:
-       #       auth    listen for authentication packets
-       #       acct    listen for accounting packets
-       #       proxy   IP to use for sending proxied packets
-       #       detail  Read from the detail file.  For examples, see
-       #               raddb/sites-available/copy-acct-to-home-server
-       #       status  listen for Status-Server packets.  For examples,
-       #               see raddb/sites-available/status
-       #       coa     listen for CoA-Request and Disconnect-Request
-       #               packets.  For examples, see the file
-       #               raddb/sites-available/coa-server
-       #
-       type = auth
-
-       #  Note: "type = proxy" lets you control the source IP used for
-       #        proxying packets, with some limitations:
-       #
-       #    * A proxy listener CANNOT be used in a virtual server section.
-       #    * You should probably set "port = 0".
-       #    * Any "clients" configuration will be ignored.
-       #
-       #  See also proxy.conf, and the "src_ipaddr" configuration entry
-       #  in the sample "home_server" section.  When you specify the
-       #  source IP address for packets sent to a home server, the
-       #  proxy listeners are automatically created.
-
-       #  IP address on which to listen.
-       #  Allowed values are:
-       #       dotted quad (1.2.3.4)
-       #       hostname    (radius.example.com)
-       #       wildcard    (*)
-       ipaddr = *
-
-       #  OR, you can use an IPv6 address, but not both
-       #  at the same time.
-#      ipv6addr = ::   # any.  ::1 == localhost
-
-       #  Port on which to listen.
-       #  Allowed values are:
-       #       integer port number (1812)
-       #       0 means "use /etc/services for the proper port"
-       port = 0
-
-       #  Some systems support binding to an interface, in addition
-       #  to the IP address.  This feature isn't strictly necessary,
-       #  but for sites with many IP addresses on one interface,
-       #  it's useful to say "listen on all addresses for eth0".
-       #
-       #  If your system does not support this feature, you will
-       #  get an error if you try to use it.
-       #
-#      interface = eth0
-
-       #  Per-socket lists of clients.  This is a very useful feature.
-       #
-       #  The name here is a reference to a section elsewhere in
-       #  radiusd.conf, or clients.conf.  Having the name as
-       #  a reference allows multiple sockets to use the same
-       #  set of clients.
-       #
-       #  If this configuration is used, then the global list of clients
-       #  is IGNORED for this "listen" section.  Take care configuring
-       #  this feature, to ensure you don't accidentally disable a
-       #  client you need.
-       #
-       #  See clients.conf for the configuration of "per_socket_clients".
-       #
-#      clients = per_socket_clients
-
-       #
-       #  Connection limiting for sockets with "proto = tcp".
-       #
-       #  This section is ignored for other kinds of sockets.
-       #
-       limit {
-             #
-             #  Limit the number of simultaneous TCP connections to the socket
-             #
-             #  The default is 16.
-             #  Setting this to 0 means "no limit"
-             max_connections = 16
-
-             #  The per-socket "max_requests" option does not exist.
-
-             #
-             #  The lifetime, in seconds, of a TCP connection.  After
-             #  this lifetime, the connection will be closed.
-             #
-             #  Setting this to 0 means "forever".
-             lifetime = 0
-
-             #
-             #  The idle timeout, in seconds, of a TCP connection.
-             #  If no packets have been received over the connection for
-             #  this time, the connection will be closed.
-             #
-             #  Setting this to 0 means "no timeout".
-             #
-             #  We STRONGLY RECOMMEND that you set an idle timeout.
-             #
-             idle_timeout = 30
-       }
-}
-
-#  This second "listen" section is for listening on the accounting
-#  port, too.
-#
-listen {
-       ipaddr = *
-#      ipv6addr = ::
-       port = 0
-       type = acct
-#      interface = eth0
-#      clients = per_socket_clients
-
-       #  The number of packets received can be rate limited via the
-       #  "max_pps" configuration item.  When it is set, the server
-       #  tracks the total number of packets received in the previous
-       #  second.  If the count is greater than "max_pps", then the
-       #  new packet is silently discarded.  This helps the server
-       #  deal with overload situations.
-       #
-       #  The packets/s counter is tracked in a sliding window.  This
-       #  means that the pps calculation is done for the second
-       #  before the current packet was received.  NOT for the current
-       #  wall-clock second, and NOT for the previous wall-clock second.
-       #
-       #  Useful values are 0 (no limit), or 100 to 10000.
-       #  Values lower than 100 will likely cause the server to ignore
-       #  normal traffic.  Few systems are capable of handling more than
-       #  10K packets/s.
-       #
-       #  It is most useful for accounting systems.  Set it to 50%
-       #  more than the normal accounting load, and you can be sure that
-       #  the server will never get overloaded
-       #  
-#      max_pps = 0
-}
+max_requests = 16384
 
 #  hostname_lookups: Log the names of clients or just their IP addresses
 #  e.g., www.freeradius.org (on) or 206.47.27.232 (off).
@@ -366,6 +268,14 @@ log {
        destination = files
 
        #
+       #  Highlight important messages sent to stderr and stdout.
+       #
+       #  Option will be ignored (disabled) if output if TERM is not
+       #  an xterm or output is not to a TTY.
+       #
+       colourise = yes
+
+       #
        #  The logging messages for the server are appended to the
        #  tail of this file if destination == "files"
        #
@@ -375,44 +285,6 @@ log {
        file = ${logdir}/radius.log
 
        #
-       #  If this configuration parameter is set, then log messages for
-       #  a *request* go to this file, rather than to radius.log.
-       #
-       #  i.e. This is a log file per request, once the server has accepted
-       #  the request as being from a valid client.  Messages that are
-       #  not associated with a request still go to radius.log.
-       #
-       #  Not all log messages in the server core have been updated to use
-       #  this new internal API.  As a result, some messages will still
-       #  go to radius.log.  Please submit patches to fix this behavior.
-       #
-       #  The file name is expanded dynamically.  You should ONLY user
-       #  server-side attributes for the filename (e.g. things you control).
-       #  Using this feature MAY also slow down the server substantially,
-       #  especially if you do thinks like SQL calls as part of the
-       #  expansion of the filename.
-       #
-       #  The name of the log file should use attributes that don't change
-       #  over the lifetime of a request, such as User-Name,
-       #  Virtual-Server or Packet-Src-IP-Address.  Otherwise, the log
-       #  messages will be distributed over multiple files.
-       #
-       #  Logging can be enabled for an individual request by a special
-       #  dynamic expansion macro:  %{debug: 1}, where the debug level
-       #  for this request is set to '1' (or 2, 3, etc.).  e.g.
-       #
-       #       ...
-       #       update control {
-       #              Tmp-String-0 = "%{debug:1}"
-       #       }
-       #       ...
-       #
-       #  The attribute that the value is assigned to is unimportant,
-       #  and should be a "throw-away" attribute with no side effects.
-       #
-       #requests = ${logdir}/radiusd-%{%{Virtual-Server}:-DEFAULT}-%Y%m%d.log
-
-       #
        #  Which syslog facility to use, if ${destination} == "syslog"
        #
        #  The exact values permitted here are OS-dependent.  You probably
@@ -442,7 +314,7 @@ log {
        auth_goodpass = no
 
        #  Log additional text at the end of the "Login OK" messages.
-       #  for these to work, the "auth" and "auth_goopass" or "auth_badpass"
+       #  for these to work, the "auth" and "auth_goodpass" or "auth_badpass"
        #  configurations above have to be set to "yes".
        #
        #  The strings below are dynamically expanded, which means that
@@ -452,6 +324,10 @@ log {
        #
 #      msg_goodpass = ""
 #      msg_badpass = ""
+
+       #  The message when the user exceeds the Simultaneous-Use limit.
+       #
+       msg_denied = "You are already logged in - access denied"
 }
 
 #  The program to execute to do concurrency checks.
@@ -499,7 +375,7 @@ security {
        #   If these are commented out, the server will run as the
        #   user/group that started it.  In order to change to a
        #   different user/group, you MUST be root ( or have root
-       #   privleges ) to start the server.
+       #   privileges ) to start the server.
        #
        #   We STRONGLY recommend that you run the server with as few
        #   permissions as possible.  That is, if you're not using
@@ -559,6 +435,9 @@ security {
        #  rejects will be sent at 'cleanup_delay' time, when the request
        #  is deleted from the internal cache of requests.
        #
+       #  As of Version 3.0.5, "reject_delay" has sub-second resolution.
+       #  e.g. "reject_delay =  1.4" seconds is possible.
+       #
        #  Useful ranges: 1 to 5
        reject_delay = 1
 
@@ -581,6 +460,8 @@ security {
        #  See also raddb/sites-available/status
        #
        status_server = yes
+
+@openssl_version_check_config@
 }
 
 # PROXY CONFIGURATION
@@ -605,7 +486,7 @@ $INCLUDE proxy.conf
 
 # CLIENTS CONFIGURATION
 #
-#  Client configuration is defined in "clients.conf".  
+#  Client configuration is defined in "clients.conf".
 #
 
 #  The 'clients.conf' file contains all of the information from the old
@@ -713,14 +594,30 @@ thread pool {
        #  comparing that to the packets/s handled by the child
        #  threads.
        #
+
        #  If the received PPS is larger than the processed PPS, *and*
-       #  the queue is more than half full, then all new accounting
-       #  requests are discarded.  This lowers the received rate,
-       #  and over time allows the server to "catch up" to the traffic.
+       #  the queue is more than half full, then new accounting
+       #  requests are probabilistically discarded.  This lowers the
+       #  number of packets that the server needs to process.  Over
+       #  time, the server will "catch up" with the traffic.
+       #
+       #  Throwing away accounting packets is usually safe and low
+       #  impact.  The NAS will retransmit them in a few seconds, or
+       #  even a few minutes.  Vendors should read RFC 5080 Section 2.2.1
+       #  to see how accounting packets should be retransmitted.  Using
+       #  any other method is likely to cause network meltdowns.
        #
        auto_limit_acct = no
 }
 
+######################################################################
+#
+#  SNMP notifications.  Uncomment the following line to enable
+#  snmptraps.  Note that you MUST also configure the full path
+#  to the "snmptrap" command in the "trigger.conf" file.
+#
+#$INCLUDE trigger.conf
+
 # MODULE CONFIGURATION
 #
 #  The names and configuration of each module is located in this section.
@@ -757,7 +654,7 @@ modules {
        #  section, such as authorize, authenticate, accounting,
        #  pre/post-proxy, etc.
        #
-       $INCLUDE ${confdir}/mods-enabled/
+       $INCLUDE mods-enabled/
 }
 
 # Instantiation
@@ -772,38 +669,21 @@ modules {
 #  of the following sections, so they can be listed here.
 #
 #  Also, listing modules here ensures that you have control over
-#  the order in which they are initalized.  If one module needs
+#  the order in which they are initialized.  If one module needs
 #  something defined by another module, you can list them in order
 #  here, and ensure that the configuration will be OK.
 #
+#  After the modules listed here have been loaded, all of the modules
+#  in the "mods-enabled" directory will be loaded.  Loading the
+#  "mods-enabled" directory means that unlike Version 2, you usually
+#  don't need to list modules here.
+#
 instantiate {
        #
-       #  Allows the execution of external scripts.
-       #  The entire command line (and output) must fit into 253 bytes.
-       #
-       #  e.g. Framed-Pool = `%{exec:/bin/echo foo}`
-       exec
-
-       #
-       #  The expression module doesn't do authorization,
-       #  authentication, or accounting.  It only does dynamic
-       #  translation, of the form:
-       #
-       #       Session-Timeout = `%{expr:2 + 3}`
-       #
-       #  So the module needs to be instantiated, but CANNOT be
-       #  listed in any other section.  See 'doc/rlm_expr' for
-       #  more information.
-       #
-       expr
-
-       #
-       # We add the counter module here so that it registers
-       # the check-name attribute before any module which sets
+       # We list the counter module here so that it registers
+       # the check_name attribute before any module which sets
        # it
 #      daily
-       expiration
-       logintime
 
        # subsections here can be thought of as "virtual" modules.
        #
@@ -814,6 +694,36 @@ instantiate {
        # lines, and list "redundant_sql" in the authorize and
        # accounting sections.
        #
+       #  The "virtual" module defined here can also be used with
+       #  dynamic expansions, under a few conditions:
+       #
+       #  * The section is "redundant", or "load-balance", or
+       #    "redundant-load-balance"
+       #  * The section contains modules ONLY, and no sub-sections
+       #  * all modules in the section are using the same rlm_
+       #    driver, e.g. They are all sql, or all ldap, etc.
+       #
+       #  When those conditions are satisfied, the server will
+       #  automatically register a dynamic expansion, using the
+       #  name of the "virtual" module.  In the example below,
+       #  it will be "redundant_sql".  You can then use this expansion
+       #  just like any other:
+       #
+       #       update reply {
+       #               Filter-Id := "%{redundant_sql: ... }"
+       #       }
+       #
+       #  In this example, the expansion is done via module "sql1",
+       #  and if that expansion fails, using module "sql2".
+       #
+       #  For best results, configure the "pool" subsection of the
+       #  module so that "retry_delay" is non-zero.  That will allow
+       #  the redundant block to quickly ignore all "down" SQL
+       #  databases.  If instead we have "retry_delay = 0", then
+       #  every time the redundant block is used, the server will try
+       #  to open a connection to every "down" database, causing
+       #  problems.
+       #
        #redundant redundant_sql {
        #       sql1
        #       sql2
@@ -822,20 +732,21 @@ instantiate {
 
 ######################################################################
 #
-#      Policies that can be applied in multiple places are listed
-#      globally.  That way, they can be defined once, and referred
-#      to multiple times.
+#  Policies are virtual modules, similar to those defined in the
+#  "instantiate" section above.
 #
-######################################################################
-$INCLUDE policy.conf
-
-######################################################################
+#  Defining a policy in one of the policy.d files means that it can be
+#  referenced in multiple places as a *name*, rather than as a series of
+#  conditions to match, and actions to take.
 #
-#  SNMP notificiations.  Uncomment the following line to enable
-#  snmptraps.  Note that you MUST also configure the full path
-#  to the "snmptrap" command in the "trigger.conf" file.
+#  Policies are something like subroutines in a normal language, but
+#  they cannot be called recursively. They MUST be defined in order.
+#  If policy A calls policy B, then B MUST be defined before A.
 #
-#$INCLUDE trigger.conf
+######################################################################
+policy {
+       $INCLUDE policy.d/
+}
 
 ######################################################################
 #