Added Install KDC section from the Kerberos V5 Installation Guide.
[krb5.git] / doc / rst_source / krb_admins / conf_files / krb5_conf.rst
1 .. _krb5_conf_label:
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 may contain any or all of the following sections:
43
44 ============== =======================================================
45 libdefaults_   Contains default values used by the Kerberos V5 library. 
46 login_         Contains default values used by the Kerberos V5 login program. 
47 appdefaults_   Contains default values that can be used by Kerberos V5 applications. 
48 realms_        Contains subsections keyed by Kerberos realm names. Each subsection describes realm-specific information, including where to find the Kerberos servers for that realm. 
49 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. 
50 logging_       Contains relations which determine how Kerberos programs are to perform logging. 
51 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. 
52 plugins_       Contains tags to register dynamic plugin modules and to turn modules on and off. 
53 ============== =======================================================
54
55 Sections
56 ----------
57
58
59 .. _libdefaults:
60
61 **[libdefaults]** 
62 ~~~~~~~~~~~~~~~~~~~
63
64 The libdefaults section may contain any of the following relations:
65
66 default_keytab_name
67     This relation specifies the default keytab name to be used by application servers such as telnetd and rlogind. The default is */etc/krb5.keytab*. 
68 default_realm
69     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. 
70 default_tgs_enctypes
71     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. 
72 default_tkt_enctypes
73     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. 
74 permitted_enctypes
75     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. 
76 allow_weak_crypto
77     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. 
78 clockskew
79     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. 
80 k5login_authoritative
81     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. 
82 k5login_directory
83     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. 
84 kdc_timesync
85     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. 
86
87 | kdc_req_checksum_type
88 | ap_req_checksum_type
89 | safe_checksum_type
90
91     An integer which specifies the type of checksum to use. Used for compatability with DCE security servers which do not support the default RSA MD5 used by this version of Kerberos. The kdc_req_checksum_type is only used for DES keys. The ap_req_checksum_type defaults to the preferred checksum for the encryption type being used if unset. If set, then the selected checksum is used regardless of the type of key being used. The possible values and their meanings are as follows.
92
93     1
94         CRC32
95     2
96         RSA MD4
97     3
98         RSA MD4 DES
99     4
100         DES CBC
101     7
102         RSA MD5
103     8
104         RSA MD5 DES
105     9
106         NIST SHA
107     12
108         HMAC SHA1 DES3
109     -138
110         Microsoft MD5 HMAC checksum type 
111
112 ccache_type
113     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. 
114 dns_lookup_kdc
115     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.)
116
117     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.
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 enable this option. If the DNS support is not compiled in, this entry has no effect. 
120 dns_lookup_realm
121     Indicate whether DNS TXT records should be used to determine the Kerberos realm of a host.
122
123     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.
124
125     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. 
126 dns_fallback
127     General flag controlling the use of DNS for Kerberos information. If both of the preceding options are specified, this option has no effect. 
128 extra_addresses
129     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. 
130 udp_preference_limit
131     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. 
132 verify_ap_req_nofail
133     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. 
134 ticket_lifetime
135     The value of this tag is the default lifetime for initial tickets. The default value for the tag is 1 day. 
136 renew_lifetime
137     The value of this tag is the default renewable lifetime for initial tickets. The default value for the tag is 0. 
138 noaddresses
139     Setting this flag causes the initial Kerberos ticket to be addressless. The default for the flag is set. 
140 forwardable
141     If this flag is set, initial tickets by default will be forwardable. The default value for this flag is not set. 
142 proxiable
143     If this flag is set, initial tickets by default will be proxiable. The default value for this flag is not set. 
144 rdns
145     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. 
146
147
148 .. _appdefaults:
149
150 **[appdefaults]**
151 ~~~~~~~~~~~~~~~~~~~~~~~~~
152
153 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.
154
155 For example::
156
157      [appdefaults]
158          telnet = {
159              ATHENA.MIT.EDU = {
160                   option1 = false
161              }
162          }
163          telnet = {
164              option1 = true
165              option2 = true
166          }
167          ATHENA.MIT.EDU = {
168              option2 = false
169          }
170          option2 = true
171      
172
173 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.
174
175 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.
176
177 .. _login:
178
179 **[login]**
180 ~~~~~~~~~~~~~~~
181
182 Each tag in the [login] section of the file is an option for *login.krb5*. This section may contain any of the following relations:
183
184 krb5_get_tickets
185     Indicate whether or not to use a user's password to get V5 tickets. The default value is *true*. 
186 krb_run_aklog
187     Indicate whether or not to run aklog. The default value is *false*. 
188 aklog_path
189     Indicate where to find aklog. The default value is *$(prefix)/bin/aklog*. 
190 accept_passwd
191     A true value will cause login not to accept plaintext passwords. The default value is false. This is not yet implemented. 
192
193 .. _realms:
194
195 **[realms]**
196 ~~~~~~~~~~~~~~~~~
197
198 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:
199
200 kdc
201     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`). 
202 master_kdc
203     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. 
204 database_module
205     This relation indicates the name of the configuration section under [dbmodules] for database specific parameters used by the loadable database library. 
206 admin_server
207     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. 
208 default_domain
209     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 
210 v4_instance_convert
211     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. 
212 v4_realm
213     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. 
214 auth_to_local_names
215     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. 
216 auth_to_local
217     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:
218
219
220     DB:filename
221         The principal will be looked up in the database filename. Support for this is not currently compiled in by default.
222     RULE:exp
223         The local name will be formulated from exp.
224
225         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.
226
227     DEFAULT
228         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. 
229
230     For example::
231
232               [realms]
233                   ATHENA.MIT.EDU = {
234                       auth_to_local = RULE:[2:$1](johndoe)s/^.*$/guest/
235                       auth_to_local = RULE:[2:$1;$2](^.*;admin$)s/;admin$//
236                       auth_to_local = RULE:[2:$2](^.*;root)s/^.*$/root/
237                       auto_to_local = DEFAULT
238                   }
239               
240
241     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*. 
242
243 .. _domain_realm:
244
245 **[domain_realm]**
246 ~~~~~~~~~~~~~~~~~~~~~
247
248 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.
249
250 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::
251
252      [domain_realm]
253          .mit.edu = ATHENA.MIT.EDU
254          mit.edu = ATHENA.MIT.EDU
255          crash.mit.edu = TEST.ATHENA.MIT.EDU
256          example.com = EXAMPLE.COM
257      
258
259 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.
260
261 .. _logging:
262
263 **[logging]**
264 ~~~~~~~~~~~~~~~~~~~~~~~
265
266 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:
267
268 kdc
269     These entries specify how the KDC is to perform its logging. 
270 admin_server
271     These entries specify how the administrative server is to perform its logging. 
272 default
273     These entries specify how to perform logging in the absence of explicit specifications otherwise. 
274
275 Values are of the following forms:
276
277 | FILE=<filename>
278 | FILE:<filename>
279
280     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. 
281
282 STDERR
283     This value causes the entity's logging messages to go to its standard error stream. 
284 CONSOLE
285     This value causes the entity's logging messages to go to the console, if the system supports it. 
286 DEVICE=<devicename>
287     This causes the entity's logging messages to go to the specified device. 
288 SYSLOG[:<severity>[:<facility>]]
289     This causes the entity's logging messages to go to the system log.
290
291     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.
292
293     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.
294
295     If no severity is specified, the default is ERR. If no facility is specified, the default is AUTH. 
296
297 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*.::
298
299      [logging]
300          kdc = CONSOLE
301          kdc = SYSLOG:INFO:DAEMON
302          admin_server = FILE:/var/adm/kadmin.log
303          admin_server = DEVICE=/dev/tty04
304      
305
306 .. _capaths:
307
308 **[capaths]**
309 ~~~~~~~~~~~~~~~~~~~~~~`
310
311 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.
312
313 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.
314
315 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.
316
317 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.
318
319 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::
320
321      [capaths]
322          ANL.GOV = {
323              TEST.ANL.GOV = .
324              PNL.GOV = ES.NET
325              NERSC.GOV = ES.NET
326              ES.NET = .
327          }
328          TEST.ANL.GOV = {
329              ANL.GOV = .
330          }
331          PNL.GOV = {
332              ANL.GOV = ES.NET
333          }
334          NERSC.GOV = {
335              ANL.GOV = ES.NET
336          }
337          ES.NET = {
338              ANL.GOV = .
339          }
340      
341
342 The [capaths] section of the configuration file used on *NERSC.GOV* systems would look like this::
343
344      [capaths]
345          NERSC.GOV = {
346              ANL.GOV = ES.NET
347              TEST.ANL.GOV = ES.NET
348              TEST.ANL.GOV = ANL.GOV
349              PNL.GOV = ES.NET
350              ES.NET = .
351          }
352          ANL.GOV = {
353              NERSC.GOV = ES.NET
354          }
355          PNL.GOV = {
356              NERSC.GOV = ES.NET
357          }
358          ES.NET = {
359              NERSC.GOV = .
360          }
361          TEST.ANL.GOV = {
362              NERSC.GOV = ANL.GOV
363              NERSC.GOV = ES.NET
364          }
365      
366
367 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.)
368
369 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.
370
371 .. _dbdefaults:
372
373 **[dbdefaults]**
374 ~~~~~~~~~~~~~~~~~~~~~~~~
375
376 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.
377
378 The following tags are used in this section:
379
380 database_module
381     This relation indicates the name of the configuration section under the dbmodules_ for database specific parameters used by the loadable database library. 
382 ldap_kerberos_container_dn
383     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_. 
384 ldap_kdc_dn
385     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_. 
386 ldap_kadmind_dn
387     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_. 
388 ldap_service_password_file
389     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_. 
390 ldap_server
391     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. 
392 ldap_conns_per_server
393     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. 
394
395 .. _dbmodules:
396
397 **[dbmodules]**
398 ~~~~~~~~~~~~~~~~~~
399
400 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.
401
402 For each section, the following tags may be specified in the subsection:
403
404 db_library
405     This tag indicates the name of the loadable database library. The value should be db2 for DB2 database and kldap for LDAP database. 
406 database_name
407     This DB2-specific tag indicates the location of the database in the filesystem. The default is */usr/local/var/krb5kdc/principal*. 
408 disable_last_success
409     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.) 
410 disable_lockout
411     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. 
412 ldap_kerberos_container_dn
413     This LDAP specific tag indicates the DN of the container object where the realm objects will be located. 
414 ldap_kdc_dn
415     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. 
416 ldap_kadmind_dn
417     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. 
418 ldap_service_password_file
419     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. 
420 ldap_server
421     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. 
422 ldap_conns_per_server
423     This LDAP specific tags indicates the number of connections to be maintained per LDAP server. 
424
425 .. _plugins:
426
427 Plugins
428 --------
429
430     * pwqual interface
431     * kadm5_hook interface
432     * clpreauth and kdcpreauth interfaces
433
434 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.
435
436 Each pluggable interface corresponds to a subsection of [plugins]. All subsections support the same tags:
437
438 module
439     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. 
440 enable_only
441     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. 
442 disable
443     This tag may have multiple values. If there are values for this tag, then the named modules will be disabled for the pluggable interface. 
444
445 The following subsections are currently supported within the [plugins] section:
446
447 ..
448
449 pwqual interface
450 ~~~~~~~~~~~~~~~~~~~~~~~
451
452 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):
453
454 dict
455     Checks against the realm dictionary file 
456 empty
457     Rejects empty passwords 
458 hesiod
459     Checks against user information stored in Hesiod (only if Kerberos was built with Hesiod support) 
460 princ
461     Checks against components of the principal name 
462
463 kadm5_hook interface
464 ~~~~~~~~~~~~~~~~~~~~~~~~
465
466 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.
467
468 clpreauth and kdcpreauth interfaces
469 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
470
471 The **clpreauth** and **kdcpreauth** interfaces allow plugin modules to provide client and KDC preauthentication mechanisms.  The following built-in modules exist for these interfaces:
472
473 pkinit
474     This module implements the PKINIT preauthentication mechanism.
475 encrypted_challenge
476     This module implements the encrypted challenge FAST factor.
477
478 PKINIT options
479 -----------------
480
481     * pkinit identity syntax
482     * pkinit krb5.conf options
483
484 .. 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:
485
486    1. realm-specific subsection of [libdefaults]
487
488                 [libdefaults]
489                     EXAMPLE.COM = {
490                         pkinit_anchors = FILE\:/usr/local/example.com.crt
491
492                     }
493                 
494
495    2. realm-specific value in the [realms] section,
496
497                 [realms]
498                     OTHERREALM.ORG = {
499                         pkinit_anchors = FILE\:/usr/local/otherrealm.org.crt
500
501                     }
502                 
503
504    3. generic value in the [libdefaults] section.
505
506                 [libdefaults]
507                     pkinit_anchors = DIR\:/usr/local/generic_trusted_cas/
508                 
509
510
511 Specifying pkinit identity information
512 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
513
514 The syntax for specifying Public Key identity, trust, and revocation information for pkinit is as follows:
515
516
517 FILE\:file-name\[,key-file-name]
518     This option has context-specific behavior.
519
520     | pkinit_identity
521     | pkinit_identities
522
523         *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.
524
525     | pkinit_anchors
526     | pkinit_pool
527
528         *file-name* is assumed to be the name of an OpenSSL-style ca-bundle file. 
529
530
531 DIR:directory-name
532     This option has context-specific behavior.
533
534     | pkinit_identity
535     | pkinit_identities
536
537         *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.
538
539     | pkinit_anchors
540     | pkinit_pool
541
542         *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.
543
544     pkinit_revoke
545         *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. 
546
547
548 PKCS12:pkcs12-file-name
549     *pkcs12-file-name* is the name of a PKCS #12 format file, containing the user's certificate and private key.
550 PKCS11:[module_name=]module-name[:slotid=slot-id][:token=token-label][:certid=cert-id][:certlabel=cert-label]
551     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.
552 ENV:environment-variable-name
553     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*. 
554
555
556
557 PKINIT krb5.conf options
558 ~~~~~~~~~~~~~~~~~~~~~~~~
559
560
561 pkinit_identities
562     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.
563 pkinit_anchors
564     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.
565 pkinit_pool
566     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.
567 pkinit_revoke
568     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.
569 pkinit_require_crl_checking
570     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.
571
572     However, if pkinit_require_crl_checking is true and there is no CRL information available for the issuing CA, then verification fails.
573
574     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.
575 pkinit_dh_min_bits
576     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.
577 pkinit_win2k
578     This flag specifies whether the target realm is assumed to support only the old, pre-RFC version of the protocol. The default is false.
579 pkinit_win2k_require_binding
580     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.
581 pkinit_eku_checking
582     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:
583
584     kpKDC
585         This is the default value and specifies that the KDC must have the id-pkinit-KPKdc EKU as defined in :rfc:`4556`.
586     kpServerAuth
587         If kpServerAuth is specified, a KDC certificate with the id-kp-serverAuth EKU as used by Microsoft will be accepted.
588     none
589         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. 
590
591
592 pkinit_kdc_hostname
593     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).
594 pkinit_cert_match
595     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.
596
597     The Subject and Issuer comparison strings are the :rfc:`2253` string representations from the certificate Subject DN and Issuer DN values.
598
599     The syntax of the matching rules is::
600
601               [relation-operator]component-rule ...
602               
603
604     where
605
606     *relation-operator*
607         can be either **&&**, meaning all component rules must match, or **||**, meaning only one component rule must match. The default is &&.
608     *component-rule*
609         can be one of the following. Note that there is no punctuation or whitespace between component rules.
610
611         *<SUBJECT>regular-expression*
612
613         *<ISSUER>regular-expression*
614
615         *<SAN>regular-expression*
616
617         *<EKU>extended-key-usage-list*
618             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.
619
620                               -  pkinit
621                               -  msScLogin
622                               -  clientAuth
623                               -  emailProtection
624                                 
625
626
627         *<KU>key-usage-list*
628             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.
629
630                               - digitalSignature
631                               - keyEncipherment
632                                 
633
634     Examples::
635
636               pkinit_cert_match = ||<SUBJECT>.*DoE.*<SAN>.*@EXAMPLE.COM
637               pkinit_cert_match = &&<EKU>msScLogin,clientAuth<ISSUER>.*DoE.*
638               pkinit_cert_match = <EKU>msScLogin,clientAuth<KU>digitalSignature
639               
640
641   
642
643 .. _krb5_conf_sample_label:
644
645 Sample krb5.conf file
646 -------------------------
647
648 Here is an example of a generic krb5.conf file::
649
650      [libdefaults]
651          default_realm = ATHENA.MIT.EDU
652          default_tkt_enctypes = des3-hmac-sha1 des-cbc-crc
653          default_tgs_enctypes = des3-hmac-sha1 des-cbc-crc
654          dns_lookup_kdc = true
655          dns_lookup_realm = false
656      
657      [realms]
658          ATHENA.MIT.EDU = {
659              kdc = kerberos.mit.edu
660              kdc = kerberos-1.mit.edu
661              kdc = kerberos-2.mit.edu:750
662              admin_server = kerberos.mit.edu
663              master_kdc = kerberos.mit.edu
664              default_domain = mit.edu
665          }
666          EXAMPLE.COM = {
667              kdc = kerberos.example.com
668              kdc = kerberos-1.example.com
669              admin_server = kerberos.example.com
670          }
671          OPENLDAP.MIT.EDU = {
672              kdc = kerberos.mit.edu
673              admin_server = kerberos.mit.edu
674              database_module = openldap_ldapconf
675          }
676      
677      [domain_realm]
678          .mit.edu = ATHENA.MIT.EDU
679          mit.edu = ATHENA.MIT.EDU
680      
681      [capaths]
682          ATHENA.MIT.EDU = {
683                 EXAMPLE.COM = .
684          }
685          EXAMPLE.COM = {
686                 ATHENA.MIT.EDU = .
687          }
688      
689      [logging]
690          kdc = SYSLOG:INFO
691          admin_server = FILE=/var/kadm5.log
692      [dbdefaults]
693          ldap_kerberos_container_dn = cn=krbcontainer,dc=example,dc=com
694      [dbmodules]
695          openldap_ldapconf = {
696              db_library = kldap
697              ldap_kerberos_container_dn = cn=krbcontainer,dc=example,dc=com
698              ldap_kdc_dn = "cn=krbadmin,dc=example,dc=com"
699                  # this object needs to have read rights on
700                  # the realm container and principal subtrees
701              ldap_kadmind_dn = "cn=krbadmin,dc=example,dc=com"
702                  # this object needs to have read and write rights on
703                  # the realm container and principal subtrees
704              ldap_service_password_file = /etc/kerberos/service.keyfile
705              ldap_servers = ldaps://kerberos.mit.edu
706              ldap_conns_per_server = 5
707      }
708      
709
710 --------------
711
712 Feedback:
713
714 Please, provide your feedback at krb5-bugs@mit.edu?subject=Documentation___conf_files
715
716