Made "chase_referrals" and "rebind" to "yes" by default.
[freeradius.git] / raddb / mods-available / ldap
1 # -*- text -*-
2 #
3 #  $Id$
4
5 #
6 # Lightweight Directory Access Protocol (LDAP)
7 #
8 ldap {
9         #
10         #  Note that this needs to match the name in the LDAP
11         #  server certificate, if you're using ldaps.
12         server = "ldap.example.org"
13
14         #  Port to connect on, defaults to 389. Setting this to
15         #  636 will enable LDAPS if start_tls (see below) is not
16         #  able to be used.
17 #       port = 389
18
19         # Read-only administrator account for initial binding and searching
20 #       identity = "cn=admin,dc=example,dc=org"
21 #       password = mypass
22
23
24 #       basedn = "ou=people,dc=example,dc=org"
25 #       filter = "(uid=%{%{Stripped-User-Name}:-%{User-Name}})"
26
27         #
28         #  Mapping of RADIUS dictionary attributes to LDAP directory attributes.
29         #
30         #  WARNING: Although this format is almost identical to the unlang 
31         #  update section format, it does *NOT* mean that you can use other
32         #  unlang constructs in module configuration files.
33         #
34         #  Configuration items are in the format:
35         #       <radius attr> <op> <ldap attr>
36         # 
37         #  Where:
38         #       <radius attr>:  The destination RADIUS attribute
39         #                       with any valid list and request qualifiers.
40         #       <op>:           Is any assignment attribute (=, :=, +=, -=).
41         #       <ldap attr>:    The attribute in the associated with user or
42         #                       profile objects in the LDAP. 
43         #                       directory. If the attribute name is wrapped in 
44         #                       double quotes it will be xlat expanded.
45         # 
46         #  Request and list qualifiers may also be placed after the section
47         #  name to set defaults for unqualified RADIUS attributes.
48         #
49         #  Note: LDAP attribute names should be single quoted unless you want
50         #  the name value to be derived from an xlat expansion, or an
51         #  attribute ref.
52         #
53         update reply {
54 #               control:NT-Password     := 'ntPassword'
55 #               Reply-Message           := 'radiusReplyMessage'
56 #               Tunnel-Type             := 'radiusTunnelType'
57 #               Tunnel-Medium-Type      := 'radiusTunnelMediumType'
58 #               Tunnel-Private-Group-ID := 'radiusTunnelPrivategroupId'
59         }
60
61         # Set to "no" to disable the 'no "known good" password' warning,
62         # if you're not using LDAP to retrieve password values.
63 #       expect_password = yes
64
65         # Set to yes if you have eDirectory and want to use the universal
66         # password mechanism.
67 #       edir = no
68
69         # Set to yes if you want to bind as the user after retrieving the
70         # Cleartext-Password. This will consume the login grace, and
71         # verify user authorization.
72 #       edir_autz = no
73
74         #
75         #  Profile related attributes.
76         #
77         profiles {
78                 #  Control whether or not "access_attr" is used to
79                 #  determine authorization.  If set to "yes", then
80                 #  "access_attr" existing means "allow access".
81                 #  "access_attr" not existing means "deny access"
82                 #
83                 #   If set to "no", then
84                 #  "access_attr" existing means "deny access".
85                 #  "access_attr" not existing means "allow access"
86 #               positive_access_attr = yes
87
88                 #  If this is undefined, anyone is authorized.
89                 #  If it is defined, the contents of this attribute
90                 #  determine whether or not the user is authorized
91 #               access_attr = "dialupAccess"
92
93                 # Base filter for the following profiles.
94 #               base_filter = "(objectclass=radiusprofile)"
95
96                 #  The default profile applied to all users.
97 #               default_profile = "cn=radprofile,dc=example,dc=org"
98
99                 #  The list of profiles which are applied (after the default)
100                 #  to all users.
101                 #  The "User-Profile" attribute in the control list
102                 #  will over-ride this setting at run-time.
103 #               profile_attribute = "radiusProfileDn"
104         }
105
106         #
107         #  Group membership checking.  Disabled by default.
108         #
109         #  When doing checks for LDAP-Group = foo"
110         #
111         group {
112                 # Check for "cn=foo"
113 #               name_attribute = cn
114
115                 # Filter to get the list of groups that a user belongs to.
116 #               membership_filter = "(|(&(objectClass=GroupOfNames)(member=%{control:Ldap-UserDn}))(&(objectClass=GroupOfUniqueNames)(uniquemember=%{control:Ldap-UserDn})))"
117
118                 # If the filter returns nothing
119                 membership_attribute = radiusGroupName
120         }
121         
122         #
123         #  Modify user object on receiving Accounting-Request
124         #
125         #  Useful for recording things like the last time the user logged
126         #  in, or the Acct-Session-ID for CoA/DM.
127         #
128         #  LDAP modification items are in the format:
129         #       <ldap attr> <op> <value>
130         # 
131         #  Where:
132         #       <ldap attr>:    The LDAP attribute to add modify or delete.
133         #       <op>:           One of the assignment operators:
134         #                       (:=, +=, -=, ++).
135         #                       Note: '=' is *not* supported.
136         #       <value>:        The value to add modify or delete.
137         #
138         #  WARNING: If using the ':=' operator with a multivalued LDAP 
139         #  attribute, all instances of the attribute will be removed and
140         #  replaced with a single attribute.
141         # 
142         accounting {
143                 reference = "%{tolower:type.%{Acct-Status-Type}}"
144                 
145                 type {
146                         start {
147                                 update {
148                                         description := "Online at %S"
149                                 }
150                         }
151                         
152                         interim-update {
153                                 update {
154                                         description := "Last seen at %S"
155                                 }
156                         }
157                         
158                         stop {
159                                 update {
160                                         description := "Offline at %S"
161                                 }
162                         }
163                 }
164         }
165         
166         #
167         #  Post-Auth can modify LDAP objects too
168         #
169         #  For eDir users this is performed *after* the post-auth login checks
170         #
171         post-auth {
172                 update {
173                         description := "Authenticated at %S"
174                 }
175         }
176
177         #  LDAP connection-specific options.
178         #
179         #  These options set timeouts, keepalives, etc. for the connections.
180         #
181         options {
182                 #
183                 #  The following two configuration items are for Active Directory
184                 #  compatibility.  If you set these to "no", then searches
185                 #  will likely return "operations error", instead of a
186                 #  useful resuly.
187                 #
188                 chase_referrals = yes
189                 rebind = yes
190
191                 # seconds to wait for LDAP query to finish. default: 20
192                 timeout = 10
193
194                 #  seconds LDAP server has to process the query (server-side
195                 #  time limit). default: 20
196                 #
197                 #  LDAP_OPT_TIMELIMIT is set to this value.
198                 timelimit = 3
199
200                 #
201                 #  seconds to wait for response of the server. (network
202                 #   failures) default: 10
203                 #
204                 #  LDAP_OPT_NETWORK_TIMEOUT is set to this value.
205                 net_timeout = 1
206
207                 # LDAP_OPT_X_KEEPALIVE_IDLE
208                 idle = 60
209
210                 # LDAP_OPT_X_KEEPALIVE_PROBES
211                 probes = 3
212
213                 # LDAP_OPT_X_KEEPALIVE_INTERVAL
214                 interval = 3
215
216                 #  ldap_debug: debug flag for LDAP SDK
217                 #  (see OpenLDAP documentation).  Set this to enable
218                 #  huge amounts of LDAP debugging on the screen.
219                 #  You should only use this if you are an LDAP expert.
220                 #
221                 #       default: 0x0000 (no debugging messages)
222                 #       Example:(LDAP_DEBUG_FILTER+LDAP_DEBUG_CONNS)
223                 ldap_debug = 0x0028
224         }
225
226         #
227         #  This subsection configures the tls related items
228         #  that control how FreeRADIUS connects to an LDAP
229         #  server.  It contains all of the "tls_*" configuration
230         #  entries used in older versions of FreeRADIUS.  Those
231         #  configuration entries can still be used, but we recommend
232         #  using these.
233         #
234         tls {
235                 # Set this to 'yes' to use TLS encrypted connections
236                 # to the LDAP database by using the StartTLS extended
237                 # operation.
238                 #                       
239                 # The StartTLS operation is supposed to be
240                 # used with normal ldap connections instead of
241                 # using ldaps (port 636) connections
242 #               start_tls = yes
243
244 #               cacertfile      = ${certdir}/cacert.pem
245
246 #               cacertdir       = ${certdir}
247 #               certfile        = /path/to/radius.crt
248 #               keyfile         = /path/to/radius.key
249 #               randfile        = ${certdir}/random
250
251                 #  Certificate Verification requirements.  Can be:
252                 #    "never" (don't even bother trying)
253                 #    "allow" (try, but don't fail if the cerificate
254                 #               can't be verified)
255                 #    "demand" (fail if the certificate doesn't verify.)
256                 #
257                 #       The default is "allow"
258 #               require_cert    = "demand"
259         }
260
261
262         #  As of version 3.0, the "pool" section has replaced the
263         #  following configuration items:
264         #
265         #  ldap_connections_number
266
267         #  The connection pool is new for 3.0, and will be used in many
268         #  modules, for all kinds of connection-related activity.
269         #
270         pool {
271                 # Number of connections to start
272                 start = 5
273
274                 # Minimum number of connections to keep open
275                 min = 4
276
277                 # Maximum number of connections
278                 #
279                 # If these connections are all in use and a new one
280                 # is requested, the request will NOT get a connection.
281                 max = 10
282
283                 # Spare connections to be left idle
284                 #
285                 # NOTE: Idle connections WILL be closed if "idle_timeout"
286                 # is set.
287                 spare = 3
288
289                 # Number of uses before the connection is closed
290                 #
291                 # 0 means "infinite"
292                 uses = 0
293
294                 # The lifetime (in seconds) of the connection
295                 lifetime = 0
296
297                 # idle timeout (in seconds).  A connection which is
298                 # unused for this length of time will be closed.
299                 idle_timeout = 60
300
301                 # NOTE: All configuration settings are enforced.  If a
302                 # connection is closed because of "idle_timeout",
303                 # "uses", or "lifetime", then the total number of
304                 # connections MAY fall below "min".  When that
305                 # happens, it will open a new connection.  It will
306                 # also log a WARNING message.
307                 #
308                 # The solution is to either lower the "min" connections,
309                 # or increase lifetime/idle_timeout.
310         }
311
312 }