Make "cadir" and "certdir" globals
[freeradius.git] / raddb / sites-available / tls
1 ######################################################################
2 #
3 #  Initial implementation of RADIUS over TLS (radsec)
4 #
5 ######################################################################
6
7 listen {
8         ipaddr = *
9         port = 2083
10         type = auth
11
12         # For now, only TCP transport is allowed.
13         proto = tcp
14
15         clients = radsec
16
17         #  This is *exactly* the same configuration as used by the EAP-TLS
18         #  module.  It's OK for testing, but for production use it's a good
19         #  idea to use different server certificates for EAP and for RADIUS
20         #  transport.
21         tls {
22                 private_key_password = whatever
23                 private_key_file = ${certdir}/server.pem
24
25                 #  If Private key & Certificate are located in
26                 #  the same file, then private_key_file &
27                 #  certificate_file must contain the same file
28                 #  name.
29                 #
30                 #  If CA_file (below) is not used, then the
31                 #  certificate_file below MUST include not
32                 #  only the server certificate, but ALSO all
33                 #  of the CA certificates used to sign the
34                 #  server certificate.
35                 certificate_file = ${certdir}/server.pem
36
37                 #  Trusted Root CA list
38                 #
39                 #  ALL of the CA's in this list will be trusted
40                 #  to issue client certificates for authentication.
41                 #
42                 #  In general, you should use self-signed
43                 #  certificates for 802.1x (EAP) authentication.
44                 #  In that case, this CA file should contain
45                 #  *one* CA certificate.
46                 #
47                 #  This parameter is used only for EAP-TLS,
48                 #  when you issue client certificates.  If you do
49                 #  not use client certificates, and you do not want
50                 #  to permit EAP-TLS authentication, then delete
51                 #  this configuration item.
52                 CA_file = ${cadir}/ca.pem
53
54                 #
55                 #  For DH cipher suites to work, you have to
56                 #  run OpenSSL to create the DH file first:
57                 #
58                 #       openssl dhparam -out certs/dh 1024
59                 #
60                 dh_file = ${certdir}/dh
61                 random_file = ${certdir}/random
62
63                 #
64                 #  This can never exceed the size of a RADIUS
65                 #  packet (4096 bytes), and is preferably half
66                 #  that, to accomodate other attributes in
67                 #  RADIUS packet.  On most APs the MAX packet
68                 #  length is configured between 1500 - 1600
69                 #  In these cases, fragment size should be
70                 #  1024 or less.
71                 #
72         #       fragment_size = 1024
73
74                 #  include_length is a flag which is
75                 #  by default set to yes If set to
76                 #  yes, Total Length of the message is
77                 #  included in EVERY packet we send.
78                 #  If set to no, Total Length of the
79                 #  message is included ONLY in the
80                 #  First packet of a fragment series.
81                 #
82         #       include_length = yes
83
84                 #  Check the Certificate Revocation List
85                 #
86                 #  1) Copy CA certificates and CRLs to same directory.
87                 #  2) Execute 'c_rehash <CA certs&CRLs Directory>'.
88                 #    'c_rehash' is OpenSSL's command.
89                 #  3) uncomment the line below.
90                 #  5) Restart radiusd
91         #       check_crl = yes
92                 CA_path = ${cadir}
93
94                #
95                #  If check_cert_issuer is set, the value will
96                #  be checked against the DN of the issuer in
97                #  the client certificate.  If the values do not
98                #  match, the cerficate verification will fail,
99                #  rejecting the user.
100                #
101                #  In 2.1.10 and later, this check can be done
102                #  more generally by checking the value of the
103                #  TLS-Client-Cert-Issuer attribute.  This check
104                #  can be done via any mechanism you choose.
105                #
106         #       check_cert_issuer = "/C=GB/ST=Berkshire/L=Newbury/O=My Company Ltd"
107
108                #
109                #  If check_cert_cn is set, the value will
110                #  be xlat'ed and checked against the CN
111                #  in the client certificate.  If the values
112                #  do not match, the certificate verification
113                #  will fail rejecting the user.
114                #
115                #  This check is done only if the previous
116                #  "check_cert_issuer" is not set, or if
117                #  the check succeeds.
118                #
119                #  In 2.1.10 and later, this check can be done
120                #  more generally by checking the value of the
121                #  TLS-Client-Cert-CN attribute.  This check
122                #  can be done via any mechanism you choose.
123                #
124         #       check_cert_cn = %{User-Name}
125         #
126                 # Set this option to specify the allowed
127                 # TLS cipher suites.  The format is listed
128                 # in "man 1 ciphers".
129                 cipher_list = "DEFAULT"
130
131                 #
132
133                 #  This configuration entry should be deleted
134                 #  once the server is running in a normal
135                 #  configuration.  It is here ONLY to make
136                 #  initial deployments easier.
137                 #
138                 #
139                 #  This is enabled in eap.conf, so we don't need it here.
140                 #
141 #               make_cert_command = "${certdir}/bootstrap"
142
143                 #
144                 #  Session resumption / fast reauthentication
145                 #  cache.
146                 #
147                 #  The cache contains the following information:
148                 #
149                 #  session Id - unique identifier, managed by SSL
150                 #  User-Name  - from the Access-Accept
151                 #  Stripped-User-Name - from the Access-Request
152                 #  Cached-Session-Policy - from the Access-Accept
153                 #
154                 #  The "Cached-Session-Policy" is the name of a
155                 #  policy which should be applied to the cached
156                 #  session.  This policy can be used to assign
157                 #  VLANs, IP addresses, etc.  It serves as a useful
158                 #  way to re-apply the policy from the original
159                 #  Access-Accept to the subsequent Access-Accept
160                 #  for the cached session.
161                 #
162                 #  On session resumption, these attributes are
163                 #  copied from the cache, and placed into the
164                 #  reply list.
165                 #
166                 #  You probably also want "use_tunneled_reply = yes"
167                 #  when using fast session resumption.
168                 #
169                 cache {
170                       #
171                       #  Enable it.  The default is "no".
172                       #  Deleting the entire "cache" subsection
173                       #  Also disables caching.
174                       #
175                       #  You can disallow resumption for a
176                       #  particular user by adding the following
177                       #  attribute to the control item list:
178                       #
179                       #         Allow-Session-Resumption = No
180                       #
181                       #  If "enable = no" below, you CANNOT
182                       #  enable resumption for just one user
183                       #  by setting the above attribute to "yes".
184                       #
185                       enable = no
186
187                       #
188                       #  Lifetime of the cached entries, in hours.
189                       #  The sessions will be deleted after this
190                       #  time.
191                       #
192                       lifetime = 24 # hours
193
194                       #
195                       #  The maximum number of entries in the
196                       #  cache.  Set to "0" for "infinite".
197                       #
198                       #  This could be set to the number of users
199                       #  who are logged in... which can be a LOT.
200                       #
201                       max_entries = 255
202                 }
203
204                 #
205                 #  Require a client certificate.
206                 #
207                 require_client_cert = yes
208
209                 #
210                 #  As of version 2.1.10, client certificates can be
211                 #  validated via an external command.  This allows
212                 #  dynamic CRLs or OCSP to be used.
213                 #
214                 #  This configuration is commented out in the
215                 #  default configuration.  Uncomment it, and configure
216                 #  the correct paths below to enable it.
217                 #
218                 verify {
219                         #  A temporary directory where the client
220                         #  certificates are stored.  This directory
221                         #  MUST be owned by the UID of the server,
222                         #  and MUST not be accessible by any other
223                         #  users.  When the server starts, it will do
224                         #  "chmod go-rwx" on the directory, for
225                         #  security reasons.  The directory MUST
226                         #  exist when the server starts.
227                         #
228                         #  You should also delete all of the files
229                         #  in the directory when the server starts.
230         #               tmpdir = /tmp/radiusd
231
232                         #  The command used to verify the client cert.
233                         #  We recommend using the OpenSSL command-line
234                         #  tool.
235                         #
236                         #  The ${..CA_path} text is a reference to
237                         #  the CA_path variable defined above.
238                         #
239                         #  The %{TLS-Client-Cert-Filename} is the name
240                         #  of the temporary file containing the cert
241                         #  in PEM format.  This file is automatically
242                         #  deleted by the server when the command
243                         #  returns.
244         #               client = "/path/to/openssl verify -CApath ${..CA_path} %{TLS-Client-Cert-Filename}"
245                 }
246         }
247 }
248
249 clients radsec {
250         client 127.0.0.1 {
251                 ipaddr = 127.0.0.1
252                 proto = tcp
253                 secret = testing123
254         }
255 }
256
257 listen {
258        ipaddr = 127.0.0.1
259        port = 4000
260        type = auth
261 }
262
263 home_server tls {
264         ipaddr = 127.0.0.1
265         port = 2083
266         type = auth
267         secret = testing123
268         proto = tcp
269         status_check = status-server
270
271         tls {
272                 private_key_password = whatever
273                 private_key_file = ${certdir}/client.pem
274
275                 #  If Private key & Certificate are located in
276                 #  the same file, then private_key_file &
277                 #  certificate_file must contain the same file
278                 #  name.
279                 #
280                 #  If CA_file (below) is not used, then the
281                 #  certificate_file below MUST include not
282                 #  only the server certificate, but ALSO all
283                 #  of the CA certificates used to sign the
284                 #  server certificate.
285                 certificate_file = ${certdir}/client.pem
286
287                 #  Trusted Root CA list
288                 #
289                 #  ALL of the CA's in this list will be trusted
290                 #  to issue client certificates for authentication.
291                 #
292                 #  In general, you should use self-signed
293                 #  certificates for 802.1x (EAP) authentication.
294                 #  In that case, this CA file should contain
295                 #  *one* CA certificate.
296                 #
297                 #  This parameter is used only for EAP-TLS,
298                 #  when you issue client certificates.  If you do
299                 #  not use client certificates, and you do not want
300                 #  to permit EAP-TLS authentication, then delete
301                 #  this configuration item.
302                 CA_file = ${cadir}/ca.pem
303
304                 #
305                 #  For DH cipher suites to work, you have to
306                 #  run OpenSSL to create the DH file first:
307                 #
308                 #       openssl dhparam -out certs/dh 1024
309                 #
310                 dh_file = ${certdir}/dh
311                 random_file = ${certdir}/random
312
313                 #
314                 #  This can never exceed the size of a RADIUS
315                 #  packet (4096 bytes), and is preferably half
316                 #  that, to accomodate other attributes in
317                 #  RADIUS packet.  On most APs the MAX packet
318                 #  length is configured between 1500 - 1600
319                 #  In these cases, fragment size should be
320                 #  1024 or less.
321                 #
322         #       fragment_size = 1024
323
324                 #  include_length is a flag which is
325                 #  by default set to yes If set to
326                 #  yes, Total Length of the message is
327                 #  included in EVERY packet we send.
328                 #  If set to no, Total Length of the
329                 #  message is included ONLY in the
330                 #  First packet of a fragment series.
331                 #
332         #       include_length = yes
333
334                 #  Check the Certificate Revocation List
335                 #
336                 #  1) Copy CA certificates and CRLs to same directory.
337                 #  2) Execute 'c_rehash <CA certs&CRLs Directory>'.
338                 #    'c_rehash' is OpenSSL's command.
339                 #  3) uncomment the line below.
340                 #  5) Restart radiusd
341         #       check_crl = yes
342                 CA_path = ${cadir}
343
344                #
345                #  If check_cert_issuer is set, the value will
346                #  be checked against the DN of the issuer in
347                #  the client certificate.  If the values do not
348                #  match, the cerficate verification will fail,
349                #  rejecting the user.
350                #
351                #  In 2.1.10 and later, this check can be done
352                #  more generally by checking the value of the
353                #  TLS-Client-Cert-Issuer attribute.  This check
354                #  can be done via any mechanism you choose.
355                #
356         #       check_cert_issuer = "/C=GB/ST=Berkshire/L=Newbury/O=My Company Ltd"
357
358                #
359                #  If check_cert_cn is set, the value will
360                #  be xlat'ed and checked against the CN
361                #  in the client certificate.  If the values
362                #  do not match, the certificate verification
363                #  will fail rejecting the user.
364                #
365                #  This check is done only if the previous
366                #  "check_cert_issuer" is not set, or if
367                #  the check succeeds.
368                #
369                #  In 2.1.10 and later, this check can be done
370                #  more generally by checking the value of the
371                #  TLS-Client-Cert-CN attribute.  This check
372                #  can be done via any mechanism you choose.
373                #
374         #       check_cert_cn = %{User-Name}
375         #
376                 # Set this option to specify the allowed
377                 # TLS cipher suites.  The format is listed
378                 # in "man 1 ciphers".
379                 cipher_list = "DEFAULT"
380         }
381
382 }
383
384 home_server_pool tls {
385                  type = fail-over
386                  home_server = tls
387 }
388
389 realm tls {
390       auth_pool = tls
391 }