Added missing configuration options
[krb5.git] / doc / rst_source / krb_admins / conf_files / krb5_conf.rst
1 .. _krb5.conf:
2
3 krb5.conf
4 ==========
5
6 The krb5.conf file contains Kerberos configuration information, including the locations of KDCs and admin servers for the Kerberos realms of interest, defaults for the current realm and for Kerberos applications, and mappings of hostnames onto Kerberos realms. Normally, you should install your krb5.conf file in the directory /etc. You can override the default location by setting the environment variable KRB5_CONFIG.
7
8 Structure
9 ---------
10
11 The krb5.conf file is set up in the style of a Windows INI file. Sections are headed by the section name, in square brackets. Each section may contain zero or more relations, of the form::
12
13      foo = bar
14      
15
16 or ::
17
18      fubar = {
19              foo = bar
20              baz = quux
21      }
22      
23
24 Placing a '\*' at the end of a line indicates that this is the *final* value for the tag. This means that neither the remainder of this configuration file nor any other configuration file will be checked for any other values for this tag.
25
26 For example, if you have the following lines::
27
28      foo = bar*
29      foo = baz
30      
31
32 then the second value of *foo* (baz) would never be read.
33
34 The krb5.conf file can include other files using either of the following directives at the beginning of a line::
35
36      include FILENAME
37      includedir DIRNAME
38      
39
40 *FILENAME* or *DIRNAME* should be an absolute path. The named file or directory must exist and be readable. Including a directory includes all files within the directory whose names consist solely of alphanumeric characters, dashes, or underscores. Included profile files are syntactically independent of their parents, so each included file must begin with a section header.
41
42 The krb5.conf file can specify that configuration should be obtained from a loadable module, rather than the file itself, using the following directive at the beginning of a line before any section headers::
43
44      module MODULEPATH:RESIDUAL
45
46 *MODULEPATH* may be relative to the library path of the krb5 installation, or it may be an absolute path.  *RESIDUAL* is provided to the module at initialization time.  If krb5.conf uses a module directive, kdc.conf should also use one if it exists.
47
48 The krb5.conf file may contain any or all of the following sections:
49
50 ============== =======================================================
51 libdefaults_   Contains default values used by the Kerberos V5 library. 
52 realms_        Contains subsections keyed by Kerberos realm names. Each subsection describes realm-specific information, including where to find the Kerberos servers for that realm. 
53 domain_realm_  Contains relations which map domain names and subdomains onto Kerberos realm names. This is used by programs to determine what realm a host should be in, given its fully qualified domain name. 
54 logging_       Contains relations which determine how Kerberos programs are to perform logging. 
55 capaths_       Contains the authentication paths used with direct (nonhierarchical) cross-realm authentication. Entries in this section are used by the client to determine the intermediate realms which may be used in cross-realm authentication. It is also used by the end-service when checking the transited field for trusted intermediate realms. 
56 plugins_       Contains tags to register dynamic plugin modules and to turn modules on and off. 
57 appdefaults_   Contains default values that can be used by Kerberos V5 applications. 
58 ============== =======================================================
59
60 Sections
61 ----------
62
63
64 .. _libdefaults:
65
66 **[libdefaults]** 
67 ~~~~~~~~~~~~~~~~~~~
68
69 The libdefaults section may contain any of the following relations:
70
71 **allow_weak_crypto**
72     If this is set to 0 (for false), then weak encryption types will be filtered out of the previous three lists (as noted in :ref:`senct_label`). The default value for this tag is false, which may cause authentication failures in existing Kerberos infrastructures that do not support strong crypto. Users in affected environments should set this tag to true until their infrastructure adopts stronger ciphers. 
73
74 **ap_req_checksum_type**
75      An integer which specifies the type of AP-REQ checksum to use in authenticators. 
76      This variable should be unset so the appropriate checksum for the encryption key in use will be used.   
77      This can be set if backward compatibility requires a specific checksum type.
78      See the *kdc_req_checksum_type* configuration option for the possible values and their meanings. 
79
80 **canonicalize**
81     This flag indicates to the KDC that the client is prepared to receive a reply that contains a principal name other than the one requested.
82     The client should expect, when sending names with the "canonicalize" KDC option,
83     that names in the KDC's reply will be different than the name in the request.
84     The default value for this flag is not set. 
85
86 **ccache_type**
87     Use this parameter on systems which are DCE clients, to specify the type of cache to be created by kinit, or when forwarded tickets are received. DCE and Kerberos can share the cache, but some versions of DCE do not support the default cache as created by this version of Kerberos. Use a value of 1 on DCE 1.0.3a systems, and a value of 2 on DCE 1.1 systems. The default value is 4. 
88
89 **clockskew**
90     Sets the maximum allowable amount of clockskew in seconds that the library will tolerate before assuming that a Kerberos message is invalid. The default value is 300 seconds, or five minutes. 
91
92 **default_keytab_name**
93     This relation specifies the default keytab name to be used by application servers such as telnetd and rlogind. The default is */etc/krb5.keytab*. 
94
95 **default_realm**
96     Identifies the default Kerberos realm for the client. Set its value to your Kerberos realm. If this is not specified and the TXT record lookup is enabled (see :ref:`udns_label`), then that information will be used to determine the default realm. If this tag is not set in this configuration file and there is no DNS information found, then an error will be returned. 
97
98 **default_tgs_enctypes**
99     Identifies the supported list of session key encryption types that should be returned by the KDC. The list may be delimited with commas or whitespace. Kerberos supports many different encryption types, and support for more is planned in the future. (see :ref:`senct_label` for a list of the accepted values for this tag). The default value is *aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 des3-cbc-sha1 arcfour-hmac-md5 des-cbc-crc des-cbc-md5 des-cbc-md4*.
100
101 **default_tkt_enctypes**
102     Identifies the supported list of session key encryption types that should be requested by the client. The format is the same as for default_tgs_enctypes. The default value for this tag is *aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 des3-cbc-sha1 arcfour-hmac-md5 des-cbc-crc des-cbc-md5 des-cbc-md4*. 
103
104 **dns_fallback**
105     General flag controlling the use of DNS for Kerberos information. If both of the preceding options are specified, this option has no effect. 
106
107 **dns_lookup_kdc**
108     Indicate whether DNS SRV records should be used to locate the KDCs and other servers for a realm, if they are not listed in the information for the realm. (Note that the admin_server entry must be in the file, because the DNS implementation for it is incomplete.)
109
110     Enabling this option does open up a type of denial-of-service attack, if someone spoofs the DNS records and redirects you to another server. However, it's no worse than a denial of service, because that fake KDC will be unable to decode anything you send it (besides the initial ticket request, which has no encrypted data), and anything the fake KDC sends will not be trusted without verification using some secret that it won't know.
111
112     If this option is not specified but dns_fallback is, that value will be used instead. If neither option is specified, the behavior depends on configure-time options; if none were given, the default is to enable this option. If the DNS support is not compiled in, this entry has no effect. 
113
114 **dns_lookup_realm**
115     Indicate whether DNS TXT records should be used to determine the Kerberos realm of a host.
116
117     Enabling this option may permit a redirection attack, where spoofed DNS replies persuade a client to authenticate to the wrong realm, when talking to the wrong host (either by spoofing yet more DNS records or by intercepting the net traffic). Depending on how the client software manages hostnames, however, it could already be vulnerable to such attacks. We are looking at possible ways to minimize or eliminate this exposure. For now, we encourage more adventurous sites to try using Secure DNS.
118
119     If this option is not specified but dns_fallback is, that value will be used instead. If neither option is specified, the behavior depends on configure-time options; if none were given, the default is to disable this option. If the DNS support is not compiled in, this entry has no effect. 
120
121 **extra_addresses**
122     This allows a computer to use multiple local addresses, in order to allow Kerberos to work in a network that uses NATs. The addresses should be in a comma-separated list. 
123
124 **forwardable**
125     If this flag is set, initial tickets by default will be forwardable. The default value for this flag is not set. 
126
127 **ignore_acceptor_hostname**
128     When accepting GSSAPI or krb5 security contexts for host-based service principals, 
129     ignore any hostname passed by the calling application and allow any service principal present in the keytab 
130     which matches the service name and realm  name (if given).  
131     This option can improve the administrative flexibility of server applications on multihomed hosts, 
132     but can compromise the security of virtual hosting environments.  The default value is false.
133
134 **k5login_authoritative**
135     If the value of this relation is true (the default), principals must be listed in a local user's k5login file to be granted login access, if a k5login file exists. If the value of this relation is false, a principal may still be granted login access through other mechanisms even if a k5login file exists but does not list the principal. 
136
137 **k5login_directory**
138     If set, the library will look for a local user's k5login file within the named directory, with a filename corresponding to the local username. If not set, the library will look for k5login files in the user's home directory, with the filename .k5login. For security reasons, k5login files must be owned by the local user or by root. 
139
140 **kdc_default_options**
141    Default KDC options (Xored for multiple values) when requesting initial credentials. By default it is set to 0x00000010 (KDC_OPT_RENEWABLE_OK).
142
143 **kdc_timesync**
144     If this is set to 1 (for true), then client machines will compute the difference between their time and the time returned by the KDC in the timestamps in the tickets and use this value to correct for an inaccurate system clock. This corrective factor is only used by the Kerberos library. The default is 1. 
145
146 **kdc_req_checksum_type**
147     An integer which specifies the type of checksum to use for the KDC requests for compatibility with DCE security servers 
148     which do not support the default RSA MD5 used by Kerberos V5.
149     This applies to DCE 1.1 and earlier.
150     Use a value of 2 to use the RSA MD4 instead. 
151     This value is only used for DES keys; other keys use the preferred checksum type for those keys.
152
153     The possible values and their meanings are as follows.
154
155     ======== ===============================
156     1        CRC32
157     2        RSA MD4
158     3        RSA MD4 DES
159     4        DES CBC
160     7        RSA MD5
161     8        RSA MD5 DES
162     9        NIST SHA
163     12       HMAC SHA1 DES3
164     -138     Microsoft MD5 HMAC checksum type 
165     ======== ===============================
166
167
168 **noaddresses**
169     Setting this flag causes the initial Kerberos ticket to be addressless. The default for the flag is set. 
170
171 **permitted_enctypes**
172     Identifies all encryption types that are permitted for use in session key encryption. The default value for this tag is *aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 des3-cbc-sha1 arcfour-hmac-md5 des-cbc-crc des-cbc-md5 des-cbc-md4*. 
173
174 **plugin_base_dir**
175     If set, determines the base directory where krb5 plugins are located.  
176     The default value is  the  "krb5/plugins" subdirectory of the krb5 library directory.
177
178
179 **preferred_preauth_types**
180     This allows you to set the preferred preauthentication types which the client will attempt before others which may be advertised by a KDC.  The default value for this setting is "17, 16, 15, 14", which forces libkrb5 to attempt to use PKINIT if it is supported.
181
182 **proxiable**
183     If this flag is set, initial tickets by default will be proxiable. The default value for this flag is not set. 
184
185 **rdns**
186     If set to false, prevent the use of reverse DNS resolution when translating hostnames into service principal names. Defaults to true. Setting this flag to false is more secure, but may force users to exclusively use fully qualified domain names when authenticating to services. 
187
188 **realm_try_domains**
189     Indicate whether a host's domain components should be used to determine the Kerberos realm of the host.  The value of this variable is an integer: -1 means not to search, 0 means to try the host's domain itself, 1 means to also try the domain's immediate parent, and so forth. The library's usual mechanism for locating Kerberos realms is used to determine whether a domain is a valid realm--which may involve consulting DNS if *dns_lookup_kdc* is set.  The default is not to search domain components.
190
191 **renew_lifetime**
192     The value of this tag is the default renewable lifetime for initial tickets. The default value for the tag is 0. 
193
194 **safe_checksum_type**
195
196     An integer which specifies the type of checksum to use for the KRB-SAFE requests.  By default it is set to 8 (RSA MD5 DES). 
197     For compatibility with applications linked against DCE version 1.1 or earlier Kerberos libraries, 
198     use a value of 3 to use the RSA MD4 DES instead.  
199     This field is ignored when its value is incompatible with the session key type.
200     See the *kdc_req_checksum_type* configuration option for the possible values and their meanings. 
201
202 **ticket_lifetime**
203     The value of this tag is the default lifetime for initial tickets. The default value for the tag is 1 day. 
204
205 **udp_preference_limit**
206     When sending a message to the KDC, the library will try using TCP before UDP if the size of the message is above *udp_preference_list*. If the message is smaller than *udp_preference_list*, then UDP will be tried before TCP. Regardless of the size, both protocols will be tried if the first attempt fails. 
207 **verify_ap_req_nofail**
208     If this flag is set, then an attempt to get initial credentials will fail if the client machine does not have a keytab. The default for the flag is not set. 
209
210 .. _realms:
211
212 **[realms]**
213 ~~~~~~~~~~~~~~~~~
214
215 Each tag in the [realms] section of the file is the name of a Kerberos realm. The value of the tag is a subsection with relations that define the properties of that particular realm. For each realm, the following tags may be specified in the realm's subsection:
216
217
218 **admin_server**
219     Identifies the host where the administration server is running. Typically, this is the master Kerberos server. This tag must be given a value in order to communicate with the kadmin server for the realm. 
220
221 **auth_to_local**
222     This tag allows you to set a general rule for mapping principal names to local user names. It will be used if there is not an explicit mapping for the principal name that is being translated. The possible values are:
223
224
225     DB:filename
226         The principal will be looked up in the database filename. Support for this is not currently compiled in by default.
227     RULE:exp
228         The local name will be formulated from exp.
229
230         The format for exp is [n:string](regexp)s/pattern/replacement/g. The integer n indicates how many components the target principal should have. If this matches, then a string will be formed from string, substituting the realm of the principal for $0 and the n'th component of the principal for $n (e.g. if the principal was *johndoe/admin* then [2:$2$1foo] would result in the string "adminjohndoefoo"). If this string matches regexp, then the s//[g] substitution command will be run over the string. The optional g will cause the substitution to be global over the string, instead of replacing only the first match in the string.
231
232     DEFAULT
233         The principal name will be used as the local user name. If the principal has more than one component or is not in the default realm, this rule is not applicable and the conversion will fail. 
234
235     For example::
236
237               [realms]
238                   ATHENA.MIT.EDU = {
239                       auth_to_local = RULE:[2:$1](johndoe)s/^.*$/guest/
240                       auth_to_local = RULE:[2:$1;$2](^.*;admin$)s/;admin$//
241                       auth_to_local = RULE:[2:$2](^.*;root)s/^.*$/root/
242                       auto_to_local = DEFAULT
243                   }
244               
245
246     would result in any principal without *root* or *admin* as the second component to be translated with the default rule. A principal with a second component of *admin* will become its first component. *root* will be used as the local name for any principal with a second component of *root*. The exception to these two rules are any principals *johndoe*/\*, which will always get the local name *guest*. 
247
248 **auth_to_local_names**
249     This subsection allows you to set explicit mappings from principal names to local user names. The tag is the mapping name, and the value is the corresponding local user name. 
250
251 **database_module**
252     This relation indicates the name of the configuration section under [dbmodules] for database specific parameters used by the loadable database library. 
253
254 **default_domain**
255     This tag is used for Kerberos 4 compatibility. Kerberos 4 does not require the entire hostname of a server to be in its principal like Kerberos 5 does. This tag provides the domain name needed to produce a full hostname when translating V4 principal names into V5 principal names. All servers in this realm are assumed to be in the domain given as the value of this tag 
256
257 **kdc**
258     The name or address of a host running a KDC for that realm. An optional port number, separated from the hostname by a colon, may be included. If the name or address contains colons (for example, if it is an IPv6 address), enclose it in square brackets to distinguish the colon from a port separator. For your computer to be able to communicate with the KDC for each realm, this tag must be given a value in each realm subsection in the configuration file, or there must be DNS SRV records specifying the KDCs (see :ref:`udns_label`). 
259
260 **kpasswd_server** 
261     Points to the server where all the password changes are performed.  If there is no such entry, the port 464 on the *admin_server* host will be tried.  
262                                  
263 **krb524_server** 
264     Points to the server that does 524 conversions.  If it is not mentioned, the krb524 port 4444 on the kdc will be tried.
265
266 **master_kdc**
267     Identifies the master KDC(s). Currently, this tag is used in only one case: If an attempt to get credentials fails because of an invalid password, the client software will attempt to contact the master KDC, in case the user's password has just been changed, and the updated database has not been propagated to the slave servers yet. 
268
269 **v4_instance_convert**
270     This subsection allows the administrator to configure exceptions to the default_domain mapping rule. It contains V4 instances (the tag name) which should be translated to some specific hostname (the tag value) as the second component in a Kerberos V5 principal name. 
271
272 **v4_realm**
273     This relation is used by the krb524 library routines when converting a V5 principal name to a V4 principal name. It is used when the V4 realm name and the V5 realm name are not the same, but still share the same principal names and passwords. The tag value is the Kerberos V4 realm name. 
274
275 .. _domain_realm:
276
277 **[domain_realm]**
278 ~~~~~~~~~~~~~~~~~~~~~
279
280 The [domain_realm] section provides a translation from a domain name or hostname to a Kerberos realm name. The tag name can be a host name, or a domain name, where domain names are indicated by a prefix of a period (.). The value of the relation is the Kerberos realm name for that particular host or domain. Host names and domain names should be in lower case.
281
282 If no translation entry applies, the host's realm is considered to be the hostname's domain portion converted to upper case. For example, the following [domain_realm] section::
283
284      [domain_realm]
285          .mit.edu = ATHENA.MIT.EDU
286          mit.edu = ATHENA.MIT.EDU
287          crash.mit.edu = TEST.ATHENA.MIT.EDU
288          example.com = EXAMPLE.COM
289      
290
291 maps *crash.mit.edu* into the *TEST.ATHENA.MIT.EDU* realm. All other hosts in the *mit.edu* domain will map by default to the *ATHENA.MIT.EDU* realm, and all hosts in the example.com domain will map by default into the *EXAMPLE.COM* realm. Note the entries for the hosts *mit.edu* and *example.com*. Without these entries, these hosts would be mapped into the Kerberos realms EDU and ORG, respectively.
292
293 .. _logging:
294
295 **[logging]**
296 ~~~~~~~~~~~~~~~~~~~~~~~
297
298 The [logging] section indicates how a particular entity is to perform its logging. The relations in this section assign one or more values to the entity name. Currently, the following entities are used:
299
300 **admin_server**
301     These entries specify how the administrative server is to perform its logging. 
302 **default**
303     These entries specify how to perform logging in the absence of explicit specifications otherwise. 
304 **kdc**
305     These entries specify how the KDC is to perform its logging. 
306
307 Values are of the following forms:
308
309 | FILE=<filename>
310 | FILE:<filename>
311
312     This value causes the entity's logging messages to go to the specified file. If the = form is used, the file is overwritten. If the \: form is used, the file is appended to. 
313
314 STDERR
315     This value causes the entity's logging messages to go to its standard error stream. 
316 CONSOLE
317     This value causes the entity's logging messages to go to the console, if the system supports it. 
318 DEVICE=<devicename>
319     This causes the entity's logging messages to go to the specified device. 
320 SYSLOG[:<severity>[:<facility>]]
321     This causes the entity's logging messages to go to the system log.
322
323     The severity argument specifies the default severity of system log messages. This may be any of the following severities supported by the syslog(3) call, minus the LOG\_ prefix: LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, and LOG_DEBUG. For example, a value of CRIT would specify LOG_CRIT severity.
324
325     The facility argument specifies the facility under which the messages are logged. This may be any of the following facilities supported by the syslog(3) call minus the LOG\_ prefix: LOG_KERN, LOG_USER, LOG_MAIL, LOG_DAEMON, LOG_AUTH, LOG_LPR, LOG_NEWS, LOG_UUCP, LOG_CRON, and LOG_LOCAL0 through LOG_LOCAL7.
326
327     If no severity is specified, the default is ERR. If no facility is specified, the default is AUTH. 
328
329 In the following example, the logging messages from the KDC will go to the console and to the system log under the facility LOG_DAEMON with default severity of LOG_INFO; and the logging messages from the administrative server will be appended to the file */var/adm/kadmin.log* and sent to the device */dev/tty04*.::
330
331      [logging]
332          kdc = CONSOLE
333          kdc = SYSLOG:INFO:DAEMON
334          admin_server = FILE:/var/adm/kadmin.log
335          admin_server = DEVICE=/dev/tty04
336      
337
338 .. _capaths:
339
340 **[capaths]**
341 ~~~~~~~~~~~~~~~~~~~~~~
342
343 In order to perform direct (non-hierarchical) cross-realm authentication, a database is needed to construct the authentication paths between the realms. This section defines that database.
344
345 A client will use this section to find the authentication path between its realm and the realm of the server. The server will use this section to verify the authentication path used by the client, by checking the transited field of the received ticket.
346
347 There is a tag for each participating realm, and each tag has subtags for each of the realms. The value of the subtags is an intermediate realm which may participate in the cross-realm authentication. The subtags may be repeated if there is more then one intermediate realm. A value of "." means that the two realms share keys directly, and no intermediate realms should be allowed to participate.
348
349 There are n**2 possible entries in this table, but only those entries which will be needed on the client or the server need to be present. The client needs a tag for its local realm, with subtags for all the realms of servers it will need to authenticate with. A server needs a tag for each realm of the clients it will serve.
350
351 For example, *ANL.GOV, PNL.GOV*, and *NERSC.GOV* all wish to use the *ES.NET* realm as an intermediate realm. *ANL* has a sub realm of *TEST.ANL.GOV* which will authenticate with *NERSC.GOV* but not *PNL.GOV*. The [capaths] section for *ANL.GOV* systems would look like this::
352
353      [capaths]
354          ANL.GOV = {
355              TEST.ANL.GOV = .
356              PNL.GOV = ES.NET
357              NERSC.GOV = ES.NET
358              ES.NET = .
359          }
360          TEST.ANL.GOV = {
361              ANL.GOV = .
362          }
363          PNL.GOV = {
364              ANL.GOV = ES.NET
365          }
366          NERSC.GOV = {
367              ANL.GOV = ES.NET
368          }
369          ES.NET = {
370              ANL.GOV = .
371          }
372      
373
374 The [capaths] section of the configuration file used on *NERSC.GOV* systems would look like this::
375
376      [capaths]
377          NERSC.GOV = {
378              ANL.GOV = ES.NET
379              TEST.ANL.GOV = ES.NET
380              TEST.ANL.GOV = ANL.GOV
381              PNL.GOV = ES.NET
382              ES.NET = .
383          }
384          ANL.GOV = {
385              NERSC.GOV = ES.NET
386          }
387          PNL.GOV = {
388              NERSC.GOV = ES.NET
389          }
390          ES.NET = {
391              NERSC.GOV = .
392          }
393          TEST.ANL.GOV = {
394              NERSC.GOV = ANL.GOV
395              NERSC.GOV = ES.NET
396          }
397      
398
399 In the above examples, the ordering is not important, except when the same subtag name is used more then once. The client will use this to determine the path. (It is not important to the server, since the transited field is not sorted.)
400
401 This feature is not currently supported by DCE. DCE security servers can be used with Kerberized clients and servers, but versions prior to DCE 1.1 did not fill in the transited field, and should be used with caution.
402
403 .. _dbdefaults:
404
405 **[dbdefaults]**
406 ~~~~~~~~~~~~~~~~~~~~~~~~
407
408 The [dbdefaults] section provides default values for the database specific parameters. It can also specify the configuration section under dbmodules_ section for database specific parameters used by the database library.
409
410 The following tags are used in this section:
411
412 **database_module**
413     This relation indicates the name of the configuration section under the dbmodules_ for database specific parameters used by the loadable database library. 
414
415 **ldap_kerberos_container_dn**
416     This LDAP specific tag indicates the DN of the container object where the realm objects will be located. This value is used if the container object is not mentioned in the configuration section under dbmodules_. 
417
418 **ldap_kdc_dn**
419     This LDAP specific tag indicates the default bind DN for the KDC server. The KDC server does a login to the directory as this object. This object should have the rights to read the Kerberos data in the LDAP database. This value is used if the bind DN for the KDC is not mentioned in the configuration section under dbmodules_. 
420
421 **ldap_kadmind_dn**
422     This LDAP specific tag indicates the default bind DN for the Administration server. The administration server does a login to the directory as this object. This object should have the rights to read and write the Kerberos data in the LDAP database. This value is used if the bind DN for the Administration server is not mentioned in the configuration section under dbmodules_. 
423
424 **ldap_service_password_file**
425     This LDAP specific tag indicates the file containing the stashed passwords (created by kdb5_ldap_util stashsrvpw) for the objects used by the Kerberos servers to bind to the LDAP server. This file must be kept secure. This value is used if no service password file is mentioned in the configuration section under dbmodules_. 
426
427 **ldap_servers**
428     This LDAP specific tag indicates the list of LDAP servers that the Kerberos servers can connect to. The list of LDAP servers is whitespace-separated. The LDAP server is specified by a LDAP URI. This value is used if no LDAP servers are mentioned in the configuration section under dbmodules_. It is recommended to use the *ldapi://* or *ldaps://* interface and not to use *ldap://* interface. 
429
430 **ldap_conns_per_server**
431     This LDAP specific tag indicates the number of connections to be maintained per LDAP server. This value is used if the number of connections per LDAP server are not mentioned in the configuration section under dbmodules_. The default value is 5. 
432
433 .. _dbmodules:
434
435 **[dbmodules]**
436 ~~~~~~~~~~~~~~~~~~
437
438 Contains database specific parameters used by the database library. Each tag in the [dbmodules] section of the file names a configuration section for database specific parameters that can be referred to by a realm. The value of the tag is a subsection where the relations in that subsection define the database specific parameters.
439
440 For each section, the following tags may be specified in the subsection:
441
442 **database_name**
443     This DB2-specific tag indicates the location of the database in the filesystem. The default is */usr/local/var/krb5kdc/principal*. 
444
445 **db_library**
446     This tag indicates the name of the loadable database library. The value should be *db2* for DB2 database and *kldap* for LDAP database. 
447
448 **db_module_dir**
449     This tag controls where the plugin system looks for modules. The value should be an absolute path.
450
451 **disable_last_success**
452     If set to *true*, suppresses KDC updates to the *"Last successful authentication"* field of principal entries requiring preauthentication. Setting this flag may improve performance. (Principal entries which do not require preauthentication never update the "Last successful authentication" field.). 
453      
454 **disable_lockout**
455     If set to *true*, suppresses KDC updates to the *"Last failed authentication"* and *"Failed password attempts"* fields of principal entries requiring preauthentication. Setting this flag may improve performance, but also disables account lockout. 
456
457 **ldap_conns_per_server**
458     This LDAP specific tags indicates the number of connections to be maintained per LDAP server. 
459
460 **ldap_kadmind_dn**
461     This LDAP specific tag indicates the default bind DN for the Administration server. The administration server does a login to the directory as this object. This object should have the rights to read and write the Kerberos data in the LDAP database. 
462
463 **ldap_kdc_dn**
464     This LDAP specific tag indicates the default bind DN for the KDC server. The KDC server does a login to the directory as this object. This object should have the rights to read the Kerberos data in the LDAP database. 
465
466 **ldap_kerberos_container_dn**
467     This LDAP specific tag indicates the DN of the container object where the realm objects will be located. 
468
469 **ldap_servers**
470     This LDAP specific tag indicates the list of LDAP servers that the Kerberos servers can connect to. The list of LDAP servers is whitespace-separated. The LDAP server is specified by a LDAP URI. It is recommended to use *ldapi://* or *ldaps://* interface to connect to the LDAP server. 
471
472 **ldap_service_password_file**
473     This LDAP specific tag indicates the file containing the stashed passwords (created by *kdb5_ldap_util stashsrvpw*) for the objects used by the Kerberos servers to bind to the LDAP server. This file must be kept secure. 
474
475
476 .. _appdefaults:
477
478 **[appdefaults]**
479 ~~~~~~~~~~~~~~~~~~~~~~~~~
480
481 Each tag in the [appdefaults] section names a Kerberos V5 application or an option that is used by some Kerberos V5 application[s]. The value of the tag defines the default behaviors for that application.
482
483 For example::
484
485      [appdefaults]
486          telnet = {
487              ATHENA.MIT.EDU = {
488                   option1 = false
489              }
490          }
491          telnet = {
492              option1 = true
493              option2 = true
494          }
495          ATHENA.MIT.EDU = {
496              option2 = false
497          }
498          option2 = true
499      
500
501 The above four ways of specifying the value of an option are shown in order of decreasing precedence. In this example, if telnet is running in the realm EXAMPLE.COM, it should, by default, have option1 and option2 set to true. However, a telnet program in the realm ATHENA.MIT.EDU should have option1 set to false and option2 set to true. Any other programs in ATHENA.MIT.EDU should have option2 set to false by default. Any programs running in other realms should have option2 set to true.
502
503 The list of specifiable options for each application may be found in that application's man pages. The application defaults specified here are overridden by those specified in the realms_ section.
504
505 .. _plugins:
506
507 Plugins
508 --------
509
510     * pwqual_ interface
511     * kadm5_hook_ interface
512     * clpreauth_ and kdcpreauth_ interfaces
513
514 Tags in the **[plugins]** section can be used to register dynamic plugin modules and to turn modules on and off. Not every krb5 pluggable interface uses the [plugins] section; the ones that do are documented here.
515
516 Each pluggable interface corresponds to a subsection of [plugins]. All subsections support the same tags:
517
518 **disable**
519     This tag may have multiple values. If there are values for this tag, then the named modules will be disabled for the pluggable interface. 
520
521 **enable_only**
522     This tag may have multiple values. If there are values for this tag, then only the named modules will be enabled for the pluggable interface. 
523
524 **module**
525     This tag may have multiple values. Each value is a string of the form "modulename:pathname", which causes the shared object located at pathname to be registered as a dynamic module named modulename for the pluggable interface. If pathname is not an absolute path, it will be treated as relative to the "krb5/plugins" subdirectory of the krb5 library directory. 
526
527 The following subsections are currently supported within the [plugins] section:
528
529 .. _pwqual:
530
531 pwqual interface
532 ~~~~~~~~~~~~~~~~~~~~~~~
533
534 The **pwqual** subsection controls modules for the password quality interface, which is used to reject weak passwords when passwords are changed. In addition to any registered dynamic modules, the following built-in modules exist (and may be disabled with the disable tag):
535
536 **dict**
537     Checks against the realm dictionary file 
538
539 **empty**
540     Rejects empty passwords 
541
542 **hesiod**
543     Checks against user information stored in Hesiod (only if Kerberos was built with Hesiod support) 
544
545 **princ**
546     Checks against components of the principal name 
547
548 .. _kadm5_hook:
549
550 kadm5_hook interface
551 ~~~~~~~~~~~~~~~~~~~~~~~~
552
553 The **kadm5_hook** interface provides plugins with information on principal creation, modification, password changes and deletion. This interface can be used to write a plugin to synchronize MIT Kerberos with another database such as Active Directory. No plugins are built in for this interface.
554
555 .. _clpreauth:
556
557 .. _kdcpreauth:
558
559 clpreauth and kdcpreauth interfaces
560 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
561
562 The **clpreauth** and **kdcpreauth** interfaces allow plugin modules to provide client and KDC preauthentication mechanisms.  The following built-in modules exist for these interfaces:
563
564 **pkinit**
565     This module implements the PKINIT preauthentication mechanism.
566
567 **encrypted_challenge**
568     This module implements the encrypted challenge FAST factor.
569
570 PKINIT options
571 -----------------
572
573     * pkinit identity syntax
574     * pkinit krb5.conf options
575
576 .. note:: The following are pkinit-specific options. Note that these values may be specified in *[libdefaults]* as global defaults, or within a realm-specific subsection of *[libdefaults]*, or may be specified as realm-specific values in the *[realms]* section. Also note that a realm-specific value over-rides, does not add to, a generic *[libdefaults]* specification. The search order is:
577
578    1. realm-specific subsection of [libdefaults]
579
580                 [libdefaults]
581                     EXAMPLE.COM = {
582                         pkinit_anchors = FILE\:/usr/local/example.com.crt
583
584                     }
585                 
586
587    2. realm-specific value in the [realms] section,
588
589                 [realms]
590                     OTHERREALM.ORG = {
591                         pkinit_anchors = FILE\:/usr/local/otherrealm.org.crt
592
593                     }
594                 
595
596    3. generic value in the [libdefaults] section.
597
598                 [libdefaults]
599                     pkinit_anchors = DIR\:/usr/local/generic_trusted_cas/
600                 
601
602
603 Specifying pkinit identity information
604 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
605
606 The syntax for specifying Public Key identity, trust, and revocation information for pkinit is as follows:
607
608
609 FILE\:file-name\[,key-file-name]
610     This option has context-specific behavior.
611
612     | pkinit_identity
613     | pkinit_identities
614
615         *file-name* specifies the name of a PEM-format file containing the user's certificate. If *key-file-name* is not specified, the user's private key is expected to be in file-name as well. Otherwise, *key-file-name* is the name of the file containing the private key.
616
617     | pkinit_anchors
618     | pkinit_pool
619
620         *file-name* is assumed to be the name of an OpenSSL-style ca-bundle file. 
621
622
623 DIR:directory-name
624     This option has context-specific behavior.
625
626     | pkinit_identity
627     | pkinit_identities
628
629         *directory-name* specifies a directory with files named \*.crt and \*.key, where the first part of the file name is the same for matching pairs of certificate and private key files. When a file with a name ending with .crt is found, a matching file ending with .key is assumed to contain the private key. If no such file is found, then the certificate in the .crt is not used.
630
631     | pkinit_anchors
632     | pkinit_pool
633
634         *directory-name* is assumed to be an OpenSSL-style hashed CA directory where each CA cert is stored in a file named *hash-of-ca-cert.#*. This infrastructure is encouraged, but all files in the directory will be examined and if they contain certificates (in PEM format), they will be used.
635
636     pkinit_revoke
637         *directory-name* is assumed to be an OpenSSL-style hashed CA directory where each revocation list is stored in a file named *hash-of-ca-cert.r#*. This infrastructure is encouraged, but all files in the directory will be examined and if they contain a revocation list (in PEM format), they will be used. 
638
639
640 PKCS12:pkcs12-file-name
641     *pkcs12-file-name* is the name of a PKCS #12 format file, containing the user's certificate and private key.
642 PKCS11:[module_name=]module-name[:slotid=slot-id][:token=token-label][:certid=cert-id][:certlabel=cert-label]
643     All keyword/values are optional. module-name specifies the location of a library implementing PKCS #11. If a value is encountered with no keyword, it is assumed to be the *module-name*. If no module-name is specified, the default is *opensc-pkcs11.so*. *slotid=* and/or *token=* may be specified to force the use of a particular smard card reader or token if there is more than one available. *certid=* and/or *certlabel=* may be specified to force the selection of a particular certificate on the device. See the *pkinit_cert_match* configuration option for more ways to select a particular certificate to use for pkinit.
644 ENV:environment-variable-name
645     environment-variable-name specifies the name of an environment variable which has been set to a value conforming to one of the previous values. For example, *ENV:X509_PROXY*, where environment variable *X509_PROXY* has been set to *FILE:/tmp/my_proxy.pem*. 
646
647
648
649 PKINIT krb5.conf options
650 ~~~~~~~~~~~~~~~~~~~~~~~~
651
652
653 **pkinit_anchors**
654     Specifies the location of trusted anchor (root) certificates which the client trusts to sign KDC certificates. This option may be specified multiple times. These values from the config file are not used if the user specifies X509_anchors on the command line.
655
656 **pkinit_cert_match**
657     Specifies matching rules that the client certificate must match before it is used to attempt pkinit authentication. If a user has multiple certificates available (on a smart card, or via other media), there must be exactly one certificate chosen before attempting pkinit authentication. This option may be specified multiple times. All the available certificates are checked against each rule in order until there is a match of exactly one certificate.
658
659     The Subject and Issuer comparison strings are the :rfc:`2253` string representations from the certificate Subject DN and Issuer DN values.
660
661     The syntax of the matching rules is::
662
663               [relation-operator]component-rule ...
664               
665
666     where
667
668     *relation-operator*
669         can be either **&&**, meaning all component rules must match, or **||**, meaning only one component rule must match. The default is &&.
670     *component-rule*
671         can be one of the following. Note that there is no punctuation or whitespace between component rules.
672
673         *<SUBJECT>regular-expression*
674
675         *<ISSUER>regular-expression*
676
677         *<SAN>regular-expression*
678
679         *<EKU>extended-key-usage-list*
680             where *extended-key-usage-list* is a comma-separated list of required Extended Key Usage values. All values in the list must be present in the certificate.
681
682                               -  pkinit
683                               -  msScLogin
684                               -  clientAuth
685                               -  emailProtection
686                                 
687
688
689         *<KU>key-usage-list*
690             where *key-usage-list* is a comma-separated list of required Key Usage values. All values in the list must be present in the certificate.
691
692                               - digitalSignature
693                               - keyEncipherment
694                                 
695
696     Examples::
697
698               pkinit_cert_match = ||<SUBJECT>.*DoE.*<SAN>.*@EXAMPLE.COM
699               pkinit_cert_match = &&<EKU>msScLogin,clientAuth<ISSUER>.*DoE.*
700               pkinit_cert_match = <EKU>msScLogin,clientAuth<KU>digitalSignature
701               
702 **pkinit_eku_checking**
703     This option specifies what Extended Key Usage value the KDC certificate presented to the client must contain. (Note that if the KDC certificate has the pkinit SubjectAlternativeName encoded as the Kerberos TGS name, EKU checking is not necessary since the issuing CA has certified this as a KDC certificate.) The values recognized in the krb5.conf file are:
704
705     *kpKDC*
706         This is the default value and specifies that the KDC must have the id-pkinit-KPKdc EKU as defined in :rfc:`4556`.
707     *kpServerAuth*
708         If kpServerAuth is specified, a KDC certificate with the id-kp-serverAuth EKU as used by Microsoft will be accepted.
709     *none*
710         If none is specified, then the KDC certificate will not be checked to verify it has an acceptable EKU. The use of this option is not recommended. 
711
712 **pkinit_dh_min_bits**
713     Specifies the size of the Diffie-Hellman key the client will attempt to use. The acceptable values are currently 1024, 2048, and 4096. The default is 2048.
714
715 **pkinit_identities**
716     Specifies the location(s) to be used to find the user's X.509 identity information. This option may be specified multiple times. Each value is attempted in order until identity information is found and authentication is attempted. Note that these values are not used if the user specifies X509_user_identity on the command line.
717
718 **pkinit_kdc_hostname**
719     The presense of this option indicates that the client is willing to accept a KDC certificate with a dNSName SAN (Subject Alternative Name) rather than requiring the id-pkinit-san as defined in :rfc:`4556`. This option may be specified multiple times. Its value should contain the acceptable hostname for the KDC (as contained in its certificate).
720
721 **pkinit_longhorn**
722     If this flag is set to true, we are talking to the Longhorn KDC.
723
724 **pkinit_pool**
725     Specifies the location of intermediate certificates which may be used by the client to complete the trust chain between a KDC certificate and a trusted anchor. This option may be specified multiple times.
726
727 **pkinit_require_crl_checking**
728     The default certificate verification process will always check the available revocation information to see if a certificate has been revoked. If a match is found for the certificate in a CRL, verification fails. If the certificate being verified is not listed in a CRL, or there is no CRL present for its issuing CA, and *pkinit_require_crl_checking* is false, then verification succeeds.
729
730     However, if *pkinit_require_crl_checking* is true and there is no CRL information available for the issuing CA, then verification fails.
731
732     *pkinit_require_crl_checking* should be set to true if the policy is such that up-to-date CRLs must be present for every CA.
733
734 **pkinit_revoke**
735     Specifies the location of Certificate Revocation List (CRL) information to be used by the client when verifying the validity of the KDC certificate presented. This option may be specified multiple times.
736
737 **pkinit_win2k**
738     This flag specifies whether the target realm is assumed to support only the old, pre-RFC version of the protocol. The default is false.
739
740 **pkinit_win2k_require_binding**
741     If this flag is set to true, it expects that the target KDC is patched to return a reply with a checksum rather than a nonce. The default is false.
742
743
744
745 .. _krb5_conf_sample_label:
746
747 Sample krb5.conf file
748 -------------------------
749
750 Here is an example of a generic krb5.conf file::
751
752      [libdefaults]
753          default_realm = ATHENA.MIT.EDU
754          default_tkt_enctypes = des3-hmac-sha1 des-cbc-crc
755          default_tgs_enctypes = des3-hmac-sha1 des-cbc-crc
756          dns_lookup_kdc = true
757          dns_lookup_realm = false
758      
759      [realms]
760          ATHENA.MIT.EDU = {
761              kdc = kerberos.mit.edu
762              kdc = kerberos-1.mit.edu
763              kdc = kerberos-2.mit.edu:750
764              admin_server = kerberos.mit.edu
765              master_kdc = kerberos.mit.edu
766              default_domain = mit.edu
767          }
768          EXAMPLE.COM = {
769              kdc = kerberos.example.com
770              kdc = kerberos-1.example.com
771              admin_server = kerberos.example.com
772          }
773          OPENLDAP.MIT.EDU = {
774              kdc = kerberos.mit.edu
775              admin_server = kerberos.mit.edu
776              database_module = openldap_ldapconf
777          }
778      
779      [domain_realm]
780          .mit.edu = ATHENA.MIT.EDU
781          mit.edu = ATHENA.MIT.EDU
782      
783      [capaths]
784          ATHENA.MIT.EDU = {
785                 EXAMPLE.COM = .
786          }
787          EXAMPLE.COM = {
788                 ATHENA.MIT.EDU = .
789          }
790      
791      [logging]
792          kdc = SYSLOG:INFO
793          admin_server = FILE=/var/kadm5.log
794      [dbdefaults]
795          ldap_kerberos_container_dn = cn=krbcontainer,dc=example,dc=com
796      [dbmodules]
797          openldap_ldapconf = {
798              db_library = kldap
799              disable_last_success = true
800              ldap_kerberos_container_dn = cn=krbcontainer,dc=example,dc=com
801              ldap_kdc_dn = "cn=krbadmin,dc=example,dc=com"
802                  # this object needs to have read rights on
803                  # the realm container and principal subtrees
804              ldap_kadmind_dn = "cn=krbadmin,dc=example,dc=com"
805                  # this object needs to have read and write rights on
806                  # the realm container and principal subtrees
807              ldap_service_password_file = /etc/kerberos/service.keyfile
808              ldap_servers = ldaps://kerberos.mit.edu
809              ldap_conns_per_server = 5
810      }
811      
812 FILES
813 --------
814
815 /etc/krb5.conf
816
817 SEE ALSO
818 -----------
819
820 syslog(3)
821
822
823
824